📘 Update P2P Trading Implementation Guide to Align with Foundational Architectural Concepts of DEG
- Dominant language
- Go
- Stars
- 61
- Forks
- 55
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 6
Description
## Description
The existing P2P trading implementation guide focuses primarily on transactional flows and was written before the introduction of the broader **Digital Energy Grid (DEG)** architectural model.
This issue requires a **full end-to-end rewrite** of the guide to align it with:
- **Beckn Protocol 2.0**
- The new **DEG Architectural Goals** (identity, trust, provenance, allocation, workflows)
- The **Core Components** framework (Registries, DID resolution, trust layers)
- The **Identity & Credentials** model (DID, VC, OID4VP/OID4VCI)
- Solar provenance, DER identity, device attestation, allocation state machines
The revised guide must evolve from a procedural “how-to trade energy” document into a **full architectural reference** for P2P workflows inside the DEG ecosystem.
---
## Required Updates (Expanded Checklist)
### 🔶 1. Integration of DEG Architectural Goals
- [ ] Explicitly incorporate **Functional Goals** (domain-based identity, programmable workflows, cross-sector integration)
- [ ] Incorporate **Implementation Goals**:
- DID-based trust
- Replicated resolution
- Hash-pinned DID docs
- Device identity & meter provenance
- Selective disclosure & VP flows
- Conservation & double-spend state
- [ ] Clearly position P2P as one *program* running atop DEG—not a siloed subsystem
---
### 🔶 2. Beckn Protocol 2.0 Alignment
- [ ] Align with **Beckn 2.0 API semantics & stateless interaction principles**
- [ ] Update context/message formats
- [ ] Correct versioning, routing, and network header standards
- [ ] Include 2.0-style catalog, item, provider, fulfillment models
---
### 🔶 3. Identity & Trust Layer Integration
- [ ] Add **domain-based identifiers** as primary actor IDs
- [ ] Incorporate **did:web** + optional secondary DID flows
- [ ] Add resolver-based DID continuity via **beckn.one** and **dedi.global**
- [ ] Integrate trust lifecycle handling:
- Revocation
- Key rotation
- Suspension
- Device/meter replacement
---
### 🔶 4. Credential & Attestation Flows
Add end-to-end coverage of all credential types relevant to P2P trading:
- [ ] **MeterOwnershipCredential**
- [ ] **SolarPanelIdentityCredential**
- [ ] **InverterIdentityCredential / MLPECredential**
- [ ] **SolarGenerationAttestationCredential**
- [ ] **ProgramEnrolmentCredential**
- [ ] **Capability & Eligibility Credentials**
Also:
- [ ] Use **OpenID4VCI** for issuance
- [ ] Use **OpenID4VP** for runtime proofs during search, select, init, confirm
---
### 🔶 5. Meter, Device & Solar Provenance
- [ ] Add **UMID/meter identity verification** flows
- [ ] Multi-utility trust provider flows
- [ ] Solar provenance: **panel → MLPE → inverter → meter → feeder**
- [ ] Meter replacement & correction flows
- [ ] Discrepancy handling between inverter and net meter
---
### 🔶 6. Conservation & Double-Spend Prevention
- [ ] Integrate the replicated allocation state model from DEG
- [ ] Enforce “available ≥ committed” rules for solar exports
- [ ] Add double-commit prevention flows
- [ ] Add allocation locking (select/on_select, init/on_init)
- [ ] Integrate DeDi/DEG state machine semantics
---
### 🔶 7. Catalog & Domain Model Updates
- [ ] Use **source / load / storage** codification
- [ ] Align items, providers, and fulfillments with DEG domain schemas
- [ ] Add time-windowed price/availability
- [ ] Include prosumer solar generation catalog formats
- [ ] Integrate updated taxonomy for DER, EV charging, flexibility
---
### 🔶 8. Workflow Modernization
Rewrite end-to-end workflows with DEG concepts:
- [ ] Discovery (with credential-based eligibility checks)
- [ ] Solar availability & export limit checks
- [ ] Trading initiation & allocation locking
- [ ] Measurement-bound fulfillment
- [ ] Settlement based on meter & inverter reconciliation
- [ ] Cross-sector integration examples (energy → mobility → finance)
---
### 🔶 9. Diagrams & Visual Architecture
- [ ] C4 model for P2P inside DEG
- [ ] Sequence diagrams for:
- Discovery
- Meter identity verification
- Credential issuance
- Double-spend prevention
- Solar production & export verification
- Settlement
- [ ] Catalog diagrams updated to Beckn 2.0
- [ ] DID resolution flow diagrams (origin → resolver → hash-pin)
---
### 🔶 10. Terminology, Standards & Narrative Alignment
- [ ] Replace all uses of “decentralized energy ecosystem” with **Digital Energy Grid (DEG)**
- [ ] Align vocabulary with DEG Vision paper
- [ ] Align device terminology (panel, inverter, MLPE, BESS, EVSE)
- [ ] Remove deprecated pre-2.0 Beckn concepts
- [ ] Normalize credential naming and schema references
---
## Acceptance Criteria
- [ ] New guide is published in Markdown under `/docs/p2p-trading/`
- [ ] Fully aligned with **Beckn Protocol 2.0**
- [ ] Fully aligned with **DEG Architectural Goals** and **Core Components**
- [ ] Covers identity, trust, provenance, measurement, credentials, allocation, workflows
- [ ] Includes solar provenance & DER identity
- [ ] Demonstrates meter traceability and double-spend prevention
- [ ] All diagrams updated or newly created
- [ ] Terminology consistent with Digital Energy Grid (DEG) vocabulary
- [ ] Suitable as a canonical implementation reference for P2P in DEG
Contributor guide
Assessment
This issue has not been assessed yet.