Layer 3: 3-Horizon Adapter, Disjoint-Commuting F1 == F0, MomentumPQQC Lifecycle & H_fork Scaling
60-Second TL;DR (
ZNN-SPEC-PHASE1-v4): ReconcilesZDC-ZP1-HR-001(H09, H15, M03, M05, B08) and Round-4MomentumVMSupervisor Audit (R4-01, R4-02, R4-03, R4-07):
- Complete
MomentumPQQCFormation & Single-Vote WAL Protocol (H09fix): Pillars deterministically execute each coalesced1.0 sMomentum v4cut first, persist(Height, Momentum.Hash)toqc_wal(forbidding double-signing), and broadcast one666 BFN-DSA-512partial signature on/znn/dag/qc/v2(0.65 Mbpsframed TX)—verifying>= 2,731 / 4,096-shareseal_qcs in0.59 msideal /0.9–1.4 msrealistic 4-core Go (M03fix)!- Exact Height-Indexed Migration Law Across
Spork #11(H_fork,H15fix): Rescales pre-fork height-locked expirations viaH_fork + 10 * (targetHeight - H_fork)and widensW_ack10xwith weighted pre-fork tick accounting.- Disjoint-Footprint
F1 == F0Determinism +postPromoStore&InclusionContext(M05+R4-02+R4-03fix): ReconstructspostPromoStoreafter Step-1AuthRegistrypromotion, passes(InclusionHeight, InclusionMomentumStore)intoGenerateEmbeddedReceive, emitsVersion = 2contract blocks post-Spork #10, and keepsProofWitnessin[0x11]outsideMomentum.ChangesHash(R4-07).
1. Three-Horizon Crash-Safe Adapter Contract (ZDC-MM-ER-01 §3.2–3.8)
go-zenon-v1 connects consensus to MomentumVM exclusively through five deterministic adapter methods:
1. ingest(native_bytes) // Durable WAL intake; continues safely during execution backpressure
2. native_progress() // Emits committed LEDGER cuts in deterministic wave/anchor order
3. derive_next(state, cursor) // Pure function -> CanonicalOutputUnit | PENDING(missing_deps)
4. drain_prefix() // Stages contiguous LEDGER units past durable_executed_ordinal
5. ack_persisted(cursor, digest) // Called ONLY after atomic Pebble WriteBatch(Sync: true)!
- Witness-Excluded Semantic Digest (
HR-12+R4-07):unit_semantic_digestcommits to(namespace, epoch, ordinal, prev_digest, ordered_vertex_ids, payload_batch_digests)whileAccountBlockstate patches exclude raw[0x11]ProofWitnessbytes (32BWitnessCommitmentis already bound insideAccountBlock.Data), so14-day witness compaction never breaks30-dayMomentum.ChangesHashreplay (R4-07). - Three-Horizon Atomic Persistence (
H03, HR-01):ordered_ordinal >= staged_ordinal >= durable_executed_ordinal.
2. 1.0 s Momentum v4 Coalescing, Async Burst Recovery & H_fork Migration (H09, H15 Fix)
- Coalesced
1.0 sCadence + Post-Partition Monotonic Timestamp Rule (H09Fix):- During normal operation (
5 Hzstride = 5Profile C-AS),15-round wave commits every1.0 sand projects a publicMomentum v4block wheneverrawMedianSec >= parent.TimestampUnix + 1, whererawMedianSec = floor(StakeWeightedLowerMedian(Cut_Anchors.timestamp_unix_ms) / 1000). - Post-Partition Burst Rule (
H09): If a prolonged asynchronous delay heals and commitsK > 1delayed wave cuts whose anchor median timestamps fall within the same second or<= parent.TimestampUnix, consecutive cuts sharingrawMedianSec <= parent.TimestampUnixcoalesce into oneMomentum v4block (up toMaxBasePlasmaInMomentum = 8,400,000andMaxProofWitnessBytesPerMomentum = 262,144), while any overflow cuts emit sequentially withTimestampUnix = max(parent.TimestampUnix + 1, rawMedianSec)—guaranteeing strictly increasing integer Unix seconds (TimestampUnix > parent.TimestampUnix, zero-38003EVM Engine API errors and zero pipeline stalls!).
- During normal operation (
- Canonical Height-Indexed Migration Law at
Spork #11(H_fork,H15Fix): WhenSporkBitMomentumMahiPQactivates atMomentumheightH_fork(10.0 sv3->1.0 sv4):MomentumsPerEpoch: Scales10x(8,640 -> 86,400heights =24 hours), withEpoch(H)forH >= H_forkcomputed asEpoch(H_fork) + floor((H - H_fork) / 86,400).- In-Flight Height-Locked Records (
Stake,Spork,Pillar, Delayed Governance): During the deterministicH_forktransition crank, every active protocol record storing a futureexpirationHeight > H_forkoractivationHeight > H_forkcalibrated under10 sticks is atomically rewritten toH_fork + 10 * (oldTargetHeight - H_fork), preserving exact wall-clock duration to the second. (Unix-timestamp locks such asHtlcInfo.ExpirationTimeandPtlcInfo.ExpirationTimeare already in Unix seconds and require zero rescaling.) MomentumAcknowledgedWindow (W_ack): Scales10x(360 -> 3,600virtual1sticks =1 hour). AcrossH_fork, virtual tick distance isVirtualAge(H_inc, H_ack) = (H_inc - max(H_ack, H_fork)) + 10 * max(0, H_fork - H_ack) <= 3,600, ensuring user transactions signed immediately beforeH_forkremain valid across the spork boundary!
3. Disjoint-Commuting F1 == F0 Execution & Post-Execution MomentumPQQC Protocol (H09, M03, M05, R4-03 Fix)
3.1 Algorithm 1: Serial-Equivalent ProjectVirtualMomentum (M05 + R4-02 + R4-03 Fix)
ALGORITHM 1: ProjectVirtualMomentum(parentStore, coalescedUnits[], nextHeight) -> DetailedMomentum (v4)
-------------------------------------------------------------------------------------------------------
1. PROMOTE AUTH REGISTRY, REFRESH STORE & SUB-DAG AUTHOR BITMAP (R4-03 Landmine #8):
Promote AuthRegistry (#14) pendingRecords with pendingEffectiveHeight <= nextHeight (B05) inside
momOverlay, then construct postPromoStore = newMomentumStore(momOverlay) so all Stage-2/3 reads
observe newly promoted keys! Compute SubDAG-only non-equivocating authorBits (C06).
2. DEDUPLICATE, TWO-LANE ADMISSION & CONTIGUITY FILTER:
Extract possessed L1 WorkerBatches in SubDAG order; keep first b per (b.Address, b.Height)
unconfirmed in postPromoStore with VirtualAge <= 3,600; enforce Lane-1 (<= 8,400,000 BasePlasma)
and Lane-2 (<= 262,144 ProofWitness bytes, 1 slot reserved for non-empty PoKoS queue H02).
3. DISJOINT-COMMUTING PARALLEL EXECUTION (F1 == F0 CONTRACT — CLOSES M05 + R4-03 Landmines #9, #10):
a) Reference Oracle F0 Order: Build causal graph (h -> h+1 and Send -> Receive) and define the
unique deterministic topological sequence Seq_F0 by popping ReadyQueue in canonical 60-byte
AccountHeader.Bytes() lexicographic min-heap order.
b) Parallel Engine F1:
- Stage 2 (Stateless Preverify): Verify all BoundSigningDigest PQ signatures (R4-01), Equi-X
solutions, WitnessPlasma, and WHIR-SHA3-v1 STARK proofs (<= 8,000 Keccak perms, <= 3.5 ms R4-04)
across GOMAXPROCS workers (100% read-only against postPromoStore).
- Stage 3a (Disjoint User Stripes): Partition user blocks in Seq_F0 by 256 Address stripes;
each worker executes blocks for its assigned Address accounts strictly in per-account height
order against isolated per-account AccountStore forks (zero cross-account / AuthRegistry writes!).
- Stage 3b (Canonical Patch Fold & Sequential Embedded Contracts): Apply per-account patches
and execute ALL Embedded Contract (#1..#15) ContractReceive + Update cranks strictly in
single-threaded Seq_F0 order, passing (InclusionHeight = nextHeight, InclusionMomentumStore)
into GenerateEmbeddedReceive (R4-03 #9) and setting generated ContractReceive/ContractSend
AccountBlock.Version = 2 whenever Spork #10 is active (R4-03 #10)! (For Phase 1A v3 Momentums,
post-content producer/PTLC Ed25519 reveals update AuthRegistry[0x03] AFTER m.Content R4-02.)
4. ATOMIC PEBBLE COMMIT (R4-07):
Assemble Momentum v4 (Hash computed WITHOUT seal_qc), write witness-stripped AccountBlocks +
StatePatch + smt-v1 NodeTree + sidecar [0x11] ProofWitness records + durable_executed_ordinal in
ONE pebble.Batch(Sync: true) BEFORE calling adapter.ack_persisted()!
3.2 Normative MomentumPQQC Signing, Aggregation & Pruning Lifecycle (H09, M03, B08 Fix)
- Deterministic Preimage: Once
Momentum v4atHeightcommits locally in Step 4 above, every active PillarP_i in P_Ecomputes:qcMsg = "zenon-mom-qc:v4" || be_u64(ChainId) || be_u64(Epoch) || be_u64(Height) || Momentum.Hash[32] - Crash-Safe Single-Vote WAL (
qc_wal.go) & Direct1 HzBroadcast:P_ichecksqc_walatHeight: if a differentMomentum.Hashwas ever signed atHeight(impossible under deterministic execution unless storage was corrupted),P_ihalts rather than double-signing (SlashQCEquivocationburns100%of Pillar stake on two conflictingqcMsgsignatures at the sameHeight!).P_ipersists(Height, Momentum.Hash)viafdatasync(1sync/s) and unicastsQCVoteProto(epoch, height, momentum_hash, auth_idx, sig_666B)(~710 B) across the direct validator mesh/znn/dag/qc/v2(0.647 Mbpsframed TX/RX atN = 100, 1 Hz).
- Quorum Assembly & Non-Unique
seal_qcEquivalence:- Upon verifying
QCVoteProtoshares summing to>= Q_vote = 2,731 / 4,096, every node writesMomentumPQQCProto(seal_qc,~14 KiBatN=30to~44.8 KiBatN=100) toMomentumQCStore[Height]. - Because honest validators sign at most one
Momentum.HashperHeightand Byzantine validators hold<= 1,365shares (2 * 2,731 - 4,096 = 1,366 > 1,365), no two conflictingMomentum.Hashes can ever obtain a validMomentumPQQCat the sameHeight! Two peers holding different>= 2,731-share signer subsets certify the exact sameMomentum.Hash. - Verification Latency (
M03Verified):67FN-DSA-512signatures ×35 µs=2.345 mssingle-core ->0.59 msideal 4-core (0.9–1.4 msrealistic Go worker pool on Pi 5)!
- Upon verifying
- Sync Gate &
14-Day Rolling Compaction (B08):- Syncing peers and light clients MUST verify a valid
MomentumPQQCon the chain tip and on everyEpochTerminalQC(Height mod 86,400 == 0). Sovereign Pi 5 nodes compact intermediateseal_qcrecords older than14days (1,209,600heights), keeping permanent QC storage at16.4 MB/year.
- Syncing peers and light clients MUST verify a valid
4. Exact Post-Quantum MomentumProto Schema (v3 & v4)
message MomentumPQQCProto {
uint64 epoch = 1;
uint32 sig_alg_id = 2; // 0x02 = FN-DSA-512 (default) or 0x04 = XMSS-SHAKE_22_256
bytes signer_bitmap = 3; // Active P_E bitset (>= Q_vote = 2,731 / 4,096 shares)
repeated bytes raw_signatures = 4; // Ordered 666B FN-DSA-512 (or 2,884B XMSS) sigs over qcMsg
}
message MomentumProto {
uint64 version = 1; // 1=Origin, 2=DynamicPlasma, 3=StateRootSpork, 4=MomentumMahiPQSpork
uint64 chain_identifier = 2;
HashProto hash = 3;
HashProto previous_hash = 4;
uint64 height = 5;
uint64 timestamp = 6; // Strict integer Unix seconds (ZVM Paris Engine API safe)
bytes data = 7;
repeated AccountHeaderProto content = 8;
HashProto changes_hash = 9;
bytes public_key = 10; // Used in v1..v3 (supports [algID] || PQPubKey in Phase 1A); empty in v4
bytes signature = 11; // Used in v1..v3 (BoundSigningDigest [algID] || PQSig R4-01); empty in v4
uint64 next_fusion_price = 12;
uint64 next_work_price = 13;
// Version >= 3 (Phase 1A+ — Domain-Separated smt-v1 SHA3-256 Sparse Merkle Root R4-07):
HashProto state_root = 14;
// Version == 4 (Phase 1B+ — Post-Quantum Momentum-Mahi Meta-DAG Projection):
uint64 dag_epoch = 15;
uint64 terminal_unit_ordinal = 16;
HashProto unit_semantic_digest = 17; // Witness-excluded cut digest (HR-12)
bytes author_bitmap = 18; // SubDAG-only participating Pillars (C06)
MomentumPQQCProto seal_qc = 19; // Excluded from ComputeHash(); 0.9-1.4 ms realistic 4c verify (M03)
}