Currency, market offers and execution budgets
Research snapshot of November 23, 2026. Code and issue observations refer to the cited revisions and collection times.
Review basis. This is a proposal for the existing token chapter and implementation map. The checked repository revision is 7310a95730791e66da98f7b0e13865930058a516. The staged chapter distinguishes the graph-native fold, an anchored ledger, the hosted Worker prototype and runtime fuel. The extension to #2043 already specifies three account classes, the Supply account, and the restricted transfer of pending units through countersigned options. A pending unit can change holder under those terms while remaining ineligible as payment. A TigerBeetle pending transfer is a reservation with its own lifecycle. Every market adapter must retain that distinction. Currency extension · Graph fold · Production remainder #10070
Supply reconciliation has a reproducible arithmetic defect
The report accepts unsigned 128-bit posted credits and debits. Its net helper clamps each operand to the maximum signed 128-bit value before subtracting. Let M = 2¹²⁷ − 1. Take an issuer with debits M+2 and credits M, and one holder with credits M+1 and debits M. Fee and burn are zero. Exact signed arithmetic gives issuer net issuance 2 and holder net balance 1. The helper returns zero for both. The equality check consequently finds no supply mismatch. This is a counterexample derived from the source, with valid counter field types and small net balances. It establishes the arithmetic failure, independently of how frequently production totals approach the boundary. Other findings could still be emitted by the report. Net and account types · Audit accumulation · Ledger counter types · Report-only audit PR #13139
Proposed first slice. File a focused successor finding after a fresh duplicate/ownership check. Compute the magnitude of the difference in unsigned arithmetic before applying a sign. Use checked accumulation or a wide exact accumulator for the entire report, including SupplyAudit::difference. Preserve ordinary report encoding. When the published representation cannot express a result, emit an explicit arithmetic-range finding and mark that audit incomplete. Run fixtures for the example above, its mirrored sign, balanced large counters, multiple individually representable holders whose sum exceeds the representable range, and a difference whose operands fit but whose result does not. Oracle is exact integer arithmetic independently computed for each ledger. A clean report requires representable exact equality. Static review only in this pass. Two repository REST duplicate searches, for “supply audit” + “overflow” and “reconcile” + “i128”, returned zero matching issues. Broader title and issue-comment checks remain appropriate at intake. Report types
What an offline participant can promise
| Prior system or result | Transferable mechanism | Consequence for ID |
|---|---|---|
| O’Neil’s escrow transactions (1986) | Reserve a bounded share of a numerical invariant before scheduling independent updates. | Specific rights can travel to a participant before disconnection. A balance observed in a cache grants no additional rights. Original paper |
| Invariant confluence and bounded counters (2014–15) | Some individually lawful independent decisions break an invariant at merge. Replica-local rights can bound independent decrements and be transferred explicitly. | Assign each cooperative replica a limited allowance per issuer/asset and epoch. Device-cloning and rollback exceed the cooperative-replica model and require separate settlement rules. Bailis et al. · Balegas et al. |
| GNU Taler | The merchant submits coin deposits to an exchange. A successful response and signature supply evidence at a distinct acceptance boundary. | Name the party able to finalize an anchored transfer and identify the signed outcome the recipient can check. Anonymous cash issuance and a shared public exchange are unnecessary for this design. Protocol · Dold, doctoral thesis |
| IETF Generic Voucher Language (2003) | Vouchers have issuers, holders, promises and permitted uses. Repeat presentation and consumption have different requirements. | Distinguish holding an item, presenting recurring eligibility and consuming a unique redemption. Give each its own signed terms and stable operation ID. RFC 3506 |
Proposed receipt contract. Return a status and an authority with every payment attempt. A graph-native recipient can display a locally valid event as provisional, then show the canonical result or a void after reconciliation under the documented fold. An anchored recipient sees a signed intent as queued, and a posted receipt only after its designated finalizer accepts the transfer. An issuer can run its finalizer locally or on a peer it chooses. Its unavailability affects that issuer’s acceptance, leaving offline graph editing and the creation of offers available. A receipt carries an asset definition ID, operation ID, issuer/finalizer identity, amount in minor units, domain, state and an optional causal or ledger position. Export/import retains these fields. Fold · Signed gateway envelopes
Counterexample and acceptance test. With 10 units, two disconnected holders of the same authorization can each promise 7. Deterministic ordering eventually selects a winner but cannot undo both merchants’ deliveries. Even an allocation of 5 to each of two devices fails to give a merchant finality if the state of one device can be cloned and it signs two incompatible 5-unit commitments. A valid signature authenticates each commitment. Ordinary offline profiles should therefore expose provisional acceptance and leave irreversible local fulfillment to explicit merchant policy. A later delegated-reserve experiment must specify rollback assumptions, device epoch, maximum risk and reclaim protocol. To reclaim, fence the old epoch at the authority and reconcile all commitments admissible under the signed terms. A disconnected device, local timeout, or restored backup cannot itself create spendable headroom. Enumerate delivery orders, retries, and competing transfers for two devices and two merchants. Require posted debits ≤ initial available balance in each settlement domain. Under partition, the observable outcome may remain pending.
Trades, items and market fees
Proposed offer envelope. Extend the existing quote/intent path with exact give/want assets, maximum spend, minimum net receive, price rational, fee asset, maximum fee, expiry rule, settlement domain per leg, and the consented fill policy. Validate amounts and rates against the issuer’s definition and bind the authorized quote revision to the signed offer. For a single domain that supports atomic transfers, post both legs and fees together or return the original rights. A cross-domain workflow needs independently durable hold receipts and a stated cancellation path. A remote timeout after submission leaves the operation pending until the remote domain can identify its outcome. Prevent a second fill against the same reservation during this interval. Present atomic and conditional offers distinctly before acceptance. #3801 and #3802 are natural review points for the gateway and quote contract, with #10070 retaining overall scope. Conversion execution #3801 · Quote interface #3802 · Agoric offer safety · TigerBeetle reservations and resolution
For fungible partial fills, quote a monotone cumulative fee function in minor units and charge its difference between successive committed filled amounts. Example proposed test tariff is ceiling of 1% of cumulative gross. Filling 100 units in 100 one-unit steps and filling once both incur exactly 1. Duplicate, canceled or rejected fills charge zero additional fees. Bind min-receive to the chosen partial-fill rule, or require all-or-nothing. For nonfungible items, bind the item ID and quantity rule. For recurring benefits, separate a proof of eligibility from a signed consumption. Replaying a single-use coupon after a host restart returns the original receipt. Presenting a reusable badge twice leaves ownership with the holder. Admission to host effects still requires the app’s effect grant. Record these as fixtures in the graph and host chapters as well as currency.
Fuel, host work and abuse budgets
Wasmtime instruction fuel measures configured guest execution. The admitted operation can also cause queued work, storage growth, bandwidth and CPU time outside that guest. Resource Containers attached work to a resource principal across server execution. Dominant Resource Fairness analyzes sharing across multiple resource types under a defined resource model. The first model suggests an accounting identity for asynchronous work. The second provides an experimental fairness comparator. Storage occupancy, in-flight concurrency and per-second fuel have distinct units and release conditions. Wasmtime engine configuration · Banga, Druschel and Mogul, OSDI 1999 · Ghodsi et al., NSDI 2011
Proposed payer contract. Resolve the authorized account with ID’s current ownership rules once per logical operation. Persist payer, operation ID, budget grant, tariff revision and bounded resource request on continuation/outbox records. Reserved capacity temporarily reduces availability. Final usage, unused release and any currency charge each have their own retry-stable identity and unit. A read query, replay of a signed graph event, or delivery of a duplicate receipt cannot issue a new currency claim. Split a logical charge only where all child charges are bounded by their ancestor grant. Provider calls with an uncertain outcome remain pending until query or idempotent replay resolves them. Limit queued operations, outstanding bytes, and concurrent commits locally even if currency settlement is remote. Payer-resolution source · Guest-burn charge path · Per-account policy PR #12539 · Runtime charging PR #12557
Implementation order after the audit finding.
| Existing work | Small next action after fresh owner checks | Oracle |
|---|---|---|
| #10070 and the currency fold | Add provisional/posted/void claims to public receipt fixtures on the library boundary. Reopen the same events after export/import and in reversed delivery order. | Fold replay agrees on canonical outcomes. An anchored receipt remains queued without its finalizer. No confirmed UI balance includes a provisional conflicting spend. |
| #2294, #2723 and adverse-hold PR #12348 | Add the redemption and recovery cases at the adapter seam. Avoid another grant implementation while this PR is open. | Duplicate redemption and adverse notices leave one economic outcome. A trade of pending units preserves their class. Restart between reserve and post/void never releases the same funds twice. Grant service #2294 · Lifecycle #2723 · Adverse grant PR #12348 |
| #3801/#3802 | Review cumulative fee and expiry semantics with the quote owner before changing the wire format. | Partition-equivalent fills pay equal total fees. A signed stale quote cannot silently choose a newer tariff. An uncertain remote fill cannot both repost and refund. |
| #1067 and existing quota PRs | First carry the payer across one async host operation. Repeat isolation workload for one world and for many sibling worlds billed to one payer. Pin engine/configuration and separately report guest fuel, wake delay and service latency. | Total reservations stay within account limits. Each committed effect has one receipt and payer. The existing exit criterion is victim p99 ≤ 1.10× calm; the checked-in 2.517 reference run does not meet it. This pass did not rerun the measurement. #1067 · Measured baseline and workload |
These proposals leave network-independent graph use available and make the point of economic finality visible in the app. The separate acceptance tests cover mutable market policy, deterministic replay, ledger integrity, host resource admission, and irreversible effects.