Skip to main content

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." Reconciling ZDC-ZP1-HR-001 (H02, H07, H13, M02, M10) and Round-4 QROM, smt-v1, & Anchor Hardening (R4-04, R4-07, R4-09), Zenon Phase 1 v4 locks a 100% pure-SHA3-256 Proof-First verification surface:

  1. Domain-Separated smt-v1 ([0x00]/[0x01]) & Stateless Light-Client Chain (H13 + R4-07 + R4-09 fix): Enforces RFC-6962 [0x00] leaf / [0x01] internal domain separation + 32B sibling bitmap (1.2 KB proof), plus BitcoinAnchorHeight <= MaxPreCRQCBitcoinHeight on SunsetAnchorCheckpoint.
  2. True 2^-128 QROM WHIR-SHA3-v1 Profile (R4-04 fix): Eliminates BN254 pairings (PQ-03) and Poseidon2 algebraic hashes (M10), discharges the CMS19 quadratic QROM loss via 224-bit classical query security + 32-bit Fiat-Shamir PoW grinding + 256-bit extension field (57–86 KiB receipts, <= 128 KiB hard cap), and tightens MaxSHA3KeccakPermutations from 45,000 (17.1 ms on Cortex-A76!) down to 8,000 (<= 3.5 ms on Pi 5 Cortex-A76, < 0.5 ms on Apple Silicon) in a zero-alloc 256 KiB arena!
  3. Post-Quantum Signature Compression (M02 fix): One 57–90 KiB STARK batch proves 1,000+ ML-DSA-44 / FN-DSA-512 signatures (2.42 MB raw)—a 26.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 Momentum consensus forces every Sovereign Raspberry Pi 5 Pillar to re-execute heavy global VM workloads.

The Proof-First Separation of Duties (v4):

  1. Zenon L1 Owns Canonical Input Ordering & Asset Custody: Supports both L1_NATIVE forced/direct inputs (CallL2, Deposit) and DA_BATCHED high-throughput rollup batches anchored over Sentinel 2D AVID DA (H03).
  2. Off-Chain Executors Own Computation: Pillar-operated zeno-executor nodes execute the deterministic Rust zeno-stf state transition off-chain and generate a WHIR-SHA3-v1 STARK receipt.
  3. SettlementContract (#13) Owns Instant Validity Finality (S1): SubmitBatch verifies one <= 128 KiB proof (57–86 KiB analytical target) in ~1.2–3.5 ms pure Go on Cortex-A76 (< 0.5 ms on 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):

  1. Link 0 — Pre-CRQC SunsetAnchorCheckpoint + MaxPreCRQCBitcoinHeight (B11 + R4-09 Fix):
    • Phase 0 (2021) through Phase 1A headers were signed by classical Ed25519 Pillar keys (0 post-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 node common/params.go and anchored in Bitcoin's SHA-256d PoW chain (99-byte checkpoints) at BitcoinAnchorHeight <= MaxPreCRQCBitcoinHeight (R4-09).
    • Why MaxPreCRQCBitcoinHeight Is Essential (R4-09): After CRQC arrival, an attacker can break old Bitcoin secp256k1 keys to broadcast new Bitcoin transactions carrying spoofed 99-byte OP_RETURN payloads at heights > MaxPreCRQCBitcoinHeight, whereas rewriting a block at <= MaxPreCRQCBitcoinHeight requires inverting cumulative SHA-256d PoW (128-bit Grover secure)! Requiring BitcoinAnchorHeight <= MaxPreCRQCBitcoinHeight freezes 100% of classical 2021–Phase 1A history unconditionally (Gate ZP-Q25).
  2. Link 1 — Post-Sunset Committee Chain (16.4 MB/yr OR 57–90 KiB STARK):
    • From CommitteeHash_sunset (or Genesis pre-CRQC) forward, every EpochTerminalMomentum (Height mod 86,400 == 0) commits NextCommitteeHash = SHA3-256(CommitteeManifest(E + 1)) and carries an unpruned PQ EpochTerminalQC (>= 2,731 / 4,096 shares of P_E, ~44.8 KiB = 16.4 MB/yr), optionally compressed into one ~57–90 KiB WHIR-SHA3-v1 Epoch-Chain STARK (circuitId = 0x03).
  3. Link 2 — Epoch E to Target Momentum v4 Header (~45.2 KiB):
    • Verify MomentumPQQC (>= 2,731 / 4,096 shares under CommitteeManifest(E)) over qcMsg binding (ChainId, Epoch, Height, Momentum.Hash), authenticating Momentum.StateRoot.
  4. Link 3 — Momentum.StateRoot to Account / Contract Key (1.2 KB):
    • Verify the domain-separated smt-v1 ([0x00]/[0x01]) Sparse Merkle inclusion or non-membership proof against Momentum.StateRoot.

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-byte digests, 128-bit Grover preimage margin).
  • Fiat-Shamir Transcript: Domain-separated SHA3-256 / SHAKE256 sponge ("zenon-whir-sha3:v1").
  • True CMS19 QROM Soundness Budget (R4-04 Fix): Under Chiesa-Manohar-Spooner (CMS19), Fiat-Shamir compilation of a multi-round IOP into the Quantum Random Oracle Model incurs a 2x bit-security halving on query + grinding rounds (k classical bits -> k/2 quantum bits). To achieve unconditional <= 2^-128 QROM soundness:
    1. Extension Field (>= 256 bits): Folding & sumcheck challenges live in a 256-bit extension field (Goldilocks^4, p = 2^64 - 2^32 + 1, or KoalaBear^8, p = 2^31 - 2^24 + 1) so algebraic soundness error satisfies eps_alg <= 2^-256 classical (<= 2^-128 QROM).
    2. WHIR Domain-Shift Query Schedule + 32-Bit Grinding (224 + 32 = 256 Classical Bits -> 128 QROM 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] = 111 total queries -> ~56.7 KiB receipt (~2,200 Keccak permutations).
      • Unconditional Johnson proximity-gap bound (1 - sqrt(rho)): [112, 64, 45] = 221 total queries -> ~86.2 KiB receipt (~3,500 Keccak permutations).
      • Paired with 32-bit Fiat-Shamir PoW grinding (16 QROM bits; < 0.12 s on 1 GPU / ~0.8 s on 32c CPU), both regimes comfortably clear <= 2^-128 QROM inside the 90 KiB planning / 128 KiB hard cap!

3.2 Hard Resource Caps Inside internal/crypto/zkverify (H02, H07, M02, R4-04 Fix)​

Verifier ParameterNormative Hard Cap (v4)Rationale & R4-04 Cortex-A76 Verification
proofAlgID0x10 (WHIR-SHA3-v1)Explicit versioned L1 verifier dispatch
MaxSingleProofWitnessBytes131,072 B (128 KiB)Fits 56.7–86.2 KiB 2^-128 QROM proofs & 2.37M < 8.40M Plasma (H02)
Standard SubmitBatch / PoKoS Target57–90 KiB (<= 92,160 B)<= 0.737 Mbps per proof (2 proofs/s = <= 180 KiB/s < 256 KiB/s M02)
MinGrindingBits32 bits (16 QROM bits)Verified in 1 SHA3-256 hash by L1; +224b query = 256b classical (R4-04)
MaxFoldingRounds6Bounds polynomial evaluation loop depth
MaxTotalMerkleQueries256Fits unconditional Johnson [112, 64, 45] = 221 queries (R4-04)
MaxSHA3KeccakPermutations8,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 Arena256 KiB pre-allocated/worker0 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)​

  1. vkeyDigest[32]: Registered WHIR-SHA3-v1 circuit commitment from VerifierRegistry.
  2. preStateRoot[32]: Must equal the domain's current postStateRoot.
  3. postStateRoot[32]: New smt-v1 domain root.
  4. inputChainValue[32]: Must equal Settlement's running SHA3-256 input chain at endOrdinal (plus verified daBlobCommitment for DA_BATCHED domains H03).
  5. batchOutputDigest[32]: SHA3-256(outboxRoot || assetFlowSummary || submitterAddress[20]).