Skip to main content

Two-Lane Dynamic Plasma, Witness Pricing, Exact 0x1f → uint64 SporkMask & Monotonicity

60-Second TL;DR (ZNN-SPEC-PHASE1-v4): Reconciling ZDC-ZP1-HR-001 (H01, H02, H14, M02) and ZDC-QS-DEEZ-HR-001 (M02, M07), Zenon Phase 1 v4 (1) aligns pow.SporkMask bit indices byte-for-byte with go-zenon-v1/internal/pow/plasma.go:45-55's existing 5-bit 0x1f mask when widening uint8 → uint64 (M07 fix), (2) scopes the formal witness_plasma_monotonicity law accurately to fixed (algID, hasProofWitness) over TotalWitnessBytes >= 96 (M07 fix), and (3) enforces Two-Lane Momentum v4 (1.0 s) admission (8.4M BasePlasma + 256 KiB/s ProofWitness with PoKoS anti-starvation).


1. Exact 0x1f → uint64 SporkMask Bit Alignment (go-zenon-v1/internal/pow/plasma.go:48, M07 Fix)​

Direct inspection of go-zenon-v1/internal/pow/plasma.go:45-78 and internal/common/params.go:256-265 shows that params.ImplementedSporks lists 8 Phase 0 sporks, while pow.SporkMask currently assigns bits 0..4 (sporkMaskAll = 0x1f) to the 5 plasma-affecting Phase 0 sporks (Libp2p, EmbeddedRefund, and EpochRewardTerms do not occupy bits in 0x1f).

To preserve 100% backward-compatible bit positions with go-zenon-v1's existing NormalizeSporkMask and golden test vectors (M07 closed), widening type SporkMask uint8 to type SporkMask uint64 preserves bits 0..4 verbatim:

// Existing 5-bit Phase 0 pow.SporkMask (plasma.go:48-54, mask 0x1f — UNCHANGED!):
Bit 0 (1 << 0) : SporkBitAccelerator (Phase 0 active)
Bit 1 (1 << 1) : SporkBitBridgeAndLiquidity (Phase 0 active; implies Bit 0)
Bit 2 (1 << 2) : SporkBitHtlc (Phase 0 active; implies Bits 1, 0)
Bit 3 (1 << 3) : SporkBitDynamicPlasma (Activated in Phase 1.0!)
Bit 4 (1 << 4) : SporkBitPtlc (Phase 0 / 1.0)

// Non-pow Phase 0 Runtime Spork Flags (tracked in ChainSporkSet):
Bit 5 (1 << 5) : SporkBitLibp2p (Activated in Phase 1.0!)
Bit 6 (1 << 6) : SporkBitEmbeddedRefund (Phase 0 active)
Bit 7 (1 << 7) : SporkBitEpochRewardTerms (Phase 0 / 1.0)

// New Phase 1A-1E Spork Bits (Bits 8..13):
Bit 8 (1 << 8) : SporkBitStateRoot (#9 — Momentum v3 domain-separated smt-v1 StateRoot)
Bit 9 (1 << 9) : SporkBitPQAccounts (#10 — AccountBlock v2, 0x02 Addr, AuthRegistry #14, WitnessPlasma, PoKoS)
Bit 10 (1 << 10): SporkBitMomentumMahiPQ (#11 — 1.0s Momentum v4, Mahi-Mahi M=4,096, HashRand-PQ M_coin=256; implies 8, 9)
Bit 11 (1 << 11): SporkBitProofFirstZeno (#12 — SettlementContract #13 ZK_VALIDITY, 2^-128 QROM WHIR-SHA3-v1; implies 8, 9)
Bit 12 (1 << 12): SporkBitBitcoinAndEdge (#13 — d_btc SPV, SigLocks 3..4, ChannelContract #15; implies 11)
Bit 13 (1 << 13): SporkBitLegacyCryptoSunset (#14 — Enforced at H_inc! Disables v1, 0x00, 0x81, Bridge/Swap/PTLC ECC)

2. Stateless Post-Quantum, Equi-X & STARK WitnessPlasma Formula (H14, M02, M07)​

When SporkBitPQAccounts is active and block.Version >= 2 (for non-embedded senders !types.IsEmbeddedAddress(block.Address) after passing Stage-1 hard length validation M02):

CanonicalBasePlasma(block) = LegacyBasePlasma(block) + WitnessPlasma(block)

TotalWitnessBytes = len(block.PublicKey)
+ len(block.Signature)
+ len(block.ProofWitness)
+ len(block.EquiXSolution) // +16 B when Difficulty > 0 (H14)

ExcessWitnessBytes = max(0, TotalWitnessBytes - 96)
ABWitnessBytePlasma = 17 // Policy byte weight (1:4 SegWit-style ratio vs ABByteDataPlasma = 68; M02)

VerifyComputePlasma(algID, hasProofWitness):
SigVerifyPlasma:
0x00 (Ed25519, pre-sunset) -> 0
0x01 (ML-DSA-44) -> 2,100 (+1.0 QSR fusion unit)
0x02 (FN-DSA-512) -> 1,050 (+0.5 QSR fusion unit)
0x03 (SLH-DSA-SHAKE-128s) -> 42,000 (+20.0 QSR fusion units)
0x81 (Hybrid Ed+MLDSA44) -> 3,150 (+1.5 QSR fusion units, pre-sunset)
StarkVerifyPlasma (iff len(block.ProofWitness) > 0):
0x10 (WHIR-SHA3-v1 STARK) -> 52,500 (+25.0 QSR fusion units)

WitnessPlasma(block) = ExcessWitnessBytes * 17 + SigVerifyPlasma(algID) + StarkVerifyPlasma

Exact Formal Monotonicity Domain (M07 Fix)​

Because ExcessWitnessBytes = max(0, W - 96) has a baseline plateau on W in [0, 96] and different algIDs carry distinct SigVerifyPlasma compute surcharges, Lean law witness_plasma_monotonicity (Suite 15) is stated over its exact mathematical domain:

  1. Per-Suite Strict Byte Monotonicity: For any fixed (algID, hasProofWitness) and valid witness lengths W_2 > W_1 >= 96, WitnessPlasma(W_2) - WitnessPlasma(W_1) == 17 * (W_2 - W_1) > 0.
  2. Global Worst-Case Resource Bound: Independent of algID, every block in a Momentum satisfies TotalWitnessBytes <= 1,345 + 7,857 + 131,072 + 16 = 140,290 B and aggregate per-Momentum BasePlasma <= 8,400,000 + ProofWitness <= 262,144 B.

Resulting Feeless QSR Fusion & Client PoW Schedule (1.0x Base Price, FusedPlasma Mode)​

Transaction Workload (AccountBlock v2, EquiXSolution = 0 B)TotalWitnessBytesTotal CanonicalBase PlasmaEquivalent Fused QSR (2,100 plasma / QSR)Client Equi-X Target (+272 plasma)
FN-DSA-512 Repeat / Registered Tx667 B31,757~15.2 QSR~50 ms
FN-DSA-512 Unregistered First Reveal (0x02, H = 1)1,565 B47,023~22.4 QSR~75 ms
ML-DSA-44 Repeat / Registered Tx2,421 B62,625~29.9 QSR~100 ms
ML-DSA-44 Unregistered First Reveal (0x02, H = 1)3,734 B84,946~40.5 QSR~135 ms
SLH-DSA-SHAKE-128s Cold Vault Tx7,857 B194,937~92.9 QSR~310 ms
SubmitBatch / PoKoS (90 KiB = 92,160 B STARK + ML-DSA-44)94,581 B1,711,245~814.9 QSR (< 0.82 QSR/tx @ 1k txs)~2.4 s
SubmitBatch / PoKoS Max (128 KiB = 131,072 B STARK + ML-DSA-44)133,493 B2,372,749~1,129.9 QSR (< 8,400,000 cap H02!)~3.3 s

3. Two-Lane Momentum v4 (1.0 s) Admission Schedule (H01, H02)​

  1. Phase 1A (10.0 s Momentum v3): DefaultMaxBasePlasmaInMomentum = 16,800,000, MaxProofWitnessBytesPerMomentum = 524,288 (512 KiB / 10s), MaxSingleProofWitnessBytes = 131,072 (128 KiB).
  2. Phase 1B+ (1.0 s Momentum v4 Two-Lane Schedule):
    • Lane 1 (Aggregate Base Plasma): MaxBasePlasmaInMomentum = 8,400,000, FusedPlasmaTarget = 2,100,000, PowPlasmaTarget = 2,100,000 (132 FN-DSA-512 / 67 ML-DSA-44 blocks/s at 1.0x, 264 / 134 blocks/s burst).
    • Lane 2 (Prunable ProofWitness Byte Budget): MaxProofWitnessBytesPerMomentum = 262,144 (256 KiB/s), MaxSingleProofWitnessBytes = 131,072 (128 KiB), 1 slot/s reserved for AuthRegistry.RescueWithPoKoS whenever PoKoS mempool queue is non-empty.
    • Damping Step: PriceChangeDenominator = 200 (~200 s exponential price response).