v1 (v3.0.0-rfc) · archived baseline · superseded
Part 3: Stage 0 Non-Custodial PTLC/HTLC Swaps, Stage 1A Sovereign Rollup STF & Feeless Zenon Rails, and Stage 1B clArk Coordination
Showing word-highlighted redline changes from archived v0 (v2.5.0-rfc) to v1 (v3.0.0-rfc). For structured finding-by-finding rationale, see theChangelog.
| @@ -1,183 +1,128 @@ | |||
| 1 | - | # Part 3: Settlement Contract, Atomic Treasury `zBTC`, Plasma & Peg-Free Rails | |
| 2 | - | ||
| 3 | - | **Document Class:** Normative L1 Settlement, Tokenomics & Peg-Free Application Specification (`v2.5.0-rfc`) | |
| 4 | - | **Upstream Baselines:** `Project Zeno/spec/SPEC.md` v1.6.0, `GENERALIZED-AUTHORIZATION-BRIDGE-FRAMEWORK.md` v0.3.2, `MINTED Settlement Extension` v0.1.1 (subject to Upstream Amendments in [`SPEC.md §6`](../SPEC.md#L110-L122)), `go-zenon` `origin/release/0.0.11-rc1` (`f19955f`) / `origin/dev` (`770e893`) | |
| 5 | - | **Contract Address:** `SettlementContract` ([`spec/05 §5.1`](./05-go-zenon-upgrade-plan.md#L68-L72)) | |
| 6 | - | **Numeric Oracle:** [`scripts/verify_spec_bounds.py`](../scripts/verify_spec_bounds.py). | |
| 7 | - | ||
| 8 | - | --- | |
| 9 | - | ||
| 10 | - | ## 1. Atomic Treasury Pre-Mint Issuance Model (Resolving C-11, R2-M2, R3-L11, A-MINT-1) | |
| 11 | - | ||
| 12 | - | In `go-zenon` `release/dev`, embedded contracts execute inside per-account `AccountVmContext`s (`vm/vm_context/interfaces.go:12-37`), committed peer storage is read-only (`chain/store/momentum.go:51`), `dev:vm/vm.go:204-226` requires embedded→embedded `ContractSend`s to target a valid ABI method (data-less sends like `dev:vm/embedded/implementation/token.go:163-172` fail `applySend`), and `TokenContract.Burn` permits `Owner` to burn even when `IsBurnable == false` (`dev:vm/embedded/implementation/token.go:330`). | |
| 1 | + | # Part 3: Stage 0 Non-Custodial PTLC/HTLC Swaps, Stage 1A Sovereign Rollup STF & Feeless Zenon Rails, and Stage 1B `clArk` Coordination | |
| 13 | 2 | ||
| 14 | - | 1. **Step 1 — `SettlementContract.InitiateMintedToken("ZenonBitcoin", "zBTC", domain, 8, 21_000_000*10^8)`** (Governance, attaches `1 ZNN`): | |
| 15 | - | - Emits descendant `ContractSend` (`1 ZNN`) calling `TokenContract.IssueMinted(...)`. | |
| 16 | - | - `TokenContract.IssueMinted` requires `sendBlock.Address == types.SettlementContract`, exempts `checkToken` regexes (`dev:vm/embedded/implementation/token.go:40,43`) ONLY for this method, sets `TotalSupply = MaxSupply = 21M*10^8`, `IsMintable = false`, `IsBurnable = false`, `Owner = types.SettlementContract`, and emits descendant `ContractSend` with `Data = ABISettlement.PackMethod("ReceiveTreasury")`. | |
| 17 | - | - **`SettlementContract.ReceiveTreasury()`**: Enforces `sendBlock.Address == types.TokenContract`, `TreasuryInitialized == 0` (single-use), `sendBlock.Amount == 21_000_000 * 10^8`, and stores immutable `TreasuryZts = sendBlock.TokenStandard` + `TreasuryInitialized = 1`. | |
| 18 | - | - **Sealing `TokenContract`**: `TokenContract.UpdateToken` AND `TokenContract.Burn` reject if `tokenInfo.Owner == types.SettlementContract`. | |
| 19 | - | 2. **Step 2 — `SettlementContract.BindMintedAsset(domainId, zbtcZts, ...)`** (Governance, after full exit window): | |
| 20 | - | - Verifies `TreasuryInitialized == 1 && zbtcZts == TreasuryZts`, reads committed `TokenContract` store, verifies `SettlementContract.Balance(zbtcZts) == MaxSupply`, enforces tuple/asset injectivity, initializes `AssetRegistry` + `CustodyRecord`, and appends initial `GOVERNANCE_ADD_BINDING` (`0x0E`). | |
| 21 | - | 3. **Single-Receive Atomic Transfers**: | |
| 22 | - | - **Mint (`MINTED_LOCK_V1`, `MINTED_REFUND_V1`)**: Descendant `ContractSend` from treasury to user (`dev:vm/vm.go:204-247`). | |
| 23 | - | - **Burn (`RequestPegOut`)**: User sends `zBTC` to `SettlementContract`; returned atomically to treasury. | |
| 24 | - | - **Exact L1 Invariant**: `SettlementContract.Balance(zBTC) + CustodyRecord.RepresentationOutstanding == 21,000,000 * 10^8`. | |
| 3 | + | **Document Class:** Normative Settlement, Rollup State Transition & Feeless Payment Specification (`v1` / `v3.0.0-rfc` — Zero-Federation Phased Architecture; supersedes archived `v0` `v2.5.0-rfc`) | |
| 4 | + | **Custody Posture:** **ZERO federated signers, ZERO ZNN governance/slashing custody coupling, ZERO federated multisig or embedded-contract pre-minting.** | |
| 5 | + | **Consistency Checker:** [`scripts/verify_spec_bounds.py`](../scripts/verify_spec_bounds.py) | |
| 25 | 6 | ||
| 26 | 7 | --- | |
| 27 | 8 | ||
| 28 | - | ## 2. `SettlementContract` Storage, Per-Domain Input Sequencing & Never-Reused Batches | |
| 9 | + | ## 1. Stage 0: Non-Custodial PTLC & HTLC Atomic Swaps (`PtlcSpork`, `M-4` Hardened) | |
| 29 | 10 | ||
| 30 | - | ### 2.1 Storage Key Prefixes (`SettlementContract` Account Storage) | |
| 11 | + | Stage 0 launches with **`0 BTC` protocol custody** (`0–5 BTC` voluntary LP capital), strictly honoring `zenon-developer-commons` (`essays/Verify Bitcoin, Don't Bridge It.md`). Native BTC stays in user self-custody on Bitcoin L1 or Lightning; Zenon swaps native ZNN/QSR/ZTS assets atomically via `PtlcContract` and `HtlcContract`. | |
| 31 | 12 | ||
| 32 | - | | Prefix | Entity | Storage Key | Contents | | |
| 33 | - | |---|---|---|---| | |
| 34 | - | | `0x01` | `DomainRecord` | `0x01 \|\| domainId(u32)` | `domainClass`, `runtimeKind`, `stfSpecHash`, `genesisStateRoot(32B)`, `inputSource`, `execProfile`, `foreignProfile`, `proposerPolicy`, `finalityModel`, `status(0=ACTIVE\|1=PAUSED)`, `dispatchFrozenByBatch(u64, 0=none)`, `lastFinalizedTipHeight(u64)`, `nextBatchId(u64, starts at 1)`, `lineageHeadBatchId(u64, 0=genesis sentinel)`, `aggregateInFlightMint(u256)` | | |
| 35 | - | | `0x02` | `GlobalInputCounter` | `0x02` | `nextGlobalInputIndex(u64)` (global monotonic across ALL domains) | | |
| 36 | - | | `0x03` | `DomainInputBySeq` | `0x03 \|\| domainId(u32) \|\| domainInputSeq(u64)` | Contiguous per-domain record: `globalInputIndex(u64) \|\| inputKind(u8: 6\|7) \|\| inputHash(32B) \|\| sourceBlockHash(32B) \|\| momentumTs(u64) \|\| spamDepositZnn(u64) \|\| submitterAddr(20B)` (+ system payload for `kind=7`) | | |
| 37 | - | | `0x04` | `DomainCursor` | `0x04 \|\| domainId(u32)` | `nextDomainInputSeq(u64)`, `lastBatchedSeq(u64)`, `lastFinalizedSeq(u64)` | | |
| 38 | - | | `0x05` | `BatchCommitment` | `0x05 \|\| domainId(u32) \|\| batchId(u64)` | `BatchCommitmentV3` + `state(0=CHALLENGE_OPEN\|1=FINALIZED\|2=REJECTED)` + `challengeDeadlineTs(u64)` + `activeChallengeSessions(u32)` + `activeChallengeCommits(u32)` + `dupRefundsClaimed(u16 <= 16)` | | |
| 39 | - | | `0x06` | `AssetRegistry` | `0x06 \|\| domainId(u32) \|\| assetId(32B)` | `custodyMode`, `foreignChainId`, `foreignAssetRef`, `decimalsPolicy`, `maxRepresentationSupply`, `maxBatchMint`, `maxInFlightMintPerExecutor`, `maxAggregateInFlightMint`, `activeChainBindingHash`, `activeVaultUtxoCount(u64)`, `unrotatedVaultCount(u64)` (`R5-H3`), `bindingState`, `drainStopBitcoinHeight`, `drainGuardianExpiryTs`, `status` | | |
| 40 | - | | `0x07` | `AssetReverseIndex` | `0x07 \|\| assetId(32B)` | `domainId(u32)` | | |
| 41 | - | | `0x08` | `ForeignTupleIndex` | `0x08 \|\| SHA3-256(domainId \|\| foreignChainId \|\| foreignAssetRef)` | `assetId(32B)` | | |
| 42 | - | | `0x09` | `CustodyRecord` | `0x09 \|\| domainId(u32) \|\| assetId(32B)` | `ESCROW` fields (`0`); `representationOutstanding`, `pendingForeignRelease`, `verifiedLockedCollateral`, `cumulativeProvenLocks`, `cumulativeMinted`, `cumulativeBurned`, `cumulativeReleased`, `cumulativeRefunded` | | |
| 43 | - | | `0x0A` | `VaultUtxoSet` | `0x0A \|\| domainId(u32) \|\| outpoint(36B)` | `amount(u64) \|\| setupChainBindingHash(32B) \|\| epochEntries[<=2]{epochId(u16), eligibleOperatorsBitmask(u64), takeTxidsSmtRoot(32B)} \|\| status(0=UNASSIGNED\|1=ASSIGNED\|2=PENDING_TRAP\|3=RELEASED\|4=RECOVERED\|5=QUARANTINED\|6=ORPHANED) \|\| quarantineReason(0=NONE\|1=RECOVERY\|2=UNROTATED) \|\| assignedOutboxId(32B)` (**R6-L3**) | | |
| 44 | - | | `0x0B` | `ClaimPolicy` | `0x0B \|\| domainId(u32) \|\| policyVersion(u32)` | `purpose`, `activationHeight`, `exitDelay`, exact 3-capability table | | |
| 45 | - | | `0x0C` | `ProcessedClaim` | `0x0C \|\| claimId(32B)` | `u8(1)` (permanent) | | |
| 46 | - | | `0x0D` | `ProcessedForeignEvent` | `0x0D \|\| domainId(u32) \|\| foreignEventId(32B)` | `u8(1)` (permanent) | | |
| 47 | - | | `0x0E` | `ClaimReceipt` | `0x0E \|\| claimId(32B)` | `handlerId(32B) \|\| effectHash(32B) \|\| dispatchHeight(u64) \|\| custodyDigest(32B)` | | |
| 48 | - | | `0x0F` | `PegOutRecord` | `0x0F \|\| outboxId(32B)` | Immutable authorization + `assignedVaultOutpoint(36B)` + `setupChainBindingHash(32B)` + `slotOperatorId(u32)` + `lastLapsedOperatorId(u32)` + `slotClaimZenonTs(u64)` + `slotExpiryBtcHeight(u64)` + `slotBondLockedZnn(u64)` + `reservedEpochLane(u16,u8)` + `reimbursementOperatorId(u32)` + `reimbursementRoundId(u32)` + one-way `state(0=PENDING\|1=RELEASED\|2=REFUNDED)` (**R6-M2/M4/M5**) | | |
| 49 | - | | `0x10` | `PegOutNonce` | `0x10 \|\| domainId(u32)` | `u64` | | |
| 50 | - | | `0x11` | `ExecutorRegistration` | `0x11 \|\| domainId(u32) \|\| executorAddr(20B)` | `znnBond(u256)`, `qsrBond(u256)`, `inFlightMintExposure(u256)`, `status`, `unbondUnlockTs(u64)` | | |
| 51 | - | | `0x12` | `OperatorRegistry` | `0x12 \|\| domainId(u32) \|\| operatorId(u32)` | `operatorAddr(20B)`, `znnBond(u256 >= 31,500 ZNN)`, `qsrBond(u256)`, `active(u8)`, `slashed(u8)` + **`OperatorLaneState[opId\|\|u16(epochId)\|\|lane] = {anchorCutoffTs, anchorExpiryTs, nextUnusedIdx(0..8), nextEligibleKickoffTs, pendingReservations(u16), retired(u8)}`** + `RoundUsed[opId\|\|roundId]` (**R6-M2**) | | |
| 52 | - | | `0x13` | `VerifierRegistry` | `0x13 \|\| verifierRef(32B)` | `kind`, `verifyingKeyId`, `active` | | |
| 53 | - | | `0x14` | `ChallengeSession` | `0x14 \|\| sessionId(32B)` | Multi-Tx Witness accumulator `(batchId, batchTraceRoot, openTs, expiryTs = openTs + 43200s)` + `CommitChallenge` (`commitHash`, `revealDeadlineTs = commitTs + 3600s`) | | |
| 54 | - | | `0x15` | `InputDepositClaimed` | `0x15 \|\| domainId(u32) \|\| domainInputSeq(u64)` | `u8(1)` | | |
| 55 | - | | `0x16` | `DeferredLockQueue` | `0x16 \|\| claimId(32B)` | Validated lock claim deferred during pause / supply cap / `G-21` / missed-rotation pause | | |
| 56 | - | | `0x17` | `PeripheryConfig` | `0x17` | `governanceContract`, `guardianMultisig`, `treasuryInitialized`, `treasuryZts`, `minOperatorBondZnn`, `softDelaySecs`, `exitWindowSecs`, `inputSpamDepositZnn`, `challengeDepositZnn` | | |
| 13 | + | > **Stage 0 Scope Honesty:** Stage 0 atomic swaps do **not** create pooled, fungible `zBTC` on Zenon. A counterparty LP is required for every swap, and under a severe Zenon attack rational LPs pull liquidity. Stage 0 delivers immediate zero-custody Bitcoin interoperability while Stage 1A (`BitVMX` Sovereign Rollup) or Stage 1B (`clArk`) is built and audited. | |
| 57 | 14 | ||
| 58 | - | ### 2.2 Canonical `BatchCommitmentV3` & Inductive Per-Leaf Accumulators (`328 B`) | |
| 15 | + | ### 1.1 Hardened BIP-327 Tweaked Taproot PTLC Swap (`M-4`) | |
| 59 | 16 | ||
| 60 | - | **`ChallengeAggregation` is DELETED.** Every batch-level aggregate is committed via complete mathematical induction inside `StepTraceLeaf[0..inputCount-1]` (`MaxBatchInputs = 256`, `traceRoot` depth `<= 8`, **`328 B`** fixed per leaf), and `RelayClaim` routes directly through `traceRoot`: | |
| 17 | + | **Protocol (Alice sells BTC on Bitcoin L1; Bob sells Zenon asset on Zenon; Bob holds secret scalar $t \in \mathbb{Z}_n^*$):** | |
| 18 | + | 1. **Setup:** Bob sends compressed 33-byte point $T = \text{compress}(t \cdot G)$ to Alice. | |
| 19 | + | 2. **Bitcoin Taproot Funding (`>= 72`-Block CSV):** Compute $P_{\text{swap}} = \text{MuSig2\_KeyAgg}(pk_A, pk_B)$, Tapscript refund leaf $L_{\text{ref}} = \text{<72> OP\_CSV OP\_DROP <pk\_A> OP\_CHECKSIG}$, tweak $t_{\text{tap}} = H_{\text{"TapTweak"}}(x(P_{\text{swap}}) \parallel \text{TapLeaf}(L_{\text{ref}}))$, and $Q_{\text{swap}} = P_{\text{swap}} + t_{\text{tap}} \cdot G$ with BIP-327 accumulated tweak `t_acc` and parity `g_key`. Alice funds `0x51 0x20 || x(Q_swap)`. Let $h_{\text{conf}}$ be Bitcoin confirmation height and `now_unix` be current UTC Unix seconds. | |
| 20 | + | 3. **Absolute Unix Timestamp Lock & `2.3×` Slow-Block Margin:** | |
| 21 | + | - `go-zenon`'s `PtlcContract.Create` compares `momentum.Timestamp.Unix() >= param.ExpirationTime` (`origin/dev:vm/embedded/implementation/ptlc.go:326`), requiring an **absolute Unix timestamp** (NEVER a relative duration!). | |
| 22 | + | - Define `T_znn_sec = 108,000` seconds (`30.0h`, `~9,474` Momentums at observed `11.4s`/Momentum) and **`expirationTime = now_unix + T_znn_sec`**. | |
| 23 | + | - **Verified `2.3×` June-2021 Slow-Block Margin:** Bob MUST confirm his Bitcoin claim by `h_conf + 66` (`6` blocks before Alice's `h_conf + 72` refund). Even under June 2021's worst daily average block slowdown (`2.3×` nominal = `1,380s`/block), `66 × 600s × 2.3 = 91,080s = 25.3h < 30.0h`, leaving Alice **`>= 4.7h`** of honest wall-clock safety margin to extract $t$ and call `PtlcContract.Unlock`. | |
| 24 | + | - Bob calls `PtlcContract.Create(expirationTime = now_unix + 108000, pointType = 2, pointLock = compress(T), destination = Alice_Addr)` (`origin/dev:vm/embedded/definition/ptlc.go:118-129`). | |
| 25 | + | 4. **Adaptor Exchange & Explicit Grief/Free-Option Disclosure:** | |
| 26 | + | - Alice sends BIP-327 adaptor partial signature $\tilde{s}_A$ within `<= 6` Bitcoin blocks of Zenon PTLC confirmation ($R' = R_A + R_B + T$ with parity $g_R$, $\tilde{s} = \tilde{s}_A + \tilde{s}_B + e \cdot g_{\text{key}} \cdot t_{\text{acc}} \pmod n$). | |
| 27 | + | - **Explicit Disclosure:** Because `PtlcContract` has **no early reclaim** prior to `ExpirationTime`, if Alice withholds $\tilde{s}_A$, Bob's Zenon funds remain grief-locked for the full `30h` duration (zero theft, pure time-lock grief). Once Alice releases $\tilde{s}_A$, Bob holds an `~8h` (`~48`-block) free option until his `h_conf + 54` (`18`-block remaining) broadcast cutoff. Production LPs bound this via small per-peer swap limits or reputation/Lightning Hold Invoices. | |
| 28 | + | 5. **Confirmed-Before-Refund Atomic Claim:** Bob completes $s = \tilde{s} + g_R \cdot t \pmod n$ with a `<pk_B>` CPFP anchor and **MUST confirm by `h_conf + 66`**. Alice extracts $t_{\text{ext}} = g_R \cdot (s - \tilde{s}) \bmod n$, checks `compress(t_ext * G) == PointLock`, and calls `PtlcContract.Unlock(ptlcId, t_ext)` (`origin/dev:vm/embedded/implementation/ptlc.go:82-97`). | |
| 61 | 29 | ||
| 62 | - | ```text | |
| 63 | - | StepTraceLeaf (328 bytes fixed) := | |
| 64 | - | domainInputSeq : u64 // MUST equal batch.FirstInputSeq + stepIndex | |
| 65 | - | preRoot : bytes32 | |
| 66 | - | postRoot : bytes32 | |
| 67 | - | stepClaimsRoot : bytes32 // domain-separated Merkle root of claim emitted by THIS step (0..1 claim) | |
| 68 | - | stepClaimCount : u8 // 0 or 1 | |
| 69 | - | stepLockAmount : u256 | |
| 70 | - | stepReleaseAmount : u256 | |
| 71 | - | stepNonDelivAmount : u256 | |
| 72 | - | stepHalted : u8 | |
| 73 | - | stepHaltedHeight : u64 | |
| 74 | - | cumLockAmount : u256 | |
| 75 | - | cumReleaseAmount : u256 | |
| 76 | - | cumNonDelivAmount : u256 | |
| 77 | - | cumClaimCount : u32 | |
| 78 | - | haltedSoFar : u8 | |
| 79 | - | haltedHeightSoFar : u64 | |
| 80 | - | observedTipAfter : u64 | |
| 81 | - | stepError : u8 // 0=ok, 1=malformed error, 2=idempotent duplicate no-op (capped <=16 global/batch) | |
| 30 | + | ### 1.2 HTLC & Lightning Submarine-Swap Gateway | |
| 82 | 31 | ||
| 83 | - | BatchCommitmentV3 := | |
| 84 | - | protocolVersion : u16 (2) | |
| 85 | - | commitmentVersion : u16 (3) | |
| 86 | - | domainId : u32 | |
| 87 | - | batchId : u64 // NEVER reused monotonic ID | |
| 88 | - | parentBatchId : u64 // MUST equal domain.lineageHeadBatchId (0 = genesis sentinel) | |
| 89 | - | policyVersion : u32 | |
| 90 | - | firstInputSeq : u64 | |
| 91 | - | lastInputSeq : u64 // == firstInputSeq + inputCount - 1 | |
| 92 | - | inputCount : u32 // 1 <= inputCount <= MaxBatchInputs (256) | |
| 93 | - | preStateRoot : bytes32 | |
| 94 | - | postStateRoot : bytes32 | |
| 95 | - | traceRoot : bytes32 | |
| 96 | - | inputRoot : bytes32 | |
| 97 | - | receiptRoot : bytes32 | |
| 98 | - | eventRoot : bytes32 | |
| 99 | - | outboxRoot : bytes32 // MUST be zero32 for AUTHORIZATION domain | |
| 100 | - | observedChainHeight : u64 | |
| 101 | - | domainHalted : u8 | |
| 102 | - | haltedReorgHeight : u64 | |
| 103 | - | daHash : bytes32 | |
| 104 | - | daMode : u8 | |
| 105 | - | executorId : bytes20 | |
| 106 | - | submittedAtHeight : u64 | |
| 107 | - | submittedAtTs : u64 | |
| 108 | - | assetFlowSummary : Bytes // MUST be empty | |
| 109 | - | claimEffectSummary : List<ClaimEffectEntry> | |
| 110 | - | proofData : Bytes // MUST be empty for OPTIMISTIC at submit | |
| 111 | - | ``` | |
| 32 | + | - **Hash Type:** ALL Bitcoin/Lightning HTLCs MUST use **`hashType = 1` (`HashTypeSHA256`, `origin/dev:vm/embedded/definition/htlc.go:92`)**. | |
| 33 | + | - **Consistent Unix-Second Arithmetic:** Let `Δ_safety_blocks = 36` (`6h` nominal, `13.8h` at `2.3×` slow blocks) and `Δ_safety_sec = 36 × 600 = 21,600s` (or `49,680s` at `2.3×`). | |
| 34 | + | - **Inbound (`LN → Zenon`):** User pays Gateway's LN Hold Invoice FIRST; ONLY AFTER Hold Invoice reaches `ACCEPTED` with `remaining_cltv_blocks >= 72` (`2 × Δ_safety_blocks`) does Gateway lock Zenon funds in `HtlcContract` with **`expirationTime_unix <= now_unix + (remaining_cltv_blocks - 36) * 600`**. Gateways MUST enforce `<= 5` concurrent pending hold invoices, `<= 0.10 BTC` exposure per peer, and a **5-minute cancel TTL**. | |
| 35 | + | - **Outbound (`Zenon → LN`):** User locks Zenon funds (`hashType = 1`, `expirationTime_unix >= now_unix + 2 * 21,600`); Gateway pays BOLT-11 invoice whose CLTV expiry satisfies `now_unix + cltv_blocks * 600 <= expirationTime_unix - 21,600`, learns preimage $r$, and unlocks Zenon `HtlcContract`. | |
| 112 | 36 | ||
| 113 | 37 | --- | |
| 114 | 38 | ||
| 115 | - | ## 3. Atomic State Transitions, Reachability `G-21` & Aligned Cross-Store Vault State Machine | |
| 39 | + | ## 2. Stage 1A: Sovereign Rollup STF $\mathcal{F}$ & Feeless Zenon Sequencer Rails | |
| 116 | 40 | ||
| 117 | - | ### 3.1 `SubmitInput` — ALWAYS Open & Global Duplicate Refund Cap | |
| 41 | + | In Stage 1A, `zBTC` is a **Bitcoin-Anchored Sovereign ZK Validity Rollup** backed by **right-sized `BitVMX` (`n = 8`, `M = 3–5`, `N = 7`) deleted-key vaults** (`spec/01`). **Zero federated signers and zero ZNN governance keys touch BTC custody or `zBTC` supply.** | |
| 118 | 42 | ||
| 119 | - | `SubmitInput` is accepted in BOTH `ACTIVE` AND `PAUSED`, requires `len(payload) <= 15,600 B` and `0.1 ZNN` spam deposit, assigns monotonic `globalInputIndex` AND contiguous per-domain `domainInputSeq`, and supports trustless `ClaimInputDepositRefund` (`stepError == 0` always refundable; `stepError == 2` refundable while `batch.DupRefundsClaimed < 16` globally; `stepError == 1` forfeited). | |
| 43 | + | ### 2.1 Immutable Rollup SMT State Schema | |
| 120 | 44 | ||
| 121 | - | ### 3.2 `SubmitBatch`, `FinalizeBatch`, Bounded Sessions & Commit-Reveal | |
| 45 | + | The canonical `zBTC` ledger state $R_h$ is a 256-bit Sparse Merkle Tree (`SHA-256` / Poseidon2) maintained deterministically by $\mathcal{F}$ over Bitcoin L1 blocks (`spec/02 §3`): | |
| 122 | 46 | ||
| 123 | - | - `SubmitBatch`: Enforces `RANDOM_BACKUP`, monotonic `batchId`, `parentBatchId == lineageHeadBatchId`, `PreStateRoot` chaining, `finalLeaf` binding, per-executor + `10.0 BTC` aggregate in-flight caps, and dispatch-only `dispatchFrozenByBatch`. | |
| 124 | - | - `FinalizeBatch`: Permitted in `ACTIVE` AND `PAUSED` (Shadow Mode); exempts `batchId == dispatchFrozenByBatch`; rejects while `ActiveChallengeSessions > 0 || ActiveChallengeCommits > 0` or parent unfinalized; releases `inFlightMintExposure` & `aggregateInFlightMint`. | |
| 125 | - | - Challenges: Mandatory `ChallengeDepositZnn` (`10%` executor bond), `CommitChallenge` (`T_reveal = 1h`, 6-momentum priority), `ChallengeContinuity` (`1,700 B`), 1-tx `ChallengeStep`, bounded Multi-Tx Sessions (`T_session = 12h`, `UploadWitnessProof = 8,676 B` @ depth 256, re-verifies `(State, traceRoot, leaf)` at `ExecuteChallenge`), permissionless expiry cleanup, and `RefundRejectedBatchChallenge` refunding deposits on ancestor-rejected descendants. | |
| 47 | + | | SMT Namespace | Key | Value Fields | Invariants | | |
| 48 | + | |---|---|---|---| | |
| 49 | + | | `Accounts` | `acctId (u32)` | `{ pubkey: bytes32 (BIP-340), balanceSats: u64, nonce: u32 }` | `balanceSats >= 0`; `nonce` strictly monotonic (`+1`/tx). | | |
| 50 | + | | `Vaults` | `vaultId (bytes32)` | `{ denomSats: u64 ∈ {50_000_000, 25_000_000}, status: UNASSIGNED \| ASSIGNED(opId, lane, round) \| REIMBURSED \| SLASHED_EQUIV }` | Total active vaults always back `Circ + PendingExits + ReimbursementCredit` 1:1. | | |
| 51 | + | | `PendingExits` | `exitId (bytes32)` | `{ acctId, grossSats, maxOpFeeSats, destScriptPubKey, cancelPubKey, exitSlotOutpoint(36B), status: OPEN \| COMPLETED \| CANCELLED }` | Created ONLY by burning `grossSats` from `Accounts[acctId]` via `0x02` or L1 `0x01`. | | |
| 52 | + | | `RollupLocks` | `lockId (bytes32)` | `{ senderAcctId, destAcctId, amountSats, expiryBtcHeight, lockType: HTLC \| PTLC, lockDigest(33B) }` | First-class rollup opcodes (`RollupHTLC`, `RollupPTLC`) for atomic swaps inside the SMT. | | |
| 53 | + | | `OperatorState` | `opId (u32)` | `{ active: bool, lanes: [L], suspended: bool }` | Auto-suspended if `B_zbtc < 0.60 BTC`/lane. | | |
| 54 | + | | `ReimbursementCredit` | `opId (u32)` | `creditSats: u64` | Incremented ONLY on `K`-deep verified `ExitSlotUTXO` payout (`vout[0]`); deterministically consumed FIFO inside $\mathcal{F}$ to assign the oldest eligible `UNASSIGNED` vault (re-credited only on explicit `O_j`-signed `0x07 RELEASE_ASSIGNMENT`). | | |
| 55 | + | | `LockedOperatorCollateral` (`B_zbtc`) | `(opId, lane)` | `collateralSats: u64` (**`60,000,000` sats = `0.60 BTC`/lane floor**) | Partitioned: `0.50 BTC` max-vault restitution + `0.05 BTC` equivocation bounty + `0.05 BTC` `ExitSlotUTXO` grief buffer. | | |
| 126 | 56 | ||
| 127 | - | ### 3.3 Complete Aligned Cross-Store Vault State Machine (`R6-M2`, `R6-M3`, `R6-L3`, `R6-L4`) | |
| 57 | + | **Global Solvency Conservation Invariant (Checked on Every State Transition $R_{h-1} \to R_h$):** | |
| 58 | + | $$\sum_{v \in \text{Unassigned} \cup \text{Assigned}} D_v \;=\; \sum_{a \in \text{Accounts}} \text{balance}_a \;+\; \sum_{\ell \in \text{RollupLocks}} \text{amt}_\ell \;+\; \sum_{e \in \text{PendingExits}_{\text{OPEN}}} \text{gross}_e \;+\; \sum_{o} \text{ReimbursementCredit}_o \;+\; \sum_{o,l} B_{\text{zbtc}}(o,l)$$ | |
| 128 | 59 | ||
| 129 | - | | Event / Call | Domain `TrackedVaultRecord` (`0x08`) | Settlement `VaultUtxoSet` (`0x0A`) | Guard / Invariant | | |
| 130 | - | |---|---|---|---| | |
| 131 | - | | `BTC_LOCK_PROOF` → `MINTED_LOCK_V1` | `∅ → ACTIVE` (`activeEpochs=[{g, smtRoot}]`) | `∅ → UNASSIGNED` (`quarantineReason=NONE`, `epochEntries=[{g, mask, smtRoot}]`) | Enforces latency-aware `G-21` + `unrotatedVaultCount == 0` | | |
| 132 | - | | `VAULT_GRAPH_EPOCH_ADDED` (`0x0D`) → `SyncVaultGraphEpoch` | `ACTIVE/RELEASED → same` (adds `g+1`); `QUARANTINED → ACTIVE` | `UNASSIGNED/ASSIGNED/RELEASED(ReimbRound==0) → same` (adds `g+1`); `QUARANTINED → UNASSIGNED/ASSIGNED` (**decrements `unrotatedVaultCount--` iff `quarantineReason == UNROTATED`!**) | Strict no-dup / `<= 2` active epochs (`R6-L2`); `RECOVERY` vaults NEVER touch `unrotatedVaultCount` (`R6-L3`)! | | |
| 133 | - | | `QuarantineExpiredVault(outpoint)` (`now >= T_cutoff(g) + 60h`) | *(n/a)* | **`UNASSIGNED\|ASSIGNED → QUARANTINED`** (`quarantineReason=UNROTATED`, **`unrotatedVaultCount++`**) | Permissionless after `60h` finalization grace (`day 48.5`) if vault lacks live next-epoch graph; pauses new mints (`R6-L3`, `R6-L4`) | | |
| 134 | - | | `RequestPegOut` | *(unchanged: `ACTIVE`)* | `UNASSIGNED → ASSIGNED` | Requires `status == UNASSIGNED` AND `>= 1` live epoch `e` with eligible op having `ReachableRounds(e, now + 3.0d) - pendingReservations >= 1` (`R6-M2`) | | |
| 135 | - | | `BTC_RELEASE_PROOF` → `MINTED_RELEASE_V1` | `ACTIVE → RELEASED`; **`PENDING_TRAP/RECOVERED` preserved (ADMITS `FOREIGN_RELEASE`!)** | `ASSIGNED → RELEASED` (or leaves `PENDING_TRAP/RECOVERED` for `RepointTrappedPegOut`!) | **Keys `ReimbursementOperator` strictly from domain `FOREIGN_RELEASE.operatorId` (`R6-M4`); NEVER strands honest fronter (`R6-M3`)!** | | |
| 136 | - | | `RepointTrappedPegOut(outboxId, newVaultOutpoint)` (`R6-M3`) | *(reads re-graphed `RecoveryVaultUTXO` or `UNASSIGNED` vault)* | Re-points `PegOutRecord.assignedVaultOutpoint` from `PENDING_TRAP\|RECOVERED` vault to re-graphed recovery vault or next `UNASSIGNED` vault | Permissionless once `PegOutRecord.State == RELEASED && ReimbursementRoundId == 0 && oldVault ∈ {PENDING_TRAP, RECOVERED}` | | |
| 137 | - | | `BTC_NON_DELIVERY_PROOF` → `MINTED_REFUND_V1` | *(unchanged)* | **`ASSIGNED → UNASSIGNED`** *(IF `PENDING_TRAP`, `RECOVERED`, or `QUARANTINED`, refunds user ONLY — NEVER overwrites vault status!)* | Releases any held lane reservation; eliminates overwrite (`R5-M3`, `R6-L3`) | | |
| 138 | - | | `BTC_VAULT_SPEND_PROOF` (SMT inclusion) → `SyncPendingTrapVault` | `ACTIVE → PENDING_TRAP(h_spend)` | `UNASSIGNED/ASSIGNED → PENDING_TRAP` | Mirrors `PENDING_TRAP` to Settlement so vault is non-assignable | | |
| 139 | - | | `BTC_VAULT_RECOVERY_PROOF` → `SyncRecoveredVaultOutpoint` | `ACTIVE\|PENDING_TRAP → RECOVERED`; inserts `recOut` as `QUARANTINED`; writes `RecoveredVaultMap[old] = {recOut, opId, roundId}` | `old → RECOVERED`; inserts `recOut` as **`QUARANTINED (reason=RECOVERY)`** *(does NOT touch `unrotatedVaultCount`!)* | Cancels `PENDING_TRAP` with zero halt; `recOut` unassignable until `SyncVaultGraphEpoch`! | | |
| 140 | - | | `SyncOrphanedVaultOutpoint(outboxId_X, oldOutpoint_d)` | *(reads `RecoveredVaultMap[oldOutpoint_d]`)* | **`RELEASED → ORPHANED`** | Deterministically checks `RecoveredVaultMap[d].(opId, roundId) == PegOutRecord[X].(reimbursementOpId, reimbursementRoundId)` | | |
| 60 | + | ### 2.2 Honest Feeless Zenon Sequencer Rails (`M-9`, `M-10`) | |
| 141 | 61 | ||
| 142 | - | ### 3.4 `RelayClaim`, Latency-Aware `G-21`, Anti-Censorship Fronting & Reimbursement (`R6-M2..M5`, `R6-L6`, `R6-L8`) | |
| 62 | + | - **Exact Zenon Transport Format (NOT Native `TokenContract` ZTS):** | |
| 63 | + | - Because `TokenContract` ZTS transfers depend on Zenon L1 consensus (which fails at 49% — `spec/04 §1`), Stage 1A `zBTC` balances live strictly in the Rollup SMT above, **NOT** in `go-zenon`'s `TokenContract`. | |
| 64 | + | - Users transmit signed `110 B` rollup transactions (`op(1) || domain(1) || fromAcctId(4) || toAcctId(4) || amountSats(8) || nonce(4) || batchTipSats(4) || expiryBtcHeight(4) || memoTag(16) || bip340Sig(64)` = **`110 B`**; `+32 B = 142 B` when creating a new recipient pubkey) inside standard Zenon `AccountBlock.Data` (`UserSend` to a canonical burn/sequencer sink address with `Amount = 0`). | |
| 65 | + | - **Exact Zenon Plasma Cost (At Floor Price `1,000`):** | |
| 66 | + | $$\text{BasePlasma}(\text{110 B rollup tx}) = 21{,}000 + 68 \times 110 = \mathbf{28{,}480\text{ Plasma}}$$ | |
| 67 | + | - Funded by **`14 QSR` refundable fused Plasma** (`ceil(28,480 / 2,100) = 14 QSR`, zero burn, replenished immediately upon confirmation) OR **`42.72M` SHA3-256 PoW hashes** (`28,480 × 1,500`, `~0.15–0.4s` desktop / `~3–12s` mobile WASM). | |
| 68 | + | - **Bitcoin L1 Fee Paid by User on Zenon Transfer:** **`0` satoshis** (`0` burned ZNN/QSR; optional `batchTipSats` for fast L1 `0x02` batch inclusion). | |
| 69 | + | - **Honest `go-zenon` Throughput Ceilings (Bounded by `8 MiB` Wire Cap):** | |
| 70 | + | - Observed mainnet Momentum time is **`~11.4s`** (`origin/dev:vm/embedded/definition/spork.go:43-46`). | |
| 71 | + | - Standard 2-block Zenon transfers (`21,000` send + `21,000` receive = `42,000` Plasma): **`~4.4` tx/s** at the pinned `2,100,000` floor, **`~8.8` tx/s** at the `4,200,000` default. | |
| 72 | + | - 1-block `110 B` `AccountBlock.Data` rollup sends (`28,480` Plasma, zero receive block needed): **`~6.5` tx/s** at `2.1M` floor, **`~12.9` tx/s** at `4.2M` default. | |
| 73 | + | - **Real Hard Protocol Ceiling (`MaxMomentumContentBytes = 8 MiB`):** `origin/dev:verifier/momentum.go:93` hard-caps cumulative protobuf-serialized Momentum content at **`8,388,608 B` (`8 MiB`)** and `origin/dev:protocol/protocol.go:70` caps `MaxDetailedMomentumWireSize = 10 MiB - 2 MiB - 4 KiB` (`~8.38 MB`). At `~300–350 B` serialized per account block, a Momentum holds `~24,000–27,000` blocks **maximum** — yielding **`~1,050–1,200` full 2-block transfers/s** (or `~2,100–2,400` 1-block rollup sends/s), **NOT** the naive `4,386` tx/s implied by `2.1B / 42,000 / 11.4`! | |
| 74 | + | - **Graceful Degradation Under Dynamic Plasma DoS:** Because `origin/dev:dp/dp.go:102-151` has no absolute upper price clamp, a whale QSR attack can temporarily spike Zenon Plasma prices (`spec/05 §2.2`). Under such an attack, feeless Zenon soft preconfirmations degrade cleanly to **Bitcoin L1 `0x03 FORCED_TRANSFER` and `0x01 FORCED_EXIT`** (paying standard Bitcoin L1 miner fees, completely bypassing Zenon!). | |
| 143 | 75 | ||
| 144 | - | - **`RelayClaim` (`MINTED_LOCK_V1`)**: Enforces **Latency-Aware, Reservation-Aware Dynamic Reachable Capacity (`G-21`, `R6-M2`, `R6-L9`)**: requires `unrotatedVaultCount == 0` AND `ActiveVaultUTXOs + 1 <= Σ_{m,e,l} ReachableRounds(m, e, l, now + 3.0d) - 25`, where `ReachableRounds = 0` if lane retired or `max(now + 3.0d, nextEligibleKickoffTs) > anchorCutoffTs`, else `max(0, min(8 - nextUnusedIdx, floor((anchorCutoffTs - max(now + 3.0d, nextEligibleKickoffTs)) / 5.5d) + 1) - pendingReservations)`! Defers smoothly to `DeferredLockQueue` during pause / supply cap / the disclosed `~5.0d` pre-epoch window before gen `g+1` registers (`DispatchDeferredLock`). | |
| 145 | - | - **`ClaimFrontingSlot(outboxId, epochId, lane)` (`R6-M2`, `R6-M4`, `R6-M5`)**: | |
| 146 | - | - Requires `PegOutRecord.State == PENDING` AND `VaultUtxoSet[assignedOutpoint].status == ASSIGNED`. | |
| 147 | - | - **Single-Authority Expiry (`R6-M4`)**: Rejects while `po.SlotOperatorId != 0 && (frontier.TimestampUnix < po.SlotClaimZenonTs + 14_400 || DomainRecord.LastFinalizedTipHeight < po.SlotExpiryBtcHeight)`! | |
| 148 | - | - **Anti-Censorship (`R6-M5`)**: If a previous slot expired unfulfilled, slashes `100%` of the lapsed holder's **`SlotBondZnn = 500 ZNN`** (`SlashLapsedSlot` also callable permissionlessly!), decrements the lapsed holder's `pendingReservations--`, records `po.LastLapsedOperatorId = oldSlotOp`, and **rejects consecutive re-claim by `po.LastLapsedOperatorId`** (while any other eligible operator exists)! | |
| 149 | - | - **Reservation & Latency Check (`R6-M2`)**: Requires caller is eligible in `epochId` on `assignedOutpoint`, `ReachableRounds(caller, epochId, lane, now + 3.0d) >= 1` (accounting for `pendingReservations`), locks `500 ZNN` `SlotBondZnn`, increments `lane.pendingReservations++`, records `{SlotOperatorId, SlotClaimZenonTs, SlotExpiryBtcHeight = LastFinalizedTipHeight + 24, reservedEpochLane}`, and appends `PEGOUT_SLOT_CLAIMED` (`0x0A`). | |
| 150 | - | - **`RegisterOperatorRound(opId, roundId, bondOutpoint, anchorCutoffTs, anchorExpiryTs, commSig)` (`R6-L6`)**: Requires `OperatorBond_ZNN >= MinOperatorBondZnn` (`31,500 ZNN`), `epoch := epoch(roundId) < 4096`, **`anchorExpiryTs == finalityEpochStartTs(epoch) + 58 days`** (exact equality!), `anchorCutoffTs == anchorExpiryTs - 12 days`, verified `CommitteeIdentityKey` sig; initializes `OperatorLaneState` and appends `OPERATOR_ROUND_REGISTERED` (`0x0B`). | |
| 151 | - | - **`SyncRetiredLane(domainId, opId, epochId, lane, batchId, smtProof)`**: Permissionless; verifies `LaneRetired[opId || u16(epochId) || lane] == 1` (`0x11`) under finalized `postStateRoot` and sets `OperatorLaneState.retired = 1`, zeroing remaining capacity! | |
| 152 | - | - **`ClaimReimbursementSlot(outboxId, opId, roundId)` (`R6-M2`, `R6-L8`)**: Callable ONCE by winning `opId` (`== PegOutRecord.ReimbursementOperatorId`, set from `FOREIGN_RELEASE`) after `PegOutRecord.State == RELEASED`; requires: (1) `epoch(roundId)` exists in `VaultUtxoSet[assignedOutpoint].epochEntries` with `opId`'s bit set, (2) lane is NOT retired and `idx(roundId) == lane.nextUnusedIdx`, (3) `RoundUsed[opId || roundId]` absent, and (4) `earliestKickoff := max(frontier.TimestampUnix, lane.nextEligibleKickoffTs) <= lane.anchorCutoffTs`! Decrements `pendingReservations--` (if reserved on this lane), advances `lane.nextUnusedIdx++`, sets `lane.nextEligibleKickoffTs = earliestKickoff + 5.5 days`, marks `RoundUsed = 1`, and writes `PegOutRecord.ReimbursementRoundId = roundId`! *(Recovery per `R6-L8`: if the claimed round expires/burns without operator fraud — e.g. slow blocks `> 1.476x` or fee spike `> 500 sat/vB` — Governance or deterministic proof of `StaleKilled`/`RoundRetired` with `assignedOutpoint` unspent invokes **`ResetFailedReimbursementSlot(outboxId, proof)`** clearing `ReimbursementRoundId = 0` so the honest operator may re-claim a fresh-epoch round!)* | |
| 153 | - | - **`SlashOperatorBond(domainId, opId, batchId, smtProof)`**: Slashes `100%` of `OperatorBond_ZNN/QSR` (`>= 31,500 ZNN`), sets `active = 0`, and zeroes all remaining capacity across ALL lanes of `opId`. | |
| 154 | - | - **Bounded Guardian Drain**: Guardian-initiated `DRAINING_ROLLOVER_STOP` carries mandatory `7-day` governance timer and NEVER blocks `RequestPegOut`. | |
| 76 | + | ### 2.3 Permissionless DA Batcher Economics | |
| 155 | 77 | ||
| 156 | - | --- | |
| 78 | + | - **Zero Trusted Sequencer or Protocol Treasury:** Anyone (an operator, a wallet provider, or a user) can read `AccountBlock.Data` rollup txs from Zenon, generate `π_batch`, and post `0x02 BATCH_DA` onto Bitcoin L1 with complete mutated SMT leaves (`16 B` existing / `48 B` new). | |
| 79 | + | - **Sustainable Incentives:** Batchers earn optional `batchTipSats` from rollup transfers, operator fronting fee spreads (since fronting operators need timely `0x02` batching to settle `PendingExits`), or self-sponsored batching by users/merchants. A batch of `500` transfers updating `~600` existing accounts requires `~9.6 KB` witness (`~2.4 kvB` vbytes) + `~0.1–10 kvB` proof = `~2.5–12.4 kvB` (`~0.0005–0.0025 BTC` at `20 sat/vB`, or `~100–500` sats amortized per transfer!). | |
| 157 | 80 | ||
| 158 | - | ## 4. Feeless Plasma, SHA3-256 PoW & Priority Lane Economics | |
| 81 | + | ### 2.4 `B_zbtc` Accounting, `ExitSlotUTXO` Spend-or-Refund & Dual-Input Slash Split | |
| 159 | 82 | ||
| 160 | - | - Standard `zBTC` transfers cost **0 satoshis** and `21,000` Plasma (`10 QSR` refundable fusion or `31.5M` SHA3-256 PoW hashes at floor price). | |
| 161 | - | - **Challenge Priority Lane**: `chain/account_pool.go` reserves `10` of `100` Momentum slots for Settlement challenge/finalize calls ordered strictly by `ChallengeDepositZnn` descending; paired with 48h (`+12h` session) window defense-in-depth. | |
| 83 | + | 1. **Per-Lane `B_zbtc` Collateral (`0.60 BTC` = `60,000,000` sats):** | |
| 84 | + | - `0.50 BTC` (`maxVaultDenom`) reserved for 1:1 vault restitution if $O_j$ executes a Lamport equivocation on `TakeTx` after `T_take = 1,152`. | |
| 85 | + | - `0.05 BTC` equivocation bounty paid to the challenger who broadcasts `BurnBondTx_{r,k}` before `T_cooldown = 1,296` (on top of burning `100%` of $O_j$'s `2.00 BTC` L1 `Bond_BTC` to `OP_RETURN`). | |
| 86 | + | - `0.05 BTC` `ExitSlotUTXO` grief buffer (handles up to `5` consecutive non-paying grief attempts before hitting the `0.55 BTC` custody floor, with immediate auto-suspension on the first grief!). | |
| 87 | + | 2. **`ExitSlotUTXO` Universal Spend-or-Refund Rule (Zero Frozen Exits):** | |
| 88 | + | - Created by `0x01 FORCED_EXIT` with **`2M + 1` Tapscript leaves** (zero anonymous `OP_TRUE` leaves!): | |
| 89 | + | - Leaves `0..M-1`: Priority slot per registered operator $O_j$ (staggered `<6*j> OP_CSV OP_DROP <P_{O_j}> OP_CHECKSIG`). | |
| 90 | + | - Leaves `M..2M-1`: Open-race leaves for all registered operators (`<6*M> OP_CSV OP_DROP <P_{O_j}> OP_CHECKSIG`). | |
| 91 | + | - Leaf `2M` (`EXIT_CANCEL`): `<288> OP_CSV OP_DROP <cancelPubKey_user> OP_CHECKSIG`. | |
| 92 | + | - On **ANY `K`-deep spend** of `ExitSlotUTXO`: | |
| 93 | + | - **Valid Fronting (Leaf `0..2M-1` AND `vout[0]` pays `destScriptPubKey` `>= grossSats - maxOpFeeSats`):** Transition `PendingExits[exitId] -> COMPLETED`, credit `ReimbursementCredit[O_j] += grossSats`. | |
| 94 | + | - **Non-Paying Grief Spend (Leaf `0..2M-1` AND `vout[0]` FAILS payment check):** Atomically transition `PendingExits[exitId] -> CANCELLED`, refund full `grossSats` `zBTC` to `Accounts[acctId]`, **slash `0.01 BTC` (`1,000,000` sats) from $O_j$'s `B_zbtc` grief buffer (credited to the victim's `zBTC` balance to cover L1 retry fees)**, and **auto-suspend $O_j$** from fronting until $O_j$ tops `B_zbtc` back up to `>= 0.60 BTC`/lane! | |
| 95 | + | - **User Cancel (Leaf `2M` after `288` blocks):** Atomically transition `PendingExits[exitId] -> CANCELLED` and refund full `grossSats` `zBTC` to `Accounts[acctId]`. | |
| 96 | + | 3. **Dual-Input `Stake_r` Slash (Positive EV Even Against `6-of-7` Verifier Collusion):** | |
| 97 | + | - When `DisproveTx_{r,i}` or `TimeoutSlashTx_{r,i}` spends **BOTH `Stake_r` (`vin[0]`) AND `VaultConnector_r` (`vin[1]`)** before `T_take = 1,152`: | |
| 98 | + | - **`0` sats** are stolen from `U_d`; `Vaults[vaultId]` immediately returns to `UNASSIGNED`. | |
| 99 | + | - L1 `Stake_r` (`2.00 BTC`) splits **`0.15 BTC` → winning verifier $V_i$** and **`1.85 BTC` → `OP_RETURN` burn**. | |
| 100 | + | - Inside $\mathcal{F}$, $O_j$'s entire **`0.55 BTC` custody slice of `B_zbtc`** (`0.50 + 0.05`, untouched because `0` sats were stolen!) is **atomically split equally across all remaining `k <= 6` verifiers** who posted `0x04 CHALLENGE_CLAIM` in `[0, 144]`: each receives **`>= 0.55 / 6 = 0.09166666 BTC > 0.075 BTC`** (`15 kvB` verifier fee @ `500 sat/vB`) + `100%` of their `F_chal = 0.40 BTC` returned from `ChalEscrow_{r,j}`, guaranteeing **`>= +0.0167 BTC` positive EV** for every honest verifier even if `6 of 7` verifiers collude with $O_j$ (while attacker P&L is **`-2.55 BTC`** solo and **`-2.40` to `-1.9417 BTC`** with `1..6` colluding verifiers — strictly `-1.94` to `-2.55 BTC`!). | |
| 162 | 101 | ||
| 163 | - | --- | |
| 102 | + | ### 2.5 End-to-End State Traces: Bob (`0.50 BTC`) & Mike (`0.25 BTC`) | |
| 164 | 103 | ||
| 165 | - | ## 5. Peg-Free Atomic Swaps & Lightning Submarine-Swap Gateway | |
| 104 | + | - **Bob's Partial Recovery (`1 BTC → spend 0.50 zBTC → recover 0.50 BTC` under `49%–100%` Zenon Compromise):** | |
| 105 | + | 1. Bob deposits `1.00 BTC` via `0x00 DEPOSIT` → creates deleted-key vaults `{0.50, 0.25, 0.25}` BTC; after `K = 14` blocks, `Accounts[Bob] = 1.00 zBTC`. | |
| 106 | + | 2. Bob sends `0.50 zBTC` to Carol via `110 B` `AccountBlock.Data` on Zenon (`28,480` Plasma, `0` sat BTC fee) → batcher anchors `0x02 BATCH_DA` → `Accounts[Bob] = 0.50 zBTC`, `Accounts[Carol] = 0.50 zBTC`. | |
| 107 | + | 3. **Attack:** `49%` (or `100%`) of Zenon Pillars turn hostile, split Zenon across its 30-Momentum cliff, censor Bob on Zenon, and spike Dynamic Plasma. | |
| 108 | + | 4. **Bob Exits Directly on Bitcoin L1:** Bob broadcasts `0x01 FORCED_EXIT(0.50 BTC, P_Bob, maxOpFee)` + `ExitSlotUTXO` on Bitcoin L1 (completely bypassing Zenon!). After `K = 14` blocks, $\mathcal{F}$ burns Bob's `0.50 zBTC` and opens `PendingExits[exit_Bob]`. | |
| 109 | + | 5. Any `1-of-M` honest operator $O_j$ (`M = 3–5`) spends `ExitSlotUTXO` paying `0.50 BTC - fee` directly to `P_Bob` in `vout[0]` (~10 min on L1!), earns `ReimbursementCredit[O_j] += 0.50 BTC`, and later reclaims one `0.50 BTC` vault via `BitVMX` `RoundTx_r` → `TakeTx` (monitored by `N = 7` verifiers). **Zero Zenon signers, zero federated signers, zero ZNN trust.** | |
| 110 | + | - **Mike's Cross-Depositor Exit (`Alice 1 + Bob 1 → Mike 2 → Mike recovers 0.25 BTC` with `0` Zenon Signer Cooperation):** | |
| 111 | + | 1. Alice deposits `1.00 BTC` (`{0.50, 0.25, 0.25}`) and Bob deposits `1.00 BTC` (`{0.50, 0.25, 0.25}`); both send `1.00 zBTC` feelessly to Mike on Zenon → `0x02 BATCH_DA` sets `Accounts[Mike] = 2.00 zBTC`. | |
| 112 | + | 2. **Attack:** Zero Zenon signers cooperate; Alice and Bob are offline or hostile. | |
| 113 | + | 3. **Mike Exits `0.25 BTC` Directly on Bitcoin L1:** Mike posts `0x01 FORCED_EXIT(0.25 BTC, P_Mike, maxOpFee)` + `ExitSlotUTXO`. Any `1-of-M` honest operator $O_j$ fronts `0.25 BTC - fee` directly to `P_Mike` in `vout[0]` (leaving Mike `1.75 zBTC` intact in `Accounts[Mike]`), earns `ReimbursementCredit[O_j] += 0.25 BTC`, and reclaims one `0.25 BTC` vault from the unassigned pool (`0.50 + 0.25 + 0.25` maps `0.25 BTC` 1:1 with zero change bottleneck!). | |
| 114 | + | 4. *Irreducible Residual Boundary ([`spec/01 §1.2`](./01-bitcoin-taproot-vault-enforcement.md) Corollary 1B):* If **100% of all `M = 3–5` pre-registered operators** vanish simultaneously, Mike's exit stalls until an operator returns (zero theft; Mike can reclaim his `0.25 zBTC` via Leaf `2M` `EXIT_CANCEL` after `288` blocks). Under a `100%` bank run of `15 BTC` (`3.0` float + `12.0` vaults), full queue drain takes **`~65 days`** (`M = 5`, `0.556` vaults/d ≈ `0.185 BTC/d`) or **`~72 days`** (`M = 3` on `10 BTC`, `~43–47d` with `{0.50, 0.50}` vaults). | |
| 166 | 115 | ||
| 167 | - | ### 5.1 PTLC Taproot MuSig2 Adaptor Atomic Swap (BIP-327 Tweaked) | |
| 116 | + | --- | |
| 168 | 117 | ||
| 169 | - | **Protocol (Alice sells BTC, Bob sells `zBTC`; Bob holds secret $t$):** | |
| 170 | - | 1. **Setup**: Bob samples $t \in \mathbb{Z}_n^*$, sends compressed 33-byte point $T = \text{compress}(t \cdot G)$ to Alice. | |
| 171 | - | 2. **Bitcoin Funding (BIP-327 Tweaked Taproot)**: Compute $P_{\text{swap}} = \text{MuSig2\_KeyAgg}(pk_A, pk_B)$, Tapscript refund leaf $L_{\text{ref}} = \text{<12> OP\_CSV OP\_DROP <pk\_A> OP\_CHECKSIG}$, tweak $t_{\text{tap}} = H_{\text{"TapTweak"}}(x(P_{\text{swap}}) \parallel \text{TapLeaf}(L_{\text{ref}}))$, and tweaked key $Q_{\text{swap}} = P_{\text{swap}} + t_{\text{tap}} \cdot G$ with BIP-327 accumulated tweak `t_acc` and key parity `g_key`. Alice funds `0x51 0x20 || x(Q_swap)`. Let $h_{\text{conf}}$ be confirmation height and $T_{\text{btc\_worst}}$ correspond to $h_{\text{conf}} + 12$. | |
| 172 | - | 3. **Bob Locks `zBTC` FIRST**: **BEFORE Alice releases ANY partial signature**, Bob calls `PtlcContract.Create(expirationTime = T_znn, pointType = 2, pointLock = compress(T), destination = Alice_Addr)` (`dev:vm/embedded/definition/ptlc.go:114-120`) with `T_znn >= T_btc_worst + 6 hours` (`21,600s`). Wait until confirmed. | |
| 173 | - | 4. **Alice Verifies Zenon Lock & Exchanges BIP-327 Tweaked Adaptor Signatures**: Alice verifies the confirmed PTLC, exchanges MuSig2 nonces $(R_A, R_B)$, forms $R' = R_A + R_B + T$ with parity $g_R$, computes $e = H_{\text{BIP0340/challenge}}(x(R') \parallel x(Q_{\text{swap}}) \parallel m)$, exchanges $(\tilde{s}_A, \tilde{s}_B)$, and aggregates per **BIP-327 `PartialSigAgg`**: | |
| 174 | - | $$\tilde{s} = \tilde{s}_A + \tilde{s}_B + e \cdot g_{\text{key}} \cdot t_{\text{acc}} \pmod n$$ | |
| 175 | - | 5. **Atomic Claim**: Bob completes $s = \tilde{s} + g_R \cdot t \pmod n$ and broadcasts $(x(R'), s)$ before $h_{\text{conf}} + 12$. Alice extracts $t_{\text{ext}} = g_R \cdot (s - \tilde{s}) \bmod n$, verifies $\text{compress}(t_{\text{ext}} \cdot G) == \text{PointLock}$, and calls `PtlcContract.Unlock(ptlcId, t_ext)` (`dev:vm/embedded/implementation/ptlc.go:82-95`). | |
| 118 | + | ## 3. Stage 1B (Alternative Gate): `clArk` VTXO Coordination Rails | |
| 176 | 119 | ||
| 177 | - | ### 5.2 HTLC Atomic Swaps & Lightning Network Submarine-Swap Gateway (`hashType = 1` SHA256) | |
| 120 | + | If the project cannot commit `~12.8–18.8 BTC` of hard operator/verifier capital or requires a `3–6` month mainnet ship window using existing audited open-source stacks (`Second bark/barkd` or `Ark Labs arkd`), Stage 1B offers an explicit **non-federated, zero-soft-fork alternative** with **`2–5 BTC` active ASP liquidity** (`0` dead slashing bonds): | |
| 178 | 121 | ||
| 179 | - | - **ALL** Bitcoin/Lightning HTLCs pass **`hashType = 1` (`HashTypeSHA256`, `dev:vm/embedded/definition/htlc.go:92`)**. | |
| 180 | - | - **Inbound (LN → `zBTC`)**: User pays Gateway's LN Hold Invoice FIRST; ONLY AFTER Hold Invoice reaches `ACCEPTED` with CLTV `>= now + 2 * Δ_safety` does Gateway lock `zBTC` in `HtlcContract` (`T_znn <= T_ln - Δ_safety`). | |
| 181 | - | - **Outbound (`zBTC` → LN)**: User locks `zBTC` (`hashType = 1`); Gateway pays BOLT-11 invoice (`T_ln <= T_znn - Δ_safety`), learns $r$, unlocks `zBTC`. | |
| 182 | - | - **Mandatory Conformance Vectors (G-18)**: Signet↔Zenon tests for claim-then-reclaim rejection, odd-$y(R')$ parity, BIP-327 `PartialSigAgg` Taproot spend, `hashType = 0` rejection, Bob-locks-first ordering, and inbound LN Hold Invoice `ACCEPTED`-first enforcement. | |
| 122 | + | - **Zenon's Role:** Feeless off-chain coordination, round scheduling, VTXO intent indexing, and Stage 0 SPV verification — **0% Zenon consensus custody dependency**. | |
| 123 | + | - **Exact Trade-Offs (Mandatory Disclosure):** | |
| 124 | + | 1. **Post-Round `0-of-N` Unilateral Exit (Until Expiry):** Once Mike's `0.25 BTC` VTXO is confirmed in an L1 `clArk` round tree, Mike exits unilaterally on Bitcoin L1 with **zero ASP/signer cooperation** by broadcasting his pre-signed `log2(N)` branch (`6..10` txs for `N = 64..1,024` VTXOs, using TRUC v3 + ephemeral anchors). | |
| 125 | + | 2. **Pre-Round (`arkoor`) Sender+ASP Collusion Risk:** Instant feeless out-of-round transfers (`Alice -> Mike`) are vulnerable to `Alice + ASP` double-spend collusion until the next L1 round refreshes Mike into a new VTXO tree. | |
| 126 | + | 3. **Hard VTXO Expiry & Liquidity Lockup:** VTXOs expire (e.g., `14–30` days) back to the ASP sweep key, forcing Mike online to refresh or pay `log2(N)` L1 exit fees; ASP liquidity (`2–5 BTC`) is locked `100%` for each full expiry cycle, capping round turnover to `2–5 BTC`/cycle. | |
| 127 | + | 4. **No Global Pooled `zBTC` Token:** `clArk` VTXOs are discrete UTXO trees, not a single global fungible `zBTC` balance sheet composable with Zenon DeFi — and `clArk` VTXOs do **not** migrate automatically into Stage 1A Rollup `zBTC` without on-chain L1 settlement. | |
| 183 | 128 | ||
Document Class: Normative Settlement, Rollup State Transition & Feeless Payment Specification (v1 / v3.0.0-rfc — Zero-Federation Phased Architecture; supersedes archived v0 v2.5.0-rfc)
Custody Posture: ZERO federated signers, ZERO ZNN governance/slashing custody coupling, ZERO federated multisig or embedded-contract pre-minting.
Consistency Checker: scripts/verify_spec_bounds.py
1. Stage 0: Non-Custodial PTLC & HTLC Atomic Swaps (PtlcSpork, M-4 Hardened)
Stage 0 launches with 0 BTC protocol custody (0–5 BTC voluntary LP capital), strictly honoring zenon-developer-commons (essays/Verify Bitcoin, Don't Bridge It.md). Native BTC stays in user self-custody on Bitcoin L1 or Lightning; Zenon swaps native ZNN/QSR/ZTS assets atomically via PtlcContract and HtlcContract.
Stage 0 Scope Honesty: Stage 0 atomic swaps do not create pooled, fungible
zBTCon Zenon. A counterparty LP is required for every swap, and under a severe Zenon attack rational LPs pull liquidity. Stage 0 delivers immediate zero-custody Bitcoin interoperability while Stage 1A (BitVMXSovereign Rollup) or Stage 1B (clArk) is built and audited.
1.1 Hardened BIP-327 Tweaked Taproot PTLC Swap (M-4)
Protocol (Alice sells BTC on Bitcoin L1; Bob sells Zenon asset on Zenon; Bob holds secret scalar $t \in \mathbb{Z}_n^*$):
- Setup: Bob sends compressed 33-byte point $T = \text{compress}(t \cdot G)$ to Alice.
- Bitcoin Taproot Funding (
>= 72-Block CSV): Compute $P_{\text{swap}} = \text{MuSig2_KeyAgg}(pk_A, pk_B)$, Tapscript refund leaf $L_{\text{ref}} = \text{<72> OP_CSV OP_DROP <pk_A> OP_CHECKSIG}$, tweak $t_{\text{tap}} = H_{\text{"TapTweak"}}(x(P_{\text{swap}}) \parallel \text{TapLeaf}(L_{\text{ref}}))$, and $Q_{\text{swap}} = P_{\text{swap}} + t_{\text{tap}} \cdot G$ with BIP-327 accumulated tweakt_accand parityg_key. Alice funds0x51 0x20 || x(Q_swap). Let $h_{\text{conf}}$ be Bitcoin confirmation height andnow_unixbe current UTC Unix seconds. - Absolute Unix Timestamp Lock &
2.3×Slow-Block Margin:go-zenon'sPtlcContract.Createcomparesmomentum.Timestamp.Unix() >= param.ExpirationTime(origin/dev:vm/embedded/implementation/ptlc.go:326), requiring an absolute Unix timestamp (NEVER a relative duration!).- Define
T_znn_sec = 108,000seconds (30.0h,~9,474Momentums at observed11.4s/Momentum) andexpirationTime = now_unix + T_znn_sec. - Verified
2.3×June-2021 Slow-Block Margin: Bob MUST confirm his Bitcoin claim byh_conf + 66(6blocks before Alice'sh_conf + 72refund). Even under June 2021's worst daily average block slowdown (2.3×nominal =1,380s/block),66 × 600s × 2.3 = 91,080s = 25.3h < 30.0h, leaving Alice>= 4.7hof honest wall-clock safety margin to extract $t$ and callPtlcContract.Unlock. - Bob calls
PtlcContract.Create(expirationTime = now_unix + 108000, pointType = 2, pointLock = compress(T), destination = Alice_Addr)(origin/dev:vm/embedded/definition/ptlc.go:118-129).
- Adaptor Exchange & Explicit Grief/Free-Option Disclosure:
- Alice sends BIP-327 adaptor partial signature $\tilde{s}_A$ within
<= 6Bitcoin blocks of Zenon PTLC confirmation ($R' = R_A + R_B + T$ with parity $g_R$, $\tilde{s} = \tilde{s}A + \tilde{s}B + e \cdot g{\text{key}} \cdot t{\text{acc}} \pmod n$). - Explicit Disclosure: Because
PtlcContracthas no early reclaim prior toExpirationTime, if Alice withholds $\tilde{s}_A$, Bob's Zenon funds remain grief-locked for the full30hduration (zero theft, pure time-lock grief). Once Alice releases $\tilde{s}_A$, Bob holds an~8h(~48-block) free option until hish_conf + 54(18-block remaining) broadcast cutoff. Production LPs bound this via small per-peer swap limits or reputation/Lightning Hold Invoices.
- Alice sends BIP-327 adaptor partial signature $\tilde{s}_A$ within
- Confirmed-Before-Refund Atomic Claim: Bob completes $s = \tilde{s} + g_R \cdot t \pmod n$ with a
<pk_B>CPFP anchor and MUST confirm byh_conf + 66. Alice extracts $t_{\text{ext}} = g_R \cdot (s - \tilde{s}) \bmod n$, checkscompress(t_ext * G) == PointLock, and callsPtlcContract.Unlock(ptlcId, t_ext)(origin/dev:vm/embedded/implementation/ptlc.go:82-97).
1.2 HTLC & Lightning Submarine-Swap Gateway
- Hash Type: ALL Bitcoin/Lightning HTLCs MUST use
hashType = 1(HashTypeSHA256,origin/dev:vm/embedded/definition/htlc.go:92). - Consistent Unix-Second Arithmetic: Let
Δ_safety_blocks = 36(6hnominal,13.8hat2.3×slow blocks) andΔ_safety_sec = 36 × 600 = 21,600s(or49,680sat2.3×).- Inbound (
LN → Zenon): User pays Gateway's LN Hold Invoice FIRST; ONLY AFTER Hold Invoice reachesACCEPTEDwithremaining_cltv_blocks >= 72(2 × Δ_safety_blocks) does Gateway lock Zenon funds inHtlcContractwithexpirationTime_unix <= now_unix + (remaining_cltv_blocks - 36) * 600. Gateways MUST enforce<= 5concurrent pending hold invoices,<= 0.10 BTCexposure per peer, and a 5-minute cancel TTL. - Outbound (
Zenon → LN): User locks Zenon funds (hashType = 1,expirationTime_unix >= now_unix + 2 * 21,600); Gateway pays BOLT-11 invoice whose CLTV expiry satisfiesnow_unix + cltv_blocks * 600 <= expirationTime_unix - 21,600, learns preimage $r$, and unlocks ZenonHtlcContract.
- Inbound (
2. Stage 1A: Sovereign Rollup STF $\mathcal{F}$ & Feeless Zenon Sequencer Rails
In Stage 1A, zBTC is a Bitcoin-Anchored Sovereign ZK Validity Rollup backed by right-sized BitVMX (n = 8, M = 3–5, N = 7) deleted-key vaults (spec/01). Zero federated signers and zero ZNN governance keys touch BTC custody or zBTC supply.
2.1 Immutable Rollup SMT State Schema
The canonical zBTC ledger state $R_h$ is a 256-bit Sparse Merkle Tree (SHA-256 / Poseidon2) maintained deterministically by $\mathcal{F}$ over Bitcoin L1 blocks (spec/02 §3):
| SMT Namespace | Key | Value Fields | Invariants |
|---|---|---|---|
Accounts | acctId (u32) | { pubkey: bytes32 (BIP-340), balanceSats: u64, nonce: u32 } | balanceSats >= 0; nonce strictly monotonic (+1/tx). |
Vaults | vaultId (bytes32) | { denomSats: u64 ∈ {50_000_000, 25_000_000}, status: UNASSIGNED | ASSIGNED(opId, lane, round) | REIMBURSED | SLASHED_EQUIV } | Total active vaults always back Circ + PendingExits + ReimbursementCredit 1:1. |
PendingExits | exitId (bytes32) | { acctId, grossSats, maxOpFeeSats, destScriptPubKey, cancelPubKey, exitSlotOutpoint(36B), status: OPEN | COMPLETED | CANCELLED } | Created ONLY by burning grossSats from Accounts[acctId] via 0x02 or L1 0x01. |
RollupLocks | lockId (bytes32) | { senderAcctId, destAcctId, amountSats, expiryBtcHeight, lockType: HTLC | PTLC, lockDigest(33B) } | First-class rollup opcodes (RollupHTLC, RollupPTLC) for atomic swaps inside the SMT. |
OperatorState | opId (u32) | { active: bool, lanes: [L], suspended: bool } | Auto-suspended if B_zbtc < 0.60 BTC/lane. |
ReimbursementCredit | opId (u32) | creditSats: u64 | Incremented ONLY on K-deep verified ExitSlotUTXO payout (vout[0]); deterministically consumed FIFO inside $\mathcal{F}$ to assign the oldest eligible UNASSIGNED vault (re-credited only on explicit O_j-signed 0x07 RELEASE_ASSIGNMENT). |
LockedOperatorCollateral (B_zbtc) | (opId, lane) | collateralSats: u64 (60,000,000 sats = 0.60 BTC/lane floor) | Partitioned: 0.50 BTC max-vault restitution + 0.05 BTC equivocation bounty + 0.05 BTC ExitSlotUTXO grief buffer. |
Global Solvency Conservation Invariant (Checked on Every State Transition $R_{h-1} \to R_h$): $$\sum_{v \in \text{Unassigned} \cup \text{Assigned}} D_v ;=; \sum_{a \in \text{Accounts}} \text{balance}a ;+; \sum{\ell \in \text{RollupLocks}} \text{amt}\ell ;+; \sum{e \in \text{PendingExits}{\text{OPEN}}} \text{gross}e ;+; \sum{o} \text{ReimbursementCredit}o ;+; \sum{o,l} B{\text{zbtc}}(o,l)$$
2.2 Honest Feeless Zenon Sequencer Rails (M-9, M-10)
- Exact Zenon Transport Format (NOT Native
TokenContractZTS):- Because
TokenContractZTS transfers depend on Zenon L1 consensus (which fails at 49% —spec/04 §1), Stage 1AzBTCbalances live strictly in the Rollup SMT above, NOT ingo-zenon'sTokenContract. - Users transmit signed
110 Brollup transactions (op(1) || domain(1) || fromAcctId(4) || toAcctId(4) || amountSats(8) || nonce(4) || batchTipSats(4) || expiryBtcHeight(4) || memoTag(16) || bip340Sig(64)=110 B;+32 B = 142 Bwhen creating a new recipient pubkey) inside standard ZenonAccountBlock.Data(UserSendto a canonical burn/sequencer sink address withAmount = 0). - Exact Zenon Plasma Cost (At Floor Price
1,000): $$\text{BasePlasma}(\text{110 B rollup tx}) = 21{,}000 + 68 \times 110 = \mathbf{28{,}480\text{ Plasma}}$$- Funded by
14 QSRrefundable fused Plasma (ceil(28,480 / 2,100) = 14 QSR, zero burn, replenished immediately upon confirmation) OR42.72MSHA3-256 PoW hashes (28,480 × 1,500,~0.15–0.4sdesktop /~3–12smobile WASM). - Bitcoin L1 Fee Paid by User on Zenon Transfer:
0satoshis (0burned ZNN/QSR; optionalbatchTipSatsfor fast L10x02batch inclusion).
- Funded by
- Because
- Honest
go-zenonThroughput Ceilings (Bounded by8 MiBWire Cap):- Observed mainnet Momentum time is
~11.4s(origin/dev:vm/embedded/definition/spork.go:43-46). - Standard 2-block Zenon transfers (
21,000send +21,000receive =42,000Plasma):~4.4tx/s at the pinned2,100,000floor,~8.8tx/s at the4,200,000default. - 1-block
110 BAccountBlock.Datarollup sends (28,480Plasma, zero receive block needed):~6.5tx/s at2.1Mfloor,~12.9tx/s at4.2Mdefault. - Real Hard Protocol Ceiling (
MaxMomentumContentBytes = 8 MiB):origin/dev:verifier/momentum.go:93hard-caps cumulative protobuf-serialized Momentum content at8,388,608 B(8 MiB) andorigin/dev:protocol/protocol.go:70capsMaxDetailedMomentumWireSize = 10 MiB - 2 MiB - 4 KiB(~8.38 MB). At~300–350 Bserialized per account block, a Momentum holds~24,000–27,000blocks maximum — yielding~1,050–1,200full 2-block transfers/s (or~2,100–2,4001-block rollup sends/s), NOT the naive4,386tx/s implied by2.1B / 42,000 / 11.4!
- Observed mainnet Momentum time is
- Graceful Degradation Under Dynamic Plasma DoS: Because
origin/dev:dp/dp.go:102-151has no absolute upper price clamp, a whale QSR attack can temporarily spike Zenon Plasma prices (spec/05 §2.2). Under such an attack, feeless Zenon soft preconfirmations degrade cleanly to Bitcoin L10x03 FORCED_TRANSFERand0x01 FORCED_EXIT(paying standard Bitcoin L1 miner fees, completely bypassing Zenon!).
2.3 Permissionless DA Batcher Economics
- Zero Trusted Sequencer or Protocol Treasury: Anyone (an operator, a wallet provider, or a user) can read
AccountBlock.Datarollup txs from Zenon, generateπ_batch, and post0x02 BATCH_DAonto Bitcoin L1 with complete mutated SMT leaves (16 Bexisting /48 Bnew). - Sustainable Incentives: Batchers earn optional
batchTipSatsfrom rollup transfers, operator fronting fee spreads (since fronting operators need timely0x02batching to settlePendingExits), or self-sponsored batching by users/merchants. A batch of500transfers updating~600existing accounts requires~9.6 KBwitness (~2.4 kvBvbytes) +~0.1–10 kvBproof =~2.5–12.4 kvB(~0.0005–0.0025 BTCat20 sat/vB, or~100–500sats amortized per transfer!).
2.4 B_zbtc Accounting, ExitSlotUTXO Spend-or-Refund & Dual-Input Slash Split
- Per-Lane
B_zbtcCollateral (0.60 BTC=60,000,000sats):0.50 BTC(maxVaultDenom) reserved for 1:1 vault restitution if $O_j$ executes a Lamport equivocation onTakeTxafterT_take = 1,152.0.05 BTCequivocation bounty paid to the challenger who broadcastsBurnBondTx_{r,k}beforeT_cooldown = 1,296(on top of burning100%of $O_j$'s2.00 BTCL1Bond_BTCtoOP_RETURN).0.05 BTCExitSlotUTXOgrief buffer (handles up to5consecutive non-paying grief attempts before hitting the0.55 BTCcustody floor, with immediate auto-suspension on the first grief!).
ExitSlotUTXOUniversal Spend-or-Refund Rule (Zero Frozen Exits):- Created by
0x01 FORCED_EXITwith2M + 1Tapscript leaves (zero anonymousOP_TRUEleaves!):- Leaves
0..M-1: Priority slot per registered operator $O_j$ (staggered<6*j> OP_CSV OP_DROP <P_{O_j}> OP_CHECKSIG). - Leaves
M..2M-1: Open-race leaves for all registered operators (<6*M> OP_CSV OP_DROP <P_{O_j}> OP_CHECKSIG). - Leaf
2M(EXIT_CANCEL):<288> OP_CSV OP_DROP <cancelPubKey_user> OP_CHECKSIG.
- Leaves
- On ANY
K-deep spend ofExitSlotUTXO:- Valid Fronting (Leaf
0..2M-1ANDvout[0]paysdestScriptPubKey>= grossSats - maxOpFeeSats): TransitionPendingExits[exitId] -> COMPLETED, creditReimbursementCredit[O_j] += grossSats. - Non-Paying Grief Spend (Leaf
0..2M-1ANDvout[0]FAILS payment check): Atomically transitionPendingExits[exitId] -> CANCELLED, refund fullgrossSatszBTCtoAccounts[acctId], slash0.01 BTC(1,000,000sats) from $O_j$'sB_zbtcgrief buffer (credited to the victim'szBTCbalance to cover L1 retry fees), and auto-suspend $O_j$ from fronting until $O_j$ topsB_zbtcback up to>= 0.60 BTC/lane! - User Cancel (Leaf
2Mafter288blocks): Atomically transitionPendingExits[exitId] -> CANCELLEDand refund fullgrossSatszBTCtoAccounts[acctId].
- Valid Fronting (Leaf
- Created by
- Dual-Input
Stake_rSlash (Positive EV Even Against6-of-7Verifier Collusion):- When
DisproveTx_{r,i}orTimeoutSlashTx_{r,i}spends BOTHStake_r(vin[0]) ANDVaultConnector_r(vin[1]) beforeT_take = 1,152:0sats are stolen fromU_d;Vaults[vaultId]immediately returns toUNASSIGNED.- L1
Stake_r(2.00 BTC) splits0.15 BTC→ winning verifier $V_i$ and1.85 BTC→OP_RETURNburn. - Inside $\mathcal{F}$, $O_j$'s entire
0.55 BTCcustody slice ofB_zbtc(0.50 + 0.05, untouched because0sats were stolen!) is atomically split equally across all remainingk <= 6verifiers who posted0x04 CHALLENGE_CLAIMin[0, 144]: each receives>= 0.55 / 6 = 0.09166666 BTC > 0.075 BTC(15 kvBverifier fee @500 sat/vB) +100%of theirF_chal = 0.40 BTCreturned fromChalEscrow_{r,j}, guaranteeing>= +0.0167 BTCpositive EV for every honest verifier even if6 of 7verifiers collude with $O_j$ (while attacker P&L is-2.55 BTCsolo and-2.40to-1.9417 BTCwith1..6colluding verifiers — strictly-1.94to-2.55 BTC!).
- When
2.5 End-to-End State Traces: Bob (0.50 BTC) & Mike (0.25 BTC)
- Bob's Partial Recovery (
1 BTC → spend 0.50 zBTC → recover 0.50 BTCunder49%–100%Zenon Compromise):- Bob deposits
1.00 BTCvia0x00 DEPOSIT→ creates deleted-key vaults{0.50, 0.25, 0.25}BTC; afterK = 14blocks,Accounts[Bob] = 1.00 zBTC. - Bob sends
0.50 zBTCto Carol via110 BAccountBlock.Dataon Zenon (28,480Plasma,0sat BTC fee) → batcher anchors0x02 BATCH_DA→Accounts[Bob] = 0.50 zBTC,Accounts[Carol] = 0.50 zBTC. - Attack:
49%(or100%) of Zenon Pillars turn hostile, split Zenon across its 30-Momentum cliff, censor Bob on Zenon, and spike Dynamic Plasma. - Bob Exits Directly on Bitcoin L1: Bob broadcasts
0x01 FORCED_EXIT(0.50 BTC, P_Bob, maxOpFee)+ExitSlotUTXOon Bitcoin L1 (completely bypassing Zenon!). AfterK = 14blocks, $\mathcal{F}$ burns Bob's0.50 zBTCand opensPendingExits[exit_Bob]. - Any
1-of-Mhonest operator $O_j$ (M = 3–5) spendsExitSlotUTXOpaying0.50 BTC - feedirectly toP_Bobinvout[0](~10 min on L1!), earnsReimbursementCredit[O_j] += 0.50 BTC, and later reclaims one0.50 BTCvault viaBitVMXRoundTx_r→TakeTx(monitored byN = 7verifiers). Zero Zenon signers, zero federated signers, zero ZNN trust.
- Bob deposits
- Mike's Cross-Depositor Exit (
Alice 1 + Bob 1 → Mike 2 → Mike recovers 0.25 BTCwith0Zenon Signer Cooperation):- Alice deposits
1.00 BTC({0.50, 0.25, 0.25}) and Bob deposits1.00 BTC({0.50, 0.25, 0.25}); both send1.00 zBTCfeelessly to Mike on Zenon →0x02 BATCH_DAsetsAccounts[Mike] = 2.00 zBTC. - Attack: Zero Zenon signers cooperate; Alice and Bob are offline or hostile.
- Mike Exits
0.25 BTCDirectly on Bitcoin L1: Mike posts0x01 FORCED_EXIT(0.25 BTC, P_Mike, maxOpFee)+ExitSlotUTXO. Any1-of-Mhonest operator $O_j$ fronts0.25 BTC - feedirectly toP_Mikeinvout[0](leaving Mike1.75 zBTCintact inAccounts[Mike]), earnsReimbursementCredit[O_j] += 0.25 BTC, and reclaims one0.25 BTCvault from the unassigned pool (0.50 + 0.25 + 0.25maps0.25 BTC1:1 with zero change bottleneck!). - Irreducible Residual Boundary (
spec/01 §1.2Corollary 1B): If 100% of allM = 3–5pre-registered operators vanish simultaneously, Mike's exit stalls until an operator returns (zero theft; Mike can reclaim his0.25 zBTCvia Leaf2MEXIT_CANCELafter288blocks). Under a100%bank run of15 BTC(3.0float +12.0vaults), full queue drain takes~65 days(M = 5,0.556vaults/d ≈0.185 BTC/d) or~72 days(M = 3on10 BTC,~43–47dwith{0.50, 0.50}vaults).
- Alice deposits
3. Stage 1B (Alternative Gate): clArk VTXO Coordination Rails
If the project cannot commit ~12.8–18.8 BTC of hard operator/verifier capital or requires a 3–6 month mainnet ship window using existing audited open-source stacks (Second bark/barkd or Ark Labs arkd), Stage 1B offers an explicit non-federated, zero-soft-fork alternative with 2–5 BTC active ASP liquidity (0 dead slashing bonds):
- Zenon's Role: Feeless off-chain coordination, round scheduling, VTXO intent indexing, and Stage 0 SPV verification — 0% Zenon consensus custody dependency.
- Exact Trade-Offs (Mandatory Disclosure):
- Post-Round
0-of-NUnilateral Exit (Until Expiry): Once Mike's0.25 BTCVTXO is confirmed in an L1clArkround tree, Mike exits unilaterally on Bitcoin L1 with zero ASP/signer cooperation by broadcasting his pre-signedlog2(N)branch (6..10txs forN = 64..1,024VTXOs, using TRUC v3 + ephemeral anchors). - Pre-Round (
arkoor) Sender+ASP Collusion Risk: Instant feeless out-of-round transfers (Alice -> Mike) are vulnerable toAlice + ASPdouble-spend collusion until the next L1 round refreshes Mike into a new VTXO tree. - Hard VTXO Expiry & Liquidity Lockup: VTXOs expire (e.g.,
14–30days) back to the ASP sweep key, forcing Mike online to refresh or paylog2(N)L1 exit fees; ASP liquidity (2–5 BTC) is locked100%for each full expiry cycle, capping round turnover to2–5 BTC/cycle. - No Global Pooled
zBTCToken:clArkVTXOs are discrete UTXO trees, not a single global fungiblezBTCbalance sheet composable with Zenon DeFi — andclArkVTXOs do not migrate automatically into Stage 1A RollupzBTCwithout on-chain L1 settlement.
- Post-Round
Attack this spec & submit feedback
This is a Public RFC updated to v2 (v3.1.0-rfc) in response to Consolidated Hostile Review R8 (redlining against archived v1 / v3.0.0-rfc). Humans and AI review agents are invited to run python3 -I scripts/verify_spec_bounds.py, inspect the v1 → v2 changelog & redlines, file findings, or open pull requests.