AccountBlock v2, Non-Separable boundDigest32, H_inc Sunset & [0x11] Witness Sidecars
60-Second TL;DR (
ZNN-SPEC-PHASE1-v4): ActivateAccountBlock.Version = 2underPQAccountsSpork(Spork #10) while keeping the exact306-byteAccountBlock.ComputeHash()preimage unchanged! ReconcilingZDC-QS-DEEZ-HR-001and the Round-4 Independent Cryptographic & Source Audit (R4-01, R4-03, R4-07),v4:
- Closes
0x81 <-> 0x00Hybrid Stripping & Key-Splicing Ransomware (R4-01fix): Binds[algID] || SHA3-256(resolvedPubKeyWire)inside everyv2signature (boundDigest32) and forbids0x81on unregistered0x00Path-C first reveals!- Enforces
Spork #14Strictly atInclusionMomentumHeight(H_inc) Across User AND Embedded Blocks (B02, R4-03fix): OverridesGenerateEmbeddedReceive'stargetMArewind for sunset/auth checks and upgrades embeddedContractReceive/ContractSendblocks toVersion = 2.- Length-Framed
PreverifyAuthTuple& Witness-Aware Gossip Dedup (M01, C03fix): Usesu32length-prefixedWitnessDigestand(block.Hash, WitnessDigest)P2P deduplication so corrupted witnesses never poison valid transactions.- Witness-Separated
[0x11]Storage for14-Day Compaction (R4-07fix): Storesv2raw witness bytes in Pebble[0x11] || blockHash[32]outsideMomentum.ChangesHash, allowing14-day witness pruning without breaking30-day native block sync!
1. Exact 306-Byte AccountBlock.ComputeHash() Preimage, Equi-X & boundDigest32 (H14, R4-01)
(Note M12: Setting Version = 2 changes bytes 0..8 of the 306-byte preimage for new v2 blocks—preventing cross-version hash collisions—while historical Version = 1 blocks keep their exact original hashes forever!)
Bytes 0..8 : be_u64(Version) // 1 (legacy) or 2 (post-PQAccountsSpork)
Bytes 8..16 : be_u64(ChainIdentifier) // 1 on Alphanet
Bytes 16..24 : be_u64(BlockType) // 1..5
Bytes 24..56 : PreviousHash[32]
Bytes 56..64 : be_u64(Height)
Bytes 64..104 : MomentumAcknowledged[40] // Hash[32] || be_u64(Height)
Bytes 104..124 : Address[20] // Must be 0x00, 0x01 (embedded), or 0x02 (M12 allowlist!)
Bytes 124..144 : ToAddress[20]
Bytes 144..176 : Amount[32]
Bytes 176..186 : TokenStandard[10]
Bytes 186..218 : FromBlockHash[32]
Bytes 218..250 : SHA3_256(DescendantHashes)[32]
Bytes 250..282 : SHA3_256(Data)[32]
Bytes 282..290 : be_u64(FusedPlasma)
Bytes 290..298 : be_u64(Difficulty)
Bytes 298..306 : Nonce[8] // STRICTLY EquiXSalt[8] when Version >= 2 & Difficulty > 0!
- Non-Separable Key- & Algorithm-Bound Signing Digest (
boundDigest32,R4-01Fix): BecauseAccountBlock.ComputeHash()excludesPublicKeyandSignature, signing rawblock.Hash[:]would leavealgIDand hybrid partner keys unbound—allowing a P2P attacker to strip0x81 -> 0x00or splice an attackerML-DSA-44key onto an uncached0x00reveal (0x00 -> 0x81ransomware). EveryVersion == 2block signs:boundDigest32 = FIPS202_SHA3_256("zenon-ab:v2" || [0x00] || [algID] || FIPS202_SHA3_256(resolvedPubKeyWire)[32] || block.Hash[32]) - Two-Stage
Equi-X([E5]) Verification (Difficulty > 0onVersion == 2):C = SHA3-256("zenon-equix:v2" || be_u64(ChainId) || Address[20] || PreviousHash[32] || Nonce[8]).EquiXVerify(C, EquiXSolution[16]) == trueANDuint128(be_u64(SHA3-256("zenon-equix-effort:v2" || C || EquiXSolution[16])[0:8])) * uint128(max(1, Difficulty >> 16)) <= 2^64 - 1.
2. Era-Separated InclusionMomentumHeight (H_inc) Policy vs. MomentumAcknowledged (B02, R4-03 Fix)
In go-zenon-v1/internal/vm/verifier/momentum.go:415 and internal/vm/supervisor/vm.go:684, Phase 0 evaluates spork masks at blk.MomentumAcknowledged.Height. Evaluating LegacyCryptoSunsetSpork (Spork #14) at H_ack would leave a 1-hour (W_ack) post-sunset Ed25519 / secp256k1 bypass on both user blocks (DEEZ-B02) and embedded ContractReceive blocks (R4-03)!
Normative v4 Dual-Height Evaluation Law (B02 + R4-03 Closed):
- Authentication & Sunset Policy (
Evaluated Strictly at InclusionMomentumHeight = H_inc):- Whether
Version == 2is permitted (H_inc >= H_spork10), whichActiveKeygovernsblock.Address(postPromoStoreatH_inc), whether classical/hybrid user suites{Version == 1, algID == 0x00, algID == 0x81}are forbidden (H_inc >= H_sunset), and whether classical embedded-contract methods (Bridge,Swap,Pillar.RegisterLegacy,PTLC {0..2}) are disabled insideApplySendandGenerateEmbeddedReceiveare ALWAYS evaluated atH_inc—NEVER atblock.MomentumAcknowledged.Height! - Post-
Spork #10, embeddedContractReceive(AutoReceiver) andContractSenddescendants/refunds (vm.go:758, 813) emitVersion = 2soSpork #14'sVersion == 2rule never blocks embedded execution (R4-03).
- Whether
- Data-Payload Plasma & Recency (
MomentumAcknowledgedPreserved Where Safe):IsCanonical(block.MomentumAcknowledged),VirtualAge(H_inc, H_ack) <= W_ack,SequencerfrontConfHeight <= H_ack, and Phase 0 embedded cross-account snapshot reads retain Zenon's source-native rules unchanged.
3. Zero-Copy Wire Admission (M02), PreverifyAuthTuple (M01, C03) & 3-Path producer() (R4-01)
3.1 Zero-Copy Frame Bounds & Stage-1 Witness Caps (M02 Verified)
Both go-zenon-v1 (proto.ConsumeBytes, rlp.readKind within MaxMsgSize = 10 MiB P2P / MaxHTTPBodySize = 5 MiB RPC) and zenon-rs (zenon_common::protowire) validate length prefixes against remaining frame bytes before any buffer allocation (preserving MaxDescendantDepth = 10,000 on ContractReceive and multi-tx TxMsg lists!). Immediately after zero-copy slice decode, Stage 1 enforces exact per-algID witness ceilings:
len(PublicKeyWire) in {0, 33, 898, 1313, 1345}(matched exact toPublicKeyWire[0]when non-empty).len(SignatureWire) in {0, 65, 667, 2421, 2485, 7857}(0only for0x01embedded senders; matched exact toSignatureWire[0]).len(ProofWitness) == 0unlessToAddress in {SettlementContract, AuthRegistryContract}ANDlen(ProofWitness) <= 131,072(128 KiB).len(EquiXSolution) in {0, 16}(16iffDifficulty > 0).- Peers delivering malformed witness lengths or failing Stage-2 crypto checks accrue
InvalidWitnessPenaltypoints ininternal/protocol/budget.gobefore touching VM locks.
3.2 Length-Framed PreverifyAuthTuple & Witness-Aware Gossip Dedup (M01, C03 Fix)
Updating go-zenon-v1/internal/vm/verifier/account_block.go:45, a cached Stage-2 PreverifiedBlock verdict is valid at Momentum H_inc if and only if every field of the 8-tuple below matches the post-promotion state at H_inc:
WitnessCommitment := SHA3_256(LP(PublicKeyWire) || LP(SignatureWire) || LP(ProofWitness) || LP(EquiXSolution))[32]
// where LP(x) = be_u32(len(x)) || x (unambiguous length framing)
PreverifyAuthTuple := (
GenesisMomentumHash[32],
ChainIdentifier,
block.Hash[32],
ResolvedAlgID, // 0x01, 0x02, 0x03 (or 0x00, 0x81 pre-sunset)
ResolvedPubKeyHash[32], // SHA3-256(ActivePublicKeyWire) post-Step-0 promotion at H_inc
AuthRotationNonce, // authState.rotationNonce post-Step-0 promotion at H_inc
IsLegacySunsetActive(H_inc), // H_inc >= H_sunset
WitnessCommitment[32]
)
P2P TxMsg gossip deduplication keys on (block.Hash, WitnessCommitment) rather than block.Hash alone so an attacker relaying a corrupted-witness copy of block.Hash is penalized without suppressing the legitimate block (C03).
3.3 Updated accountBlockVerifier.producer() Resolution (account_block.go:1192, B03, R4-01 Fix)
- Path A (
AuthRegistryactiveRecordPresent — rotated0x00,PoKoS-rescued0x00,PrecommitKey0x02, rotated0x02):- Require
Version == 2andlen(block.PublicKey) == 0(ErrABPublicKeyMustBeCached), resolveActiveKey = [activeAlgId] || authState.activePublicKey, verifyboundDigest32signature, and skipPubKeyToAddress.
- Require
- Path B (
AccountStore[0x09]Populated — repeat blocks on unrotated0x02orv2-cached0x00):- Require
Version == 2,len(block.PublicKey) == 0, resolveActiveKey = AccountStore[0x09], and verifyboundDigest32signature.
- Require
- Path C (
First Reveal— uncached & unregistered inAuthRegistry):- Require
len(block.PublicKey) > 0; - If
block.Address[0] == 0x02: allowalgID in {0x01, 0x02, 0x03}(plus0x81pre-sunset), assertDerivePQAddress(algID, rawPub) == block.Address; - If
block.Address[0] == 0x00(pre-sunset only!): requirealgID == 0x00(0x81FORBIDDEN on0x00Path CR4-01!) and assertPubKeyToAddress(rawPub) == block.Address; - Persist
block.PublicKeytoAccountStore[0x09](and for0x00Path-C reveals whenSporkBitPQAccountsis active and[0x0a]is empty, persistAccountStore[0x0a] = edPub32).
- Require
4. [0x11] Witness Sidecar Separation & 14-Day Compaction (N01, B08, R4-07 Fix)
- Key-Omission Byte Savings (
N01): CachingPublicKeyWiresaves1,313 BonML-DSA-44(35.16%of witness,32.50%of full4,040 Bblock) and898 BonFN-DSA-512(57.38%of witness,48.00%of full1,871 Bblock). ChangesHash-Safe Witness Compaction (R4-07Fix): In Phase 0,[0x03]||addr||[0x02]||be_u64(h)insideMomentum.ChangesHashstored fullSerializeProtobytes including witnesses. ForVersion == 2blocks,[0x02]stores the witness-stripped canonical body +32BWitnessCommitment, while raw witness bytes(PublicKey, Signature, ProofWitness, EquiXSolution)are stored in Pebble namespace[0x11] || blockHash[32](outsideMomentumChanges). Compacting[0x11]witnesses older than14days (EpochTerminalQC-finalized) keepsMomentum.ChangesHash100% verifiable across the entire30-day rolling native block window (<= 450 GBNVMe)!