Skip to content

id(currency): deterministic account factory + per-currency system accounts (from #2062) #2318

Open

Description

@dezren39

Follow-up from the currency control plane design (#2062), §3 of
doc/2026-10-29T12-42-21Z_design_currency_control_plane/.

Scope

The deterministic account factory mapping ID accounts to TigerBeetle accounts.

  • Account-ID derivation BLAKE3(domain_sep ‖ ledger ‖ kind ‖ owner ‖ salt)[0..16], versioned domain separator (design §3.1).
  • ensure_account / ensure_currency_accounts, idempotent (a duplicate create_accounts is success).
  • The per-currency system accounts (issuer unconstrained; liquidity, fee, burn) and constrained holder accounts (debits_must_not_exceed_credits, history where audit matters) (design §3.2).
  • The reserved transfer-code table (design §4.4).

Acceptance

  • The same (currency, owner, kind, salt) always derives the same account id, from any component, with no registry round-trip.
  • Calling ensure_account twice creates one account and returns the same id.
  • Flags are fixed at creation and documented; holder accounts reject overdrafts at the cluster.

Depends on

F1 (registry + ledger allocation).

Refs #2062

Activity

  1. added
    kind/featureNew feature or capability request
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/normalOrdinary priority (the default)
    meta/follow-upFollow-up spun out of earlier work
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  3. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    on Oct 29, 2026
  4. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 29, 2026
  5. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    Intake review

  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  7. 152 remaining items

  8. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  10. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  11. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 8503
    lane: code-p
    stage: claimed / verified
    Gate revalidated fresh 2026-11-05T06:58Z: issue #2317 (F1 currency registry + ledger-u32 allocator) is still OPEN (labels now queue/blocked + status/blocked, updated 2026-11-05T02:23Z), and issue #2318 is OPEN with no hard-stop labels and no implementing PR found. Per task 8503's packet gate, implementation must not start and the registry contract must not be invented while #2317 is unlanded. Parking task 8503 naming this gate; resume when #2317 lands/closes.

  12. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 5, 2026
  13. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Lane A (code-a) claimed task 8503 for issue #2318 (direct execution lane) and revalidated its dependency before any work: issue #2318 depends on F1 (registry + ledger allocation, issue #2317). Fresh check: issue #2317 is still OPEN, no PR references it, and no currency-registry / ledger-allocator code is present in pkgs/id/src on current main — the gate has not landed. Parking task 8503 until F1 lands.

  14. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Parked by lane A (code-a): task 8503 parked for 6h (resume after 2026-11-05T13:59Z or when the gate closes sooner). Gate check (fresh): F1 issue #2317 is OPEN, no PR references it, and pkgs/id/src on current main has no currency-registry / ledger-allocator code — F1 has not landed. Resume condition: #2317 closed/landed; then implement the deterministic account factory per design #2062 §3. No code touched.

  15. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — task 8503 (lane code-p) revalidated 2026-11-05T14:05Z: gate still not met. Issue #2317 (F1 currency registry schema + ledger-u32 allocator) is still OPEN with no implementing PR found, and #2318 is explicitly gated on it landing (do not invent the registry contract). Task 8503 parked 6h; resume condition: #2317 closed/landed, then implement #2318 per design #2062.

  16. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — task 8503 (lane code-y) revalidated 2026-11-05T20:06Z: gate still not met. Issue #2317 (F1 currency registry schema + ledger-u32 allocator) is still OPEN (now queue/blocked + status/blocked) with no implementing PR, and #2318 is explicitly gated on it landing (do not invent the registry contract). Task 8503 parked 6h; resume condition: #2317 closed/landed, then implement #2318 per design #2062.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedmeta/follow-upFollow-up spun out of earlier workpriority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/queue-workerFiled or worked by the queue/worker pilotstatus/parkedDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions