You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290
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.
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 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.
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.
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.
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.
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)
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.
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:
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.
Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
Session / ID: queue task 12596; lane aea12c82-c5af-4e5a-9b66-f8e360f87177
Found via: atomic queue claim (remainder packet from triage task 12045)
Task: Add the ABC→123 at 0.8123 worked example, both directions as separate objects, to doc/2026-11-01_design_id2290.md.
Outcome: PR docs(id): record the ABC→123 at 0.8123 worked example for #2290 #7326 adds §5 Worked example: ABC→123 at 0.8123 — the forward currency.rate_authorisation (authorisation_id 7, 8123/10000, bounds, cap, callers, validity window), its scale-aware floor arithmetic (10000 → 8123, 10001 → 8123 with the remainder not credited), a 60-second quote pinned to the version-1 event, and the reverse 123→ABC offer as a separate signed object (authorisation_id 8, 6/5, its own cap/callers/expiry). Doc-only; no gateway or quote code. Task completed as pr_opened; CI pending.
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.
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.
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").
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)
Activity
developing-today commentedon Oct 29, 2026
CODE-1148
dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up
dezren39 commentedon 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)
id(u128),version,issuer_id, one-directionsource_ledger/dest_ledger, integer-rationalrate_num/rate_denapplied scale-aware (y = floor(x · rate_num / rate_den), rounding always down in the LP's favour),min_amount/max_amount,total_capwith a control-planeremaining_volumecounter decremented only on POSTED,authorised_callers(any| allowlist | single counterparty), mandatoryexpires_at, and a control-plane revocation set checked at submission. TigerBeetle never sees the object; the gateway checks it before submitting.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.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 bychain::decode/verify_strict.Revokeentry atpkgs/id/src/groups/mod.rs:141-142.doc/2026-10-29T12-42-21Z_design_currency_control_plane/); issue id: design: ID currencies v1 #2043 (currencies v1 synthesis) remains open and gated. Nocurrency.*kinds or RateAuthorisation types exist inpkgs/id/srcat origin/main.Options considered
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.convert, §6 of that doc) need the offer in the graph; a DB record would need a second audit story.Recommendation — the object
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).authorisation_idandversion + 1. State is a fold: the live object is the highest non-revoked version. No in-place edits, ever.123offers 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) yieldsfloor(100 · 8123 / 10000) = 81.23 → 81whole 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)
chain::decodeverifies the event signature; the header's verifying key must equal bodyissuer_id— a body naming another issuer is invalid, not merely untrusted.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.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
currency.rate_authorisation_revokeon the issuer's chain:{authorisation_id, revoked_version_from, effective_at, reason (optional)}. Only the issuer's signature revokes in the graph.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)
currency.rate_authorisation/ revoke schema types + fold (live-version + revocation state) inpkgs/id, library-only, with the worked-example golden tests. Task + dedupe key listed in the routing comment below.Questions that genuinely need Drew (explicit, with recommendation)
currency.rate_authorisation_platform_revokekind the gateway also honours (faster incident response, but introduces a second revocation authority every verifier must model). Neither option blocks Phase 1.🤖 Agent note · triaged
dezren39 commentedon 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:
repo-health:v1:fix:developing-today/code:issue:3800repo-health:v1:fix:developing-today/code:issue:3801repo-health:v1:fix:developing-today/code:issue:3802All three tasks are queued on
repo-health-code-pilotwithqueue/queuedon their issues; Phases 2 and 3 name their dependencies in their packets. Read the design record's phase list with these numbers substituted.42 remaining items
dezren39 commentedon Nov 8, 2026
🤖 Agent note · done
repo-worker-code), OpenChamber scheduled laneaea12c82-c5af-4e5a-9b66-f8e360f87177doc/2026-11-01_design_id2290.md.currency.rate_authorisation(authorisation_id 7,8123/10000, bounds, cap, callers, validity window), its scale-aware floor arithmetic (10000 → 8123,10001 → 8123with the remainder not credited), a 60-second quote pinned to the version-1 event, and the reverse 123→ABC offer as a separate signed object (authorisation_id 8,6/5, its own cap/callers/expiry). Doc-only; no gateway or quote code. Task completed aspr_opened; CI pending.docs(tokens): reconcile token.offer with #2290 rate authorisations
docs(id): resolve the worked example's issuer annotation to account/d…
Merge pull request #7326 from developing-today/queue/12596-2290-rate-…
dezren39 commentedon Nov 16, 2026
🤖 Agent note · merged (queue task 17326, PR shepherd)
repo-worker-code, lanecode-f)daa7e40902, headd4501bf974(doc-only, 1 file)doc/2026-11-01_design_id2290.md— forward and reversecurrency.rate_authorisationobjects 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.issuer_idas "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 equalissuer_id, and the prose says "signed on behalf of" the LP. Flagged by the Codex review (P2) on the original head.test_bitwarden_load_secrets.pyon a branch predating the current script; that suite passes on the merged tree and locally on main.scripts-testno longer runs on PRs (push-to-main only) — the passing checks on the merged head were dependabot + CodeRabbit.Labels: PR carried no lifecycle labels; the issue's
user/escalated(Q1) is untouched.dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged (bulk-intake concurrence) — design + worked example landed; Q1 escalation now ledger-delivered
user/escalatedfor 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) todoc/2026-11-01_design_id2290.md.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.dezren39 commentedon 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-reviewis 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 commentedon 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/escalatedis removed.