GeezerVison is showing github.com — id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation · Issue #2290 · developing-today/code
id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290DescriptionFrom the conversion-engine design on #2063 §2 (feeds #2043; parent epic #2056; relates to the issuance-in-graph investigation #2041).
Define the RateAuthorisation as a signed ID-graph object:
- Schema for the fields in id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §2: id, version, issuer (LP) identity, source/dest ledgers, integer-rational rate (rate_num/rate_den, scale-aware), per-conversion min/max, total cap, authorised callers (any / allowlist / single counterparty), not_before + mandatory expires_at, one-direction-only (reverse is a separate object).
- Signing: the object is signed with the issuer's ID key; specify how the gateway (id: design: currency control plane — registry, account factory, gateway #2062) verifies the signature chains to the identity controlling both liquidity accounts.
- Revocation: representation + how the control plane's revocation set is checked at submission; revocation stops new conversions and never touches posted ones.
- Quote binding: how a short-lived single-conversion quote references an authorisation (authorisation_id + amounts + fee + expiry).
Acceptance criteria:
- A schema + worked example (ABC→123 at 0.8123, both directions as separate objects) recorded in a design doc or on this issue.
- Signature-verification and revocation-check flows specified precisely enough for the id: design: currency control plane — registry, account factory, gateway #2062 gateway to implement against.
- Anything buildable that falls out is filed as follow-ups linked here.
Schema/design work only in this issue; the gateway implementation belongs to #2062's follow-ons. Activitydeveloping-today commented on Oct 29, 2026 dezren39 commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026 Design record — issue #2290, RateAuthorisation as a signed ID-graph object (task 5741 triage)
The decision to be made: the graph-native representation of a RateAuthorisation — schema, how the gateway (#2062) verifies that its signature chains to the identity controlling both liquidity accounts, how revocation is represented and checked, and how a quote binds to an authorisation — precise enough for the gateway follow-ons to implement against.
Evidence at origin/main (3cbab2d, verified fresh this run)
- The ledger-facing field set is already decided by the conversion-engine design on issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §2:
id (u128), version, issuer_id, one-direction source_ledger/dest_ledger, integer-rational rate_num/rate_den applied scale-aware (y = floor(x · rate_num / rate_den), rounding always down in the LP's favour), min_amount/max_amount, total_cap with a control-plane remaining_volume counter decremented only on POSTED, authorised_callers (any | allowlist | single counterparty), mandatory expires_at, and a control-plane revocation set checked at submission. TigerBeetle never sees the object; the gateway checks it before submitting.
- The graph-side division of ownership is also already decided: the token-issuance investigation (issue id: investigate: token issuance in the ID graph — per-ID issuance, issuer snapshots, authorized conversion rates #2041, CLOSED; doc on main at
doc/2026-10-30T19-18-00Z_investigation_token_issuance_id_graph/, lines 62–65) states conversions surface in the graph as per-pair, per-direction signed offers — "ID 123 accepting ABC at 0.8123 is one signed offer; the reverse is a separate offer or none" — and that the RateAuthorisation field schema is issue id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290's to define.
- The implementation pattern for signed graph objects already exists in shipped code:
pkgs/id/src/attestation.rs:1-25 — PoC objects carried as ordinary signed chained events (crate::chain) whose bodies are the objects, with kind constants (attestation.genesis, attestation.claim) and state computed from the objects alone by a viewer/fold. Identity is the 32 bytes of the signing key's verifying key (attestation.rs:40-47), and event signatures are verified by chain::decode/verify_strict.
- Revocation-by-signed-event is the house pattern too: group authorisation changes are signed log events, e.g. the
Revoke entry at pkgs/id/src/groups/mod.rs:141-142.
- Issue id: design: currency control plane — registry, account factory, gateway #2062 (currency control plane: registry, account factory, gateway) is CLOSED with its design doc on main (
doc/2026-10-29T12-42-21Z_design_currency_control_plane/); issue id: design: ID currencies v1 #2043 (currencies v1 synthesis) remains open and gated. No currency.* kinds or RateAuthorisation types exist in pkgs/id/src at origin/main.
Options considered
- Ordinary signed chain event, new kind
currency.rate_authorisation, body = the id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §2 fields (recommended). Graph-native, auditable, folds like every other ID object; matches the attestation.rs precedent and the id: investigate: token issuance in the ID graph — per-ID issuance, issuer snapshots, authorized conversion rates #2041 division of ownership.
- Detached-signed control-plane database record. Rejected: not a graph object — issuer snapshots (id: investigate: token issuance in the ID graph — per-ID issuance, issuer snapshots, authorized conversion rates #2041 §5) and app APIs (
convert, §6 of that doc) need the offer in the graph; a DB record would need a second audit story.
- A TigerBeetle-side representation. Rejected by issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 itself: TigerBeetle never sees the authorisation; the gateway checks it.
Recommendation — the object
- Kind:
currency.rate_authorisation. Body fields: authorisation_id (u128, stable across versions), version (monotonic per id), issuer_id (verifying-key bytes; must equal the event author), source_ledger, dest_ledger, rate_num/rate_den (u128), min_amount, max_amount, total_cap (u128, source-ledger units), authorised_callers (any | allowlist: [ID…] | single: ID), not_before, expires_at (mandatory), reversal_window_secs (optional; governs post-posting reversals at the original rate, per issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §4.4), fee_bps (optional; fees are non-refundable unless stated, per §4.4).
- Versioning: a new version is a new signed event on the issuer's chain with the same
authorisation_id and version + 1. State is a fold: the live object is the highest non-revoked version. No in-place edits, ever.
- Worked example (both directions, as required): LP identity
123 offers ABC→123 at 0.8123: {authorisation_id: 7, version: 1, issuer_id: 123, source_ledger: ABC, dest_ledger: 123, rate_num: 8123, rate_den: 10000, …} — 100 ABC (at equal ledger scales) yields floor(100 · 8123 / 10000) = 81.23 → 81 whole dest units before scale normalisation, remainder never credited out. The reverse is a separate object by the ABC-side LP: {authorisation_id: 8, version: 1, issuer_id: ABC-issuer, source_ledger: 123, dest_ledger: ABC, rate_num: 120, rate_den: 100, …} (1.20 ABC per 123) — its own rate, its own cap, its own expiry; neither object implies the other.
Signing + gateway verification flow (for the issue #2062 follow-ons to implement)
- Decode + signature:
chain::decode verifies the event signature; the header's verifying key must equal body issuer_id — a body naming another issuer is invalid, not merely untrusted.
- Issuer eligibility: the gateway checks the issuer's LP tier (issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §3: Issuer LP, Registered LP, or Platform LP) in the control-plane registry (issue id: design: currency control plane — registry, account factory, gateway #2062 design).
- Account-control chain: the account factory's binding records (control-plane, factory-signed) map
issuer_id → (source liquidity account, dest liquidity account). The gateway verifies both accounts named by the conversion are exactly those bound accounts, and neither is closing/closed. An authorisation for a pair where the issuer holds no bound account pair is ineligible, however valid its signature.
- Live-state checks at submission: highest version folded, not revoked (below),
not_before ≤ now < expires_at, caller ∈ authorised_callers, amount within [min_amount, max_amount], remaining_volume ≥ amount. Any failure is pre-flight (FAILED_PRE_SUBMIT, issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §4.1) with no TigerBeetle writes.
Revocation
- Representation: a signed event
currency.rate_authorisation_revoke on the issuer's chain: {authorisation_id, revoked_version_from, effective_at, reason (optional)}. Only the issuer's signature revokes in the graph.
- Control-plane check: the control plane materialises a revocation set by folding revoke events; the gateway consults the set at submission time (not quote time). Revocation stops new conversions; posted conversions are untouched and can only be reversed by a compensating conversion (issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063 §4.4).
- Platform safety: the platform cannot forge a graph revocation; it can only suspend gateway acceptance of an authorisation as a local, logged control-plane policy. (This is Drew-question Q1 below.)
Quote binding
A quote is a short-lived, gateway-issued control-plane record (not a graph object): {quote_id, authorisation_id, authorisation_version, authorisation_event_hash, x, computed_y, fee, issued_at, quote_expires_at} with a 60-second lifetime (issue #2063 §2 suggestion, adopted). The event-hash + version pinning means a re-issued or revoked authorisation can never silently satisfy an old quote: execution must reference an unexpired quote and re-run the live-state checks at submission; any mismatch fails pre-flight.
Phased implementation packets (filed + enqueued this run)
- Issue id: match attestation v1 — signed result objects, state machine, counting views in pkgs/id (from #2039) #3792 —
currency.rate_authorisation / revoke schema types + fold (live-version + revocation state) in pkgs/id, library-only, with the worked-example golden tests. Task + dedupe key listed in the routing comment below.
- Issue id: match audit v0 — netcode log format + tic-tac-toe exporter + verifier CLI (L0-L2) (from #2039) #3793 — gateway verification flow (steps 1–4 above) + revocation-set materialisation in the control plane, against the Phase 1 types; serves the issue id: design: currency control plane — registry, account factory, gateway #2062 follow-ons.
- Issue id: protocol v1 phase 1 — session header + segment checkpoint event kind (#2036) #3794 — quote issuance + binding (quote record, hash/version pinning, submission revalidation).
Questions that genuinely need Drew (explicit, with recommendation)
- Q1 — platform emergency revocation: may the platform identity revoke another LP's authorisation in the graph? Options: (a) issuer-only graph revocation; the platform can only suspend gateway acceptance locally, as a logged policy (recommended — a forgeable-by-platform revocation would make every authorisation's audit trail ambiguous); (b) a platform-signed
currency.rate_authorisation_platform_revoke kind the gateway also honours (faster incident response, but introduces a second revocation authority every verifier must model). Neither option blocks Phase 1.
- Explicit statement: no other Drew-only questions — field semantics, rounding, and failure behaviour are already decided by issue id: design: conversion engine — linked transfer pairs, rate authorisation, liquidity accounts #2063, and representation choices above follow shipped precedents.
🤖 Agent note · triaged
dezren39 commented on Nov 1, 2026 Correction + routing update (task 5741): the design record above anticipated phase issue numbers #3792–#3794, but those numbers were taken by other filings before the phase issues were created. The actual routing is:
| Phase |
Issue |
Queue task |
Dedupe key |
| 1 — schema types + fold |
issue #3800 |
task 5789 |
repo-health:v1:fix:developing-today/code:issue:3800 |
| 2 — gateway verification + revocation set |
issue #3801 |
task 5790 |
repo-health:v1:fix:developing-today/code:issue:3801 |
| 3 — quote issuance + binding |
issue #3802 |
task 5791 |
repo-health:v1:fix:developing-today/code:issue:3802 |
All three tasks are queued on repo-health-code-pilot with queue/queued on their issues; Phases 2 and 3 name their dependencies in their packets. Read the design record's phase list with these numbers substituted. dezren39 commented on Nov 16, 2026 🤖 Agent note · merged (queue task 17326, PR shepherd)
- Agent: OpenChamber scheduled lane (
repo-worker-code, lane code-f)
- Session / ID: queue task 17326 — shepherd PR docs(id): record the ABC→123 at 0.8123 worked example for #2290 #7326 (90-day open-PR pass)
- Merged: PR docs(id): record the ABC→123 at 0.8123 worked example for #2290 #7326 at 2026-11-16T11:54:05Z, merge commit
daa7e40902, head d4501bf974 (doc-only, 1 file)
- What landed: §5 "Worked example: ABC→123 at 0.8123" in
doc/2026-11-01_design_id2290.md — forward and reverse currency.rate_authorisation objects as separate signed objects, scale-aware floor arithmetic, min/max/cap rejections, and quote binding to the exact event/version/amounts. This closes the last acceptance-criterion-1 gap on id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290.
- Fixed during the shepherd: the example annotated
issuer_id as "must equal the event author", contradicting §2 step 3 (id: design: currency control plane — registry, account factory, gateway #2062 §4.1b: resolve device → account; never compare the body account ID to a device verifying key). The annotation now requires the signer's resolved LP account to equal issuer_id, and the prose says "signed on behalf of" the LP. Flagged by the Codex review (P2) on the original head.
- CI: the stale scripts-test failure on the pre-merge head (2026-11-08) was
test_bitwarden_load_secrets.py on a branch predating the current script; that suite passes on the merged tree and locally on main. scripts-test no longer runs on PRs (push-to-main only) — the passing checks on the merged head were dependabot + CodeRabbit.
- Not closed by this: the issue's Q1 (platform emergency revocation) decision remains Drew's, escalated on id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290; the PR deliberately does not rule on it. Issue stays open.
Labels: PR carried no lifecycle labels; the issue's user/escalated (Q1) is untouched.
dezren39 commented on Nov 17, 2026 🤖 Agent note · triaged (bulk-intake concurrence) — design + worked example landed; Q1 escalation now ledger-delivered
- Agent: queue worker (repo-worker-code), lane code-e
- Task: task 18215 — bulk-intake triage of issue id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290
- Fresh verification (2026-11-17, this run): issue id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290 OPEN, no hard-stop labels; it carries
user/escalated for Q1 only (below). Follow-ons verified this run: issue id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801 OPEN (Phase 2, gateway verification + revocation-set check), issue id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802 OPEN (Phase 3, quote issuance + binding). The last criterion-1 gap closed 2026-11-16: PR docs(id): record the ABC→123 at 0.8123 worked example for #2290 #7326 MERGED, adding the §5 ABC→123 at 0.8123 worked example (both directions as separate signed objects) to doc/2026-11-01_design_id2290.md.
- Triage of record stands: tasks 5741 / 7868 / 8607 / 12045 — design delivered (PR design(id): #2290 RateAuthorisation schema and revocation #3831), slice 1 implemented (issue id(currency): RateAuthorisation + revoke schema types and fold in pkgs/id (Phase 1 of #2290) #3800 closed, PR feat(id): currency.rate_authorisation + revoke types and fold (#3800) #3888 merged), worked-example remainder (task 12596) now merged. Everything is delivered or routed except Q1.
- Q1 — the one Drew decision, now actually delivered: should the platform be able to revoke another LP's authorisation in the graph? A (doc-recommended): issuer-only graph revocation + local logged gateway suspension. B: a platform-signed revoke event every verifier honours. Task 8607 escalated this by label on 2026-11-03, but no pending-decisions ledger item existed for it (verified this run) — per the runbook an escalation is only delivered when ledgered, so this run created
rate-authorisation-q1-2290 (pending) with both options and the note that the gateway slice (issue id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801) is the consumer of the answer.
- Verdict: triaged. Issue id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290 stays OPEN as parent record for id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801 / id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802 and the Q1 ruling.
dezren39 commented on Nov 22, 2026 Merged work, still open. Every pull request that references this issue has merged (#2806, #3844, #3886, #3888, #4547, #3831) and none is open, but the issue kept status:in-review. Tasks that name it as a blocker have been waiting on it.
status:in-review is removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").
By: Claude, 2026-11-22 flow review.
Generated by Claude Code dezren39 commented on Nov 22, 2026
Decided: Q1 is answered with the design doc's recommended option A: revocation of a RateAuthorisation in the graph is issuer-only; the platform's remedy is a local, logged gateway suspension, not a platform-signed revoke event. The #2062 gateway and its follow-ons (#3801 verification + revocation-set check, #3802 quote issuance) implement against option A.
Why: The design doc for this issue (doc/2026-11-01_design_id2290.md) recommends A; everything else on the issue is delivered (design PR #3831, slice 1 via #3800/PR #3888, worked example via PR #7326). Under the #12234 decision hierarchy the issue's own recorded recommendation is the first authority, and FDR-0013 rule 2 makes the call now rather than a park. Option A also keeps the graph's trust model uniform: the only signatures a verifier must honour are issuers', and platform power over a foreign authorisation stays local and auditable instead of becoming a graph-wide kill switch.
Undo: A design PR amending doc/2026-11-01_design_id2290.md to option B, with the verifier changes it implies, supersedes this record.
By: archer (lane S, #12234 owner-parks sweep, under FDR-0013)
user/escalated is removed.
dezren39 commented on Nov 24, 2026
🤖 Agent note · done — lane code-i, queue task 21538 (AUDIT-7 Lane 6 design slice)
Outcome: design upgraded to the 9-point sufficient standard and merged.
- PR docs(design): #2290 RateAuthorisation design to 9-point sufficient standard #14075 (branch
queue/21538-2290-design-9pt, head 45dc26c0368) MERGED 2026-11-24T04:31:12Z, merge commit a9be5e136c8 — verified as the latest change to the doc on origin/main.
- What changed (doc-only, 1 file, +73/−11, in
doc/2026-11-01_design_id2290.md): explicit Goals G1–G5; do-nothing alternative F (rejected); Rollout and rollback plan; slice status (all three implemented, id(currency): RateAuthorisation + revoke schema types and fold in pkgs/id (Phase 1 of #2290) #3800/id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801/id(currency): quote issuance + binding for RateAuthorisation (Phase 3 of #2290) #3802 closed); Q1 recorded as DECIDED option A (2026-11-22 record, decider Drew).
- 9-point check on the merged doc: (1) problem+context — Intent + Context and evidence; (2) Goals + Non-goals; (3) alternatives A–F incl. do-nothing; (4) chosen approach — Design §§1–5 + Decisions; (5) dependency-ordered slices with acceptance criteria; (6) Rollout and rollback; (7) verification — Acceptance criteria for implementation; (8) open questions naming the decider (Q1 decided); (9) dated doc in doc/ + this tracking issue + queue task 21538.
- Gates: PR mergeable, mergeStateStatus CLEAN, no failing checks (CodeRabbit + Proof skipping); CodeRabbit rate-limited with no findings; no Codex review appeared in ~12 min; no findings to disposition. Issue comments re-read before merge (21, unchanged) — no competing claim.
- Verification: doc-only change; no test suite applies. Done check per the packet: design doc linked from this issue covers all 9 points.
Issue #2290 stays open as the parent record. dezren39 commented on Nov 24, 2026 🤖 Agent note · second-pass verdict — resolved in substance, closing with evidence
Fresh verification (2026-11-24 ~03:10 CST, live GitHub state + main)
Acceptance criterion 1 — schema + worked example: MET.
doc/2026-11-01_design_id2290.md at main (515 lines, 34,648 bytes) carries §5 "Worked example: ABC→123 at 0.8123" (line 233), forward and reverse as separate signed objects, with scale-aware floor arithmetic. Landed via PR #7326, merged 2026-11-16.
Acceptance criterion 2 — signature-verification and revocation flows: MET.
Same doc, §§1–4: closed canonical-CBOR schema, chain-envelope signing with issuer-authority resolution, version fold + signed currency.rate_authorisation_revoke, submission-time revocation-set checks, quote binding pinned to authorisation + version + event ID. Upgraded to the 9-point sufficient standard and merged via PR #14075 (2026-11-24).
Acceptance criterion 3 — buildable follow-ups filed: MET, all landed.
Q1 — platform emergency revocation: DECIDED.
Option A (issuer-only graph revocation; platform remedy is local, logged gateway suspension), decided 2026-11-22 under FDR-0013 and recorded in the doc §9 (line 477) and Decision 6. user/escalated removed. No open PR references this issue.
What changed since the last triage
Phases 2 and 3 closed 2026-11-23 and the design doc reached the 9-point standard 2026-11-24 (PR #14075) — those were the last open items named in the 2026-11-17 triage. No follow-on packet is routed: every follow-up is closed and the design is complete; a new packet would duplicate closed work.
Verdict: #2290 is resolved in substance. Closing with this evidence per the pass-2 packet acceptance ("close with evidence if already resolved").
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|