SPEC-05: Contracts, Symmetric Assent, Verifiable Credentials, and General Notary Acts
- Version:
1.0.0-draft.2 - Status:
draft(normative rulesdecided) - Evidence / Maturity:
vectors(vectors/wire-jcs-and-hashes.json,vectors/trace-02-guardian-succession-assent.json,vectors/refusal-coverage-matrix.json) - Registries:
registry/object-types.json,registry/key-roles.json,registry/opreturn-actions.json,registry/refusal-codes.json - Schemas:
schemas/contract.schema.json,schemas/credential.schema.json
1. Relationship Between Grants and Contracts
In SealLink v1.0, a **unilateral grant (SPEC-06) is the base authorization primitive: it requires no recipient assent and imposes no obligations on the recipient. A contract (seallink-contract/1)** is the bilateral or multilateral overlay that adds mutual agreement, obligations, framework governance, and shared or arbiter-controlled termination (SL-CONT-001, decided).
- A contract MAY exist without any grant (e.g., an anchored agreement between two people or organizations).
- Any action profile imposing payment, work, rental, or liability obligations on the recipient (such as
rentalor contract-boundagent/session) MUST declarerequires_contract = true; executors refuse unilateral grants for such actions (GRANT_CONTRACT_REQUIRED).
2. N-Party Structured Contracts (seallink-contract/1)
2.1 Structure, Salted Selective Disclosure, and Machine-Clause Completeness (SL-CONT-002, decided)
A seallink-contract/1 object (<= 65536 bytes, schemas/contract.schema.json) binds N >= 2 parties (any combination of people, organizations, agents, or unverified actors):
- Header fields:
type,network,genesis,profile,contract_salt(32 CSPRNG bytes, preventing offline guessing of short contracts),parties[2..32]— where each entry is either an autonomous party{role, name_pin?, signing_policy: ThresholdPolicy}or a ward party{role, ward_origin_id, name_pin}(omitting staticsigning_policyso guardian succession never invalidates a live contract) —window(not_before_height, optionalnot_after_height, optional calendarnot_after_unix), optionalmachine_clause_indices, optionalframework_id, optional/requiredseal, optionalassent_output, optionalconfig_sha256, and optionalmoderation. - Clauses & Selective Disclosure: Each clause
iis a canonical JCS object containing free-text prose (text, where\nis allowed perSL-WIRE-005), typed machine terms (mirroring any bound grant capabilities/quotas), or both. The contract stores ONLY the ordered arrayclause_commitments[]where:
clause_commitments[i] = H_tag("seallink-clause/1", salt_i || canonical_JCS(clause_i))
contract_id = SHA256(canonical_JCS(seallink-contract/1))
When a grant binds contract_id (and optionally framework_id), both complete contract documents MUST be presented (CONTRACT_NOT_PRESENTED) and MUST recompute to their bound identifiers (CONTRACT_ID_MISMATCH).
- Deterministic machine-clause completeness: Every clause index carrying machine-enforced terms MUST be listed in strictly ascending order in
machine_clause_indices[](with every index< len(clause_commitments)). An executor MUST require disclosure of(salt_i, clause_i)for EVERY indexiinmachine_clause_indices[], verifycommit(salt_i, clause_i) == clause_commitments[i], and check every disclosed machine term against the bound grant (CONTRACT_TERMS_MISMATCHon missing disclosure or mismatch). Prose-only clauses outsidemachine_clause_indices[]MAY remain undisclosed to the executor. - **Framework Nesting (
SL-CONT-003,decided):** A contract MAY name at most oneframework_id, and a framework contract MUST NOT name another framework contract (maximum nesting depth = 1). Every grant's window MUST nest inside its bound contract's window, which MUST nest inside its framework contract's window.
2.2 Symmetric Native Assent (seallink-assent/1) and Anchoring (SL-CONT-004, decided)
- Symmetric off-chain assent: A contract is concluded when EVERY party in
parties[]has signed an identical-formatseallink-assent/1(<= 32768bytes, accommodating multi-guardianguardian_approvals[]and up to 32-of-32SignatureSet,target_type = "seallink-contract/1",target_id = contract_id):- Permitted signer roles for
seallink-assent/1are strictlygrantandguardian_quorum(registry/object-types.json, coherent withregistry/key-roles.json);authanddevicekeys MUST NEVER signseallink-assent/1(WIRE_SIGNATURE). - For an autonomous party (
signing_policypresent),seallink-assent/1uses the ordinary{"payload","signatures"}envelope whosesignatures.policyMUST strictly equalparty.signing_policy(SL-WIRE-013). - For a ward party (
ward_origin_idpresent,SPEC-04),seallink-assent/1MUST carrypayload.guardian_context(origin_id == party.ward_origin_id,ward_name == party.name_pin.name,event_class = "contract_assent",revisionmatching the ward's active roster revision) and top-levelguardian_approvals[]satisfyingrequired("contract_assent")across distinct active guardian slots (SL-ORIG-006refusal precedence:WARD_AUTONOMOUS_FORBIDDEN, thenGUARDIAN_INACTIVE, thenWIRE_SIGNATURE, thenGUARDIAN_QUORUM_UNMET). - Assent freshness for grant issuance is at most
72hours (259200s) and single-use per issuance (CONTRACT_ASSENT_INVALID).
- Permitted signer roles for
- **Contract anchor (
0x07):** A contract is anchored viaOP_RETURNaction0x07committingcontract_id(loc_type = 0x00default for private contracts). - Optional on-chain assent: Parties MAY additionally name a confirmed
N-of-NP2WSHassent_outputinseallink-contract/1and have the0x07anchor transaction spend it (SIGHASH_ALLon all signatures), proving mutual assent on chain even to observers who never see contract plaintext.
2.3 The Contract Seal Decides Termination (SL-CONT-005, decided)
- Mandatory seal before signing: Every framework contract and every contract under which any grant is issued MUST name a confirmed
sealcreated before parties signseallink-assent/1. Signing services and verifiers MUST check confirmation and exact compiledScriptPolicymatch of both the bound contract's seal and any named framework contract's seal on their own node (CONTRACT_SEAL_MISSINGon conclusive absence/mismatch;SEAL_UNAVAILABLEon inconclusive read). - Script derives termination type — never prose: Every reader, renderer, and UI MUST derive the contract's termination type strictly from
seal.script_policy(SL-LDGR-004): A prose clause describing termination binds parties as text only and NEVER ends a contract or overrides the script-derived type.{"kind":"key"}-> **issuer_only**{"kind":"branch","template":"either_of_2"}-> **either_party**{"kind":"branch","template":"both_of_2"}-> **both_together**{"kind":"branch","template":"arbiter_or_both"}-> **arbiter**
- One spend ends all grants: Spending a contract or framework seal (
SEAL_SPENT) durably terminates every grant bound to that contract (or framework) upon first observation. The spending transaction SHOULD carryOP_RETURNaction0x08committingtyped_digest(seallink-termination/1)(SIGHASH_ALL); however, the spend alone terminates the contract regardless of whether0x08is valid or present.
2.4 Agreed Configuration Hash (SL-CONT-006, decided)
Any contract profile under which a runtime launches a configured agent (profiles/PROFILE-agent-v1.md) MUST require config_sha256. A runtime launcher that cannot reproduce config_sha256 from the exact profile, skills, and tools it is about to launch MUST refuse to start (CONTRACT_CONFIG_MISMATCH).
3. Violation Verdicts and Salted Request Attribution (seallink-verdict/1)
For moderated contracts (e.g., hosted services or agent sessions), seallink-contract/1 MAY declare moderation: {rules_sha256, moderator_key, moderator_kind} (SL-CONT-007, decided):
- Each recorded violation is a moderator-signed
seallink-verdict/1chained viaordinalandprev_verdict_id, committing torules_sha256,violated_rule,request_salted_sha256, andresponse_salted_sha256. - Salted invocation attribution: To allow dispute evidence without exposing plaintext on chain or enabling dictionary guesses against short messages,
seallink-invocation/1MAY include a fresh 32-bytecontent_salt(distinct fromnonce), withsalted_hash = SHA256(content_salt || plaintext_bytes). - A grant-seal revocation spend MAY include
OP_RETURNaction0x03committingtyped_digest(seallink-verdict/1). Closure still follows the seal spend alone; the verdict frame supplies auditable dispute evidence.
4. Verifiable Credentials (seallink-credential/1)
Third-party attestations about a subject — diplomas, licenses, notary credentials, human-verification claims (subject-claim), runtime isolation audits (agent-audit), and work-completion acts — share one object type: **seallink-credential/1** (SL-CONT-008, decided).
4.1 Lifecycles, Anchoring, and Compromise Cutoff h_c
- Signing role: Signed ONLY by the issuer's
link.credrole policy (issuer.role_policy, verified perSL-IDEN-003andSL-WIRE-013). A credential is NEVER a grant and confers zero execution authority by itself; verifier policies may only use credentials to narrow admission. - **Signed-form anchoring (
0x09):** Every credential MUST be anchored viaOP_RETURNaction0x09committing **content_addr = SHA256(signed_bytes)**, proving the signature existed at or before the earliest confirmed anchor blockh_anchor(CRED_ANCHOR_MISSING). - Two lifecycles:
- **
eternal:** MUST NOT carryrevocation_seal;not_after_heightoptional. Verified against the issuer'slink.credrole policy authorized ath_anchor. Survives routine issuer key rotation, expiry, and transfer. - **
revocable:** MUST carry a confirmedrevocation_seal;not_after_heightis optional. By default verifies the issuer'slink.credrole policy current at tip (exceptions such asseallink-guardian/1verify ath_anchor,SL-ORIG-008). Spending the seal closes the credential (SEAL_SPENT); spending withOP_RETURN 0x0a(seallink-credential-withdrawal/1) recordsCRED_REVOKED_FOR_CAUSE.
- **
- **Owner-authenticated compromise break
h_c(0x0b,SL-CONT-009,decided):**- If an issuer's
credornotaryrole policy (current or retired) is compromised, the issuer's coldname_ownerScriptPolicybroadcasts anOP_NAME_UPDATE(removing/replacing the role if current, signedSIGHASH_ALL) containing the 50-byte0x0bframe embeddingh_c_le64(<= inclusion_height) andtyped_digest(seallink-credential-break/1). - Because verifiers reconstruct
seallink-credential-break/1directly from the name history and on-chainh_c, withholding off-chain break documents cannot hide a compromise. - For the affected
(issuer, registration, owner_policy, compromised_policy): anchors ath_anchor < h_csurvive, while anchors ath_anchor >= h_cdurably refuse **CRED_ISSUER_CLOSED** (for both eternal and revocable lifecycles). Multiple breaks narrow bymin(h_c).
- If an issuer's
- Privacy: Raw PII MUST NOT appear on chain (
loc_type = 0x00default). Issuers deduplicating humans MUST NOT hash raw biometrics directly. Per-claim selective disclosure usesclaim_commitmentswith an independent 32-byte CSPRNG salt per entry (SL-WIRE-014).
4.2 Deterministic Credential Verification Order (SL-CONT-010, decided)
- Wire pipeline (
SPEC-01 §7) ->WIRE_* - Supported
credential_kind->WIRE_TYPE; claim schema compliance ->WIRE_MEMBER - Chain/genesis match ->
CHAIN_MISMATCH; subjectname_pinowner match ->NAME_OWNER_MISMATCH - Earliest confirmed signed-form
0x09anchor present ->CRED_ANCHOR_MISSING; confirmation depth>= required_depth->CHAIN_DEPTH_INSUFFICIENT - Issuer
link.credhistory walk available ->NAME_HISTORY_UNAVAILABLE;owner_policy&role_policymatch ->NAME_OWNER_MISMATCH;0x0bcompromise check (h_anchor < h_c) ->CRED_ISSUER_CLOSED - Height / calendar window check ->
CRED_WINDOW_CLOSED - Revocable seal state (
0x0acause ->CRED_REVOKED_FOR_CAUSE; plain spend ->SEAL_SPENT; unavailable ->SEAL_UNAVAILABLE)
5. General Notary Acts (seallink-notary/1)
A notary is an independent off-authority-path actor (human, organization, or agent; refusing by actor class is invalid unless required by explicit policy) acting under its link.notary role policy (SL-CONT-011, decided):
- **Four act kinds (each with a closed
detailsschema inschemas/credential.schema.json):**contract-notarization: certifies that named parties executedcontract_id(plus optionalnotary_clause_sha256).certified-copy: certifies correspondence oforiginal_sha256andmedia_typeto an inspected original.fact-attestation: certifies a witnessedfact_sha256underfact_schemaat(tip_height, tip_hash).child-within-parent: optional re-delegation attestation naming(parent_grant_id, child_grant_id, ordinal)when parent policy demands prose/policy review alongside mechanical narrowing.
- **Lifecycles & Anchoring (
0x04):** Anchored viaOP_RETURNaction0x04committingcontent_addr(seallink-notary/1). Supports BOTH **eternal** (nonotary_seal, verified againstlink.notaryath_anchor, bounded by0x0bh_c) and **revocable** (notary_sealrequired; plain spend withdraws allowing recertification; spend with0x05recordsCRED_REVOKED_FOR_CAUSEand bars recertification without a new ruling). - Notary identity pin: Every reference to a notary pins
(name, registration, owner_policy)with mandatory writer verification (SL-LDGR-007) so transferring a notary's name never transfers notarizing authority.
6. Security Considerations
- **Choosing
h_c:** Settingh_ctoo late preserves earlier attacker forgeries; settingh_ctoo early invalidates legitimate historical documents. - Selective clause context: Disclosing a single contract clause without qualifying clauses can mislead;
machine_clause_indicesensures executors always see every machine-enforced clause, while arbiters MAY demand additional prose clauses before ruling. - Notary truth limit: A notary act cryptographically binds the notary's accountability to a claim; it never proves physical truth mathematically.
7. References
- Normative: [RFC8785], [BIP-340], [BIP-141], [JSON-SCHEMA-2020-12].
- Informative: [RFC8448].