Purpose
Provide BFT agreement on how much dispatchable surplus is real before any on-ledger action occurs, then atomically anchor that agreement to the XRP Ledger (XRPL) for EDX issuance and settlement.
Actors & Keys
Storage Node (SN): Household/coop/farm with metered battery. Keys:
SN_ed25519(ledger),SN_device(TEE/firmware).Verifier Node (VN): Enerdex validators that check claims. Keys:
VN_ed25519. Maintains UNL-style allowlist (Enerdex UNL ≠ XRPL UNL).Anchor Agent (AA): Rotating leader that posts quorum results to XRPL.
XRPL Hook (optional): On-account hook set to validate anchors/mint controls.
Time Model
Discrete epochs E of length Δ (e.g., 5–15 min). A claim pertains to a window [t0, t1] ⊂ E.
Data Structures
StorageProof (SP):
EnergySlice (ES): indivisible claimable unit
Vote & QuorumCertificate (QC):
(Use Ed25519 multisig or BLS aggregate off-ledger; XRPL anchor stores S and vn_bitmap.)
AnchorCommit (AC):
Posted to XRPL in a canonical transaction with memo/binary blob; Hook validates fields.
Protocol (Round per ES)
Phase 0 — Measurement (SN):
Battery firmware emits ticks; TEE signs samples →
meter_root.SN composes
SP, chainsnonce, signs withSN_device.
Phase 1 — Proposal (SN → VNs):
3. SN gossips SP to VNs in Enerdex mesh.
Phase 2 — Verification (VNs):
4. Each VN checks:
TEE/fabric signature validity & firmware allowlist.
Non-overlap: ES uniqueness
(storage_id,E,nonce)not seen before.Continuity:
prev_nonce → noncechain matches SN’s history.Dispatchability: policy guards (SoC ≥ θ, grid/state flags OK).
Plausibility: Δ-bounded slope of ticks; no backfill; no time skew.
If valid, VN issues
Vote.
Phase 3 — Certification (AA):
6. AA collects ≥ 2f+1 Votes (Byzantine threshold for N VNs).
7. AA builds QC and AC = H(QC).
Phase 4 — XRPL Anchor (AA → XRPL):
8. AA posts Anchor Tx (e.g., AccountSet/Payment with memo blob) containing QC.
Optional Hook on
EnerdexIssueraccount validates:epoch monotonicity,
ES uniqueness (seen set),
VN quorum (bitmap vs allowlist),
policy hash (frozen via Hook state).
On XRPL ledger close, anchor achieves finality (~3–5s).
Phase 5 — EDX Mint & Lock (Issuer on XRPL):
10. Upon successful Hook check, EnerdexIssuer mints EDX (Issued Currency) equal to kWh_avail * R, where R is conversion rate.
11. A MintLock (state var/NFToken guard) binds EDX lot to ES to prevent re-mint.
Phase 6 — Trade & Settle (XRPL DEX):
12. Holder lists EDX via OfferCreate; trades clear on XRPL DEX.
13. Hook/daemon can burn-on-redeem or unlock-on-delivery as per market mode.
Safety & Liveness (Sketch)
Safety:
Non-overlap invariant: No two certified QCs share
(storage_id,E,nonce); enforced by VN check + Hook set membership on XRPL.One-mint per ES: MintLock + Hook rejection if
ESseen.Byzantine tolerance: With N VNs, tolerate f faulty if
2f+1quorum used.
Liveness:
Under partial synchrony, AA eventually gathers quorum.
XRPL ledger closes provide bounded anchor finality.
Leader (AA) rotates if timeout (view-change).
Double-Claim Resistance
Physical layer: TEE-signed ticks, bounded drift, SoC threshold.
Consensus layer: nonce chain, ES uniqueness, epoch windows.
Ledger layer: Hook-maintained Seen(ES) set and MintLock per ES.
Cryptography & Identifiers
Device attestation: vendor TEE (e.g., Ed25519 over measured boot hash).
VN votes: Ed25519 multisig or BLS aggregate (off-ledger), exposed as
S.All hashes:
H = SHA-256(XRPL-native).IDs:
storage_id = H(serial || grid_id || owner_key).
Hooks (XRPL) – Minimal State Machine
state.seen[ES] = 1on first valid anchor.state.last_epoch[storage_id]monotonic.state.policy_hashpinned (prevents mid-epoch policy swaps).Reject mint if
seen[ES]==1or epoch regresses.
Economic Envelope
R (kWh→EDX) set by policy oracle; posted each epoch; hash pinned in Hook.
Optional bond from SN (in XRP/EDX) slashed if fraud proven (challenge window with counter-SP).
VN reputation score (on-ledger scalar) weights quorum participation over time.
Interfaces (sketch)
SN → VN
VN → AA
AA → XRPL
Submit Anchor Tx with
QCblob in memo; Hook enforces validity.
Issuer → XRPL
Paymentof EDX to SN upon Hook approval (mint), tag = ES.
Pseudocode (Core Round)
Why This Works for Enerdex on XRPL
Enerdex reaches application-layer consensus (ESSC) on physics-constrained data (stored kWh) before invoking XRPL, eliminating garbage-in.
XRPL provides deterministic, low-latency finality and a native DEX, so once a QC is anchored, EDX issuance and settlement are on-ledger, immutable, and cheap.
The trio (TEE proofs + ESSC QC + XRPL Hook state) closes the loop on measurement → agreement → settlement.
Scalability, Determinism, and Ledger Coupling
The Enerdex Surplus-Storage Consensus (ESSC) architecture is explicitly designed to scale horizontally without compromising the deterministic guarantees provided by the XRP Ledger (XRPL). Unlike probabilistic-finality chains, XRPL’s deterministic close model ensures that once a Quorum Certificate (QC) is anchored, the result is immutable and globally agreed within ~3–5 seconds.
Enerdex’s application-layer consensus exists orthogonally to XRPL consensus:
ESSC determines truth about a physical claim.
XRPL consensus determines order and finality of the accepted truth.
This separation enables parallelism in measurement verification while serializing settlement at the ledger layer, allowing high-throughput trade of EnergySlices (ES) without saturating XRPL transaction bandwidth.
Threat Model and Adversarial Resistance
Physical Layer Attacks
Forged Energy Claims: Mitigated via Trusted Execution Environment (TEE) attestations, firmware allowlists, and meter root Merkle proofs.
Replay / Double-Sell: Blocked by nonce chaining, ES uniqueness, and Hook state checks.
Consensus Layer Attacks
Byzantine Verifiers: ESSC tolerates up to
fmalicious VNs in a network ofNnodes, requiring2f+1honest votes to finalize a QC.Leader Misbehavior: Anchor Agent rotation on timeout ensures no single VN can block anchoring indefinitely.
Ledger Layer Attacks
Invalid Anchor Injections: Hooks validate QC structure, bitmap, policy hash, and epoch monotonicity before minting EDX.
State Rollback: XRPL’s deterministic close prevents forks that could roll back anchored QCs.
EnergySlice Lifecycle
Creation: SN measures surplus, creates SP, and derives ES ID.
Verification: VNs cross-validate SP and vote.
Certification: AA aggregates votes into QC.
Anchoring: QC committed to XRPL via Anchor Transaction.
Issuance: Hook mints EDX tokens bound to ES.
Trading: EDX enters XRPL DEX liquidity pools.
Redemption / Burn: Upon delivery or offset, Hook burns corresponding EDX lot and retires ES from circulation.
Formal Invariants
Non-overlap Invariant:
∀ ES, ∃! MintEvent(ES)Monotonic Epoch Invariant:
epoch(storage_id)_{n} < epoch(storage_id)_{n+1}Policy Lock Invariant:
policy_hash_epoch_n == policy_hash_epoch_commit
These invariants are enforced jointly by VN verification rules and Hook state machine constraints.
Performance Considerations
Verification Latency: Median VN verification < 500 ms for standard SP payloads.
Quorum Formation: Target < 2 seconds for
2f+1vote aggregation.Ledger Settlement: Anchoring + XRPL finality within 5 seconds.
Throughput: Designed for 1,000+ concurrent ES verifications per epoch across distributed VN clusters.