A STARK proof of Bitcoin's UTXO set at block 972,500, with circuits proven in Lean

Thank you both for the answers & interest! Replying to both in this post.

  1. A correction. I wrote earlier that the proof covers every rule except signatures and scripts, like assumevalid. Checking against @ajtowns’s list, two ConnectBlock rules are missing: BIP68 relative locktimes and the full sigop cost. Currently only legacy sigops are checked. P2SH and witness sigops aren’t. Core under assumevalid still enforces both, so today’s guarantee is a bit weaker than assumevalid. Both fit the existing design, since the undo records already carry each spent coin’s height and script. Time-based BIP68 locks also need older blocks’ median time past. I’ve updated the first post.

  2. To @AdamISZ comment on the 72 s checktime. My post wasn’t clear so I edited it. 70.7 of the 72 s is reading the 9.4 GB snapshot from disk to recompute its hash. The proof itself verifies in about 0.5 s in a browser (wasm). A Groth16 wrap wouldn’t buy much verification time. It would shrink 1.6 MB to a few hundred bytes, which matters for verifying on another chain though. The cost would be a trusted setup, and losing the hash-only security assumption that keeps a STARK plausibly post-quantum. I’d rather keep that for now.

  3. On batching Schnorr signatures. I agree that a random linear combination makes it one MSM, and nothing stops it spanning many blocks. I see two caveats: most historical signatures are ECDSA, which doesn’t batch the same way, and secp256k1 over M31 is foreign-field arithmetic, which I haven’t costed yet. It’s the obvious shape for a signature module.

  4. The 4 layers you mention @ajtowns are close to how this is built currently.

    1. A header chain proof: You’re correct it does not need ZK. What it gives is one proof for ~970k headers and an MMR commitment over block hashes that the later proofs bind to.
    2. Undo data commitments. Each block proof outputs a commitment to the block plus, per input, the spent coin (amount, scriptPubKey, height, coinbase flag), i.e. Core’s undo data.
    3. UTXO set updates. A multiset argument over coin events across the chain: each spend consumes an existing coin exactly once, the undo records are those coins, unspendable outputs are excluded, and the duplicate-coinbase cases match Core. It ends in Core’s hash_serialized
    4. Full per-block validation. Part of this is already in there: Merkle and witness commitments, CheckTransaction, finality, BIP34, legacy sigops, weight, and (because they need the undo data) coinbase maturity, inputs ≥ outputs and coinbase ≤ subsidy + fees. What’s missing: signatures, scripts, BIP68 and full sigop cost.

The difference from your split is that amounts and maturity sit with the coin-set layer rather than per-block validation. I agree with your main point: layer 3 is the long-lived part across soft forks and the hard one to be confident in, and it’s the part with the Lean soundness proofs. Your suggestion that layer 4 only needs the block plus its undo commitment is how the script module is meant to plug in. A proven undo commitment could also serve SwiftSync-style validation, as you say. I’d be happy to try that if someone wants it.

Thanks again to both of you for the review! I’ll keep working on this and see how I can make it better :slight_smile:

1 Like