Story 007: Settlement-Capable Node as the Authoritative ORC Ledger¶
Current Baseline Used by This Story¶
This story is the operator-facing settlement counterpart of story-001.md. It is
based on the current supervised-ledger corpus rather than on an imagined later
payment system.
In particular, it assumes:
- one federation-local authoritative host-ledger instance for MVP, understood as one logical settlement authority rather than necessarily one physical host,
- explicit separation between:
- routing identities (
node-id), - participation subjects (
participant:did:key:...), - organization subjects (
org:did:key:...), - and settlement accounts (
ledger-account.v1), ORCas the internal settlement unit visible to procurement artifacts, with fixed decimal scale2and protocol-visible integer amount fields expressed in ORC minor units,- trusted gateway and escrow roles attached to a settlement-capable Node,
- append-only settlement facts instead of hidden mutable balance state,
- explicit
gateway-policy.v1,escrow-policy.v1, andsettlement-policy-disclosure.v1artifacts, - procurement contracts that bind the business agreement to explicit settlement
anchors such as
payer/account-ref,payee/account-ref,escrow/node-id, andescrow/hold-ref.
This story does not assume a public-chain rail, decentralized smart contracts, or cross-federation settlement portability.
Sequence of Steps¶
- An umbrella organization decides to run one Node in the
settlement-capabledeployment profile for one federation. - The operator starts the Node with settlement services enabled and binds it to a
stable local
node-idplus a stable accountable organization subjectorg:did:key:.... - The operator publishes or loads the current
gateway-policy.v1andescrow-policy.v1artifacts, each naming: - the serving node,
- the accountable
operator/org-ref, - the admitted settlement unit
ORC, - and the active status and timing semantics.
- The settlement-capable Node creates or restores the authoritative ledger scope
for that federation. This scope may later be implemented with failover or HA,
but in MVP the only frozen constraint is that it behaves as one logical
authority and single-writer ledger. Within this scope it treats
ledger-account.v1as the canonical binding between an accountable subject and one ORC account. - The operator provisions the first accounts:
- a
community-poolaccount owned by the accountable organization, - one or more
participant-settlementaccounts for participants, - and, where needed later,
org-settlementaccounts for organizations serving as payees. - When a new participant is admitted to paid procurement, the Node creates a
ledger-account.v1whoseowner/idis the canonical accountable subject such asparticipant:did:key:...rather than the rawnode-id. - The operator or a connected payer performs a prepaid top-up through the gateway
path. The gateway side receives external money and emits one signed
gateway-receipt.v1. - From that gateway event, the authoritative ledger records the corresponding append-only internal facts:
- one net credit to the payer's settlement account,
- and, when policy requires it, one fee credit to the
community-poolaccount. - The payer opens a priced procurement flow elsewhere in the swarm. The resulting
procurement-contract.v1names: payer/account-refas the accountable economic owner,payee/account-refas the accountable receiving owner,settlement/rail = host-ledger,- and the escrow anchors for this contract.
- Before remote execution begins, the settlement-capable Node checks available balance for the payer's account. This check is against the authoritative ledger view, not against chat-local state or offer-local assumptions.
- If balance is sufficient, the Node creates one
ledger-hold.v1that reserves the ORC amount on the payer account for that exact contract. - The contract and the hold are now joined in both directions:
- the hold names
contract/id, - the contract names
escrow/hold-ref.
- the hold names
- While the responder works, the ledger remains the source of truth for the
reserved amount, dispute window, and timeout cascade:
work-by,accept-by,dispute-by,auto-release-after.
- When the responder delivers, the payer confirms, rejects within policy, or opens a dispute. If silence persists until the contract policy allows it, auto-release may occur.
- The settlement-capable Node then records one or more
ledger-transfer.v1facts, for example:releaseto the payee account,partial-releaseplusrefund,- or full
refundto the payer account.
- A
procurement-receipt.v1records the terminal business outcome and points back to the settlement path throughsettlement/ref,settlement/hold-ref, and optionalsettlement/transfer-refs. - At any moment, the Node can export an operator-visible read model for each
account, such as current
available/balanceandheld/balance, but those remain derived views rather than the only source of truth. - If the organization suspends payouts, imposes manual review, or blocks a
settlement path, the Node emits
settlement-policy-disclosure.v1rather than silently mutating behavior. Paid procurement then becomes:blocked,manual-review-only,- or otherwise degraded, while preserving audit joins to the governing policy.
- If the organization later needs to support an accountable service provider or
collective payee, it provisions an
org-settlementaccount whoseowner/idisorg:did:key:.... ORC therefore remains attached to the organization's ledger account, not to an informal label or to the serving infrastructure node. - If the federation operator needs to inspect a balance anomaly, dispute, or
complaint, the Node can reconstruct it from append-only artifacts:
gateway-receipt.v1,ledger-hold.v1,ledger-transfer.v1,procurement-contract.v1,procurement-receipt.v1,- and any
settlement-policy-disclosure.v1events.
Implementation Guidance Carried by This Story¶
- ORC ownership belongs to
ledger-account.v1, not directly toparticipantororgrecords. - ORC uses fixed scale
2: protocol-visible integers carry minor units, while human-facing rendering usesmajor.minor ORC. participant:did:key:...andorg:did:key:...are accountable owners; the ledger account is the settlement container.available/balanceandheld/balanceare exported read models, not the only source of truth.- The first settlement-capable runtime should prefer one authoritative ledger per federation over multi-supervisor split-brain complexity.
- MVP does not yet freeze a concrete HA profile beyond one logical authority and no split-brain behavior.
- The storage backend may later be swapped for MariaDB or a similar replicated engine if the ledger still preserves append-only facts, one logical authority, and protocol-visible compatibility.
- Gateway and escrow behavior should remain policy-bound and disclosure-friendly, not hidden inside ad hoc operator grace.
Open Continuation¶
- Multi-supervisor federation once one-ledger MVP is stable.
- Cross-federation settlement portability.
- Operational support for direct
pod-user:did:key:...ownership in paid paths. - First user-facing operator UI for inspecting ledger accounts, holds, transfers, and policy disclosures together.