Skip to main content

Proposal: This page presents the draft API and profile model. Send feedback on GitHub.

Data model and schema reference

The companion schema is a draft 2020-12 JSON Schema. All listed object properties are required and additionalProperties is false. The schema supports syntactic validation; the semantic constraints below must also be implemented. A signed wrapper can contain several payload kinds, so every endpoint additionally verifies that its expected payload kind and signer role match.

DefinitionRequired fields beyond v and kind, unless notedSemantics
policyid, tenant, purpose, rules, unit, pool, limit, per, maxDepth, surviveOne to eight exact action rules; each rule has action, resource, audience, releaseTo, args. The unit and pool define shared accounting.
termsid, rootId, parentGrantRef, origin, holder, keyId, gen, service, policyRef, depth, limit, per, epoch, nbf, expEmbedded object, no v or kind. Root has parentGrantRef: null; child names the signed parent.
challengeid, nonce, purpose, contextRef, actorKeyId, recipient, iat, expSigned by a configured challenge issuer. Purposes are root-approval, join, request-proof, response-proof, ledger-control.
approvalchallengeRef, subject, termsRef, nbf, expSigned by the configured human key over the exact root terms and challenge.
joinchallengeRef, holder, keyId, gen, termsRef, nbf, expCandidate signs to prove possession for the exact terms and issued join challenge.
parent-requestparentGrantRef, childTermsRef, joinRef, nbf, expImmediate parent signs this specific child birth request.
grantterms, approvalRef, parentRequestRef, joinRef, appraisalRefIssuer-signed root or child. Root uses an approval reference and null parent request; child does the reverse. Referenced admission evidence must remain retrievable.
appraisalholder, keyId, gen, service, appraisalPolicy, measurement, nbf, expTrusted appraiser's statement about this instance under configured appraisal policy.
intentrootId, tenant, purpose, audience, action, resource, args, inputHash, releaseTo, unitsComplete stable business action for this bounded vocabulary. args values are printable ASCII strings.
attemptop, record, intentRef, grantRef, policyRef, holder, keyId, gen, method, target, epoch, iat, expA particular signed attempt. op persists across an unchanged retry; record is fresh per new attempt.
proof-resultproofType, direction, contextRef, challengeRef, actorKeyId, policyRef, witnessCommitment, verdict, iat, expA designated verifier's signed attestation. Here proofType is designated-verifier-attestation; verdict is accepted. It is not an independently verifiable native witness.
proofchallenge, resultEmbedded object, no v or kind; both members are signed envelopes. A real provider must define the challenge and native response validation.
requestattemptRef, proofRefHolder-signed statement. The attempt names the exact target, grant, intent, actor and policy.
requestPacketintent, input, attempt, proof, request, grantChain, policies, appraisalEmbedded transport object, no v or kind. input is lowercase hex of exact input bytes. Policies correspond one-for-one with the root-to-leaf grant chain.
permitid, op, record, intentRef, requestRef, proofRef, grantRef, policyRef, holder, keyId, audience, units, epoch, fence, iat, expState authority's short-lived reservation for one exact request and audience.
outcomeop, permitRef, requestRef, intentRef, audience, row, resultHash, units, epoch, atResource assertion about a unique durable operation row and the exact result bytes.
closureop, permitRef, requestRef, intentRef, audience, epoch, atResource attests a terminal no-effect result. It must be mutually exclusive with an outcome for the same permit.
response-contextop, record, requestRef, recipientKeyId, resourceKeyId, policyRef, status, contentType, resultHash, outcomeRef, iat, expBinds the response's content, status, recipient, actual resource identity and original signed request.
responsecontextRef, proofRefResource-signed statement over the context and response proof.
responsePacketcontext, result, proof, outcome, responseEmbedded transport object; result is lowercase hex of exact result bytes.
ledger-controlaction, requestRef, permitRef, presentationRef, caller, nonce, idempotencyKey, iat, expSigned control action: check, redeem, settle, close or inspect. If a control proof is required, carry it separately and bind it to the control payload's context digest.
ledger-decisioncontrolRef, requestRef, permitRef, caller, nonce, decision, sequence, epoch, fence, iat, expState-signed decision bound to the caller's exact control request and fresh nonce.
ledger-eventledger, sequence, prev, event, actor, op, objectRef, atSigned event. prev is null at genesis and otherwise the previous signed event reference.
checkpointledger, sequence, head, stateHash, epoch, atIndependently retained keeper signature over the log head and a specified complete state projection.
revocationrootId, epoch, fence, atState-signed advancement of a lineage fence.
recoveryledger, rootId, checkpointRef, nextEpoch, atAuthorized recovery for the exact trusted checkpoint and next epoch.

The responsePacket schema models a committed response and requires an outcome. A denial, hold, closure, status response, and general error envelope need separate versioned schemas before they can be exchanged under this profile. This is a deliberate limitation of the worked contract; do not fill an outcome with invented evidence for a failed request.

Relationships beyond schema​

  • terms.nbf < terms.exp; parent interval contains child interval. A proof, challenge, permit and response have nonempty intervals and cannot authorize outside their own or their controlling authority's intervals. Current eligibility uses a clock uncertainty interval, not an unchecked local timestamp.
  • Each grant's terms.policyRef equals its corresponding H("policy", policy). Policies preserve tenant, purpose, pool and unit. Every child rule is an exact permitted parent rule; child's limit, per, maxDepth, depth and lifetime never expand; survive cannot change from false to true. These exact-match rules are a starting vocabulary, not a general policy language.
  • A grant is issuer-signed, registered, uniquely identified and current. At use, the chain is root first, each parentGrantRef equals the preceding signed grant reference, root and epoch are consistent, key and holder bindings are valid, depth strictly decreases, and each ancestor is valid and not revoked.
  • A challenge's purpose, contextRef, actorKeyId, recipient and interval match the pending ceremony or message. Its unpredictable nonce comes from a cryptographic random generator; its identifier and nonce are consumed atomically at the authoritative verifier. The fixed fixture nonces are deterministic test values.
  • Every proof result is signed by a configured verifier for its proof type; it matches its signed challenge, context, actor, direction and policy. The verifier must actually perform its defined native checks before signing. A digest of a witness is not by itself a proof.
  • The operation key in this guide is (configured service, tenant, audience, op). Its first eligible reservation binds original root, holder, intent, resource and accounting meaning. A changed intent or actor under the same key is a conflict for an entitled caller. A transmission record is scoped to service, direction, actor key and generation.
  • units > 0, units <= per, and settled plus outstanding reservations, including uncertain amounts, do not exceed the pool or inherited ceilings. State changes need a single transactional ordering point for that pool.