Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 464 additions & 0 deletions docs/Onboarding_Users_in_Digital_Energy_Programs.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/implementation-guides/v2/EV_Charging/EV_Charging.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ Specifically, for EV Charging, please use the following configuration:

### 11.2.3. 10.2.3 Performing a test EV charging transaction

Step 1 : Download the postman collection, from [here](/testnet/postman-collections/v2/EV_Charging/).
Step 1 : Download the postman collection, from [here](/testnet/ev-charging-devkit/postman/).

Step 2 : Run API calls

Expand Down

Large diffs are not rendered by default.

3,740 changes: 2,343 additions & 1,397 deletions .../implementation-guides/v2/P2P_Trading/P2P_Trading_implementation_guide_DRAFT.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

253 changes: 0 additions & 253 deletions docs/implementation-guides/v2/P2P_Trading/taxonomy.md

This file was deleted.

53 changes: 53 additions & 0 deletions examples/enrollment/v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Enrollment Examples

This directory contains JSON examples for the enrollment/onboarding flow for Digital Energy Programs.

## Files

### Init Requests
- **init-request-simple-consumer.json** - Simple consumer with single meter enrolling in a demand flexibility program
- **init-request-prosumer-solar-battery.json** - Prosumer with solar and battery DERs enrolling in a P2P trading program

### On_Init Responses
- **on-init-response-success.json** - Successful credential verification with no conflicts
- **on-init-response-conflict.json** - Enrollment conflict detected (meter already enrolled)
- **on-init-response-error.json** - Credential verification failed

### Confirm Request
- **confirm-request.json** - Confirm request with enrollment start and end dates

### On_Confirm Response
- **on-confirm-response-success.json** - Successful enrollment with issued credential

### Update Requests (Revocation/Unenrollment)
- **update-request-consent-revocation.json** - Request to revoke a consent credential
- **update-request-unenrollment.json** - Request to unenroll from a program

### On_Update Responses
- **on-update-response-consent-revocation.json** - Confirmation of consent revocation with status list details
- **on-update-response-unenrollment.json** - Confirmation of unenrollment with all credential revocations

## Usage

These examples are embedded in the implementation guide using the `embed_example_json.py` script. The examples are referenced using `<details>` blocks in the markdown file.

To update the embedded examples in the guide, run:
```bash
python3 scripts/embed_example_json.py docs/implementation-guides/v2/Onboarding/IG_Onboarding_users_in_digital_energy_programs.md
```

## Schema

All examples use the `EnergyEnrollment` schema defined at:
- Context: `https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/p2p-trading/schema/EnergyEnrollment/v0.2/context.jsonld`
- Attributes: `../protocol-specifications-new/schema/EnergyEnrollment/v0.2/attributes.yaml`

## Revocation Mechanism

Consent and enrollment credentials use W3C VC Status Lists (BitstringStatusList) for revocation:

1. **Consent Revocation**: User revokes consent via `update` action → BPP updates status list → Future verifications fail
2. **Unenrollment**: User unenrolls via `update` action → BPP revokes enrollment VC and all consent VCs → All credentials added to status lists

Verifiers must check status lists before accepting credentials. Status lists use bitstrings for efficient and privacy-preserving revocation checks as per [W3C VC Data Model v2.0](https://www.w3.org/TR/vc-data-model-2.0/).

58 changes: 58 additions & 0 deletions examples/enrollment/v2/confirm-request-oauth2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"context": {
"version": "2.0.0",
"action": "confirm",
"domain": "beckn.one:deg:p2p-enrollment:2.0.0",
"timestamp": "2024-10-15T10:35:00Z",
"message_id": "msg-confirm-oauth2-001",
"transaction_id": "txn-onboard-oauth2-001",
"bap_id": "utility-portal.example.com",
"bap_uri": "https://utility-portal.example.com/beckn",
"bpp_id": "vpp-program-owner.example.com",
"bpp_uri": "https://vpp-program-owner.example.com/beckn",
"ttl": "PT30S"
},
"message": {
"order": {
"@context": "https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/p2p-trading/schema/core/v2/context.jsonld",
"@type": "beckn:Order",
"beckn:id": "order-onboard-oauth2-001",
"beckn:orderStatus": "PENDING",
"beckn:seller": "vpp-program-flex-001",
"beckn:buyer": {
"@context": "https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/p2p-trading/schema/core/v2/context.jsonld",
"@type": "beckn:Buyer",
"beckn:id": "user-12345"
},
"beckn:orderItems": [
{
"beckn:orderedItem": "program-p2p-trading-001"
}
],
"beckn:fulfillment": {
"@context": "https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/p2p-trading/schema/core/v2/context.jsonld",
"@type": "beckn:Fulfillment",
"beckn:id": "fulfillment-onboard-001",
"beckn:mode": "DIGITAL",
"beckn:fulfillmentStatus": "PENDING"
},
"beckn:orderAttributes": {
"@context": "https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/p2p-trading/schema/EnergyEnrollment/v0.2/context.jsonld",
"@type": "EnergyEnrollment",
"userAuth": {
"authMethod": "OIDC",
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyLTEyMzQ1IiwiYXVkIjoicHJvZ3JhbS1vd25lci1icHAiLCJpc3MiOiJodHRwczovL3V0aWxpdHktaWRwLmV4YW1wbGUuY29tIiwiaWF0IjoxNzI5MDAwMDAwLCJleHAiOjE3MjkwMDM2MDB9.signature"
},
"meters": [
{
"meterId": "umid-001",
"meterNumber": "MTR-987654321",
"connectionType": "residential"
}
],
"startDate": "2024-11-01T00:00:00Z",
"endDate": "2025-10-31T23:59:59Z"
}
}
}
}
Loading