Proof-First Architecture: smt-v1 StateRoot, SettlementContract (#13) & Pure-SHA3 WHIR STARKs
60-Second TL;DR (
ZNN-SPEC-PHASE1-v4): "Consensus orders. Executors compute. Settlement anchors." ReconcilingZDC-ZP1-HR-001(H02, H07, H13, M02, M10) and Round-4 QROM,smt-v1, & Anchor Hardening (R4-04, R4-07, R4-09), Zenon Phase 1v4locks a 100% pure-SHA3-256Proof-First verification surface:
- Domain-Separated
smt-v1([0x00]/[0x01]) & Stateless Light-Client Chain (H13+R4-07+R4-09fix): Enforces RFC-6962[0x00]leaf /[0x01]internal domain separation +32Bsibling bitmap (1.2 KBproof), plusBitcoinAnchorHeight <= MaxPreCRQCBitcoinHeightonSunsetAnchorCheckpoint.- True
2^-128QROMWHIR-SHA3-v1Profile (R4-04fix): EliminatesBN254pairings (PQ-03) andPoseidon2algebraic hashes (M10), discharges theCMS19quadratic QROM loss via224-bitclassical query security +32-bitFiat-Shamir PoW grinding +256-bitextension field (57–86 KiBreceipts,<= 128 KiBhard cap), and tightensMaxSHA3KeccakPermutationsfrom45,000(17.1 mson Cortex-A76!) down to8,000(<= 3.5 mson Pi 5 Cortex-A76,< 0.5 mson Apple Silicon) in a zero-alloc256 KiBarena!- Post-Quantum Signature Compression (
M02fix): One57–90 KiBSTARK batch proves1,000+ML-DSA-44/FN-DSA-512signatures (2.42 MBraw)—a26.3x+wire compression!
1. Why Proof-First Solves Dual-Ledger Programmability & Post-Quantum Bloat Together
Programmability fails on dual-ledger architectures whenever execution lands on the wrong layer ([R36]):
- Executing smart contracts on individual user account-chains destroys shared-state atomicity.
- Executing WASM or EVM bytecode inside
Momentumconsensus forces every Sovereign Raspberry Pi 5 Pillar to re-execute heavy global VM workloads.
The Proof-First Separation of Duties (v4):
- Zenon L1 Owns Canonical Input Ordering & Asset Custody: Supports both
L1_NATIVEforced/direct inputs (CallL2,Deposit) andDA_BATCHEDhigh-throughput rollup batches anchored over Sentinel2D AVIDDA (H03). - Off-Chain Executors Own Computation: Pillar-operated
zeno-executornodes execute the deterministic Rustzeno-stfstate transition off-chain and generate aWHIR-SHA3-v1STARK receipt. SettlementContract (#13)Owns Instant Validity Finality (S1):SubmitBatchverifies one<= 128 KiBproof (57–86 KiBanalytical target) in~1.2–3.5 mspure Go on Cortex-A76 (< 0.5 mson Apple Silicon). Acceptance equals immediate cryptographic finality—zero 7-day fraud challenge windows.
2. Domain-Separated smt-v1 State Tree & Complete Light-Client Chain (H13 + R4-07 + R4-09 Fix)
To eliminate second-preimage / leaf-internal type confusion (32B path || 32B value == 64B vs left[32] || right[32] == 64B), ZNN-SPEC-PHASE1-v4 mandates explicit RFC-6962 1-byte node domain tags ([0x00] leaf, [0x01] internal) and a canonical compact proof format (R4-07):
EmptyHash = [32]byte{0} // Constant zero at all 256 levels
LeafHash(path, value) = FIPS202_SHA3_256([0x00] || path[32] || value) // 0x00 Leaf domain tag (R4-07)
InternalHash(left, right) = EmptyHash if left == 0 and right == 0
FIPS202_SHA3_256([0x01] || left[32] || right[32]) otherwise // 0x01 Internal tag
// Canonical Compact SMTProof Wire Format (~1.0-1.3 KiB typical):
SMTProof = nonEmptyBitmap[32] || nonEmptySiblings[popcount(bitmap) * 32]
Complete End-to-End Trustless Light-Client & Post-CRQC Bootstrap Chain (H13 + B11 + R4-09 Fix)
ZNN-SPEC-PHASE1-v4 specifies both the pre-CRQC classical history freeze and the 3-link light-client chain (ledger.getLightClientBundle):
- Link 0 — Pre-CRQC
SunsetAnchorCheckpoint+MaxPreCRQCBitcoinHeight(B11+R4-09Fix):- Phase 0 (
2021) through Phase 1A headers were signed by classicalEd25519Pillar keys (0post-CRQC Shor resistance against long-range genesis fabrication). - When
Spork #14(LegacyCryptoSunsetSpork) activates ahead of CRQC,SunsetAnchorCheckpoint = (H_sunset, MomentumHash_sunset, StateRoot_sunset, CommitteeHash_sunset, BitcoinAnchorHeight, BitcoinBlockHash)is permanently pinned in nodecommon/params.goand anchored in Bitcoin'sSHA-256dPoW chain (99-bytecheckpoints) atBitcoinAnchorHeight <= MaxPreCRQCBitcoinHeight(R4-09). - Why
MaxPreCRQCBitcoinHeightIs Essential (R4-09): After CRQC arrival, an attacker can break old Bitcoinsecp256k1keys to broadcast new Bitcoin transactions carrying spoofed99-byteOP_RETURNpayloads at heights> MaxPreCRQCBitcoinHeight, whereas rewriting a block at<= MaxPreCRQCBitcoinHeightrequires inverting cumulativeSHA-256dPoW (128-bitGrover secure)! RequiringBitcoinAnchorHeight <= MaxPreCRQCBitcoinHeightfreezes 100% of classical 2021–Phase 1A history unconditionally (Gate ZP-Q25).
- Phase 0 (
- Link 1 — Post-Sunset Committee Chain (
16.4 MB/yrOR57–90 KiBSTARK):- From
CommitteeHash_sunset(or Genesis pre-CRQC) forward, everyEpochTerminalMomentum(Height mod 86,400 == 0) commitsNextCommitteeHash = SHA3-256(CommitteeManifest(E + 1))and carries an unpruned PQEpochTerminalQC(>= 2,731 / 4,096shares ofP_E,~44.8 KiB=16.4 MB/yr), optionally compressed into one~57–90 KiBWHIR-SHA3-v1Epoch-Chain STARK (circuitId = 0x03).
- From
- Link 2 — Epoch
Eto TargetMomentum v4Header (~45.2 KiB):- Verify
MomentumPQQC(>= 2,731 / 4,096shares underCommitteeManifest(E)) overqcMsgbinding(ChainId, Epoch, Height, Momentum.Hash), authenticatingMomentum.StateRoot.
- Verify
- Link 3 —
Momentum.StateRootto Account / Contract Key (1.2 KB):- Verify the domain-separated
smt-v1([0x00]/[0x01]) Sparse Merkle inclusion or non-membership proof againstMomentum.StateRoot.
- Verify the domain-separated
3. Normative WHIR-SHA3-v1 L1 Verifier Contract (H02, H07, M02, M10, R4-04 Fix)
3.1 Pure FIPS 202 SHA3-256 Commitment & True 2^-128 QROM Budget (M10 + R4-04 Fix)
To uphold the strict invariant that L1 STARK soundness relies solely on NIST standard symmetric primitives (0 algebraic hash assumptions), WHIR-SHA3-v1 forbids Poseidon2, Rescue, or Monolith anywhere in L1-verified receipts:
- Trace & Folding Merkle Trees: 100%
FIPS 202 SHA3-256([0x00]leaf /[0x01]internal,32-bytedigests,128-bitGrover preimage margin). - Fiat-Shamir Transcript: Domain-separated
SHA3-256/SHAKE256sponge ("zenon-whir-sha3:v1"). - True
CMS19QROM Soundness Budget (R4-04Fix): Under Chiesa-Manohar-Spooner (CMS19), Fiat-Shamir compilation of a multi-round IOP into the Quantum Random Oracle Model incurs a2xbit-security halving on query + grinding rounds (kclassical bits ->k/2quantum bits). To achieve unconditional<= 2^-128QROM soundness:- Extension Field (
>= 256bits): Folding & sumcheck challenges live in a256-bitextension field (Goldilocks^4,p = 2^64 - 2^32 + 1, orKoalaBear^8,p = 2^31 - 2^24 + 1) so algebraic soundness error satisfieseps_alg <= 2^-256classical (<= 2^-128QROM). - WHIR Domain-Shift Query Schedule +
32-BitGrinding (224 + 32 = 256Classical Bits ->128QROM Bits): Outer $2^16$-row wrapper starts at rate $\rho_0 = 2^-4$ (1/16) with $2^4$-bundled coset leaves (tree depths[16, 15, 14], effective shift rates $\rho_0 = 2^-4, \rho_1 = 2^-7, \rho_2 = 2^-10$):- Conjectured list-decoding capacity (
1 - rho):[56, 32, 23] = 111total queries ->~56.7 KiBreceipt (~2,200Keccak permutations). - Unconditional Johnson proximity-gap bound (
1 - sqrt(rho)):[112, 64, 45] = 221total queries ->~86.2 KiBreceipt (~3,500Keccak permutations). - Paired with
32-bitFiat-Shamir PoW grinding (16QROM bits;< 0.12 son 1 GPU /~0.8 son 32c CPU), both regimes comfortably clear<= 2^-128QROM inside the90 KiBplanning /128 KiBhard cap!
- Conjectured list-decoding capacity (
- Extension Field (
3.2 Hard Resource Caps Inside internal/crypto/zkverify (H02, H07, M02, R4-04 Fix)
| Verifier Parameter | Normative Hard Cap (v4) | Rationale & R4-04 Cortex-A76 Verification |
|---|---|---|
proofAlgID | 0x10 (WHIR-SHA3-v1) | Explicit versioned L1 verifier dispatch |
MaxSingleProofWitnessBytes | 131,072 B (128 KiB) | Fits 56.7–86.2 KiB 2^-128 QROM proofs & 2.37M < 8.40M Plasma (H02) |
Standard SubmitBatch / PoKoS Target | 57–90 KiB (<= 92,160 B) | <= 0.737 Mbps per proof (2 proofs/s = <= 180 KiB/s < 256 KiB/s M02) |
MinGrindingBits | 32 bits (16 QROM bits) | Verified in 1 SHA3-256 hash by L1; +224b query = 256b classical (R4-04) |
MaxFoldingRounds | 6 | Bounds polynomial evaluation loop depth |
MaxTotalMerkleQueries | 256 | Fits unconditional Johnson [112, 64, 45] = 221 queries (R4-04) |
MaxSHA3KeccakPermutations | 8,000 (tightened from 45,000) | Pi 5 Cortex-A76 (ARMv8.2 w/o FEAT_SHA3, ~380 ns/perm): 45k took 17.1 ms; 8,000 caps worst-case at <= 3.5 ms (~0.85–1.35 ms typical; < 0.5 ms on Apple Silicon)! |
| Verifier Scratch Arena | 256 KiB pre-allocated/worker | 0 dynamic heap allocations (0 GC amplification DoS H07) |
Any receipt violating any cap above returns vmerr.ErrInvalidStarkProof in < 50 µs before executing folding rounds.
3.3 Five Public Inputs Verified Deterministically by SettlementContract (#13)
vkeyDigest[32]: RegisteredWHIR-SHA3-v1circuit commitment fromVerifierRegistry.preStateRoot[32]: Must equal the domain's currentpostStateRoot.postStateRoot[32]: Newsmt-v1domain root.inputChainValue[32]: Must equalSettlement's runningSHA3-256input chain atendOrdinal(plus verifieddaBlobCommitmentforDA_BATCHEDdomainsH03).batchOutputDigest[32]:SHA3-256(outboxRoot || assetFlowSummary || submitterAddress[20]).