@real-life/trust-protocol 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/carrier-identity.d.ts +11 -0
- package/dist/carrier-identity.d.ts.map +1 -0
- package/dist/carrier-identity.js +85 -0
- package/dist/carrier-identity.js.map +1 -0
- package/dist/carrier.d.ts +157 -0
- package/dist/carrier.d.ts.map +1 -0
- package/dist/carrier.js +577 -0
- package/dist/carrier.js.map +1 -0
- package/dist/holder.d.ts +42 -0
- package/dist/holder.d.ts.map +1 -0
- package/dist/holder.js +92 -0
- package/dist/holder.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/probe.d.ts +1 -0
- package/dist/probe.d.ts.map +1 -1
- package/dist/probe.js +1 -1
- package/dist/probe.js.map +1 -1
- package/dist/wire.d.ts +573 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +2 -0
- package/dist/wire.js.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier.js","sourceRoot":"","sources":["../src/carrier.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,oCAAoC;AACpC,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,8DAA8D;AAC9D,EAAE;AACF,mEAAmE;AACnE,wEAAwE;AACxE,sEAAsE;AACtE,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,8CAA8C;AAC9C,EAAE;AACF,kEAAkE;AAClE,uEAAuE;AACvE,wEAAwE;AACxE,qEAAqE;AACrE,wEAAwE;AACxE,uCAAuC;AACvC,EAAE;AACF,wDAAwD;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,MAAM,EAA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C,CAAA,CAAC,CAAC;CACpE","sourcesContent":["// carrier — Delivery §4.4 + §5a: the carrier side of the port, as one\n// transport-agnostic state machine.\n//\n// What this module is: the executable form of the five guarantees, the\n// proof rule of §5a.3, the total binding lifecycle (unbound → live →\n// closing → released), the verdict sets with their normative evaluation\n// orders (s1–s6, r1–r5), the wind-up whose deadline IS the release, and\n// the binding tombstones with their normative eviction order.\n//\n// What it deliberately is NOT: a resource manager. A carrier's own\n// budgets are policy (the 0.65 scope re-cast) and enter through hooks —\n// and the CALL GRAPH enforces the guarantees: a request naming a held\n// binding never invokes the shared gate (guarantee 4), a below-floor\n// submission never reaches the cross-queue hooks (guarantee 5). What no\n// library can prevent is a policy wiring two hooks to one counter; such\n// a policy is a nonconformant carrier, and the port-review triage says\n// so out loud rather than claiming otherwise.\n//\n// Linearization (§4.4 atomicity): every public operation does its\n// asynchronous work (crypto) FIRST and then commits in one synchronous\n// block that re-reads state — the commit is the linearization point, no\n// await crosses it, and time-driven transitions are applied from the\n// operation's own `now` before it reads anything (so a late tick cannot\n// lend a released queue an afterlife).\n//\n// The clock is injected. Nothing here reads Date.now().\nimport { jcs } from './core.js'\nimport type { Json } from './core.js'\nimport { b64uOf, fromB64u, base58, fromBase58, sha } from './crypto.js'\nimport { validCarrierIdentifier } from './carrier-identity.js'\n\nconst S = globalThis.crypto.subtle\nconst te = new TextEncoder()\n\n// ── declared constants (guarantee 1: the declaration binds) ─────────────\nexport interface CarrierDeclaration {\n carrier: string // C, byte-exact (Identity §7a.2)\n orphanHorizonMs: number // [P7D, P365D]\n giveUpHorizonMs: number // [P1D, P90D]\n challengeLifetimeMs: number // [PT5S, PT5M]\n queueFloorBytes: number // [65536, maxQueueBytes]\n maxQueueBytes: number // [1048576, 1073741824]\n maxBindingTombstones: number // [1, 2^53−1]\n statusHorizonMs: number // [PT5S, PT5M]\n}\n\nconst DAY = 86_400_000\nconst DOMAINS: Array<[keyof CarrierDeclaration, number, number]> = [\n ['orphanHorizonMs', 7 * DAY, 365 * DAY],\n ['giveUpHorizonMs', 1 * DAY, 90 * DAY],\n ['challengeLifetimeMs', 5_000, 300_000],\n ['statusHorizonMs', 5_000, 300_000],\n ['maxQueueBytes', 1_048_576, 1_073_741_824],\n ['maxBindingTombstones', 1, Number.MAX_SAFE_INTEGER],\n]\n\n/** §11: an out-of-domain declaration REJECTS — it never half-applies. */\nexport function validateDeclaration (d: CarrierDeclaration): string[] {\n const errs: string[] = []\n if (!validCarrierIdentifier(d.carrier)) errs.push('carrier identifier violates Identity 7a.2')\n for (const [k, lo, hi] of DOMAINS) {\n const v = d[k] as number\n if (!Number.isSafeInteger(v) || v < lo || v > hi) errs.push(`${k} outside [${lo}, ${hi}]`)\n }\n if (!Number.isSafeInteger(d.queueFloorBytes) ||\n d.queueFloorBytes < 65_536 || d.queueFloorBytes > d.maxQueueBytes) {\n errs.push('queueFloorBytes outside [65536, maxQueueBytes]')\n }\n if (d.orphanHorizonMs < d.giveUpHorizonMs) errs.push('orphan-horizon < give-up-horizon')\n return errs\n}\n\n// the role key of the registry declaration — a role URI and never a\n// document type (round-44 B-1)\nexport const CARRIER_ROLE_URI = 'https://real-life.org/trust-tasks/delivery-carrier/0.1'\nexport const PROOF_V = 'rltp-carrier-proof/0.3'\n\n// ── policy hooks ────────────────────────────────────────────────────────\nexport interface CarrierPolicy {\n /** shared admission gate — the one unknown-address traffic competes\n * for. NEVER invoked for a request naming a held binding. */\n admitNew?: () => boolean\n /** per-binding gate for requests naming a HELD rkid (guarantee 4). */\n admitHeld?: (rkid: string) => boolean\n /** per-queue submission meter — the only resource hook reachable below\n * the floor (guarantee 5); DO-6 lives here. A duplicate charges it\n * like an admitted submission (§5a.5) and stores nothing. */\n meterQueue?: (rkid: string, bytes: number) => boolean\n /** global occupancy — s6, unreachable below the floor. */\n hasCapacity?: (bytes: number) => boolean\n /** room for one more binding — r4, never consulted for a held one. */\n hasBindingRoom?: () => boolean\n}\n\n// ── verdicts ────────────────────────────────────────────────────────────\nexport type RegistrationVerdict =\n | { verdict: 'registered' | 'registered(idempotent)' | 'rebound' }\n | { verdict: 'refused(malformed)' | 'refused(possession-failed)' }\n | { verdict: 'refused(stale-generation)', heldGeneration: number } // §5a.3: the disclosure\n | { verdict: 'registration-refused(capacity)' | 'refused(admission-resource)', retriable: true }\n\nexport type SessionVerdict =\n | { verdict: 'served' }\n | { verdict: 'refused(no-such-queue)' | 'refused(malformed)' | 'refused(possession-failed)' }\n | { verdict: 'refused(admission-resource)', retriable: true }\n\nexport type SubmissionVerdict =\n | { verdict: 'admitted' | 'duplicate' }\n | { verdict: 'refused(no-such-queue)' | 'refused(bounds)' }\n | { verdict: 'refused(admission-resource)' | 'refused(queue-saturated)' | 'refused(capacity)', retriable: true }\n\n// ── the proof object (§5a.3, wire 0.3) ──────────────────────────────────\nexport interface CarrierProof {\n v: string, type: string\n purpose: 'register' | 'rebind' | 'collect' | 'conclude'\n carrier: string, principal: string, rkid: string\n generation?: number\n principalChallenge: string\n addressChallenge?: string\n sig: string\n}\nconst REGISTRATION_FIELDS = new Set(['v', 'type', 'purpose', 'carrier', 'principal', 'rkid',\n 'generation', 'principalChallenge', 'addressChallenge', 'sig'])\nconst SESSION_FIELDS = new Set(['v', 'type', 'purpose', 'carrier', 'principal', 'rkid',\n 'principalChallenge', 'sig'])\n\n// canonical decimal spelling, checked on the RECEIVED bytes (§5a.3):\n// `1.0` and `1e0` parse and JCS-canonicalize to `1`, so the signature\n// verifies over them — only the lexical check catches the spelling.\nexport const canonicalGenerationSpelling = (raw: string): boolean =>\n /^[1-9][0-9]*$/.test(raw) && Number.isSafeInteger(Number(raw))\n\nconst canonicalB64u32 = (s: unknown): boolean => {\n if (typeof s !== 'string' || s.length !== 43) return false\n try { const b = fromB64u(s); return b.length === 32 && b64uOf(b) === s } catch { return false }\n}\n\n// decode-and-check: schema validity is not acceptance (§11)\nconst decodedEd = (did: unknown): Uint8Array | null => {\n if (typeof did !== 'string' || !did.startsWith('did:key:z')) return null\n const b = fromBase58(did.slice('did:key:z'.length))\n return b && b.length === 34 && b[0] === 0xed && b[1] === 0x01 ? b.subarray(2) : null\n}\nconst decodedX = (mk: unknown): Uint8Array | null => {\n if (typeof mk !== 'string' || mk[0] !== 'z') return null\n const b = fromBase58(mk.slice(1))\n return b && b.length === 34 && b[0] === 0xec && b[1] === 0x01 ? b.subarray(2) : null\n}\nconst cmpRkidBytes = (a: string, b: string): number => {\n const ka = decodedX(a); const kb = decodedX(b)\n if (!ka || !kb) return a < b ? -1 : 1\n for (let i = 0; i < 32; i++) if (ka[i] !== kb[i]) return ka[i]! - kb[i]!\n return 0\n}\nconst decodedSig = (zsig: unknown): Uint8Array | null => {\n if (typeof zsig !== 'string' || zsig[0] !== 'z') return null\n const b = fromBase58(zsig.slice(1))\n if (!b || b.length !== 64) return null\n return 'z' + base58(b) === zsig ? b : null\n}\n\n/** r1, the SYNTACTIC half only — no cryptography happens here, so a\n * request refused at r1 or r2 has cost the carrier no key operation\n * (guarantee 3). `rawGeneration` is REQUIRED for register/rebind: a\n * parsed number cannot carry its own spelling, and an adapter that\n * cannot supply the received bytes cannot claim the check (round-44\n * M-4 of the port review: optional was fail-open). */\nexport function checkProofShape (\n p: CarrierProof, expectedCarrier: string, rawGeneration?: string,\n): 'refused(malformed)' | null {\n if (typeof p !== 'object' || p === null) return 'refused(malformed)'\n if (p.v !== PROOF_V || p.type !== 'carrier-registration-proof') return 'refused(malformed)'\n if (!['register', 'rebind', 'collect', 'conclude'].includes(p.purpose)) return 'refused(malformed)'\n if (p.carrier !== expectedCarrier) return 'refused(malformed)'\n const sessionScoped = p.purpose === 'collect' || p.purpose === 'conclude'\n // the wire format is CLOSED: an extra field is not this artifact\n const allowed = sessionScoped ? SESSION_FIELDS : REGISTRATION_FIELDS\n for (const k of Object.keys(p)) if (!allowed.has(k)) return 'refused(malformed)'\n if (!decodedEd(p.principal) || !decodedX(p.rkid) || !decodedSig(p.sig)) return 'refused(malformed)'\n if (!canonicalB64u32(p.principalChallenge)) return 'refused(malformed)'\n if (sessionScoped) {\n if (p.generation !== undefined || p.addressChallenge !== undefined) return 'refused(malformed)'\n } else {\n if (!Number.isSafeInteger(p.generation) || (p.generation as number) < 1) return 'refused(malformed)'\n if (rawGeneration === undefined || !canonicalGenerationSpelling(rawGeneration) ||\n Number(rawGeneration) !== p.generation) return 'refused(malformed)'\n if (!canonicalB64u32(p.addressChallenge)) return 'refused(malformed)'\n }\n return null\n}\n\n/** the asymmetric half of r3 — called only past r1, r2 and the challenge\n * consumption, so one challenge buys at most one verification. */\nasync function verifySignature (p: CarrierProof): Promise<boolean> {\n const pub = decodedEd(p.principal)!; const sig = decodedSig(p.sig)!\n const { sig: _omit, ...signed } = p\n const key = await S.importKey('raw', pub as Uint8Array<ArrayBuffer>, { name: 'Ed25519' }, false, ['verify'])\n return S.verify({ name: 'Ed25519' }, key, sig as Uint8Array<ArrayBuffer>, te.encode(jcs(signed as unknown as Json)))\n}\n\n/** compatibility shim for the shape+signature question alone (tests,\n * tooling): stateless, no challenge semantics. */\nexport async function verifyProofShape (\n p: CarrierProof, expectedCarrier: string, rawGeneration?: string,\n): Promise<'refused(malformed)' | 'refused(possession-failed)' | null> {\n const sessionScoped = p?.purpose === 'collect' || p?.purpose === 'conclude'\n const raw = rawGeneration ?? (sessionScoped || p?.generation === undefined ? undefined : String(p.generation))\n const shape = checkProofShape(p, expectedCarrier, raw)\n if (shape) return shape\n return await verifySignature(p) ? null : 'refused(possession-failed)'\n}\n\n// ── envelope shape for submissions (§5, s2) ─────────────────────────────\n// A carrier is key-blind but not shape-blind: a submission is a Section-5\n// envelope whose rkid names the queue it is submitted to.\nconst canonicalB64uAny = (s: unknown): Uint8Array | null => {\n if (typeof s !== 'string' || s.length === 0) return null\n try { const b = fromB64u(s); return b64uOf(b) === s ? b : null } catch { return null }\n}\nexport function checkEnvelopeBytes (bytes: Uint8Array, rkid: string): boolean {\n let doc: unknown\n try { doc = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)) } catch { return false }\n if (typeof doc !== 'object' || doc === null) return false\n const e = doc as Record<string, unknown>\n if (Object.keys(e).length !== 4) return false\n if (e.rkid !== rkid) return false\n const epk = canonicalB64uAny(e.epk); const nonce = canonicalB64uAny(e.nonce)\n const ct = canonicalB64uAny(e.ciphertext)\n // > 16: exactly the GCM tag is an EMPTY plaintext, which §5 forbids\n return !!epk && epk.length === 32 && !!nonce && nonce.length === 12 && !!ct && ct.length > 16\n}\n\n// ── state ───────────────────────────────────────────────────────────────\ninterface Deposit { bytes: Uint8Array, digest: string, admittedAt: number, lifeEndsAt: number }\ninterface Binding {\n state: 'live' | 'closing'\n generation: number\n principal: string\n deposits: Deposit[]\n lastCollectionAt: number\n deadline?: number // = closing instant + give-up-horizon; it does not move\n}\ninterface Tombstone { generation: number, releaseSeq: number }\n\nexport interface CarrierEvents {\n onRelease?: (rkid: string, tombstoneGeneration: number) => void\n onGiveUp?: (rkid: string, digest: string) => void\n onEvict?: (rkid: string) => void // a local hook; the port reports eviction to no one\n}\n\ninterface Challenge { rkid: string, addressValue: string | null, expiresAt: number }\n\nexport class Carrier {\n #decl: CarrierDeclaration\n /** the declaration as published — a copy; mutating it changes nothing\n * (port-review-2 M-3: the validated state must not be reachable from\n * outside the validated paths). */\n get decl (): CarrierDeclaration { return { ...this.#decl } }\n private policy: CarrierPolicy\n private events: CarrierEvents\n private bindings = new Map<string, Binding>()\n private tombstones = new Map<string, Tombstone>()\n private releaseSeq = 0\n private challenges = new Map<string, Challenge>()\n // the carrier's clock high-water mark: async completions commit at the\n // NEWEST time the carrier has seen, never at their caller's stale now\n // (port-review-2 M-1) — normative time is monotone\n private clock = 0\n\n constructor (decl: CarrierDeclaration, policy: CarrierPolicy = {}, events: CarrierEvents = {}) {\n const errs = validateDeclaration(decl)\n if (errs.length) throw new Error(`declaration rejects (§11): ${errs.join('; ')}`)\n this.#decl = { ...decl }; this.policy = policy; this.events = events\n }\n\n // ── time (§5a.9): transitions fire at their NORMATIVE instants ───────\n // A late tick applies them retroactively — the closing instant is\n // lastCollection + orphan-horizon and the deadline is that + give-up,\n // never \"whenever tick happened to run\" (port-review B-5). Every\n // public operation advances time to its own `now` before reading, so\n // the port never serves from a state the clock has already ended.\n private advance (rawNow: number): void {\n // fail-closed time (port-review-4 M-3): NaN would poison the\n // high-water mark forever, Infinity would fire every deadline at once\n if (!Number.isFinite(rawNow) || rawNow < 0) throw new Error('now must be a finite non-negative instant')\n this.clock = Math.max(this.clock, rawNow)\n const now = this.clock\n for (const [rkid, b] of this.bindings) {\n if (b.state === 'live') {\n // give-up: a deposit's life ends at its own horizon (§5a.8 —\n // carrier-side storage release; the sender learns through its\n // adapter's ordinary path, never through a new verdict)\n for (const d of b.deposits.filter((d) => now >= d.lifeEndsAt)) this.events.onGiveUp?.(rkid, d.digest)\n b.deposits = b.deposits.filter((d) => now < d.lifeEndsAt)\n const closingAt = b.lastCollectionAt + this.#decl.orphanHorizonMs\n if (now >= closingAt) {\n b.state = 'closing'\n b.deadline = closingAt + this.#decl.giveUpHorizonMs\n for (const d of b.deposits) d.lifeEndsAt = Math.min(d.lifeEndsAt, b.deadline)\n }\n }\n }\n // releases due at this advance, ordered by their NORMATIVE instants\n // (port-review-4 B-2: visit order is Map order, and a late tick made\n // the younger release evict as if it were the older one)\n const due: Array<{ rkid: string, b: Binding }> = []\n for (const [rkid, b] of this.bindings) {\n if (b.state === 'closing' && now >= (b.deadline as number)) due.push({ rkid, b })\n }\n due.sort((x, y) => (x.b.deadline! - y.b.deadline!) || cmpRkidBytes(x.rkid, y.rkid))\n for (const { rkid, b } of due) {\n // the deadline IS the release — one transition (round-43 B-1)\n for (const d of b.deposits) this.events.onGiveUp?.(rkid, d.digest)\n this.bindings.delete(rkid)\n this.installTombstone(rkid, b.generation, b.deadline as number)\n this.events.onRelease?.(rkid, b.generation)\n }\n for (const [id, ch] of this.challenges) if (now >= ch.expiresAt) this.challenges.delete(id)\n this.pendingSeqInstant = null\n }\n tick (now: number): void { this.advance(now) }\n\n // ── challenges (§5a.3) ───────────────────────────────────────────────\n /** The gated challenge entry — guarantee 3 BY CONSTRUCTION\n * (port-review-3 M-3): the admission gate runs INSIDE, before any\n * entropy is drawn, so a refused request costs neither randomness nor\n * sealing. `draw` is invoked only past the gate; its `addressValue`\n * (for registration challenges) is the value the adapter will seal to\n * the rkid — the carrier remembers it and a proof must return exactly\n * it. Every challenge is BOUND to its rkid (port-review-3 B-1: a\n * null-rkid challenge disabled the address proof).\n * Returns null when the gate refuses — retriable, guarantee 2. */\n issueChallenge (\n now: number, rkid: string,\n draw: () => { entropy: Uint8Array, addressValue?: string },\n ): string | null {\n this.advance(now)\n // syntax BEFORE policy and draw (port-review-5 B-1): a syntactically\n // impossible address buys neither a gate consultation nor a single\n // random byte — §5a.3's order is syntax → admission → randomness\n if (!decodedX(rkid)) throw new Error('malformed rkid — refuse before any work (5a.3)')\n const held = this.bindings.has(rkid)\n const admitted = held ? (this.policy.admitHeld?.(rkid) ?? true) : (this.policy.admitNew?.() ?? true)\n if (!admitted) return null\n const { entropy, addressValue } = draw()\n if (entropy.length !== 32) throw new Error('challenge entropy is 32 bytes')\n const value = b64uOf(entropy)\n this.challenges.set(value, {\n rkid, addressValue: addressValue ?? null,\n expiresAt: this.clock + this.#decl.challengeLifetimeMs, // M-2: the monotone clock, never a stale now\n })\n return value\n }\n\n /** consume-first (§5a.3): the first attempt takes the challenge before\n * anything is verified; expiry and rkid binding are checked HERE, so a\n * stale or transplanted challenge dies without buying a verification. */\n private consume (value: string, rkid: string, now: number): Challenge | null {\n const ch = this.challenges.get(value)\n this.challenges.delete(value)\n if (!ch || Math.max(now, this.clock) >= ch.expiresAt) return null\n if (ch.rkid !== rkid) return null // bound, always (B-1)\n return ch\n }\n\n // ── registration / rebind: r1–r5 (§5a.3, rounds 43/44) ───────────────\n async register (proof: CarrierProof, opts: { now: number, rawGeneration: string }): Promise<RegistrationVerdict> {\n // SNAPSHOT at entry (port-review-4 B-1): the caller's object stays\n // the caller's — what was verified is what commits, whatever the\n // caller mutates while the crypto runs\n const p = { ...proof }\n this.advance(opts.now)\n // r1 — syntax and canonical encodings; no crypto has happened yet.\n // The PURPOSE binds the operation (port-review-2 B-2): a session\n // proof at register() is not this artifact, whatever it signs.\n if (p?.purpose !== 'register' && p?.purpose !== 'rebind') return { verdict: 'refused(malformed)' }\n if (checkProofShape(p, this.#decl.carrier, opts.rawGeneration)) return { verdict: 'refused(malformed)' }\n const heldAtGate = this.bindings.has(p.rkid)\n // r2 — the carrier's own admission metering, subject to guarantee 4:\n // a held binding's request has its own gate (round-44 B-2)\n const admitted = heldAtGate ? (this.policy.admitHeld?.(p.rkid) ?? true) : (this.policy.admitNew?.() ?? true)\n if (!admitted) return { verdict: 'refused(admission-resource)', retriable: true }\n // r3 — consume, then verify: the challenge is taken by this attempt\n // before the response is verified, checked for expiry and rkid\n // binding at the same instant (port-review B-1/B-2)\n const ch = this.consume(p.principalChallenge, p.rkid, opts.now)\n if (!ch) return { verdict: 'refused(possession-failed)' }\n // fail-closed (port-review-2 B-1): a challenge issued WITHOUT a\n // sealed address value cannot prove address possession — it refuses,\n // it never waves through\n if (ch.addressValue === null || p.addressChallenge !== ch.addressValue) {\n return { verdict: 'refused(possession-failed)' }\n }\n if (!await verifySignature(p)) return { verdict: 'refused(possession-failed)' }\n // ── the commit block: synchronous from here — the linearization\n // point of §4.4. State is RE-read; no await crosses this line.\n this.advance(opts.now)\n const held = this.bindings.get(p.rkid)\n // r2, re-established (port-review-3 B-3): the gate CLASS (held vs\n // new) may have changed while the crypto ran — a binding that\n // released mid-verify makes this a NEW-binding request, and it must\n // pass the gate a new binding passes, in this same sync block\n if ((held !== undefined) !== heldAtGate) {\n const readmit = held ? (this.policy.admitHeld?.(p.rkid) ?? true) : (this.policy.admitNew?.() ?? true)\n if (!readmit) return { verdict: 'refused(admission-resource)', retriable: true }\n }\n // r4 — capacity: only a transition that creates a binding consults it\n if (!held && !(this.policy.hasBindingRoom?.() ?? true)) {\n return { verdict: 'registration-refused(capacity)', retriable: true }\n }\n // r5 — the state table\n const g = p.generation as number\n const tomb = this.tombstones.get(p.rkid)\n if (held) {\n if (g > held.generation) {\n held.generation = g; held.principal = p.principal\n this.reopen(held, this.clock)\n return { verdict: 'rebound' }\n }\n if (g === held.generation && p.principal === held.principal) {\n this.reopen(held, this.clock)\n return { verdict: 'registered(idempotent)' }\n }\n return { verdict: 'refused(stale-generation)', heldGeneration: held.generation }\n }\n if (tomb) {\n if (g > tomb.generation) {\n this.tombstones.delete(p.rkid) // consumed\n this.bindings.set(p.rkid, this.freshBinding(g, p.principal, this.clock))\n return { verdict: 'registered' }\n }\n return { verdict: 'refused(stale-generation)', heldGeneration: tomb.generation }\n }\n this.bindings.set(p.rkid, this.freshBinding(g, p.principal, this.clock))\n return { verdict: 'registered' }\n }\n\n private freshBinding (generation: number, principal: string, now: number): Binding {\n return { state: 'live', generation, principal, deposits: [], lastCollectionAt: now }\n }\n private reopen (b: Binding, now: number): void {\n if (b.state === 'closing') {\n b.state = 'live'; b.deadline = undefined\n // the return ends the wind-up: deposits revert to their own\n // admission-dated horizons (§5a.9)\n for (const d of b.deposits) d.lifeEndsAt = d.admittedAt + this.#decl.giveUpHorizonMs\n }\n b.lastCollectionAt = now\n }\n\n // ── collection / conclusion (§5a.3/5a.7/5a.8) ────────────────────────\n // purpose is part of the signed bytes AND of the dispatch: a proof for\n // one operation is not a proof for the other (port-review B-3).\n async collect (proof: CarrierProof, opts: { now: number }): Promise<SessionVerdict & { deposits?: Array<{ bytes: Uint8Array, digest: string }> }> {\n const p = { ...proof }\n const s = await this.session(p, 'collect', opts.now)\n if (s) return s\n const b = this.bindings.get(p.rkid)\n if (!b || b.principal !== p.principal) return { verdict: 'refused(no-such-queue)' }\n b.lastCollectionAt = this.clock\n return { verdict: 'served', deposits: b.deposits.map((d) => ({ bytes: d.bytes.slice(), digest: d.digest })) }\n }\n\n async conclude (proof: CarrierProof, digest: string, opts: { now: number }): Promise<SessionVerdict> {\n const p = { ...proof }\n const s = await this.session(p, 'conclude', opts.now)\n if (s) return s\n const b = this.bindings.get(p.rkid)\n if (!b || b.principal !== p.principal) return { verdict: 'refused(no-such-queue)' }\n b.deposits = b.deposits.filter((d) => d.digest !== digest)\n // deliberately NOT lastCollectionAt: orphan-expiry counts collections\n // (§5a.9), and a principal must not keep a never-collected queue out\n // of its wind-up by concluding (port-review-2 M-2)\n return { verdict: 'served' }\n }\n\n private async session (proofArg: CarrierProof, expected: 'collect' | 'conclude', now: number): Promise<SessionVerdict | null> {\n const p = { ...proofArg }\n this.advance(now)\n if (p.purpose !== expected) return { verdict: 'refused(malformed)' }\n if (checkProofShape(p, this.#decl.carrier)) return { verdict: 'refused(malformed)' }\n const held = this.bindings.get(p.rkid)\n const admitted = held ? (this.policy.admitHeld?.(p.rkid) ?? true) : (this.policy.admitNew?.() ?? true)\n if (!admitted) return { verdict: 'refused(admission-resource)', retriable: true }\n const ch = this.consume(p.principalChallenge, p.rkid, now)\n if (!ch) return { verdict: 'refused(possession-failed)' }\n if (!await verifySignature(p)) return { verdict: 'refused(possession-failed)' }\n // commit side re-reads (the caller checks binding + principal after\n // this returns null, synchronously)\n this.advance(now)\n if (!this.bindings.has(p.rkid)) return { verdict: 'refused(no-such-queue)' }\n return null\n }\n\n // ── submission: s1–s6 (§5a.5) ────────────────────────────────────────\n async submit (rkid: string, callerBytes: Uint8Array, opts: { now: number }): Promise<SubmissionVerdict> {\n // SNAPSHOT at entry (port-review-4 M-1/M-2): the bytes are copied\n // before anything reads them, and the declaration is pinned for the\n // whole operation — a concurrent revision governs the NEXT\n // submission, never one already running\n const bytes = callerBytes.slice()\n const decl = this.#decl\n this.advance(opts.now)\n // s1 — queue lookup FIRST: no hashing for an address the carrier\n // does not hold (port-review-2 M-4 — s3 work ran before s1/s2 and\n // let an unauthenticated blob buy a full SHA pass)\n if (!this.bindings.has(rkid)) return { verdict: 'refused(no-such-queue)' }\n // s2 — shape and size: a Section-5 envelope naming this queue,\n // within declared bounds\n if (bytes.length > decl.maxQueueBytes || !checkEnvelopeBytes(bytes, rkid)) {\n return { verdict: 'refused(bounds)' }\n }\n // s3 needs the digest — hash now, then RE-read state (the await may\n // have crossed a deadline; the commit block below is synchronous)\n const digest = b64uOf(await sha(bytes))\n this.advance(opts.now)\n const b = this.bindings.get(rkid)\n if (!b) return { verdict: 'refused(no-such-queue)' }\n // s3 — byte-identity. The digest indexes; the BYTES decide (M-6).\n const same = b.deposits.find((d) => d.digest === digest &&\n d.bytes.length === bytes.length && d.bytes.every((x, i) => x === bytes[i]))\n if (same) {\n // §5a.5: a duplicate consumes admission work exactly like an\n // admitted submission — and stores nothing\n this.policy.meterQueue?.(rkid, bytes.length)\n return { verdict: 'duplicate' }\n }\n const occupancy = b.deposits.reduce((a, d) => a + d.bytes.length, 0) + bytes.length\n const withinFloor = occupancy <= decl.queueFloorBytes\n // s4 — the queue's own meter (below the floor: the only one, g5)\n if (!(this.policy.meterQueue?.(rkid, bytes.length) ?? true)) {\n return { verdict: 'refused(admission-resource)', retriable: true }\n }\n if (!withinFloor) {\n // s5 — the queue's own bound\n if (occupancy > decl.maxQueueBytes) return { verdict: 'refused(queue-saturated)', retriable: true }\n // s6 — global occupancy, unreachable below the floor\n if (!(this.policy.hasCapacity?.(bytes.length) ?? true)) {\n return { verdict: 'refused(capacity)', retriable: true }\n }\n }\n const lifeEndsAt = b.state === 'closing' && b.deadline !== undefined\n ? b.deadline // inherits the remaining time\n : this.clock + decl.giveUpHorizonMs\n b.deposits.push({ bytes, digest, admittedAt: this.clock, lifeEndsAt })\n return { verdict: 'admitted' }\n }\n\n // ── tombstones (§5a.3): normative order, bookkeeping-free ────────────\n // Releases that fall on the SAME normative instant share one release\n // rank, so the bytewise tie-break genuinely decides between them\n // (port-review M-7) — the advance() loop batches them per call.\n private pendingSeqInstant: { instant: number, seq: number } | null = null\n private installTombstone (rkid: string, generation: number, releasedAt: number): void {\n if (this.pendingSeqInstant?.instant !== releasedAt) {\n this.pendingSeqInstant = { instant: releasedAt, seq: ++this.releaseSeq }\n }\n this.tombstones.set(rkid, { generation, releaseSeq: this.pendingSeqInstant.seq })\n this.trimTombstones(this.#decl.maxBindingTombstones)\n }\n private trimTombstones (bound: number): void {\n while (this.tombstones.size > bound) {\n const victim = [...this.tombstones.entries()].sort((a, b) =>\n (a[1].releaseSeq - b[1].releaseSeq) || cmpRkidBytes(a[0], b[0]))[0][0]\n this.tombstones.delete(victim)\n this.events.onEvict?.(victim)\n }\n }\n /** guarantee 1: the declaration binds, and a revision is itself\n * validated; a lowered tombstone bound trims in the same step\n * (round-45 B-3 — standing state is not a running act). */\n reviseDeclaration (next: Partial<CarrierDeclaration>): void {\n // C is the carrier's IDENTITY, not an operational constant: every\n // principal is derived from it (Identity §7a.4), so \"the same\n // carrier under a new C\" is a contradiction — a new C is a new\n // carrier with no bindings (port-review-3 B-2)\n if (next.carrier !== undefined && next.carrier !== this.#decl.carrier) {\n throw new Error('the carrier identifier is not revisable — a different C is a different carrier (7a.4)')\n }\n const revised = { ...this.#decl, ...next }\n const errs = validateDeclaration(revised)\n if (errs.length) throw new Error(`revision rejects (§11): ${errs.join('; ')}`)\n this.#decl = revised\n this.trimTombstones(revised.maxBindingTombstones)\n }\n\n // ── introspection (tests and adapters; not port surface) ─────────────\n stateOf (rkid: string): 'unbound' | 'live' | 'closing' | 'released' {\n const b = this.bindings.get(rkid)\n if (b) return b.state\n return this.tombstones.has(rkid) ? 'released' : 'unbound'\n }\n tombstoneOf (rkid: string): number | null { return this.tombstones.get(rkid)?.generation ?? null }\n bindingOf (rkid: string): { generation: number, principal: string, deposits: number, deadline?: number } | null {\n const b = this.bindings.get(rkid)\n return b ? { generation: b.generation, principal: b.principal, deposits: b.deposits.length, deadline: b.deadline } : null\n }\n tombstoneLabels (): string[] { return [...this.tombstones.keys()] }\n}\n"]}
|
package/dist/holder.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CarrierPrincipal } from './carrier-identity.js';
|
|
2
|
+
import type { CarrierProof, RegistrationVerdict } from './carrier.js';
|
|
3
|
+
export interface HolderContext {
|
|
4
|
+
carrier: string;
|
|
5
|
+
identity: CarrierPrincipal;
|
|
6
|
+
rkid: string;
|
|
7
|
+
generation: number;
|
|
8
|
+
}
|
|
9
|
+
/** derive-and-wrap: one holder context per (relationship × carrier) */
|
|
10
|
+
export declare function holderContext(rootIkm: Uint8Array, carrier: string, nonce: Uint8Array, rkid: string, generation: number): Promise<HolderContext>;
|
|
11
|
+
/** register/rebind proof: both succession fields present (§5a.3).
|
|
12
|
+
* `openedAddressChallenge` is the value the holder decrypted from the
|
|
13
|
+
* carrier's sealed challenge — possession of the rkid's private key. */
|
|
14
|
+
export declare function registrationProof(ctx: HolderContext, purpose: 'register' | 'rebind', principalChallenge: string, openedAddressChallenge: string, generation?: number): Promise<CarrierProof>;
|
|
15
|
+
/** collect/conclude proof: session-scoped, neither succession field —
|
|
16
|
+
* their ABSENCE is part of the signed bytes (§5a.3). */
|
|
17
|
+
export declare function sessionProof(ctx: HolderContext, purpose: 'collect' | 'conclude', principalChallenge: string): Promise<CarrierProof>;
|
|
18
|
+
export declare const GENERATION_MAX: number;
|
|
19
|
+
export interface RecoveryStep {
|
|
20
|
+
attempt: number;
|
|
21
|
+
generation: number;
|
|
22
|
+
verdict: RegistrationVerdict['verdict'];
|
|
23
|
+
}
|
|
24
|
+
export interface RecoveryResult {
|
|
25
|
+
outcome: 'bound' | 'waiting' | 'failed' | 'terminal';
|
|
26
|
+
finalGeneration?: number;
|
|
27
|
+
steps: RecoveryStep[];
|
|
28
|
+
}
|
|
29
|
+
/** One recovery run. `rotateTo(g)` performs the LOCAL register rotations
|
|
30
|
+
* up to generation g — fresh nonce, re-derived principal — and returns
|
|
31
|
+
* the holder context of the new canonical entry (Identity §7a.3).
|
|
32
|
+
* `exchange` is the transport; `challenges` draws a fresh pair per
|
|
33
|
+
* attempt. `maxCapacityRetries` bounds only this run: the protocol
|
|
34
|
+
* promises order, never time (round-46 B-2). At the generation maximum
|
|
35
|
+
* no rotation exists and the address is not re-registrable at this
|
|
36
|
+
* carrier (Identity §7a.3) — the outcome is `terminal`, and the lever is
|
|
37
|
+
* §7a.2's move to a different configured carrier string. */
|
|
38
|
+
export declare function recoverCarrierEntry(initial: HolderContext, rotateTo: (generation: number) => Promise<HolderContext>, exchange: (proof: CarrierProof, rawGeneration: string) => Promise<RegistrationVerdict>, challenges: () => Promise<{
|
|
39
|
+
principalChallenge: string;
|
|
40
|
+
openedAddressChallenge: string;
|
|
41
|
+
}>, maxCapacityRetries?: number): Promise<RecoveryResult>;
|
|
42
|
+
//# sourceMappingURL=holder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holder.d.ts","sourceRoot":"","sources":["../src/holder.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAKrE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,uEAAuE;AACvE,wBAAsB,aAAa,CACjC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GACxF,OAAO,CAAC,aAAa,CAAC,CAExB;AAYD;;wEAEwE;AACxE,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,QAAQ,EAClD,kBAAkB,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,UAAU,SAAiB,GACtF,OAAO,CAAC,YAAY,CAAC,CAEvB;AAED;wDACwD;AACxD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,GAAG,UAAU,EAAE,kBAAkB,EAAE,MAAM,GAC9E,OAAO,CAAC,YAAY,CAAC,CAEvB;AAWD,eAAO,MAAM,cAAc,QAA0B,CAAA;AAErD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;CACxC;AACD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAA;IACpD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,YAAY,EAAE,CAAA;CACtB;AAED;;;;;;;;4DAQ4D;AAC5D,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,EACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,EACtF,UAAU,EAAE,MAAM,OAAO,CAAC;IAAE,kBAAkB,EAAE,MAAM,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAA;CAAE,CAAC,EACzF,kBAAkB,SAAI,GACrB,OAAO,CAAC,cAAc,CAAC,CA6BzB"}
|
package/dist/holder.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// holder — the holder's side of the carrier port (Delivery §5a, the
|
|
2
|
+
// client half): proof construction for all four purposes, the recovery
|
|
3
|
+
// flow of Identity §9.3, and verdict handling.
|
|
4
|
+
//
|
|
5
|
+
// The holder never guesses what the carrier holds. It derives its
|
|
6
|
+
// principal (carrier-identity), asks for challenges, signs proofs whose
|
|
7
|
+
// bytes are fixed by §5a.3, and reads exactly the closed verdict set —
|
|
8
|
+
// including the one disclosure the protocol makes: a
|
|
9
|
+
// `refused(stale-generation)` carries the generation to exceed, which is
|
|
10
|
+
// what makes "carrier entry lost, pair context held" replaceable in two
|
|
11
|
+
// exchanges instead of never.
|
|
12
|
+
import { jcs } from './core.js';
|
|
13
|
+
import { base58 } from './crypto.js';
|
|
14
|
+
import { carrierPrincipal } from './carrier-identity.js';
|
|
15
|
+
import { PROOF_V } from './carrier.js';
|
|
16
|
+
const S = globalThis.crypto.subtle;
|
|
17
|
+
const te = new TextEncoder();
|
|
18
|
+
/** derive-and-wrap: one holder context per (relationship × carrier) */
|
|
19
|
+
export async function holderContext(rootIkm, carrier, nonce, rkid, generation) {
|
|
20
|
+
return { carrier, identity: await carrierPrincipal(rootIkm, carrier, nonce), rkid, generation };
|
|
21
|
+
}
|
|
22
|
+
async function sign(ctx, fields) {
|
|
23
|
+
const p = {
|
|
24
|
+
v: PROOF_V, type: 'carrier-registration-proof',
|
|
25
|
+
carrier: ctx.carrier, principal: ctx.identity.principal, rkid: ctx.rkid,
|
|
26
|
+
...fields,
|
|
27
|
+
};
|
|
28
|
+
const sig = new Uint8Array(await S.sign({ name: 'Ed25519' }, ctx.identity.key.priv, te.encode(jcs(p))));
|
|
29
|
+
return { ...p, sig: 'z' + base58(sig) };
|
|
30
|
+
}
|
|
31
|
+
/** register/rebind proof: both succession fields present (§5a.3).
|
|
32
|
+
* `openedAddressChallenge` is the value the holder decrypted from the
|
|
33
|
+
* carrier's sealed challenge — possession of the rkid's private key. */
|
|
34
|
+
export function registrationProof(ctx, purpose, principalChallenge, openedAddressChallenge, generation = ctx.generation) {
|
|
35
|
+
return sign(ctx, { purpose, generation, principalChallenge, addressChallenge: openedAddressChallenge });
|
|
36
|
+
}
|
|
37
|
+
/** collect/conclude proof: session-scoped, neither succession field —
|
|
38
|
+
* their ABSENCE is part of the signed bytes (§5a.3). */
|
|
39
|
+
export function sessionProof(ctx, purpose, principalChallenge) {
|
|
40
|
+
return sign(ctx, { purpose, principalChallenge });
|
|
41
|
+
}
|
|
42
|
+
// ── the recovery flow (Identity §9.3, executable) ───────────────────────
|
|
43
|
+
// After losing the carrier entry alone (pair context held), the holder
|
|
44
|
+
// knows neither the old principal nor the generation to exceed. The flow
|
|
45
|
+
// is: attempt at generation 1; on the disclosing refusal, ROTATE THE
|
|
46
|
+
// REGISTER to disclosed + 1 — Identity §7a.3: each rotation is a fresh
|
|
47
|
+
// nonce N at generation g+1, and the principal is DERIVED from the new
|
|
48
|
+
// nonce; a proof that named a higher generation over an old nonce would
|
|
49
|
+
// claim a register state that does not exist (port-review B-6). Only the
|
|
50
|
+
// number of carrier exchanges stays two; the rotations are local.
|
|
51
|
+
export const GENERATION_MAX = Number.MAX_SAFE_INTEGER; // 2^53 − 1 (Identity §7a.3)
|
|
52
|
+
/** One recovery run. `rotateTo(g)` performs the LOCAL register rotations
|
|
53
|
+
* up to generation g — fresh nonce, re-derived principal — and returns
|
|
54
|
+
* the holder context of the new canonical entry (Identity §7a.3).
|
|
55
|
+
* `exchange` is the transport; `challenges` draws a fresh pair per
|
|
56
|
+
* attempt. `maxCapacityRetries` bounds only this run: the protocol
|
|
57
|
+
* promises order, never time (round-46 B-2). At the generation maximum
|
|
58
|
+
* no rotation exists and the address is not re-registrable at this
|
|
59
|
+
* carrier (Identity §7a.3) — the outcome is `terminal`, and the lever is
|
|
60
|
+
* §7a.2's move to a different configured carrier string. */
|
|
61
|
+
export async function recoverCarrierEntry(initial, rotateTo, exchange, challenges, maxCapacityRetries = 3) {
|
|
62
|
+
const steps = [];
|
|
63
|
+
let ctx = initial;
|
|
64
|
+
let purpose = 'register';
|
|
65
|
+
for (let attempt = 1; attempt <= 2 + maxCapacityRetries; attempt++) {
|
|
66
|
+
const ch = await challenges();
|
|
67
|
+
const proof = await registrationProof(ctx, purpose, ch.principalChallenge, ch.openedAddressChallenge);
|
|
68
|
+
const v = await exchange(proof, String(ctx.generation));
|
|
69
|
+
steps.push({ attempt, generation: ctx.generation, verdict: v.verdict });
|
|
70
|
+
switch (v.verdict) {
|
|
71
|
+
case 'registered':
|
|
72
|
+
case 'rebound':
|
|
73
|
+
case 'registered(idempotent)':
|
|
74
|
+
return { outcome: 'bound', finalGeneration: ctx.generation, steps };
|
|
75
|
+
case 'refused(stale-generation)': {
|
|
76
|
+
const held = v.heldGeneration;
|
|
77
|
+
if (held >= GENERATION_MAX)
|
|
78
|
+
return { outcome: 'terminal', steps };
|
|
79
|
+
ctx = await rotateTo(held + 1); // real rotations, fresh nonce
|
|
80
|
+
purpose = 'rebind';
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case 'registration-refused(capacity)':
|
|
84
|
+
case 'refused(admission-resource)':
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
return { outcome: 'failed', steps };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return { outcome: 'waiting', steps };
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=holder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holder.js","sourceRoot":"","sources":["../src/holder.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,uEAAuE;AACvE,+CAA+C;AAC/C,EAAE;AACF,kEAAkE;AAClE,wEAAwE;AACxE,uEAAuE;AACvE,qDAAqD;AACrD,yEAAyE;AACzE,wEAAwE;AACxE,8BAA8B;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAA;AAClC,MAAM,EAAE,GAAG,IAAI,WAAW,EAAE,CAAA;AAS5B,uEAAuE;AACvE,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAmB,EAAE,OAAe,EAAE,KAAiB,EAAE,IAAY,EAAE,UAAkB;IAEzF,OAAO,EAAE,OAAO,EAAE,QA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IAAI,IAAI,cAAc;oBAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;gBACjE,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA,CAAkB,8BAA8B;gBAC9E,OAAO,GAAG,QAAQ,CAAA;gBAClB,MAAK;YACP,CAAC;YACD,KAAK,gCAAgC,CAAC;YACtC,KAAK,6BAA6B;gBAChC,MAAK;YACP;gBACE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;QACvC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;AACtC,CAAC","sourcesContent":["// holder — the holder's side of the carrier port (Delivery §5a, the\n// client half): proof construction for all four purposes, the recovery\n// flow of Identity §9.3, and verdict handling.\n//\n// The holder never guesses what the carrier holds. It derives its\n// principal (carrier-identity), asks for challenges, signs proofs whose\n// bytes are fixed by §5a.3, and reads exactly the closed verdict set —\n// including the one disclosure the protocol makes: a\n// `refused(stale-generation)` carries the generation to exceed, which is\n// what makes \"carrier entry lost, pair context held\" replaceable in two\n// exchanges instead of never.\nimport { jcs } from './core.js'\nimport type { Json } from './core.js'\nimport { base58 } from './crypto.js'\nimport { carrierPrincipal } from './carrier-identity.js'\nimport type { CarrierPrincipal } from './carrier-identity.js'\nimport { PROOF_V } from './carrier.js'\nimport type { CarrierProof, RegistrationVerdict } from './carrier.js'\n\nconst S = globalThis.crypto.subtle\nconst te = new TextEncoder()\n\nexport interface HolderContext {\n carrier: string // C, byte-exact\n identity: CarrierPrincipal // from carrierPrincipal(rootIkm, C, N)\n rkid: string // the relationship address at this carrier\n generation: number // the register's generation for N (§7a.3)\n}\n\n/** derive-and-wrap: one holder context per (relationship × carrier) */\nexport async function holderContext (\n rootIkm: Uint8Array, carrier: string, nonce: Uint8Array, rkid: string, generation: number,\n): Promise<HolderContext> {\n return { carrier, identity: await carrierPrincipal(rootIkm, carrier, nonce), rkid, generation }\n}\n\nasync function sign (ctx: HolderContext, fields: Record<string, Json>): Promise<CarrierProof> {\n const p = {\n v: PROOF_V, type: 'carrier-registration-proof',\n carrier: ctx.carrier, principal: ctx.identity.principal, rkid: ctx.rkid,\n ...fields,\n }\n const sig = new Uint8Array(await S.sign({ name: 'Ed25519' }, ctx.identity.key.priv, te.encode(jcs(p as unknown as Json))))\n return { ...(p as unknown as CarrierProof), sig: 'z' + base58(sig) }\n}\n\n/** register/rebind proof: both succession fields present (§5a.3).\n * `openedAddressChallenge` is the value the holder decrypted from the\n * carrier's sealed challenge — possession of the rkid's private key. */\nexport function registrationProof (\n ctx: HolderContext, purpose: 'register' | 'rebind',\n principalChallenge: string, openedAddressChallenge: string, generation = ctx.generation,\n): Promise<CarrierProof> {\n return sign(ctx, { purpose, generation, principalChallenge, addressChallenge: openedAddressChallenge })\n}\n\n/** collect/conclude proof: session-scoped, neither succession field —\n * their ABSENCE is part of the signed bytes (§5a.3). */\nexport function sessionProof (\n ctx: HolderContext, purpose: 'collect' | 'conclude', principalChallenge: string,\n): Promise<CarrierProof> {\n return sign(ctx, { purpose, principalChallenge })\n}\n\n// ── the recovery flow (Identity §9.3, executable) ───────────────────────\n// After losing the carrier entry alone (pair context held), the holder\n// knows neither the old principal nor the generation to exceed. The flow\n// is: attempt at generation 1; on the disclosing refusal, ROTATE THE\n// REGISTER to disclosed + 1 — Identity §7a.3: each rotation is a fresh\n// nonce N at generation g+1, and the principal is DERIVED from the new\n// nonce; a proof that named a higher generation over an old nonce would\n// claim a register state that does not exist (port-review B-6). Only the\n// number of carrier exchanges stays two; the rotations are local.\nexport const GENERATION_MAX = Number.MAX_SAFE_INTEGER // 2^53 − 1 (Identity §7a.3)\n\nexport interface RecoveryStep {\n attempt: number\n generation: number\n verdict: RegistrationVerdict['verdict']\n}\nexport interface RecoveryResult {\n outcome: 'bound' | 'waiting' | 'failed' | 'terminal'\n finalGeneration?: number\n steps: RecoveryStep[]\n}\n\n/** One recovery run. `rotateTo(g)` performs the LOCAL register rotations\n * up to generation g — fresh nonce, re-derived principal — and returns\n * the holder context of the new canonical entry (Identity §7a.3).\n * `exchange` is the transport; `challenges` draws a fresh pair per\n * attempt. `maxCapacityRetries` bounds only this run: the protocol\n * promises order, never time (round-46 B-2). At the generation maximum\n * no rotation exists and the address is not re-registrable at this\n * carrier (Identity §7a.3) — the outcome is `terminal`, and the lever is\n * §7a.2's move to a different configured carrier string. */\nexport async function recoverCarrierEntry (\n initial: HolderContext,\n rotateTo: (generation: number) => Promise<HolderContext>,\n exchange: (proof: CarrierProof, rawGeneration: string) => Promise<RegistrationVerdict>,\n challenges: () => Promise<{ principalChallenge: string, openedAddressChallenge: string }>,\n maxCapacityRetries = 3,\n): Promise<RecoveryResult> {\n const steps: RecoveryStep[] = []\n let ctx = initial\n let purpose: 'register' | 'rebind' = 'register'\n for (let attempt = 1; attempt <= 2 + maxCapacityRetries; attempt++) {\n const ch = await challenges()\n const proof = await registrationProof(ctx, purpose, ch.principalChallenge, ch.openedAddressChallenge)\n const v = await exchange(proof, String(ctx.generation))\n steps.push({ attempt, generation: ctx.generation, verdict: v.verdict })\n switch (v.verdict) {\n case 'registered':\n case 'rebound':\n case 'registered(idempotent)':\n return { outcome: 'bound', finalGeneration: ctx.generation, steps }\n case 'refused(stale-generation)': {\n const held = (v as { heldGeneration: number }).heldGeneration\n if (held >= GENERATION_MAX) return { outcome: 'terminal', steps }\n ctx = await rotateTo(held + 1) // real rotations, fresh nonce\n purpose = 'rebind'\n break\n }\n case 'registration-refused(capacity)':\n case 'refused(admission-resource)':\n break\n default:\n return { outcome: 'failed', steps }\n }\n }\n return { outcome: 'waiting', steps }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,7 @@ export * from './crypto.js';
|
|
|
3
3
|
export * from './identity.js';
|
|
4
4
|
export * from './encounter.js';
|
|
5
5
|
export * from './delivery.js';
|
|
6
|
+
export * from './carrier-identity.js';
|
|
7
|
+
export * from './carrier.js';
|
|
8
|
+
export * from './holder.js';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA2BA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,19 +6,22 @@
|
|
|
6
6
|
// label registry, the encounter wire builders, the sealed envelope and
|
|
7
7
|
// the generic receive chain.
|
|
8
8
|
//
|
|
9
|
-
// What it is NOT (yet): the layers' state machines. Identity's
|
|
10
|
-
//
|
|
9
|
+
// What it is NOT (yet): the layers' full state machines. Identity's
|
|
10
|
+
// recovery derivation, Encounter's ceremony record and acceptance
|
|
11
11
|
// machinery, Delivery's type-specific stages and residual bookkeeping
|
|
12
12
|
// live in the specification and its conformance fixtures, not here. A
|
|
13
13
|
// conformant implementation builds ON this module; importing it is not
|
|
14
14
|
// yet conformance. The README states per module which casting's wire
|
|
15
15
|
// forms it implements.
|
|
16
16
|
//
|
|
17
|
-
// core
|
|
18
|
-
// crypto
|
|
19
|
-
// identity
|
|
20
|
-
// encounter
|
|
21
|
-
// delivery
|
|
17
|
+
// core the form every artifact obeys
|
|
18
|
+
// crypto the primitives, and the Data Integrity proof
|
|
19
|
+
// identity context derivation under the closed registry (§6.1/§6.2)
|
|
20
|
+
// encounter the ceremony's wire forms: challenges, cards, credentials
|
|
21
|
+
// delivery the sealed envelope and the generic receive stages 1–4
|
|
22
|
+
// carrier-identity the carrier-relationship principal (Identity §7a)
|
|
23
|
+
// carrier the carrier side of the port (Delivery §4.4 + §5a)
|
|
24
|
+
// holder the holder side: proofs, verdicts, recovery (§5a, §9.3)
|
|
22
25
|
//
|
|
23
26
|
// Specification, schemas and vectors: https://rltp.real-life.org
|
|
24
27
|
export * from './core.js';
|
|
@@ -26,4 +29,7 @@ export * from './crypto.js';
|
|
|
26
29
|
export * from './identity.js';
|
|
27
30
|
export * from './encounter.js';
|
|
28
31
|
export * from './delivery.js';
|
|
32
|
+
export * from './carrier-identity.js';
|
|
33
|
+
export * from './carrier.js';
|
|
34
|
+
export * from './holder.js';
|
|
29
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,uEAAuE;AACvE,mEAAmE;AACnE,uEAAuE;AACvE,uEAAuE;AACvE,6BAA6B;AAC7B,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,uEAAuE;AACvE,mEAAmE;AACnE,uEAAuE;AACvE,uEAAuE;AACvE,6BAA6B;AAC7B,EAAE;AACF,oEAAoE;AACpE,kEAAkE;AAClE,sEAAsE;AACtE,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,uBAAuB;AACvB,EAAE;AACF,oDAAoD;AACpD,mEAAmE;AACnE,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,wEAAwE;AACxE,yEAAyE;AACzE,8EAA8E;AAC9E,EAAE;AACF,iEAAiE;AAEjE,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA","sourcesContent":["// @real-life/trust-protocol — the cryptographic core of RLTP.\n//\n// What this entry point IS: the wire-level primitives of the converged\n// layers, reproducing the shipped test vectors byte for byte — the\n// canonical form, the derivation of identity contexts under the closed\n// label registry, the encounter wire builders, the sealed envelope and\n// the generic receive chain.\n//\n// What it is NOT (yet): the layers' full state machines. Identity's\n// recovery derivation, Encounter's ceremony record and acceptance\n// machinery, Delivery's type-specific stages and residual bookkeeping\n// live in the specification and its conformance fixtures, not here. A\n// conformant implementation builds ON this module; importing it is not\n// yet conformance. The README states per module which casting's wire\n// forms it implements.\n//\n// core the form every artifact obeys\n// crypto the primitives, and the Data Integrity proof\n// identity context derivation under the closed registry (§6.1/§6.2)\n// encounter the ceremony's wire forms: challenges, cards, credentials\n// delivery the sealed envelope and the generic receive stages 1–4\n// carrier-identity the carrier-relationship principal (Identity §7a)\n// carrier the carrier side of the port (Delivery §4.4 + §5a)\n// holder the holder side: proofs, verdicts, recovery (§5a, §9.3)\n//\n// Specification, schemas and vectors: https://rltp.real-life.org\n\nexport * from './core.js'\nexport * from './crypto.js'\nexport * from './identity.js'\nexport * from './encounter.js'\nexport * from './delivery.js'\nexport * from './carrier-identity.js'\nexport * from './carrier.js'\nexport * from './holder.js'\n"]}
|
package/dist/probe.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { Person } from './probe/deps.js';
|
|
2
2
|
export { SCHEMAS } from './schemas.js';
|
|
3
3
|
export { COMMUNITY_GENESIS } from './probe/deps.js';
|
|
4
|
+
export type * as wire from './wire.js';
|
|
4
5
|
export * as introduce from './probe/introduce.js';
|
|
5
6
|
export * as trust from './probe/trust.js';
|
|
6
7
|
export * as continuity from './probe/continuity.js';
|
package/dist/probe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../src/probe.ts"],"names":[],"mappings":"AA+BA,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAK7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../src/probe.ts"],"names":[],"mappings":"AA+BA,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAK7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAKnD,YAAY,KAAK,IAAI,MAAM,WAAW,CAAA;AACtC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA"}
|
package/dist/probe.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
// and this file loses a line. That is the intended direction of travel.
|
|
31
31
|
// the LIVE schema bundle (deep-frozen): it tracks the running castings
|
|
32
32
|
// and therefore belongs to the probe surface, not the pinned root —
|
|
33
|
-
// the root
|
|
33
|
+
// the root pins each module to a named casting (see README, Versions),
|
|
34
34
|
// this bundle moves with the repository (review 4, M-1)
|
|
35
35
|
export { SCHEMAS } from './schemas.js';
|
|
36
36
|
export { COMMUNITY_GENESIS } from './probe/deps.js';
|
package/dist/probe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../src/probe.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,EAAE;AACF,iEAAiE;AACjE,uEAAuE;AACvE,EAAE;AACF,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,kEAAkE;AAClE,qEAAqE;AACrE,qEAAqE;AACrE,kEAAkE;AAClE,oEAAoE;AACpE,+DAA+D;AAC/D,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,qDAAqD;AACrD,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AAGxE,uEAAuE;AACvE,oEAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../src/probe.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,EAAE;AACF,iEAAiE;AACjE,uEAAuE;AACvE,EAAE;AACF,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,kEAAkE;AAClE,qEAAqE;AACrE,qEAAqE;AACrE,kEAAkE;AAClE,oEAAoE;AACpE,+DAA+D;AAC/D,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,qDAAqD;AACrD,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AAGxE,uEAAuE;AACvE,oEAAoE;AACpE,uEAAuE;AACvE,wDAAwD;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAMnD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA","sourcesContent":["// @real-life/trust-protocol/probe — the layers still being cast.\n//\n// ┌──────────────────────────────────────────────────────────────────┐\n// │ NOT WIRE-NORMATIVE. These forms are probes: they exercise the │\n// │ converged semantics of their layer, but their transport shapes │\n// │ carry @probe and WILL change. Experiment with them; do not │\n// │ ship them as if they were the standard, and do not treat their │\n// │ wire forms as an interoperability target. │\n// └──────────────────────────────────────────────────────────────────┘\n//\n// The separation is structural on purpose: a subpath import is a\n// decision someone has to make, not a name they can reach by accident.\n//\n// The modules map onto two specifications:\n//\n// Network Visibility introduce (mediated introductions over a\n// rendezvous drop) · trust (the explicit trust\n// act: anchor-mapping@2, the blinded star,\n// pause) · continuity (§6a: probe + mapping —\n// re-recognizing a relationship after a fresh\n// enactment, chains instead of duplicates)\n// Membership + Access membership (founding, prelude, VIC invite,\n// consent, admission, welcome, vouch@2)\n//\n// Everything operates on the probe WORLD: a Person (deps.js) holding\n// contexts, contacts, groups — DOM-free and storage-free, so the same\n// code drives tests, simulators and future adapters.\n//\n// When a layer converges, its module graduates to the main entry point\n// and this file loses a line. That is the intended direction of travel.\n\nexport type { Person } from './probe/deps.js'\n// the LIVE schema bundle (deep-frozen): it tracks the running castings\n// and therefore belongs to the probe surface, not the pinned root —\n// the root pins each module to a named casting (see README, Versions),\n// this bundle moves with the repository (review 4, M-1)\nexport { SCHEMAS } from './schemas.js'\nexport { COMMUNITY_GENESIS } from './probe/deps.js'\n// the wire-artifact types GENERATED from the same schemas (wire.ts):\n// structural projections only — satisfying a type is necessary for\n// conformance, never sufficient; the schemas remain normative. They\n// live here for the same reason SCHEMAS does: they track the castings.\nexport type * as wire from './wire.js'\nexport * as introduce from './probe/introduce.js'\nexport * as trust from './probe/trust.js'\nexport * as continuity from './probe/continuity.js'\nexport * as membership from './probe/membership.js'\n"]}
|