Skip to main content

Regime 4 Unbounded Edge Channels (ChannelContract #15): Adjudication State Machine, PQ SigLocks & HTLC Mesh

60-Second TL;DR (ZNN-SPEC-PHASE1-v4): Reconciling ZDC-ZP1-HR-001 (B06, B07, B09, M06, M07) and Round-4 ChannelContract Audit (R4-08), Regime 4 (d_channels / ChannelContract #15) delivers strictly unbounded global edge throughput (O(Active Channel Pairs)) with an airtight L1 dispute adjudication contract:

  • Throughput Decomposition (M06 fix): 20–100 sequential RTT updates/s per pair (10–50 ms WAN), 1,280–6,400 pipelined (W = 64) micro-payments/s per pair, and 0 Pillar/Sentinel bytes per off-chain hop (O(Active Pairs) unbounded global ceiling).
  • Valid Bech32 Address + Lockout-Free & Hostage-Free ChannelContract (#15) (R4-08 fix): Fixes the invalid v3 Bech32 checksum (...9n4k2p) to verified BIP-173 z1qxemdeddedxchannelxxxxxxxxxxxxxxr7xsx2 (01b3b6e5adcb4d8bf673cfcc6318c6318c6318c6), enables immediate in-CLOSING ClaimHTLC(channelId, preimage32) (RevealedPreimage survives ChallengeHigherNonce and never expires during finalizeAtHeight!), and decouples FinalizeBasePayouts from SettleHTLC so unsettled/withheld dust HTLCs can never freeze balance_a or balance_b!
  • Accurate Primitive Naming (B07 fix) & Exact 1,538 B Wire Vector (M07 fix): Renames PtlcContract types 3 & 4 to PQ Signature Locks (SigLockMLDSA44, SigLockFNDSA512) with recipient-bound redeem digests, designates SHA-256/SHA3-256 HTLCs as the normative multi-hop atomic lock, and fixes ZenonCommitStateProto at a constant 1,538 bytes.

1. Plain-English Walkthrough & Latency vs. Pipelining Math (M06 Fix)​

Exact Per-Pair vs. Network-Wide Edge Capacity (M06 Reconciled)​

  • Sequential Stop-and-Wait Mode (W = 1): Over a 10–50 ms WAN RTT, waiting for each countersignature before sending the next yields 20 – 100 sequential state transitions/s per pair (1,000+ /s on < 1 ms LAN/colocated links).
  • Pipelined Streaming Mode (W = 64 in-flight monotonic states, e.g., per-token AI billing): Achieves 1,280 – 6,400 micro-payments/s per pair over WAN, bounded locally only by dual FN-DSA-512 verification (~72 µs = ~13,800 states/s/core).
  • Global Edge Capacity: Across K independent pairs, global consensus load is 0 bytes/hop, so network-wide throughput scales as O(K) without any global ceiling.

2. Explicit Dispute Safety Model (B06 Fix) & PQ Lock Primitives (B07 Fix)​

2.1 Bounded-Partition Dispute Assumption (B06 Fix)​

While Zenon L1 consensus (Mahi-Mahi) is safe under arbitrary asynchrony (Delta = infinity), unilateral channel closure uses a finite L1 dispute window T_dispute (MinDisputeWindow = 86,400 Momentum v4 blocks = 24 hours). Therefore, unilateral dispute safety holds under the explicit assumption:

Delta_party_or_watchtower < T_dispute / 2 (i.e., < 12 hours max eclipse/offline window)

On Zenon Phase 1, feeless QSR Plasma + mandatory 10% D0 Pillar bypass + asynchronous DAG liveness eliminate mempool fee-spike / congestion pinning attacks, while optional Watchtower Delegation (ChallengeHigherNonce is callable by any third party without spending authority!) protects offline mobile users.

2.2 PQ Signature Locks (SigLock) vs. Multi-Hop Atomic HTLCs (B07 Fix)​

  1. Normative Multi-Hop Atomic Routing (SHA-256 / SHA3-256 HTLCs, M10 Entropy Rule):
    • Both on-chain HtlcContract and in-channel ChannelHTLCLeafs use 32-byte hashlocks H = SHA-256(r) where r MUST be sampled from a 256-bit CSPRNG (crypto/rand, never user-chosen passphrases M10), preserving 128-bit Grover security and 1:1 Bitcoin Lightning BOLT-11 compatibility.
    • (Optional Unlinkable PQ Multi-Hop Privacy: Routers wanting correlation-free hops without elliptic adaptors use H_i = SHA-256(r || hopSalt_i) paired with an off-chain WHIR-SHA3-v1 ZK-HTLC proof.)
  2. Conditional Single-Hop Escrow (PtlcContract Types 3 & 4 Renamed to SigLock, B07 + B12 Drain):
    • Types 3 (SigLockMLDSA44) and 4 (SigLockFNDSA512) are recipient-bound PQ Signature Locks (single-hop escrow, not scalar adaptors). Classical {0, 1, 2} types undergo a zero-stranded-funds two-step drain before Spork #14 (B12 — see PoKoS & Sunset §4).
    • Anti-Griefing Redeem Transcript (B07): Redeeming lockId requires sig under pk over SHA3-256("zenon-siglock-redeem:v2" || be_u64(ChainId) || GenesisHash[32] || lockId[32] || recipientAddress[20]) (92 B).

3. Normative ChannelContract (Embedded Contract #15) Adjudication State Machine (B09 + R4-08 Fix)​

SporkBitBitcoinAndEdge (Spork #13) activates ChannelContract (Embedded Contract #15) at verified BIP-173 Bech32 address z1qxemdeddedxchannelxxxxxxxxxxxxxxr7xsx2 (raw 20-byte embedded core 01b3b6e5adcb4d8bf673cfcc6318c6318c6318c6, replacing v3's malformed ...9n4k2p checksum R4-08) with five states (FUNDING -> OPEN -> CLOSING -> CLOSED | ABORTED) and strict conservation:

Invariant (Every State): remaining_base_a + remaining_base_b + remaining_htlc_sum == remaining_locked_total

Why ZNN-SPEC-PHASE1-v4 Decouples Preimage Reveal & Base Payouts (R4-08 Audit Fix)​

In v3, ClaimHTLC was blocked until H_inc >= finalizeAtHeight (>= 24h + 1h challenges), allowing a malicious sender to set leaf.expiryTs < finalizeAtHeight, trigger StartUnilateralClose, lock out ClaimHTLC until expiryTs passed, and steal forwarded funds via TimeoutHTLC! Furthermore, FinalizeClose required remaining_htlc_sum == 0 before releasing balance_a and balance_b, allowing an uncooperative party to freeze 99.99% of channel funds behind a single unsettled HTLC! v4 closes both bugs cleanly:

Method (ChannelContract #15)Guard Conditions & State Transition (B09 + R4-08 Closed)
1. OpenChannel (partyB, zts, amountA, disputeWindow, pkA_fndsa, pkB_fndsa)Requires disputeWindow >= 86,400 (24h), len(pkA) == 897, len(pkB) == 897. Escrows amountA. Single-funded (expectedAmountB == 0) enters OPEN; dual-funded enters FUNDING (fundingExpiry = H_inc + 3,600) after pre-signing sequence_nonce == 0 refund state (M07).
2. FundCounterparty (channelId, amountB)Callable in FUNDING before fundingExpiry (AbortFunding refunds amountA if partyB stalls). Escrows amountB, sets locked_total = amountA + amountB, transitions to OPEN.
3. CooperativeClose (channelId, balA, balB, sigA, sigB)Callable in OPEN or CLOSING (prior to FinalizeBasePayouts). Verifies balA + balB == locked_total (pending_htlc_sum == 0) and dual FN-DSA-512 sigs over "zenon-chan-coop:v2" || channelId || balA || balB. Credits balA, balB immediately; sets CLOSED.
4. StartUnilateralClose (stateBytes[1538])Callable in OPEN by partyA or partyB. Verifies dual FN-DSA-512 sigs over stateHash and balA + balB + pending_htlc_sum == locked_total, sets closingState = state, finalizeAtHeight = H_inc + disputeWindow, transitions to CLOSING.
5. ChallengeHigherNonce (stateBytes[1538])Callable in CLOSING by anyone (party or watchtower!) while H_inc < finalizeAtHeight. Requires valid dual FN-DSA-512 sigs AND new.sequence_nonce > closingState.sequence_nonce. Replaces closingState = new and sets finalizeAtHeight = max(finalizeAtHeight, H_inc + 3,600) (1h anti-snipe extension!).
6. ClaimHTLC (channelId, preimage32) (R4-08a Fix)Callable IMMEDIATELY in CLOSING (H_inc < finalizeAtHeight OR H_inc >= finalizeAtHeight) by anyone! Records RevealedPreimage[channelId][SHA-256(preimage32)] = (preimage32, Momentum.Timestamp) in contract state (<= 64 active HTLCs/channel). Survives ChallengeHigherNonce replacements so leaf.expiryTs can never lock out an honest router during the 24h+ dispute window!
7. FinalizeBasePayouts (channelId) (R4-08b Fix)Callable in CLOSING once H_inc >= finalizeAtHeight (basePaid == false) — DOES NOT wait for remaining_htlc_sum == 0! Immediately emits Embedded ContractSend payouts (closingState.balance_a, closingState.balance_b) (basePaid = true), and sets CLOSED if remaining_htlc_sum == 0.
8. SettleHTLC (channelId, leaf, merkleBranch) (R4-08 Fix)Callable in CLOSING once H_inc >= finalizeAtHeight for any unsettled leaf verified against closingState.htlc_merkle_root: if RevealedPreimage[channelId][leaf.hashLock] exists with revealedTs < leaf.expiryTs, pays leaf.amount to leaf.recipient; else if Momentum.Timestamp >= leaf.expiryTs, refunds leaf.amount to leaf.sender. Decrements remaining_htlc_sum; sets CLOSED when basePaid && remaining_htlc_sum == 0.

4. Exact 1,538-Byte Constant-Size ZenonCommitStateProto Wire Vector (M07 Verified)​

Using fixed64 integer tags eliminates variable-length varint drift across sequence_nonce in [0 .. 2^64 - 1], locking every signed channel state at exact 1,538 bytes:

syntax = "proto3";
package znn.edge.v2;

message ZenonCommitStateProto {
bytes channel_id = 1; // 1B tag + 1B len + 32B = 34 B
fixed64 sequence_nonce = 2; // 1B tag + 8B le_u64 = 9 B (0 = initial refund state!)
bytes token_standard = 3; // 1B tag + 1B len + 10B = 12 B
bytes balance_a = 4; // 1B tag + 1B len + 32B = 34 B
bytes balance_b = 5; // 1B tag + 1B len + 32B = 34 B
bytes pending_htlc_sum = 6; // 1B tag + 1B len + 32B = 34 B
bytes htlc_merkle_root = 7; // 1B tag + 1B len + 32B = 34 B ([32]byte{0} when sum == 0)
fixed64 dispute_window_momentums = 8; // 1B tag + 8B le_u64 = 9 B (>= 86,400)
// ---- State Body Subtotal: 200 B ----
bytes sig_party_a_fndsa = 9; // 1B tag + 2B len + 666B = 669 B
bytes sig_party_b_fndsa = 10; // 1B tag + 2B len + 666B = 669 B
// ==== Exact Wire Total: 1,538 B ====
}
  • stateHash Signed by Both Parties: SHA3-256("zenon-chan-state:v2" || be_u64(ChainId) || ProtobufBytes(fields 1..8)[200]) (32 B), fitting 10 full channel dispute proofs inside a single 16 KiB L1 AccountBlock.Data payload!