Skip to main content

Layer 3: 3-Horizon Adapter, Disjoint-Commuting F1 == F0, MomentumPQQC Lifecycle & H_fork Scaling

60-Second TL;DR (ZNN-SPEC-PHASE1-v4): Reconciles ZDC-ZP1-HR-001 (H09, H15, M03, M05, B08) and Round-4 MomentumVM Supervisor Audit (R4-01, R4-02, R4-03, R4-07):

  1. Complete MomentumPQQC Formation & Single-Vote WAL Protocol (H09 fix): Pillars deterministically execute each coalesced 1.0 s Momentum v4 cut first, persist (Height, Momentum.Hash) to qc_wal (forbidding double-signing), and broadcast one 666 B FN-DSA-512 partial signature on /znn/dag/qc/v2 (0.65 Mbps framed TX)—verifying >= 2,731 / 4,096-share seal_qcs in 0.59 ms ideal / 0.9–1.4 ms realistic 4-core Go (M03 fix)!
  2. Exact Height-Indexed Migration Law Across Spork #11 (H_fork, H15 fix): Rescales pre-fork height-locked expirations via H_fork + 10 * (targetHeight - H_fork) and widens W_ack 10x with weighted pre-fork tick accounting.
  3. Disjoint-Footprint F1 == F0 Determinism + postPromoStore & InclusionContext (M05 + R4-02 + R4-03 fix): Reconstructs postPromoStore after Step-1 AuthRegistry promotion, passes (InclusionHeight, InclusionMomentumStore) into GenerateEmbeddedReceive, emits Version = 2 contract blocks post-Spork #10, and keeps ProofWitness in [0x11] outside Momentum.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_digest commits to (namespace, epoch, ordinal, prev_digest, ordered_vertex_ids, payload_batch_digests) while AccountBlock state patches exclude raw [0x11] ProofWitness bytes (32B WitnessCommitment is already bound inside AccountBlock.Data), so 14-day witness compaction never breaks 30-day Momentum.ChangesHash replay (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)​

  1. Coalesced 1.0 s Cadence + Post-Partition Monotonic Timestamp Rule (H09 Fix):
    • During normal operation (5 Hz stride = 5 Profile C-AS), 1 5-round wave commits every 1.0 s and projects a public Momentum v4 block whenever rawMedianSec >= parent.TimestampUnix + 1, where rawMedianSec = floor(StakeWeightedLowerMedian(Cut_Anchors.timestamp_unix_ms) / 1000).
    • Post-Partition Burst Rule (H09): If a prolonged asynchronous delay heals and commits K > 1 delayed wave cuts whose anchor median timestamps fall within the same second or <= parent.TimestampUnix, consecutive cuts sharing rawMedianSec <= parent.TimestampUnix coalesce into one Momentum v4 block (up to MaxBasePlasmaInMomentum = 8,400,000 and MaxProofWitnessBytesPerMomentum = 262,144), while any overflow cuts emit sequentially with TimestampUnix = max(parent.TimestampUnix + 1, rawMedianSec)—guaranteeing strictly increasing integer Unix seconds (TimestampUnix > parent.TimestampUnix, zero -38003 EVM Engine API errors and zero pipeline stalls!).
  2. Canonical Height-Indexed Migration Law at Spork #11 (H_fork, H15 Fix): When SporkBitMomentumMahiPQ activates at Momentum height H_fork (10.0 s v3 -> 1.0 s v4):
    • MomentumsPerEpoch: Scales 10x (8,640 -> 86,400 heights = 24 hours), with Epoch(H) for H >= H_fork computed as Epoch(H_fork) + floor((H - H_fork) / 86,400).
    • In-Flight Height-Locked Records (Stake, Spork, Pillar, Delayed Governance): During the deterministic H_fork transition crank, every active protocol record storing a future expirationHeight > H_fork or activationHeight > H_fork calibrated under 10 s ticks is atomically rewritten to H_fork + 10 * (oldTargetHeight - H_fork), preserving exact wall-clock duration to the second. (Unix-timestamp locks such as HtlcInfo.ExpirationTime and PtlcInfo.ExpirationTime are already in Unix seconds and require zero rescaling.)
    • MomentumAcknowledged Window (W_ack): Scales 10x (360 -> 3,600 virtual 1s ticks = 1 hour). Across H_fork, virtual tick distance is VirtualAge(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 before H_fork remain 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)​

  1. Deterministic Preimage: Once Momentum v4 at Height commits locally in Step 4 above, every active Pillar P_i in P_E computes:
    qcMsg = "zenon-mom-qc:v4" || be_u64(ChainId) || be_u64(Epoch) || be_u64(Height) || Momentum.Hash[32]
  2. Crash-Safe Single-Vote WAL (qc_wal.go) & Direct 1 Hz Broadcast:
    • P_i checks qc_wal at Height: if a different Momentum.Hash was ever signed at Height (impossible under deterministic execution unless storage was corrupted), P_i halts rather than double-signing (SlashQCEquivocation burns 100% of Pillar stake on two conflicting qcMsg signatures at the same Height!).
    • P_i persists (Height, Momentum.Hash) via fdatasync (1 sync/s) and unicasts QCVoteProto(epoch, height, momentum_hash, auth_idx, sig_666B) (~710 B) across the direct validator mesh /znn/dag/qc/v2 (0.647 Mbps framed TX/RX at N = 100, 1 Hz).
  3. Quorum Assembly & Non-Unique seal_qc Equivalence:
    • Upon verifying QCVoteProto shares summing to >= Q_vote = 2,731 / 4,096, every node writes MomentumPQQCProto (seal_qc, ~14 KiB at N=30 to ~44.8 KiB at N=100) to MomentumQCStore[Height].
    • Because honest validators sign at most one Momentum.Hash per Height and Byzantine validators hold <= 1,365 shares (2 * 2,731 - 4,096 = 1,366 > 1,365), no two conflicting Momentum.Hashes can ever obtain a valid MomentumPQQC at the same Height! Two peers holding different >= 2,731-share signer subsets certify the exact same Momentum.Hash.
    • Verification Latency (M03 Verified): 67 FN-DSA-512 signatures × 35 µs = 2.345 ms single-core -> 0.59 ms ideal 4-core (0.9–1.4 ms realistic Go worker pool on Pi 5)!
  4. Sync Gate & 14-Day Rolling Compaction (B08):
    • Syncing peers and light clients MUST verify a valid MomentumPQQC on the chain tip and on every EpochTerminalQC (Height mod 86,400 == 0). Sovereign Pi 5 nodes compact intermediate seal_qc records older than 14 days (1,209,600 heights), keeping permanent QC storage at 16.4 MB/year.

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)
}