FGM license state machine
Purpose
The Firebreak Guarantee Module (FGM) sits on each accelerator's clock, power and interconnect control paths. This module is its licensing logic, written as a pure reducer:
step(state: FgmState, event: FgmEvent): FgmState
allowance(state): Allowance // the throttle setting after each event
rate(state): number // allowance(state).rateIt follows the paper's license state machine (Appendix A, "License state machine"). The default state is low capability. Full rate is earned one license at a time, and every lapse falls back toward the Tier 0 rate r_0.
Everything the module trusts from outside arrives already verified. The Bitcoin time beacon module checks header chains (proof of work, the difficulty floor), the distance-bounding protocol checks location, and full-block outage proofs are checked upstream. This reducer only decides what those facts mean for the license.
Data formats
License
Field names follow the paper's tuple (chip, op, tier, B, site, cset, h, H_from, H_to, lambda, d_min, nonce).
| Field | Type | Meaning |
|---|---|---|
chip |
32 bytes | chip_id = H(pk_dev) |
op |
string | operator |
tier |
0, 1 or 2 | licensed tier |
budget |
integer | B, in metered work units |
site |
string | registered site; must match the latest location proof |
cset |
string | cluster set for high-bandwidth collectives |
blockHash |
32 bytes | h, a recent Bitcoin block; must be newer than the chip's recorded tip |
heightFrom, heightTo |
integers | H_from, H_to, the valid block-height window |
lambda |
integer | maximum local duration, in local seconds |
dMin |
integer | lowest header difficulty accepted while the license runs |
nonce |
32 bytes | |
sig |
64 bytes | BIP340 Schnorr signature under the Council key K_C |
The signed digest is taggedHash("Firebreak/fgm/license", encoding) (BIP340 tagged hash). The encoding concatenates the fields in table order: integers as u64 little-endian, strings as a u32 little-endian length followed by UTF-8, and hashes as raw 32 bytes. In deployment the signature comes from a FROST signing session of the Council. A FROST signature is an ordinary BIP340 signature, so the module verifies it with schnorr.verify from @noble/curves.
Orders
{ kind: "hold" | "confirm" | "lift", seq, chips[], sig }. The digest is taggedHash("Firebreak/fgm/order", kindByte || u64le(seq) || u32le(count) || chips), with kind bytes 1, 2 and 3. The Council key signs hold and confirm orders; the dispute panel's key signs lift orders. Each signer has its own sequence counter, and an order is accepted only if its seq is higher than every earlier one from that signer.
Events
| Event | Source | Effect |
|---|---|---|
install(license, at) |
operator, with the beacon's verified position at of block h |
accept or refuse the license |
headers(tip, minDifficulty) |
beacon | adopt a header chain with more work |
tick(a, b) |
the two oscillators | advance the local counter by max(a, b), or flag a clock anomaly |
meter(work) |
hardware counters | charge work to the budget |
location(site) |
distance-bounding proof | record the proven site |
order(order) |
Council or dispute panel | hold, confirm or lift |
outage |
full-block proof that no root was anchored | enter outage grace |
anchor |
a valid anchored root seen | leave outage grace |
tamper |
tamper sensor | destroy keys |
States and transitions
| State | Rate (allowance) |
Training rate | Entered when | Left when |
|---|---|---|---|---|
| Unlicensed | r_0 |
r_0 |
enrollment; any lapse of a non-critical chip; a clock anomaly; grace ends; an outage ends | a valid license (to Licensed); an outage proof (to OutageGrace) |
| Licensed | r, for at most the rest of lambda and the rest of B |
r |
a valid license is accepted | budget spent, lambda local seconds passed, or tip height above H_to (to Grace if critical, else OutageGrace if an outage is proven, else Unlicensed); clock anomaly; hold; tamper |
| Grace | g*r for at most the rest of gamma |
r_0 |
a critical-service chip's license lapses | renewal (to Licensed); gamma passes (to OutageGrace or Unlicensed); clock anomaly |
| OutageGrace | g*r |
r_0 |
an outage proof, with no running license | an anchored root (to Unlicensed); a valid license (to Licensed) |
| Hold | r_0 |
r_0 |
a valid Council hold naming the chip | an unconfirmed hold lapses after holdPeriod; a valid panel lift; tamper |
| Tampered | r_0 |
r_0 |
tamper | never (re-enrollment is outside this reducer) |
Licenses are refused in Hold and Tampered. In every other state a valid license moves the chip to Licensed, which is how a renewal works.
enrollment
|
v valid license
+------------+ -------------------------------> +----------+
| Unlicensed | | Licensed | <--+ renewal
+------------+ <------------------------------- +----------+ | (valid license)
| ^ lapse of a non-critical chip, | |
| | or clock anomaly | lapse of a |
| | | critical |
| | v chip |
| | gamma over, or anomaly +-------+ |
| +----------------------------------- | Grace | --------+
| | +-------+
| | anchored root
outage |
proof |
v |
+-------------+
| OutageGrace | ---- valid license ----> Licensed
+-------------+
Any state except Tampered --- valid Council hold ---> Hold
Hold --- panel lift, or an unconfirmed hold lapses ---> the state the facts imply
Any state --- tamper ---> Tampered (absorbing)
While an outage is proven, every arrow above that ends in Unlicensed ends in OutageGrace instead.How the reducer is built: Hold and Tampered are stored. Every other status is recomputed after each event, in this order: Hold if a hold record exists; Licensed if the license slot has not lapsed; Grace if the chip is critical and gamma has not passed since the lapse; OutageGrace if an outage is proven; otherwise Unlicensed. A lapse is recorded once, with the local time it happened. For a duration lapse that time is acceptedAt + lambda even when one large tick jumps past it, so gamma is measured from the true moment of the lapse.
The throttle (dead-man allowance)
After every event the module loads allowance(state) into the throttle: a rate, plus the local seconds and work units that rate may run for. When either runs out, the throttle drops to r_0 by itself, whether or not another event arrives. This makes the reducer exact in discrete steps. A tick of any length can never carry full rate past lambda or past B, because the throttle stops at the limit within the tick.
Security properties and the tests that check them
All property tests are in test/fgm/properties.test.ts. A test world drives the chip with arbitrary and adversarial events: forged, unsigned and edited licenses; replays; licenses for other chips, other sites, or with lambda above LAMBDA_MAX; stale and low-difficulty header chains; huge ticks of 2^40 seconds; disagreeing and malformed oscillator readings; holds, confirms and lifts from right and wrong signers, with fresh and replayed sequence numbers; outage proofs; tamper. Real time is tracked exactly, in integer microseconds. Oscillator A is always honest: real elapsed time equals a * (1 + q) with |q| <= eps. Oscillator B is honest or adversarial depending on the run. The world also plays the accelerator: during each tick it does as much full-rate work as the throttle allows. A separate test checks that the harness reaches all six states and pushes work and time to within 1% of the bounds, so the properties are not vacuous. Each property was also checked against deliberately broken versions of the reducer.
| Property | Test |
|---|---|
| (a) Tampered is absorbing: every later event returns the identical state | mixed runs, check(); transitions.test.ts "any state -> Tampered" |
(b) Full-rate work under any one license is at most min{B, (1+eps) r lambda}, and the real time spent at full rate is at most (1+eps) lambda (the paper's license-window bound) |
mixed runs, checkAccounts() after every tick |
| (c) Only a genuine, unedited Council-signed license can become the running license; forged, unsigned and edited licenses never yield full rate | mixed runs, check(); "(c) forged, unsigned and edited licenses never yield full rate" |
| (d) A replayed license or order never changes the state | mixed runs (replay and replay-order actions) |
(e) Hold is entered only by a valid Council hold, and left only by a valid panel lift, by the lapse of an unconfirmed hold after holdPeriod, or by tamper |
mixed runs; "(e) holds, confirmations and lifts under dense order traffic" |
(f) The local counter and the recorded tip's cumulative work never decrease (the paper's chain-tip invariant); an honest tick never voids a license; readings whose tolerance ranges are disjoint always void it; real time never exceeds local * (1+eps), and with both oscillators honest it also stays at or above local * (1-eps) |
mixed runs; "(f) with both oscillators honest" |
(g) The rate is at most r; at most g*r in Grace and OutageGrace; at most r_0 elsewhere; training above r_0 happens only while Licensed (the paper's rate invariant) |
mixed runs, check() |
Licensed always means a live license: inside lambda, inside [H_from, H_to], budget left |
mixed runs, check() |
While a license runs, a header chain below its d_min never moves the tip |
mixed runs, check() |
| Only critical-service chips enter Grace | mixed runs, check() |
test/fgm/transitions.test.ts has an example test for each transition and for every license refusal reason.
Interpretations
Each of these is a choice the paper leaves open. Each needs the authors to confirm it.
- Local time is the larger of the two oscillator readings. The paper says a counter "driven by an oscillator" is compared with a second one. Advancing by
max(a, b)means the(1+eps) lambdabound holds as long as either oscillator is honest. The anomaly rule stays as the paper requires. - Clock anomaly test. A tick is anomalous when the real-time ranges
[a(1-eps), a(1+eps)]and[b(1-eps), b(1+eps)]do not overlap, checked per tick. A malformed or overflowing reading also counts as an anomaly. An anomaly voids the license ("Tier 0 until a fresh license arrives") and gives no grace, even to a critical chip. - Anti-replay is the chain tip. The paper accepts a license "whose block hash is newer than the module's recorded tip". Accepting it moves the tip to
h, so the same license can never be accepted twice. No separate sequence number is needed. LAMBDA_MAX. The paper putslambdain the license. The module also refuses anylambdaabove a constant fixed at manufacture, so a compromised Council key cannot issue a very long license.- Grace starts on any lapse. Budget, duration and height all count, but a clock anomaly does not. The paper says "after expiry".
- Hold orders carry a chip list and per-signer sequence numbers. A hold refreshes its start time if it is re-issued. A confirmed hold never lapses; only a lift ends it. The hold period is measured in local time.
- Outage. A Licensed chip keeps its license through an outage, and falls to OutageGrace only when the license lapses.
- Malformed meter readings spend the whole budget. This fails safe.
- Units. Budgets and work are integers. The rates
r,g*randr_0are work per second of real time, becauseris the chip's physical peak rate.
Open questions and gaps for the paper's authors
- Power loss. The local counter only advances while the module is powered. Real time while the chip is off is not counted. That does not extend full-rate compute, since
lambdais local time while running, but it can stretch a license over a longer calendar period. The paper should say whetherlambdais meant as calendar time, which would need a battery-backed counter or a resync rule. - License tip versus report tip. A renewal must embed a block newer than the module's recorded tip. If the module adopts newer headers between its epoch report and the renewal, the renewal is refused. Issuance must use the tip reported in the epoch report, and the module should not adopt headers in between, or the rule should compare against the reported tip.
- Header consistency with local time. The paper requires "cumulative work consistent with the local time elapsed", but gives no bound. It is left to the beacon module.
- Hold lapse in local time can be cut short by a factor of up to
(1+eps). A height-based period would avoid that. - Tier 2 fields. The
job_idand spec hash that Tier 2 licenses carry are not modeled here. - Peer licensing is modeled as a predicate,
mayLink(state, peerCset), that gates collectives rather than the chip's rate, as the paper describes. Freshness of peer license proofs is not specified. - Effective compute.
Bis in effective compute while the module meters raw operations. The conversion ateta(t)is outside this reducer.