SPEC-06: Universal Grants, Invocations, Re-Delegation, Sessions, and Anti-Rollback Journals
- Version:
1.0.0-draft.4 - Status:
draft(normative rulesdecided; external CAS witness transport protocol trackedopeninOPEN-QUESTIONS.md) - Evidence / Maturity:
vectors(vectors/trace-01-mail-offline-revoke.json,vectors/trace-03-delegation-pool-single-use.json,vectors/trace-04-agent-guardian-intake.json,vectors/refusal-coverage-matrix.json) - Registries:
registry/object-types.json,registry/constraints.json,registry/opreturn-actions.json,registry/refusal-codes.json - Schemas:
schemas/grant.schema.json,schemas/invocation.schema.json
1. Universal Grant Model (seallink-grant/1)
A seallink-grant/1 (<= 65536 bytes, schemas/grant.schema.json) is the universal authorization instrument across people, organizations, services, and agents (SL-GRNT-001, decided). Every grant carries exactly one of issuer (root grant) or parent (depth-2 child grant).
1.1 Unilateral Base and Optional Contract Binding
- Unilateral base: An autonomous root grant requires ONLY the issuer's valid
SignatureSetmatchingissuer.role_policy(pinned on chain inlink.grantperSL-IDEN-003). A root grant issued on behalf of awardomitsissuer.role_policy, setspayload.guardian_context, and carries top-levelguardian_approvals[]satisfyingrequired(derived_event_class)(SL-WIRE-013,SL-ORIG-006). Neither form requires recipient assent or imposes obligations on the recipient. - Contract-bound grants: Setting optional
contract_idbinds the grant to aseallink-contract/1(SPEC-05): the grant's window MUST nest inside the contract (and any framework contract), allmachine_clause_indicesMUST be disclosed and match the grant's capabilities, and spending the contract or framework seal terminates the grant (SEAL_SPENT). Action profiles withrequires_contract = truerefuse unilateral grants (GRANT_CONTRACT_REQUIRED).
1.2 Recipient Modes (SL-GRNT-002, decided)
Every grant selects exactly one recipient mode:
- **By Key (
mode = "key"):** Names onexonly_64hexpublic key (suitable for ephemeral key-only workers and hardware keys). Ledger name resolution is skipped for the recipient. - **By Name (
mode = "name"):** Names(name, owner_policy). At invocation, the verifier resolvesname, confirms its current live output matchesowner_policy(NAME_OWNER_MISMATCH), and accepts signatures from the name's current authorizednostr/request key, permitting same-owner key rotation and name renewal without reissuing the grant. - **By Group (
mode = "group"):** Names aThresholdPolicy(m-of-ndistinct keys), authorizing execution ONLY when>= mdistinct co-recipients signseallink-invocation/1(SignatureSet).
1.3 Concrete executor vs. Stateless executor_ref (SL-GRNT-003, decided)
Every action leaf in a service profile declares four orthogonal boolean properties (SPEC-07 §4.1): external_mutation, discloses_data, quota_consuming, and allows_executor_ref. Every grant carries exactly one of:
- **Concrete
executor: {name, key}: Pins one specific service identity and receipt key. MANDATORY** whenever ANY capability incapabilities[]hasexternal_mutation = true,quota_consuming = true, carriesquotas, usessingle_userevocation, or includesdelegate. - **Dynamic
executor_ref: {provider_of, service_type, label}:** Resolves at verification time againstprovider_of's current confirmedseallink-manifest/1providers[]entry (NamePin+ service manifestreceipt_key) matching(service_type, label). STRICTLY FORBIDDEN if the grant carries anyquotas, usessingle_userevocation, includesdelegate, or includes any action withexternal_mutation = trueorallows_executor_ref = false(GRANT_EXECUTOR_REF_FORBIDDEN).
Rationale: Stateless data-read actions (e.g.,
mail/readwithout quotas) havediscloses_data = trueandexternal_mutation = false, so resolving the current pinned provider viaexecutor_refcannot double-spend quotas or cause duplicate side effects.
1.4 Validity Window and Revocation Modes (SL-GRNT-004, decided)
- Half-open block window:
[not_before_height, not_after_height)withrecent_block_height <= not_before_height < not_after_heightandnot_after_height <= issuer_name_expiry_at_issuancefor sealed grants. Admission attip == not_after_heightrefusesGRANT_WINDOW_CLOSED. Optionalmin_depth(1..144, defaults to1) specifies the issuer's minimum required anchor/seal confirmation depth. - Two revocation modes:
- **
revocation.mode = "seal"(Standard Default):** Namesconstruction ("W" | "L"),kind ("revocable" | "single_use"), and confirmedseal: {txid, vout, script_policy}. Anchored viaOP_RETURN 0x01(or Merkle batch0x02withMerkleProof) committingtyped_digest(seallink-issuance/1)(loc = 0x00default). Spending arevocableseal closes the grant at mempool speed (SEAL_SPENT). Asingle_useseal MUST useScriptPolicytemplatesingle_use_1_of_2and follows the branch-aware state machine inSPEC-02 §6.2. - **
revocation.mode = "window_only"(Root-Only Zero-Tx Ephemeral Mode): Strictly permitted ONLY on root** grants withoutdelegate(parentanddelegateMUST be absent), withnot_after_height - not_before_height <= 12blocks. Requires zero ledger transactions. **Executors MUST refusewindow_onlyby default (GRANT_SEAL_REQUIRED)** unless local executor policy explicitly opts in for that action and budget tier. Emergency rotation/removal of the issuer'slink.grant(NAME_ROLE_CHANGED) still terminates all livewindow_onlygrants immediately.
- **
1.5 Text-vs-Effect Invariant (SL-GRNT-005, decided)
A grant MAY carry optional terms_text solely to guide cognitive work (e.g., agent/brief). Any mechanical effect executor (mail/*, agent/tool, agent/session, wallets, locks, name updaters, blob stores) MUST refuse any grant containing terms_text (GRANT_TEXT_FORBIDDEN).
2. Invocations (seallink-invocation/1) and Signed Receipts (seallink-receipt/1)
2.1 Signed Invocation and Acyclic Single-Use Delivery (SL-GRNT-006, decided)
Every execution request is a canonical JCS seallink-invocation/1 (<= 1 MiB) signed by the final grant's recipient (SignatureSet):
- Binds
network,genesis, concreteexecutor {name, key}, exactaction,target, closed typedarguments(validated against the owning profile schema), optionalcontent_salt(SPEC-05 §3),proof_path(1 entry for root grant, 2 entries[parent, child]for delegated child grant, each optionally carryingissuance_txidandbatch_proof), 32-byte CSPRNGnonce, and wall-clock half-open window[iat, exp)(iat <= now < exp, no grace,INVOKE_TIME_INVALID). - **Acyclic single-use consumption (
0x11):**seallink-invocation/1NEVER embedsuse_txid. For asingle_usegrant:- The grantee constructs and signs
seallink-invocation/1, computinginvocation_content_addr = SHA256(canonical_JCS(invocation)). - The grantee broadcasts
T_usespending thesingle_use_1_of_2seal via branch0(grantee,SIGHASH_ALL) withOP_RETURN 0x11(SINGLE_USE_CONSUMPTION) committinginvocation_content_addr. - The grantee delivers
(seallink-invocation/1, use_txid = txid(T_use))in the transport envelope alongside inline grant/contract/manifest bytes. The executor verifiesT_useon its own chain view (SPEC-02 §6.2).
- The grantee constructs and signs
- Signed arguments are sole authority: The executor MUST derive effect parameters strictly from
payload.arguments(never from transport headers or unsigned wrapper fields) and evaluate everywherepredicate (SL-WIRE-016) againstpayload.arguments(INVOKE_CONSTRAINT_FAILED).
2.2 Quota Accounting, Reservation, and Settlement (SL-GRNT-007, decided)
- Reserve before effect (atomic dual-account multi-quota batch): Before executing any effect, the executor MUST compute the profile-defined maximum debit for every quota key consumed by the action (exact integer/rational arithmetic, never binary64) and atomically check and reserve across both accounts for a delegated child grant — the child grant's
ownaccount keyed by(account="own", grant_id=child_grant_id, quota_kind, resource, unit, window, bucket_id)and the parent's per-rowrowaccount keyed by(account="row", grant_id=parent_grant_id, row_ordinal=child.parent.ordinal, quota_kind, resource, unit, window, bucket_id)(bounded by the group template row ceiling — strictly isolated perrow_ordinalso sibling rows sharing one executor never collide, and never charging the parent'sownaccount) — plus operator ceilings (QUOTA_EXCEEDED). Bothaccountand (whenaccount = "row")row_ordinalMUST be persisted inFencedJournalreservationandsettlemententries and restored identically on replay. If ANY quota key or account in the batch fails, the entire reservation batch MUST abort leaving all balances and the journal unchanged. A zero ceiling authorizes nothing; missing required quota refuses. - Window modes:
term: cumulative across[not_before_height, not_after_height).blocks:<N>: half-open block buckets[not_before_height + k*N, not_before_height + (k+1)*N).seconds:<S>: UTC epoch-aligned buckets[floor(now/S)*S, (floor(now/S)+1)*S)guarded by a durable per-key monotonic clock watermark (QUOTA_CLOCK_REGRESSION).
- Settlement (Actual Charge and Release): Once an effect completes with a known actual debit, the executor writes a
settlementjournal entry per reserved(account, [row_ordinal], quota_key, bucket_id)charging the exact actual debit (exact integer/rational arithmetic rounded upward once per request, zero binary64) and releasing the unused reservation difference (reserved = settled + released). On restart replay, every reservation lacking a matching settlement remains unsettled until reconciled. - Uncertain outcomes: If an effect outcome is uncertain (timeout, crash, network split), the full reservation MUST be retained until operator/protocol reconciliation; the executor reports
outcome = "uncertain"and MUST NOT silently refund or allow replay. - Idempotency and Replay: Request identity is
invocation_id = SHA256(canonical_JCS(invocation.payload))(excludingsignatures). A repeated identicalinvocation_idMUST perform no second effect; the executor returns its stored signed receipt or refusesINVOKE_REPLAYper profile. A reusednoncewith a different payload MUST refuseINVOKE_REPLAY.
2.3 Signed Receipt (SL-GRNT-008, decided)
Every executor answers with a seallink-receipt/1 (<= 65536 bytes, schemas/invocation.schema.json) signed by its pinned receipt key (executor.key), recording invocation_id, grant_id, action, outcome ("executed" | "refused" | "uncertain"), optional refusal_code, settlements[], optional result_sha256, and observation (tip_height, tip_hash, recorded_at). Each entry in settlements[] (maxItems: 64, supporting full lossless reporting of up to 32 capability quotas across both own and row accounts within the 64 KiB envelope ceiling) MUST specify account ("own" | "row" | "session"), row_ordinal (REQUIRED iff account = "row", FORBIDDEN otherwise), kind, resource, unit, window, reserved, settled, and released. Callers MUST verify receipts solely against their pinned executor.key.
3. Bounded Depth-2 Re-Delegation
A root seallink-grant/1 MAY authorize bounded child grants by including delegate (SL-GRNT-009, decided). Maximum authority path depth is 2 (root -> child; children MUST NOT carry delegate and MUST use revocation.mode = "seal" bound to delegate.child_seal_key, GRANT_NOT_DELEGABLE).
- Separated delegation and child-seal keys:
delegate.key(xonly_64hex) signs child grants ONLY (disjoint from issuer, recipient, and messaging keys; held in an isolated delegation signing service enforcing at-most-one signature per row,guides/GUIDE-01-custody-and-signers.md).delegate.child_seal_key(compressed_66hex) controls the issuer revocation branch of every child grant's seal (held outside the delegation signer so the delegator can revoke children even if the delegation signer is compromised).
- **Grouped rows, row coins, and pairwise disjointness (
R8.6):**delegate.groupsholds1..16groups; each group pairs atemplate(concreteexecutor, closedrecipient_rule(exact_key | exact_name | member_class),capabilities[], andnotary_mode) with1..16rangesof1..4096pre-confirmed P2WPKH row coins (confirmed<= parent.recent_block).- **Disjoint coin ranges (
R8.6):** Every(txid, vout)across ALL row ranges and ALL stop-coin ranges across ALL groups indelegate.groups, as well as the parent's ownsealand linkage output, MUST be pairwise disjoint (GRANT_ROW_INVALID). - Global 1-based
ordinalenumerates rows in signed group/range order. A child namingparent: {grant_id, ordinal}MUST have its issuance anchor (0x01or0x02) spend the exact row coin forordinal(GRANT_ROW_INVALID), enforcing on chain that at most one child per row exists.
- **Whole-parent aggregate budget (
R8.5) and mechanical child narrowing (SL-GRNT-010,decided):** Every verifier MUST check BOTH the whole parent allocation AND the individual child:- **Whole-parent budget sum (
R8.5):** For every quota keyq = (kind, resource, unit, window)appearing in any group template'scapabilities[].quotas, letrows(g) = sum(r.count for r in g.ranges)andcap(g, q)be the maximum ceiling forqin groupg's template (summed across capabilities ingthat shareq). Using exact integer arithmetic (overflow ->GRANT_CHILD_WIDER), the verifier MUST confirm a matching pool entrypool_max(q)exists indelegate.poolsand:
- **Whole-parent budget sum (
sum over all groups g of (rows(g) * cap(g, q)) <= pool_max(q)
Failure refuses GRANT_CHILD_WIDER. (This invariant prevents sibling rows at different executors from exceeding the parent's total budget.)
- Child-within-parent check:
C.genesis == P.genesis,C.contract_id == P.contract_id(if present),C.executor == template.executor, andC.revocation.mode == "seal"with issuer branch controlled byP.delegate.child_seal_key;[C.not_before_height, C.not_after_height) ⊆ [P.not_before_height, P.not_after_height);- Every capability in
C.capabilitiesmechanically narrows a capability intemplate.capabilitiesunder the 7-predicate Constraint Algebra (SL-WIRE-017), and every child quota<=the template's row cap; C.recipientsatisfiestemplate.recipient_rule(exact_keymatchesmode="key";exact_namematchesmode="name"with equalnameandowner_policy;member_classchecks live unspent membership ofC.recipientin at least one pinned operator's confirmedseallink-members-list/1).
- **Optional notary and stop coins (
SL-GRNT-011,decided):**"none"(default): mechanical narrowing underSL-GRNT-010requires no notary."optional_stop": range specifies confirmed P2WPKH stop coins controlled by a pinned notary; spending a stop coin permanently closes that row for cause across all verifiers (GRANT_ROW_STOPPED)."required_act": additionally requires a verifiedseallink-notary/1(act_kind = "child-within-parent") act (NOTARY_REQUIRED).
4. Deterministic Admission Order (Invocation Pipeline)
An executor MUST evaluate an incoming seallink-invocation/1 in this exact 12-step order, returning the first failure (SL-GRNT-012, decided). Early recipient authentication runs strictly before cached-receipt lookup and blockchain RPCs to prevent unauthenticated DoS, cached-receipt harvesting, and state-oracle leakage:
- **Invocation wire check (
SPEC-01 §7):** Parse and verifyseallink-invocation/1syntax, JCS, closed schema, profile argument schema, keys, and self-consistentSignatureSet->WIRE_* - Early local request checks (pre-chain):
- 2a. Wall-clock half-open window
iat <= now < exp->INVOKE_TIME_INVALID - 2b.
invocation.executorequals this executor's pinned(name, receipt_key)->GRANT_EXECUTOR_MISMATCH
- 2a. Wall-clock half-open window
- Presented bundle wire, early recipient authentication, and replay check (pre-chain):
- 3a. Wire pipeline on presented grant(s), optional contract(s), and optional manifest(s) ->
WIRE_* - 3b. If leaf grant uses
recipient.mode = "key"or"group", verifyinvocation.signatures.policyequalsgrant.recipientimmediately ->WIRE_SIGNATURE(runs before any cached-receipt lookup so forged callers cannot probe or retrieve cached receipts) - 3c. For
keyandgrouprecipients (whose authentication succeeded in Step 3b): check local journal replay/nonce table. Ifinvocation_idalready has a stored terminal receipt, return that cached receipt (orINVOKE_REPLAYif profile forbids cached return). Ifinvocation_idhas an unsettledreservation(crash inside the external-effect window before receipt persistence), returnoutcome = "uncertain"while retaining the reservation and executing zero second effect. Ifnoncewas already used for a differentinvocation_id, refuseINVOKE_REPLAY. *(Forrecipient.mode = "name", this identical replay/crash-recovery check runs immediately after Step 11a once the recipient's on-chain key is verified.)*
- 3a. Wire pipeline on presented grant(s), optional contract(s), and optional manifest(s) ->
- **Consistent chain observation (
SPEC-02 §4):** Check in strict order:- 4a. Chain/genesis pin ->
CHAIN_MISMATCH - 4b. Reading node health (
!IBD,txindex=1, header lag<= LAG) ->CHAIN_UNHEALTHY - 4c. Independent comparison peer veto ->
CHAIN_NODE_DISAGREEMENT - 4d. Monotonic UTC clock watermark and header future bound
S->CHAIN_CLOCK_ERROR - 4e. Action risk-class tip freshness (
tip_age) ->CHAIN_TIP_STALE
- 4a. Chain/genesis pin ->
- **Journal continuity (
§6):** Check external CAS witness readability, local store readability, andjournal_idmatch (JOURNAL_LOST), then activewrite_token(JOURNAL_FENCED), then position/commitment continuity (JOURNAL_LOST) - Durable closure check: Check local closure journal for every grant ID, contract ID, framework ID, issuer role, and row in
proof_path, in strict order:- 6a. Closed grant or ancestor grant ->
INVOKE_REPLAYif closed specifically bySINGLE_USE_CONSUMED(for a newinvocation_id), elseGRANT_CLOSED - 6b. Stopped row ->
GRANT_ROW_STOPPED - 6c. Closed issuer role ->
NAME_ROLE_CHANGED - 6d. Closed seal ->
SEAL_SPENT
- 6a. Closed grant or ancestor grant ->
- **Issuer identity, origin, and guardianship (
SPEC-03,SPEC-04):**- 7a. Resolve root issuer name (
NAME_NOT_FOUND), liveness (NAME_EXPIRED), history walk availability (NAME_HISTORY_UNAVAILABLE),SIGHASH_ALLwriter check (NAME_WRITER_UNVERIFIED),owner_policymatch (NAME_OWNER_MISMATCH), 520B name value grammar (NAME_VALUE_INVALID). For autonomous issuers (no verified ward origin): verifylink.grantcontinuity (NAME_ROLE_CHANGED), verifyissuer.role_policymatcheslink.grantand equalsroot_grant.signatures.policy(WIRE_SIGNATURE). - 7b. If origin-certified (
link.originor pinned origin): check in strict order:origin/1validity & trust (ORIGIN_UNVERIFIED),name-binding/1validity (ORIGIN_BINDING_INVALID),status_sealandroster_sealcompleteness (ORIGIN_STATUS_INCOMPLETE), subject end (SUBJECT_ENDED), pending emancipation transfer (GUARDIAN_TRANSFER_PENDING), calendar majority time boundary (GUARDIAN_TIME_BOUNDARY); ifward, enforceSL-ORIG-006order (WARD_AUTONOMOUS_FORBIDDEN, thenGUARDIAN_INACTIVE, thenWIRE_SIGNATURE, thenGUARDIAN_QUORUM_UNMET).
- 7a. Resolve root issuer name (
- **Contract and framework checks (
SPEC-05):** Check in strict order: action requires contract (GRANT_CONTRACT_REQUIRED); ifcontract_idpresent: presentation (CONTRACT_NOT_PRESENTED), ID recomputation (CONTRACT_ID_MISMATCH), party assents (CONTRACT_ASSENT_INVALID), confirmed seal presence &ScriptPolicymatch (CONTRACT_SEAL_MISSING), seal spend (SEAL_SPENT) or inconclusive seal (SEAL_UNAVAILABLE), disclosedmachine_clause_indices& window nesting (CONTRACT_TERMS_MISMATCH), runtimeconfig_sha256if required (CONTRACT_CONFIG_MISMATCH). - **Re-delegation checks (depth 2,
§3):** Check in strict order: parent delegation rights & depth<= 2(GRANT_NOT_DELEGABLE), whole-parent R8.5 aggregate pool sum (GRANT_CHILD_WIDER), R8.6 disjointness & ordinal row coin spend (GRANT_ROW_INVALID), stop coin live (GRANT_ROW_STOPPED), optional notary act (NOTARY_REQUIRED), childsignatures.policyequalsparent.delegate.key(WIRE_SIGNATURE), mechanical child narrowing against group template (GRANT_CHILD_WIDER). - Grant window, revocation / single-use seal, and executor binding:
- 10a. Grant height window
[not_before_height, not_after_height)->GRANT_WINDOW_CLOSED - 10b. If
revocation.mode = "window_only": enforcenot_after_height - not_before_height <= 12(WIRE_INTEGER), then executor opt-in policy (GRANT_SEAL_REQUIRED) - 10c. If
revocation.mode = "seal": verify issuance0x01/0x02frame & Merkle proof (CHAIN_FRAME_INVALID),recent_blockrecency (CHAIN_RECENCY_INVALID), WitnessWconstruction (CHAIN_TX_CONSTRUCTION), anchor depth (CHAIN_DEPTH_INSUFFICIENT); then evaluate seal: revocable(SPEC-02 §6.1):revoked-> write closure +SEAL_SPENT;unavailable->SEAL_UNAVAILABLEsingle_use(SPEC-02 §6.2):awaiting_spend->SEAL_UNAVAILABLE;revoked-> write closure +SEAL_SPENT;pending_confirm->CHAIN_DEPTH_INSUFFICIENT;consumedwith distinctinvocation_id->INVOKE_REPLAY- 10d. Verify
executoror resolveexecutor_ref: forbidexecutor_refif the grant includesdelegate, usessingle_use, carries anyquotas, or declares any capability ingrant.capabilities[]withexternal_mutation = trueorallows_executor_ref = false(GRANT_EXECUTOR_REF_FORBIDDEN; evaluated strictly againstgrant.capabilities[]so unauthorizedinvocation.actionvalues reach Step 11bINVOKE_ACTION_DENIED); verify holder's confirmed manifest (MANIFEST_UNAVAILABLE, thenMANIFEST_MISMATCH, thenMANIFEST_ROLLBACK), confirm providerNamePinbinding (SERVICE_PROVIDER_UNBOUND) and providerowner_policy(NAME_OWNER_MISMATCH), confirm resolved(name, receipt_key)matches this executor (GRANT_EXECUTOR_MISMATCH)
- 10a. Grant height window
- Named recipient, action, text ban, and constraints:
- 11a. If leaf grant uses
recipient.mode = "name", resolve recipient name (NAME_NOT_FOUND), check liveness (NAME_EXPIRED), checkowner_policy(NAME_OWNER_MISMATCH), verifyinvocation.signatures.policyagainst its authorized request key (WIRE_SIGNATURE), and then execute the Step 3c local journal replay / crash-recovery check (INVOKE_REPLAY, cached receipt, oruncertain) - 11b. Action supported and present in
grant.capabilities(INVOKE_ACTION_DENIED) - 11c. Mechanical effect text ban (
GRANT_TEXT_FORBIDDEN) - 11d. Target match and 7-predicate
whereevaluation againstinvocation.arguments(INVOKE_CONSTRAINT_FAILED)
- 11a. If leaf grant uses
- Pre-effect recheck and atomic reservation: Re-bracket chain tip (
CHAIN_OBSERVATION_VOID, thenCHAIN_TIP_STALE) and re-check live seals (SEAL_SPENT), verify seconds-window monotonic clock (QUOTA_CLOCK_REGRESSION), atomically writenonce+reservationentries to fenced journal (QUOTA_EXCEEDED, thenJOURNAL_FENCED, thenJOURNAL_LOST)
5. Bearer Sessions for Non-Signing Clients (seallink-session-open/1)
When a client harness cannot sign per-request invocations (e.g., an SDK accepting only a base URL and bearer token), an executor MAY support short-lived sessions (SL-GRNT-013, decided):
- Recipient's key holder sends a signed
seallink-session-open/1(<= 16384bytes,op = "open" | "extend" | "close") withslot_binding, boundedquotas <= grant.quotas, andexp <= now + 3600(at most 1 hour ahead). - Executor runs the full admission pipeline (
§4), binds a 32-byte CSPRNG bearer token (storing ONLYSHA256(token)in its journal), and returns the token once over a local socket or mutually authenticated encrypted channel. - Every unsigned in-session request MUST re-run live chain observation, seal checks, and recipient channel-key checks before reserving from
(grant, row, session)accounts (SESSION_INVALIDon mismatch, expiry, or any link closure). - Unsigned in-session requests lack per-request non-repudiation and retry idempotency; executors MUST NOT enable bearer sessions for wallets, name updates, or irreversible financial transfers.
6. Anti-Rollback Fenced Journals (seallink-journal-entry/1)
Every stateful SealLink verifier/executor (tracking closures, single-use consumption, quota reservations, nonces, and manifest heads) MUST guard against backup-restore and equal-position forks using a hash-chained journal + external CAS witness (SL-GRNT-014, decided state machine / open witness wire transport in OPEN-QUESTIONS.md):
- Hash chain: Random 32-byte
journal_id; commitmentc(0) = H_tag("seallink-journal/1", journal_id),c(n) = H_tag("seallink-journal/1", c(n-1) || canonical_JCS(entry_n)). Everyentry_nMUST validate against the closed discriminatedJournalEntryschema (schemas/invocation.schema.json) withentry_n.pos == nandentry_n.prev_commitment == c(n-1). - External witness: An append-only CAS register stored strictly outside the local store's backup domain, holding
(journal_id, pos, commitment, write_token). Onlyadvance(journal_id, token, pos, from_commit, to_commit)mutates it; fencing strictly incrementswrite_token. - Write order: Check continuity -> durably write local entry ->
advanceexternal witness -> execute effect. - Continuity precedence: (1) witness readable, (2) local store readable, (3) matching
journal_id-> elseJOURNAL_LOST; (4) activewrite_tokenheld -> elseJOURNAL_FENCED(checked before position comparison so partitioned replicas fence cleanly); (5)store.pos == witness.posand equal commitment (Intact), orstore.pos == witness.pos + 1with matchingprev_commitment(Pendingcompletion), elseJOURNAL_LOST. - Attended recovery (start anew): Record
recoveryentry withfenced_at, wait for a confirmed ledger blockboundarywhoseheader_time > fenced_at + 7200s(exceeding Namecoin's +2h future-header consensus bound to prove the block was accepted after fencing), and conservatively treat all pre-fencing uncertain reservations as consumed.
7. Security Considerations
- No cross-executor quota sharing: Two independent executors MUST NEVER spend from one apparent grant quota; split budgets across separate concrete-executor grants or parent row groups verified under R8.5.
- Closure write failure: If writing a newly observed
SEAL_SPENTclosure to the journal fails, the verifier MUST refuse admission and halt further admission for that seal until durable storage recovers. - **
window_onlycontainment:** Executors opting into rootwindow_onlyMUST enforce low per-grant and global operator ceilings so a compromisedgrantkey's damage is bounded even before an emergency name update propagates.
8. References
- Normative: [RFC8785], [BIP-340], [BIP-141], [JSON-SCHEMA-2020-12].
- Informative: [RFC8448].