Regime 4 Unbounded Edge Channels (ChannelContract #15): Adjudication State Machine, PQ SigLocks & HTLC Mesh
60-Second TL;DR (
ZNN-SPEC-PHASE1-v4): ReconcilingZDC-ZP1-HR-001(B06, B07, B09, M06, M07) and Round-4ChannelContractAudit (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 (
M06fix):20–100sequential RTT updates/s per pair (10–50 msWAN),1,280–6,400pipelined (W = 64) micro-payments/s per pair, and0Pillar/Sentinel bytes per off-chain hop (O(Active Pairs)unbounded global ceiling).- Valid Bech32 Address + Lockout-Free & Hostage-Free
ChannelContract (#15)(R4-08fix): Fixes the invalidv3Bech32 checksum (...9n4k2p) to verified BIP-173z1qxemdeddedxchannelxxxxxxxxxxxxxxr7xsx2(01b3b6e5adcb4d8bf673cfcc6318c6318c6318c6), enables immediate in-CLOSINGClaimHTLC(channelId, preimage32)(RevealedPreimagesurvivesChallengeHigherNonceand never expires duringfinalizeAtHeight!), and decouplesFinalizeBasePayoutsfromSettleHTLCso unsettled/withheld dust HTLCs can never freezebalance_aorbalance_b!- Accurate Primitive Naming (
B07fix) & Exact1,538 BWire Vector (M07fix): RenamesPtlcContracttypes3&4to PQ Signature Locks (SigLockMLDSA44,SigLockFNDSA512) with recipient-bound redeem digests, designatesSHA-256/SHA3-256HTLCs as the normative multi-hop atomic lock, and fixesZenonCommitStateProtoat a constant1,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 a10–50 msWAN RTT, waiting for each countersignature before sending the next yields20 – 100sequential state transitions/s per pair (1,000+ /son< 1 msLAN/colocated links). - Pipelined Streaming Mode (
W = 64in-flight monotonic states, e.g., per-token AI billing): Achieves1,280 – 6,400micro-payments/s per pair over WAN, bounded locally only by dualFN-DSA-512verification (~72 µs=~13,800states/s/core). - Global Edge Capacity: Across
Kindependent pairs, global consensus load is0bytes/hop, so network-wide throughput scales asO(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)
- Normative Multi-Hop Atomic Routing (
SHA-256/SHA3-256HTLCs,M10Entropy Rule):- Both on-chain
HtlcContractand in-channelChannelHTLCLeafs use32-bytehashlocksH = SHA-256(r)whererMUST be sampled from a256-bitCSPRNG (crypto/rand, never user-chosen passphrasesM10), preserving128-bitGrover security and1:1Bitcoin LightningBOLT-11compatibility. - (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-chainWHIR-SHA3-v1ZK-HTLCproof.)
- Both on-chain
- Conditional Single-Hop Escrow (
PtlcContractTypes3&4Renamed toSigLock,B07+B12Drain):- Types
3(SigLockMLDSA44) and4(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 beforeSpork #14(B12— see PoKoS & Sunset §4). - Anti-Griefing Redeem Transcript (
B07): RedeeminglockIdrequiressigunderpkoverSHA3-256("zenon-siglock-redeem:v2" || be_u64(ChainId) || GenesisHash[32] || lockId[32] || recipientAddress[20])(92 B).
- Types
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 ====
}
stateHashSigned by Both Parties:SHA3-256("zenon-chan-state:v2" || be_u64(ChainId) || ProtobufBytes(fields 1..8)[200])(32 B), fitting10full channel dispute proofs inside a single16 KiBL1AccountBlock.Datapayload!