v2 (v3.1.0-rfc) · public rfc · zero-federation · not mainnet-active
Part 2: Stage 0 Direct-on-L1 Bitcoin SPV Event Oracle & Stage 1A Bitcoin-L1-Canonical Authorization Domain
Showing word-highlighted redline changes from archived v1 (v3.0.0-rfc) to v2 (v3.1.0-rfc). For structured finding-by-finding rationale, see theChangelog.
| @@ -1,5 +1,5 @@ | |||
| 1 | 1 | # Part 2: Stage 0 Direct-on-L1 Bitcoin SPV Event Oracle & Stage 1A Bitcoin-L1-Canonical Authorization Domain | |
| 2 | 2 | ||
| 3 | - | **Document Class:** Normative Bitcoin SPV Verification & L1 Authorization Domain Specification (`v1` / `v3.0.0-rfc` — Zero-Federation Phased Architecture; supersedes archived `v0` `v2.5.0-rfc`) | |
| 3 | + | **Document Class:** Normative Bitcoin SPV Verification & L1 Authorization Domain Specification (`v2` / `v3.1.0-rfc` — Zero-Federation Phased Architecture; supersedes archived `v1` `v3.0.0-rfc` and `v0` `v2.5.0-rfc`) | |
| 4 | 4 | **Philosophical Anchor:** Stage 0 implements Zenon's non-custodial verification thesis (`zenon-developer-commons`: `essays/Verify Bitcoin, Don't Bridge It.md` & `docs/specs/spv-event-oracle-spec.md`): **Event Validity only, zero custody authority**. Stage 1A moves canonical `zBTC` authorization, data availability, and forced exit directly onto **Bitcoin L1** so that `49%–100%` Zenon compromise cannot forge state or censor exits. | |
| 5 | 5 | **Consistency Checker:** [`scripts/verify_spec_bounds.py`](../scripts/verify_spec_bounds.py) | |
| @@ -17,5 +17,5 @@ | |||
| 17 | 17 | 2. **Stage 1A — Bitcoin-L1-Canonical Authorization Domain (`vk_STF` Rollup Circuit):** | |
| 18 | 18 | - For pooled, fungible `zBTC` (`Stage 1A`), **Zenon L1 does NOT authorize mints, burns, or exits**. | |
| 19 | - | - Instead, the immutable RISC-V / ZK Rollup State Transition Function ($\mathcal{F}$, compiled to `RV32IM` for `BitVMX-CPU` `n = 8` bisection — `spec/01`) scans **complete stripped Bitcoin blocks** directly on Bitcoin L1, deriving the entire canonical `zBTC` state root $R_h$ strictly from Bitcoin's heaviest PoW chain (`0-of-N` Zenon trust; `0%` ZNN market-cap coupling). | |
| 19 | + | - Instead, an off-chain ZK prover executes the deterministic Rollup State Transition Function ($\mathcal{F}$) over **complete stripped Bitcoin blocks** directly on Bitcoin L1, deriving the entire canonical `zBTC` state root $R_h$ strictly from Bitcoin's heaviest PoW chain (`0-of-N` Zenon trust; `0%` ZNN market-cap coupling). Inside `BitVMX-CPU` (`RV32IM`), only the **constant-size wrapped SNARK verifier `vk_STF`** runs (`R8-H05`), NEVER bare 1 MB block SHA-256 scanning! | |
| 20 | 20 | ||
| 21 | 21 | --- | |
| @@ -31,9 +31,10 @@ | |||
| 31 | 31 | // retargetStartHash(32B), retargetStartTime(u32), retargetHeight(u64), mtpWindow[11](u32) } | |
| 32 | 32 | admissionDepthN : u32 // 6 blocks (provisional event admission; reversible on reorg) | |
| 33 | - | finalizationDepthK : u32 // 12 blocks (oracle event finalization depth) | |
| 33 | + | finalizationDepthK : u32 // 12 blocks (oracle event finalization depth; probabilistic PoW finality) | |
| 34 | 34 | minimumPostAnchorWork : u256 // finalizationDepthK * blockWork(genesisAnchor.nBits) | |
| 35 | 35 | retainedReorgDepth : u32 // 144 blocks (stale HeaderNode pruning ONLY; ActiveChainByHeight NEVER pruned) | |
| 36 | 36 | maximumHeaderBatch : u32 // 2 headers per SubmitHeaderBatch call | |
| 37 | 37 | maximumMerkleDepth : u32 // 16 levels (65,536 txs/block) | |
| 38 | + | minimumStrippedTxBytes : u32 // 65 B (rejects 64-byte CVE-2017-12842 interior nodes & impossibly short txs) | |
| 38 | 39 | maximumStrippedTxBytes : u32 // 6,144 B (per-call Stage 0 proof cap; fits 3x inside pinned 2.1M Plasma floor) | |
| 39 | 40 | futureTimeGuardSecs : u32 // 7,200 s (Bitcoin consensus MAX_FUTURE_BLOCK_TIME) | |
| @@ -53,5 +54,5 @@ | |||
| 53 | 54 | | `StepReorg()` | `52,500` (Simple) | `0 B` | `4 B` | `52,500` (`25 QSR`) | `<= 6` | Walk 1 incremental reorg step; emits deterministic reorg state transition if an admitted `< 12`-deep event is orphaned; flags `DeepReorgAlert = 1` if `ReorgSteps > 144`. | | |
| 54 | 55 | | `PruneStaleHeaders(hashes)` | `52,500` (Simple) | `64 B` (`2 × 32 B`) | `132 B` | `61,204` (`30 QSR`) | `<= 4` | Delete `1..2` stale `HeaderNode`s (`height < BestTip - 144 && height % 2016 != 0 && ReorgActive == 0`). | | |
| 55 | - | | `ProveTxInclusion(...)` | `73,500` (Heavy SPV) | `7,279 B` | `7,620 B` | `591,388` (`282 QSR`) | `<= 8` | Verify `>= N`-deep `strippedTx` (`<= 6,144 B`) + 1-/2-block coinbase midstate + Merkle inclusion → record `VerifiedEvent[txid]`. | | |
| 56 | + | | `ProveTxInclusion(...)` | `73,500` (Heavy SPV) | `7,279 B` | `7,620 B` | `591,388` (`282 QSR`) | `<= 8` | Verify `>= N`-deep `strippedTx` (`65..6,144 B`) + 1-/2-block coinbase midstate + Merkle inclusion → record `VerifiedEvent[txid]`. | | |
| 56 | 57 | ||
| 57 | 58 | *Exact `ProveTxInclusion` ABI Derivation (Full `32 B`-Padded Accounting):* | |
| @@ -60,10 +61,10 @@ | |||
| 60 | 61 | - Total ABI `= 260 + 7,360 = 7,620 B <= 16,384 B` (`MaxDataLength`). Base Plasma `= 73,500 + 68 × (7,620 - 4) = 591,388`. Up to **`3`** max-size `ProveTxInclusion` calls (`1,774,164 <= 2,100,000`) fit inside a single Momentum even at the pinned floor (`6` at default `4,200,000`). | |
| 61 | 62 | ||
| 62 | - | ### 2.3 Exact 1- and 2-Block Coinbase Midstate Proof (`CVE-2017-12842`) | |
| 63 | + | ### 2.3 Exact 1- and 2-Block Coinbase Midstate Proof (`CVE-2017-12842`, `R8-M06` Hardened) | |
| 63 | 64 | ||
| 64 | 65 | Every `ProveTxInclusion` call MUST verify: | |
| 65 | 66 | 1. `ChainMeta.ReorgActive == 0` and `ChainMeta.PostAnchorWork >= minimumPostAnchorWork`. | |
| 66 | 67 | 2. `ActiveChainByHeight[blockHeight]` exists and `BestTipHeight >= blockHeight + admissionDepthN - 1`. | |
| 67 | - | 3. `len(strippedTx) <= 6,144`, `len(strippedTx) != 64` (**CVE-2017-12842**), `txIndex != 0`, and no SegWit marker (`0x00 0x01`) in stripped bytes. | |
| 68 | + | 3. **`65 <= len(strippedTx) <= 6,144`** (rejects `len == 64` **CVE-2017-12842** interior-node forgery AND any impossibly short `< 65 B` non-tx byte sequence, tightened per `R8-M06`), `txIndex != 0`, valid Bitcoin non-witness transaction syntax (`vin_count >= 1`, `vout_count >= 1`, exact byte consumption), and no SegWit marker (`0x00 0x01`) in stripped bytes. | |
| 68 | 69 | 4. `doubleSHA256(strippedTx)` verifies against `merkleRootLE` via `txBranch` at `txIndex` with `len(txBranch) == len(coinbaseBranch) <= 16` and zero duplicate-sibling **CVE-2012-2459** padding. | |
| 69 | 70 | 5. **1- and 2-Block SHA-256 Coinbase Midstate Verification:** | |
| @@ -77,5 +78,5 @@ | |||
| 77 | 78 | - **Case 2 (`56 <= rem <= 63` — 2-block final padding):** Build `B_1 = finalChunkTail[0:rem] || 0x80 || 0x00^(63 - rem)` and `B_2 = 0x00^56 || bitLen(8B)`. Compute `state_1 = SHA256_Compress(sha256Midstate, B_1)`, then `innerHash = SHA256_Compress(state_1, B_2)`. | |
| 78 | 79 | - Compute `coinbaseTxid = SHA256(innerHash)` and verify `coinbaseBranch` at index `0` against `merkleRootLE` with `len(coinbaseBranch) == len(txBranch)`. | |
| 79 | - | - *Explicit Auditability Disclosure:* A midstate proof proves that Merkle index `0` is a valid non-64-byte leaf at the same tree depth as `txIndex` (completely closing CVE-2017-12842 interior-node forgery); it does **not** parse the prefix of the coinbase transaction itself. In Stage 1A below, full coinbase bytes are directly verified inside the stripped-block scanner to extract the BIP-141 witness commitment. | |
| 80 | + | - *Explicit Auditability Disclosure:* A midstate proof proves that Merkle index `0` is a valid non-64-byte leaf at the same tree depth as `txIndex` (completely closing CVE-2017-12842 interior-node forgery); it does **not** parse the prefix of the coinbase transaction itself. In Stage 1A below, full coinbase bytes are directly verified inside the off-chain ZK stripped-block scanner to extract the BIP-141 witness commitment. | |
| 80 | 81 | ||
| 81 | 82 | ### 2.4 Stage 0 Oracle Storage Layout (`BtcSpvOracleContract`) | |
| @@ -92,62 +93,76 @@ | |||
| 92 | 93 | ## 3. Stage 1A: Bitcoin-L1-Canonical Authorization Domain (`0%` Zenon Trust) | |
| 93 | 94 | ||
| 94 | - | For pooled, fungible `zBTC`, **Bitcoin L1 is the sole canonical ordering, data-availability, and forced-inclusion layer**. Zenon Pillars act strictly as **untrusted feeless soft-preconfirmation sequencers** (`spec/03 §2`, `spec/04 §2`). Even if **49%–100% of Zenon Pillars are Byzantine**, they cannot fork `zBTC`, mint 1 unbacked satoshi, or censor Bob's or Mike's exit. | |
| 95 | + | For pooled, fungible `zBTC`, **Bitcoin L1 is the sole canonical ordering, data-availability, and forced-inclusion layer**. Zenon Pillars act strictly as **untrusted L1-subsidized soft-preconfirmation sequencers** (`spec/03 §2`, `spec/04 §2`). Even if **49%–100% of Zenon Pillars are Byzantine**, they cannot fork `zBTC`, mint 1 unbacked satoshi, or censor Bob's or Mike's exit. | |
| 95 | 96 | ||
| 96 | - | ### 3.1 Canonical Bitcoin L1 Tag Schema (`OP_RETURN "ZBTX"` `<= 80 B` + Taproot Witness) | |
| 97 | + | ### 3.1 Canonical Bitcoin L1 Tag Schema (`OP_RETURN "ZBTX"` `<= 80 B` + Authenticated Taproot Witness) | |
| 97 | 98 | ||
| 98 | - | All Stage 1A protocol events are tagged on Bitcoin L1 with a `4 B` magic prefix `"ZBTX"` (`0x5a 0x42 0x54 0x58`) and `1 B` `tag` inside an `OP_RETURN` output (`<= 80 B` standardness limit). Bulk payloads (`certBlob`, mutated SMT leaves, `π_batch`, signed forced transfers) sit inside the spending transaction's Taproot script-path witness, bound by SHA-256 commitment in the `OP_RETURN` and verified against the block's BIP-141 coinbase witness commitment. | |
| 99 | + | All Stage 1A protocol events are tagged on Bitcoin L1 with a `4 B` magic prefix `"ZBTX"` (`0x5a 0x42 0x54 0x58`) and `1 B` `tag` inside an `OP_RETURN` output (`<= 80 B` standardness limit). Bulk payloads (`certBlob`, complete mutated SMT leaves, `π_batch`, signed forced transfers) sit inside the spending transaction's Taproot script-path witness, bound by SHA-256 commitment in the `OP_RETURN` and verified against the block's BIP-141 coinbase witness commitment. | |
| 99 | 100 | ||
| 100 | 101 | | Tag | Name | `OP_RETURN` Layout & Exact Size | Taproot Witness / Additional Outputs | Purpose | | |
| 101 | 102 | |---|---|---|---|---| | |
| 102 | - | | `0x00` | `DEPOSIT` | `"ZBTX"(4) \|\| 0x00(1) \|\| recipientAcctHash(32) \|\| vaultParamsHash(32)` = **`69 B`** | Input witness carries acyclic `OP_DROP` `certBlob` (`104 B <= 520 B` BIP-342 push limit) + `<pk_depositor> OP_CHECKSIG`; outputs create `{0.50, 0.25, 0.25}` BTC deleted-key vaults (`spec/01 §2.2`, zero hash cycle — `txid_dep` is fixed before presigning). | Register `K`-deep multi-tier deposit vaults (`vaultId = txid_dep : vout`) and credit `recipientAcctHash` in the Rollup SMT. | | |
| 103 | - | | `0x01` | `FORCED_EXIT` | `"ZBTX"(4) \|\| 0x01(1) \|\| exitCommitHash(32)` = **`37 B`** | Witness carries `(acctId, nonce, grossSats, maxOpFeeSats, destScriptPubKey, cancelPubKey, sig_user)`; additional output creates the **`(2M+1)`-leaf `ExitSlotUTXO`** (`546` sat dust anchor, `spec/01 §5`, `spec/03 §2.4`). | Uncensorable L1 exit for Bob (`0.50 BTC`) or Mike (`0.25 BTC`), bypassing 49%–100% Zenon censorship & Plasma spikes. | | |
| 104 | - | | `0x02` | `BATCH_DA` | `"ZBTX"(4) \|\| 0x02(1) \|\| batchCommitHash(32)` = **`37 B`** | Witness carries `prevRoot(32B) \|\| newRoot(32B) \|\| mutatedLeaves[]` (**`16 B`** existing `{acctId(4), balanceSats(8), nonce(4)}` / **`48 B`** new `{acctId(4), pubkey(32), balanceSats(8), nonce(4)}`) `\|\| π_batch` (`~256 B` Groth16 or `~15–40 KB` transparent STARK/IPA). | Anchor feeless Zenon-sequenced transfers onto Bitcoin L1 with **100% self-contained state-diff DA** (zero Zenon node needed to reconstruct SMT!). | | |
| 105 | - | | `0x03` | `FORCED_TRANSFER` | `"ZBTX"(4) \|\| 0x03(1) \|\| txCommitHash(32)` = **`37 B`** | Witness carries signed `110 B` rollup transfer (or `RollupHTLC`/`RollupPTLC` op). | Uncensorable L1 transfer fallback if Zenon censors or Dynamic Plasma spikes. | | |
| 106 | - | | `0x04` | `CHALLENGE_CLAIM` | `"ZBTX"(4) \|\| 0x04(1) \|\| kickoffTxid(32) \|\| verifierAcctId(4)` = **`41 B`** | Emitted on every `ChallengeTx_{r,i}` opened in simultaneous window `[0, 144]` (`spec/01 §4`). | Registers honest challenger eligibility for atomic `0.55 BTC` `B_zbtc` split (`>= 0.0917 BTC` each) upon `Stake_r` slash. | | |
| 107 | - | | `0x05` | `FRONT_CLAIM` | `"ZBTX"(4) \|\| 0x05(1) \|\| exitId(32) \|\| operatorId(4)` = **`41 B`** | Emitted when operator $O_j$ spends `ExitSlotUTXO` paying `destScriptPubKey` `>= grossSats - maxOpFeeSats` in `vout[0]`. | Credits `ReimbursementCredit[O_j] += grossSats` (or triggers `0.01 BTC` grief slash + refund if `vout[0]` fails payment!). | | |
| 103 | + | | `0x00` | `DEPOSIT` | `"ZBTX"(4) \|\| 0x00(1) \|\| recipientAcctHash(32) \|\| vaultParamsHash(32)` = **`69 B`** | `vin[0]` = confirmed `U_dep_wallet` (`OP_DROP` `certBlob` `104 B <= 520 B`); `vin[1..3]` = denomination-matched `AdmissionTicketUTXO`s (`R8-C03`); `vout[0..2]` = `{0.50, 0.25, 0.25}` BTC deleted-key vaults keyed by acyclic `vault_id` (`R8-C01`). | Register `K`-deep multi-tier deposit vaults (enforcing `Cap_TVL_total` via L1 ticket conservation & $2^M$ Hall invariant) and credit `recipientAcctHash`. | | |
| 104 | + | | `0x01` | `FORCED_EXIT` | `"ZBTX"(4) \|\| 0x01(1) \|\| exitCommitHash(32)` = **`37 B`** | Witness carries `(acctId, nonce, grossSats >= max(dust, MIN_EXIT_SATS=100_000), maxOpFeeSats, destScriptPubKey, cancelPubKey, sig_user)` (`R8-M05`); additional output creates active-operator **`(2M_active+1)`-leaf `ExitSlotUTXO`** (`546` sat dust anchor, `spec/01 §5`). | Uncensorable L1 exit for Bob (`0.50 BTC`) or Mike (`0.25 BTC`), bypassing 49%–100% Zenon censorship & Plasma spikes. | | |
| 105 | + | | `0x02` | `BATCH_DA` | `"ZBTX"(4) \|\| 0x02(1) \|\| batchCommitHash(32)` = **`37 B`** | Witness carries `prevRoot(32B) \|\| newRoot(32B) \|\| batcherSlotId(2B) \|\| mutatedAccounts[]` (`16 B` existing / `48 B` new, `<= 1,000` new/6-blk epoch w/ `500`-sat refundable leaf deposit) `\|\| mutatedRollupLocks[]` `\|\| cooperativeExits[]` `\|\| creditTransfers[]` `\|\| π_batch` (`R8-C05`, `R8-M01`, `R8-M02`, `R8-M04`). | Anchor feeless Zenon-sequenced transfers, `RollupLocks`, cooperative `PendingExits`, and `TransferCredit` ops onto Bitcoin L1 with **100% self-contained state-diff DA** across all non-L1-derivable SMT namespaces! | | |
| 106 | + | | `0x03` | `FORCED_TRANSFER` | `"ZBTX"(4) \|\| 0x03(1) \|\| txCommitHash(32)` = **`37 B`** | Witness carries signed `110 B` rollup transfer (or `RollupHTLC`/`RollupPTLC` / `TransferCredit` op). | Uncensorable L1 transfer fallback if Zenon censors or Dynamic Plasma spikes. | | |
| 107 | + | | `0x04` | `CHALLENGE_CLAIM` | `"ZBTX"(4) \|\| 0x04(1) \|\| kickoffTxid(32) \|\| verifierAcctId(4)` = **`41 B`** | Emitted on every `ChallengeTx_{r,i}` opened in simultaneous window `[0, 144]` (which also creates `ChalProofConnector_{r,i}` for native-L1 `0.15 BTC` payout from `Stake_r`, `spec/01 §4`). | Indexes active challengers on-chain for auditability and optional protocol insurance attribution (native L1 verifier EV comes strictly from `Stake_r`!). | | |
| 108 | + | | `0x05` | `FRONT_CLAIM` | `"ZBTX"(4) \|\| 0x05(1) \|\| exitId(32) \|\| operatorId(4)` = **`41 B`** | Emitted when active operator $O_j$ spends `ExitSlotUTXO` paying `destScriptPubKey` `>= grossSats - maxOpFeeSats` in `vout[0]`. *(Note: even untagged `ExitSlotUTXO` spends are caught by full stripped-`vin` scanning, §3.2!)* | Credits `ReimbursementCredit[O_j] += grossSats` (tagged with exit creation height for `R8-N01` oldest-exit priority; or triggers hard-partitioned `B_grief` slash + refund on non-paying spend!). | | |
| 108 | 109 | | `0x06` | `EXIT_FEE_BUMP` | `"ZBTX"(4) \|\| 0x06(1) \|\| exitId(32) \|\| newMaxOpFeeSats(8)` = **`45 B`** | Witness carries user signature over `(exitId, newMaxOpFeeSats)` where `newMaxOpFeeSats > oldMaxOpFeeSats`. | Lets Bob/Mike raise fronting incentive during L1 fee spikes without re-queuing. | | |
| 109 | - | | `0x07` | `RELEASE_ASSIGNMENT` | `"ZBTX"(4) \|\| 0x07(1) \|\| vaultId(32) \|\| operatorId(4)` = **`41 B`** | Witness carries explicit `O_j` signature voluntarily releasing an already-assigned vault (vault assignment itself is **deterministic FIFO inside $\mathcal{F}$** once `ReimbursementCredit[O_j] >= D_d`; zero passive-timeout slash, `spec/01 §6`). | Optional `O_j`-signed voluntary release returning `Vaults[vaultId]` to `UNASSIGNED` and restoring `ReimbursementCredit[O_j] += D_d`. | | |
| 110 | + | | `0x07` | `RELEASE_ASSIGNMENT` | `"ZBTX"(4) \|\| 0x07(1) \|\| vaultId(32) \|\| operatorId(4)` = **`41 B`** | Witness carries explicit `O_j` signature voluntarily releasing an assigned vault (`AssignedObligations[vaultId] -> ReimbursementCredit[O_j]`, `Vaults[vaultId] -> UNASSIGNED`). | Optional `O_j`-signed voluntary release preserving exact `V_unassigned + V_assigned = C + L + E + R + A + B` (`R8-C02`). | | |
| 110 | 111 | ||
| 111 | - | ### 3.2 Complete Stripped-Block Scan & BIP-141 Witness Binding | |
| 112 | + | ### 3.2 Off-Chain Stripped-Block ZK Scanner, Fail-Closed BIP-141 Witness Completeness & Full `vin` Tracking (`R8-C05`, `R8-H05`) | |
| 112 | 113 | ||
| 113 | - | Inside the `RV32IM` Rollup verifier $\mathcal{F}$ (executed optimistically off-chain and disprovable via `BitVMX-CPU` `n = 8` bisection on any disputed single instruction): | |
| 114 | - | 1. **Complete Stripped Block Verification (`<= 1,000,000 B` Bitcoin consensus stripped-block cap):** For every confirmed block $h$ in the canonical range `[h_prev + 1, h_tip - K + 1]`, the prover feeds the **complete stripped block** (`tx_0 .. tx_{m-1}`) into $\mathcal{F}$. $\mathcal{F}$ computes every `txid_i = doubleSHA256(stripped_tx_i)`, reconstructs the full transaction Merkle root, and asserts equality with `header[h].merkleRoot`. **No transaction in block $h$ can ever be omitted or censored by a malicious prover.** | |
| 115 | - | 2. **BIP-141 Single-Branch Witness Inclusion:** For each stripped transaction $tx_i$ carrying an `OP_RETURN "ZBTX"` output requiring witness data (`0x00`, `0x01`, `0x02`, `0x03`, `0x06`, `0x07`), $\mathcal{F}$ parses the full `tx_0` coinbase outputs to extract the unique BIP-141 witness commitment `SHA256d(witnessRoot || witnessNonce)` (verifying `tx_0` is syntactically a coinbase with `vin[0].prevout == 0x00^32 : 0xffffffff`), verifies the single `wtxid_i` Merkle branch against `witnessRoot`, and checks `SHA256(witnessPayload) == opReturnCommitHash` (or verifies the `O_j` witness signature for `0x07`). | |
| 116 | - | 3. **Deterministic Skip on Invalid `0x02 BATCH_DA`:** Because `0x02` is permissionless, anyone can post a malformed `0x02` commitment on Bitcoin L1. If a `0x02` transaction fails witness parsing, `prevRoot != R_cur`, or `Verify(π_batch) == false`, $\mathcal{F}$ **deterministically skips** that `0x02` tx without halting state progression! | |
| 114 | + | **Architecture Split (`R8-H05`):** The full stripped-block scanner and SMT updater $\mathcal{F}$ execute inside the **off-chain ZK validity prover**, producing a succinct proof verified by the immutable **`vk_STF` wrapped SNARK verifier** inside `BitVMX-CPU` (`RV32IM`, `<= 8^9` instructions, Gate G2). Inside the off-chain ZK circuit proved by `vk_STF`: | |
| 117 | 115 | ||
| 118 | - | ### 3.3 Canonical Intra-Block Ordering (Eliminating 49%–100% Zenon Forks) | |
| 116 | + | 1. **Complete Stripped Block Verification (`<= 1,000,000 B` Bitcoin consensus stripped-block cap):** For every confirmed block $h$ in `[h_prev + 1, h_tip - K + 1]`, the prover feeds the **complete stripped block** (`tx_0 .. tx_{m-1}`) into $\mathcal{F}$. $\mathcal{F}$ computes every `txid_i = doubleSHA256(stripped_tx_i)`, reconstructs the full transaction Merkle root, and asserts equality with `header[h].merkleRoot`. **No transaction in block $h$ can ever be omitted or censored by a malicious prover.** | |
| 117 | + | 2. **Mandatory Full Stripped-`vin` Scan for Untagged Protocol UTXO Spends (`R8-C05`):** $\mathcal{F}$ MUST inspect **every `vin` of EVERY stripped transaction `tx_1 .. tx_{m-1}` in block `h`** (regardless of whether the spending transaction carries an `OP_RETURN "ZBTX"` tag!) against the canonical tracked outpoint set (`VaultUTXO`, `ExitSlotUTXO`, `Stake_r`, `VaultConnector_r`, `AdmissionTicketUTXO`). Thus an attacker CANNOT bypass `ExitSlotUTXO` grief slashing, `TakeTx` Lamport equivocation accounting, `Stake_r` dual-input slashing, or `RetireStakeTx_r` detection by omitting a `"ZBTX"` tag! | |
| 118 | + | 3. **Exact BIP-141 Witness Commitment Extraction & Fail-Closed vs Deterministic-Skip Rule (`R8-C05`):** | |
| 119 | + | - $\mathcal{F}$ parses the full stripped coinbase transaction `tx_0` (verifying `vin[0].prevout == 0x00^32 : 0xffffffff`), locates the **LAST output** whose `scriptPubKey` starts with the 6-byte BIP-141 header **`0x6a24aa21a9ed`** and satisfies `len(scriptPubKey) >= 38`, and extracts `witnessCommitment = scriptPubKey[6:38]`. | |
| 120 | + | - Using coinbase **`wtxid_0 = 0x00^32`** and the coinbase witness nonce (`32 B` `witnessReservedValue`), $\mathcal{F}$ verifies `SHA256d(witnessRoot || witnessNonce) == witnessCommitment` and authenticates the exact BIP-141 **`wtxid_i` Merkle branch** for every protocol transaction `tx_i` carrying witness data (`0x00`, `0x01`, `0x02`, `0x03`, `0x06`, `0x07`, or any SegWit spend of a tracked UTXO). | |
| 121 | + | - **Strict Fail-Closed vs Skip Classification (Eliminating Witness-Withholding Censorship):** | |
| 122 | + | - **FAIL CLOSED (`REFUSED_DATA_UNAVAILABLE` — Proof Invalid!):** If a prover omits the witness bytes for a SegWit protocol transaction, submits witness bytes whose computed `wtxid_i` fails the coinbase BIP-141 `witnessRoot` Merkle proof, or fails to locate the valid last `0x6a24aa21a9ed` commitment when SegWit transactions exist, the ZK circuit **MUST REJECT** (`satisfiability = FALSE`). A prover can NEVER claim a valid `0x02`/`0x01`/`0x03` tx was "malformed" by withholding its witness! | |
| 123 | + | - **DETERMINISTIC SKIP (Only AFTER `wtxid_i` Authentication):** ONLY AFTER the exact witness bytes of `tx_i` have been cryptographically authenticated against `witnessRoot` inside the coinbase commitment may $\mathcal{F}$ deterministically skip `tx_i` if its authenticated payload fails schema decoding, `prevRoot != R_cur`, slot priority, or `Verify(π_batch) == false`. | |
| 119 | 124 | ||
| 125 | + | ### 3.3 Canonical Intra-Block Ordering & Slotted `0x02` Batcher Priority (`R8-M02`) | |
| 126 | + | ||
| 120 | 127 | Within each `K`-deep Bitcoin block $h$, $\mathcal{F}$ transitions $R_{h-1} \to R_h$ in strict deterministic order: | |
| 121 | - | 1. **Pass 1 — Deposits (`0x00 DEPOSIT`):** Process in Bitcoin block transaction-index order `i = 1..m-1`. Verify acyclic `certBlob` (`104 B`), valid `N`-of-`N` setup cohort binding, valid `{0.50, 0.25, 0.25}` BTC vault outputs, and `totalTVL + D_d <= Cap_TVL`. Credit `Accounts[recipientAcctHash].balanceSats += D_d`. | |
| 122 | - | 2. **Pass 2 — First Valid Sequenced Batch (`0x02 BATCH_DA`):** Scan block $h$ in tx-index order and apply **AT MOST ONE** valid `0x02` batch whose `prevRoot == R_after_pass_1` and whose `π_batch` verifies against the complete mutated SMT leaf list. **Any competing `0x02` batch (e.g., from a 49% Zenon fork!) automatically fails `prevRoot` matching and is deterministically ignored.** | |
| 123 | - | 3. **Pass 3 — Mandatory L1 Forced Inclusion (`0x03`, `0x01`, `0x06`):** Apply EVERY valid `0x03 FORCED_TRANSFER`, `0x01 FORCED_EXIT`, and `0x06 EXIT_FEE_BUMP` in tx-index order. Because these execute directly from Bitcoin L1, **100% hostile Zenon Pillars cannot delay or censor a single forced transfer or exit by even 1 Bitcoin block**. | |
| 124 | - | 4. **Pass 4 — Settlement, Deterministic FIFO Assignment & Slashing Events (`0x04`, `0x05`, `0x07`, `ExitSlotUTXO` spends, `Stake_r` slashes, `BurnBondTx_{r,k}`):** Process all `ExitSlotUTXO` spends (universal spend-or-refund rule, `spec/03 §2.4`), deterministic FIFO oldest-eligible-vault assignment whenever `ReimbursementCredit[O_j] >= D_d` (filtered by `opBitmask`), optional `O_j`-signed `0x07 RELEASE_ASSIGNMENT`, `ChallengeTx_{r,i}` (`0x04`), `DisproveTx`/`TimeoutSlashTx` dual-input slashes (`0.55 BTC` `B_zbtc` split across remaining challengers), and `BurnBondTx_{r,k}` Lamport equivocation slashes (`D_d` burned from `B_zbtc` + `0.05 BTC` bounty). | |
| 128 | + | 1. **Pass 1 — Deposits (`0x00 DEPOSIT`):** Process in Bitcoin block transaction-index order `i = 1..m-1`. Verify `AdmissionTicketUTXO` consumption (`vin[1..3]`), acyclic `vault_id` Taproot script derivation, `wtxid`-authenticated `certBlob` (`104 B`), valid `N`-of-`N` setup cohort binding, `{0.50, 0.25, 0.25}` BTC outputs, and the **$2^M$ Hall's Marriage Invariant** (`spec/01 §6.2`). Credit `Accounts[recipientAcctHash].balanceSats += D_d`. | |
| 129 | + | 2. **Pass 2 — First Valid Sequenced Batch (`0x02 BATCH_DA`):** Scan block $h$ in tx-index order and apply **AT MOST ONE** `wtxid`-authenticated valid `0x02` batch whose `prevRoot == R_after_pass_1`, `π_batch` verifies against the complete mutated SMT state diff (`Accounts`, `RollupLocks`, cooperative `PendingExits`, `TransferCredit`, `<= 1,000` new leaves/epoch with `500`-sat refundable deposit), and whose `batcherSlotId` matches the **deterministic slotted batcher priority** (`primary_batcher = H(header[h-1].hash) mod K_batchers` for the first 2 blocks after `prevBatchHeight + 6`, open permissionless fallback to any batcher thereafter — eliminating stale-root L1 fee burn races, `R8-M02`!). Any competing `0x02` batch (e.g. from a 49% Zenon fork) fails `prevRoot` matching and is deterministically skipped. | |
| 130 | + | 3. **Pass 3 — Mandatory L1 Forced Inclusion (`0x03`, `0x01`, `0x06`):** Apply EVERY `wtxid`-authenticated valid `0x03 FORCED_TRANSFER`, `0x01 FORCED_EXIT` (`grossSats >= max(dust, 100_000)` sats, active-operator `ExitSlotUTXO`), and `0x06 EXIT_FEE_BUMP` in tx-index order. **100% hostile Zenon Pillars cannot delay or censor a single forced transfer or exit by even 1 Bitcoin block.** | |
| 131 | + | 4. **Pass 4 — Tracked-UTXO Spends, Deterministic FIFO Assignment & Slashing Events (Full `vin` Scan + `0x04`, `0x05`, `0x07`):** Process ALL spends of tracked `ExitSlotUTXO`s (universal spend-or-refund rule with hard-partitioned `B_grief` pro-rata burst cap, `spec/01 §5`), `TakeTx` confirmations (`V_assigned -= D_v`, `AssignedObligations.pop(v)`), `0x07 RELEASE_ASSIGNMENT` (`V_assigned -> V_unassigned`, `A[v] -> R[O_j]`), deterministic tightest-slack FIFO vault assignment (`V_unassigned -> V_assigned`, `R[O_j] -> A[v]` respecting oldest-`PendingExit` credit priority, `R8-N01`), `DisproveTx`/`TimeoutSlashTx` dual-input slashes (`0` vault stolen, `B_custody` slashed), `BurnBondTx_{r,k}` Lamport equivocation slashes (`D_v` burned from `B_custody`, innocent `O_k` restored if `v` was assigned to `O_k`, `0.05 BTC` bounty), and `RetireStakeTx_r` (gating `B_zbtc` unlock on `A[O_j] == 0` and Hall's invariant). Assert exact **`V_unassigned + V_assigned == C + L + E + R + A + B`** (`R8-C02`)! | |
| 125 | 132 | ||
| 126 | 133 | --- | |
| 127 | 134 | ||
| 128 | - | ## 4. Launch-Time PoW Anchor, Retargeting & Halving-Indexed TVL-Scaled `K` | |
| 135 | + | ## 4. Launch-Time PoW Anchor, `K >= 18` Unpublished-Fork Heuristic, Heaviest-Chainwork Verification & `>= K` Deep-Reorg Circuit Breaker (`R8-H03`, `R8-M07`) | |
| 129 | 136 | ||
| 130 | - | Because Bitcoin L1 scripts without covenants cannot inspect arbitrary future chain tips directly, each finite `BitVMX` `StakeChain` lane `(j, l)` (`R = 64` rounds, active horizon `<= ~1.5` years) verifies Bitcoin PoW inside $\mathcal{F}$ anchored at lane launch (`t = 0`, **before** `Q_lane_{j,l}` deletion — zero pre-broadcast hash cycle!): | |
| 137 | + | Because Bitcoin L1 scripts without covenants cannot inspect arbitrary future chain tips directly, each finite `BitVMX` `StakeChain` lane `(j, l)` (`R = 64` rounds, active horizon `<= ~2.3` years at `T_cooldown = 13.0d`) anchors Bitcoin PoW at lane launch (`t = 0`, **before** `Q_lane_{j,l}` deletion): | |
| 131 | 138 | ||
| 132 | 139 | 1. **Launch-Time Lane Anchor `(h_lane_init, H_init, D_init)`:** Pins an **already-confirmed** Bitcoin mainnet block at lane creation, together with its 2,016-block retarget-period start header and `mtpWindow[11]`. | |
| 133 | - | 2. **Full 2,016-Block Retargeting & Difficulty Floor:** $\mathcal{F}$ validates every 80-byte Bitcoin header from `h_lane_init` to `h_tip` with exact mainnet `SetCompact`, `[302400, 4838400]`s 2,016-block retarget clamping, MTP monotonicity, and a normative difficulty-drop floor **`D(h) >= 0.50 * D(h_lane_init)`**. | |
| 134 | - | - *Explicit Difficulty-Growth Disclosure:* If mainnet difficulty grows `> 2×` during a finite lane's active lifetime, the effective private-fork difficulty ratio `α_diff = D(h_lane_init) / D_current` tightens proportionally (e.g., at `3×` growth, `α_diff = 0.33`, increasing required `K` by `1.5×`). Operators periodically retire old lanes (`RetireStakeTx` at `1,440` blocks) and launch fresh lanes re-anchored to current `D(h_lane_init)`. | |
| 135 | - | 3. **Halving-Indexed TVL-Scaled `K` Private-Fork Inequality:** To make a private PoW fork forging a fake `K`-deep state strictly unprofitable against honest mining opportunity cost, protocol TVL caps MUST satisfy: | |
| 136 | - | $$0.50 \times K \times \text{Subsidy}(\text{era}) > \text{Cap}_{\text{TVL}}$$ | |
| 140 | + | 2. **Full 2,016-Block Retargeting & Difficulty Floor:** The ZK prover validates every 80-byte Bitcoin header from `h_lane_init` to `h_tip` with exact mainnet `SetCompact`, `[302400, 4838400]`s 2,016-block retarget clamping, MTP monotonicity, and minimum difficulty floor **`D(h) >= 0.50 * D(h_lane_init)`**. *(If mainnet difficulty grows `> 2×` during a lane's active lifetime, operators retire old lanes at `2,016` blks and launch fresh lanes re-anchored to current `D`.)* | |
| 141 | + | 3. **Interactive Heaviest-Chainwork Competing-Header Challenge (`R8-H03` — Clementine / BitVM3 Light-Client Pattern):** | |
| 142 | + | - To prevent a malicious operator from submitting a valid but lower-work private fork anchored at `h_lane_init`, any verifier `V_i` challenging `RoundTx_r` in `[0, 144]` may supply a **competing valid Bitcoin header-chain proof** anchored to the same `(h_lane_init, H_init, D_init)` whose cumulative chainwork strictly exceeds the operator's claimed chain (`cumWork(H_chal) > cumWork(H_op)`) and which diverges at or before the claimed `K`-deep confirmation block. | |
| 143 | + | - Inside `vk_STF`, comparing the two header-chain SNARK commitments deterministically proves the operator asserted a non-canonical/lower-work fork and slashes `Stake_r` + `VaultConnector_r`! | |
| 144 | + | 4. **Honest Private-Fork Heuristic (`K >= 18` Hard Floor) & Budish Subsidy-Offset Disclosure (`R8-H03`):** | |
| 145 | + | - The protocol enforces a hard minimum **`K >= 18` blocks (`~3.0h` nominal)** and sizes `K` across halvings against **`Cap_TVL_total = Cap_user + M × B_zbtc`** using the **conditional unpublished-fork opportunity-cost heuristic**: | |
| 146 | + | $$0.50 \times K \times \text{Subsidy}(\text{era}) > \text{Cap}_{\text{TVL,total}}$$ | |
| 147 | + | - **Mandatory Economic Honesty Disclosure (Budish Winning-Fork Offset):** This inequality measures the *unpublished/orphaned fork* opportunity cost. Under a **majority (`>50%`) hashrate attack** where the attacker publishes the winning fork and recaptures all `K` block subsidies, the attacker's direct mining cost is only the **net electricity/hardware flow cost `κ × K × Subsidy`** (`κ ∈ [0.05, 0.50]`) PLUS external reputational/BTC-price-crash losses (`verify_spec_bounds.py` prints the exact Budish sensitivity table). Consequently, `K >= 18` delivers **probabilistic PoW finality under `<50%` honest hashrate** — NOT an unconditional economic guarantee against a `>50%` cartel! | |
| 137 | 148 | ||
| 138 | - | | Deployment Stage | `Cap_TVL` | `K` (2024–2028, `3.125 BTC` Subsidy) | `0.50 × K × Subsidy` | `K` (2028–2032, `1.5625 BTC` Subsidy) | `K` (2032–2036, `0.78125 BTC` Subsidy) | | |
| 149 | + | | Deployment Stage | `Cap_user` / **`Cap_TVL_total`** (incl. `M × B_zbtc`) | `K` (2024–2028, `3.125 BTC`) | `0.50 × K × Sub` (`K × Sub` nom) | `K` (2028–2032, `1.5625 BTC`) | `K` (2032–2036, `0.78125 BTC`) | | |
| 139 | 150 | |---|---:|---:|---:|---:|---:| | |
| 140 | - | | **Stage 1A Pilot (`M = 3`)** | `<= 10 BTC` | **`14`** (`~2.3h`) | `21.875 BTC > 10` | `14` (`10.94 > 10`) | `28` (`10.94 > 10`) | | |
| 141 | - | | **Stage 1A Expanded (`M = 5`)** | `<= 15 BTC` | **`14`** (`~2.3h`) | `21.875 BTC > 15` | `20` (`15.63 > 15`) | `40` (`15.63 > 15`) | | |
| 142 | - | | **Stage 2 Scaled (`M = 10–20`)** | `<= 50 BTC` | **`36`** (`~6.0h`) | `56.250 BTC > 50` | `66` (`51.56 > 50`) | `130` (`50.78 > 50`) | | |
| 143 | - | | **Stage 2 High-Cap (`M = 20+`)** | `<= 200 BTC` | **`144`** (`~24h`) | `225.000 BTC > 200` | `260` (`203.13 > 200`) | `516` (`201.56 > 200`) | | |
| 151 | + | | **Stage 1A Pilot (`M = 3`)** | `<= 10 BTC` / **`11.80 BTC`** | **`18`** (`~3.0h`) | `28.125` (`56.25`) `> 11.80` | `18` (`14.06 > 11.80`) | `32` (`12.50 > 11.80`) | | |
| 152 | + | | **Stage 1A Expanded (`M = 5`)** | `<= 15 BTC` / **`18.00 BTC`** | **`18`** (`~3.0h`) | `28.125` (`56.25`) `> 18.00` | `24` (`18.75 > 18.00`) | `48` (`18.75 > 18.00`) | | |
| 153 | + | | **Stage 2 Scaled (`M = 20`)** | `<= 50 BTC` / **`62.00 BTC`** | **`42`** (`~7.0h`) | `65.625` (`131.25`) `> 62.00` | `80` (`62.50 > 62.00`) | `160` (`62.50 > 62.00`) | | |
| 154 | + | | **Stage 2 High-Cap (`M = 40`)** | `<= 200 BTC` / **`224.00 BTC`** | **`144`** (`~24.0h`) | `225.00` (`450.00`) `> 224.00` | `288` (`225.00 > 224.00`) | `576` (`225.00 > 224.00`) | | |
| 144 | 155 | ||
| 156 | + | 5. **Fail-Closed Deep-Reorg (`>= K`) Circuit Breaker (`R8-M07`):** | |
| 157 | + | - All Rollup full nodes, batchers, operators, and verifiers MUST retain **`>= 144`-block rollback snapshots** of `(R_h, SMT_h)`. | |
| 158 | + | - If Bitcoin ever experiences a reorg of depth `>= K` (`>= 18` blocks), nodes MUST immediately assert **`DEEP_REORG_HALT`**: (a) freeze new `0x02` batch submissions and new operator fronting, (b) rewind canonical state to the highest common ancestor `h_fork` and deterministically replay the heavier canonical Bitcoin chain from `h_fork + 1`, (c) treat any orphaned `FrontingTx` as valid ONLY if confirmed on the canonical chain (operators explicitly accept `< K`-deep fronting risk and wait `K` blocks before claiming vault reimbursement), and (d) resume normal operation automatically once the canonical tip stabilizes `>= K` blocks past `h_fork`. | |
| 159 | + | ||
| 145 | 160 | --- | |
| 146 | 161 | ||
| 147 | 162 | ## 5. Mandatory SPV & Authorization Domain Conformance Test Vectors | |
| 148 | 163 | ||
| 149 | - | 1. **Stage 0 Header & Merkle Suite:** All 24 Bitcoin header, 2,016-block retarget (`[302400, 4838400]`s), MTP, `futureTimeGuardSecs = 7,200`, `LOWEST_BLOCK_HASH_BE` tie-break, `CVE-2012-2459`, and `CVE-2017-12842` (`len == 64` rejection) vectors. | |
| 150 | - | 2. **1- and 2-Block Coinbase Midstate Suite:** Valid coinbase proofs for BOTH `totalCoinbaseBytes % 64 ∈ [0, 55]` (1-block) AND `totalCoinbaseBytes % 64 ∈ [56, 63]` (2-block — e.g. `120 B`, `127 B`, `250 B`), plus rejection of `len(finalChunkTail) != totalCoinbaseBytes % 64` and `totalCoinbaseBytes == 64`. | |
| 164 | + | 1. **Stage 0 Header & Merkle Suite:** All 24 Bitcoin header, 2,016-block retarget (`[302400, 4838400]`s), MTP, `futureTimeGuardSecs = 7,200`, `LOWEST_BLOCK_HASH_BE` tie-break, `CVE-2012-2459`, and `CVE-2017-12842` (`len < 65` rejection, `R8-M06`) vectors. | |
| 165 | + | 2. **1- and 2-Block Coinbase Midstate Suite:** Valid coinbase proofs for BOTH `totalCoinbaseBytes % 64 ∈ [0, 55]` (1-block) AND `totalCoinbaseBytes % 64 ∈ [56, 63]` (2-block — e.g. `120 B`, `127 B`, `250 B`), plus rejection of `len(finalChunkTail) != totalCoinbaseBytes % 64` and `totalCoinbaseBytes <= 64`. | |
| 151 | 166 | 3. **Panic-Free & Plasma-Floor Fuzz Gate (`B1`, `B2`):** Malformed ABI inputs across all 4 Stage 0 oracle methods MUST return deterministic errors (zero panics, zero FIFO sequencer stalls), and exact ABI sizing of `ProveTxInclusion` (`7,620 B`, `591,388` Plasma) fits `>= 3×` inside the `2,100,000` floor and `<= 40` contract blocks/Momentum. | |
| 152 | - | 4. **Stage 1A Stripped-Block & Tag-Ordering Suite:** Deterministic skip of malformed `0x02 BATCH_DA`, rejection of competing second `0x02` batch (49% Zenon fork simulation), mandatory inclusion of `0x03`/`0x01` even when all Zenon sequencers censor, and halving-indexed `K` PoW boundary enforcement across `2024–2036`. | |
| 167 | + | 4. **Stage 1A Stripped-Block, BIP-141 Completeness & Reorg Suite (`R8-C05`, `R8-M07`):** Rejection (`REFUSED_DATA_UNAVAILABLE`) of omitted or `wtxid`-mismatched witnesses, extraction of the LAST `0x6a24aa21a9ed` coinbase output when multiple matching outputs exist, full stripped-`vin` detection of untagged `ExitSlotUTXO`/`VaultUTXO`/`Stake_r` spends, deterministic skip of `wtxid`-authenticated malformed `0x02 BATCH_DA`, slotted batcher priority, interactive heaviest-chainwork fork rejection, and `>= K` `DEEP_REORG_HALT` rewind/replay. | |
| 153 | 168 | ||
Document Class: Normative Bitcoin SPV Verification & L1 Authorization Domain Specification (v2 / v3.1.0-rfc — Zero-Federation Phased Architecture; supersedes archived v1 v3.0.0-rfc and v0 v2.5.0-rfc)
Philosophical Anchor: Stage 0 implements Zenon's non-custodial verification thesis (zenon-developer-commons: essays/Verify Bitcoin, Don't Bridge It.md & docs/specs/spv-event-oracle-spec.md): Event Validity only, zero custody authority. Stage 1A moves canonical zBTC authorization, data availability, and forced exit directly onto Bitcoin L1 so that 49%–100% Zenon compromise cannot forge state or censor exits.
Consistency Checker: scripts/verify_spec_bounds.py
1. Two-Layer Separation: Stage 0 Event Oracle vs Stage 1A Canonical L1 Domain
This specification strictly separates two orthogonal verification surfaces with zero federated signers anywhere:
- Stage 0 — Direct-on-L1 Bitcoin SPV Event Oracle (
vm/embedded/btcspv):- Runs deterministically inside an embedded Zenon contract (
BtcSpvOracleContract), wrapped in mandatory panic recovery (recover(), zerocommon.DealWithErrcalls — closing upstream issue#239/ B1). - Proves Event Validity ONLY: cryptographic evidence that a Bitcoin transaction
txidis included at depth>= K_oracleon the heaviest cumulative-PoW Bitcoin header chain. - Hard Non-Custody Invariant: Stage 0 SPV has ZERO minting, burning, sweeping, or vault-spending authority. It powers Bitcoin-verified receipts, proof-of-payment triggers, and non-custodial PTLC/HTLC atomic swaps (
spec/03 §1).
- Runs deterministically inside an embedded Zenon contract (
- Stage 1A — Bitcoin-L1-Canonical Authorization Domain (
vk_STFRollup Circuit):- For pooled, fungible
zBTC(Stage 1A), Zenon L1 does NOT authorize mints, burns, or exits. - Instead, an off-chain ZK prover executes the deterministic Rollup State Transition Function ($\mathcal{F}$) over complete stripped Bitcoin blocks directly on Bitcoin L1, deriving the entire canonical
zBTCstate root $R_h$ strictly from Bitcoin's heaviest PoW chain (0-of-NZenon trust;0%ZNN market-cap coupling). InsideBitVMX-CPU(RV32IM), only the constant-size wrapped SNARK verifiervk_STFruns (R8-H05), NEVER bare 1 MB block SHA-256 scanning!
- For pooled, fungible
2. Stage 0: Direct-on-L1 Bitcoin SPV Event Oracle (vm/embedded/btcspv)
2.1 OracleChainConfig & Finality Parameters
OracleChainConfig {
foreignChainId : bytes32 // u16(0x0001) || SHA3-256("BTC_MAINNET_SPV_V1" || btcGenesisHashBE)[0:30]
genesisAnchor : Bytes // BitcoinAnchor { blockHashBE(32B), height(u64), header(80B), cumWork(u256),
// retargetStartHash(32B), retargetStartTime(u32), retargetHeight(u64), mtpWindow[11](u32) }
admissionDepthN : u32 // 6 blocks (provisional event admission; reversible on reorg)
finalizationDepthK : u32 // 12 blocks (oracle event finalization depth; probabilistic PoW finality)
minimumPostAnchorWork : u256 // finalizationDepthK * blockWork(genesisAnchor.nBits)
retainedReorgDepth : u32 // 144 blocks (stale HeaderNode pruning ONLY; ActiveChainByHeight NEVER pruned)
maximumHeaderBatch : u32 // 2 headers per SubmitHeaderBatch call
maximumMerkleDepth : u32 // 16 levels (65,536 txs/block)
minimumStrippedTxBytes : u32 // 65 B (rejects 64-byte CVE-2017-12842 interior nodes & impossibly short txs)
maximumStrippedTxBytes : u32 // 6,144 B (per-call Stage 0 proof cap; fits 3x inside pinned 2.1M Plasma floor)
futureTimeGuardSecs : u32 // 7,200 s (Bitcoin consensus MAX_FUTURE_BLOCK_TIME)
equalWorkTieBreak : u8 // 0 = LOWEST_BLOCK_HASH_BE (deterministic across all Zenon full nodes)
}
Testnet / Signet Scope Caveat: On Bitcoin Signet (where validity rests in the Signet challenge signature) and Testnet4 (minimum-difficulty block exception), header-only PoW SPV does not resist an adversary. Stage 0 Signet SPV tests are conformance-only; full PoW security applies strictly on Bitcoin Mainnet.
2.2 Stage 0 Embedded ABI Methods, Exact Sizes & Pinned Plasma Floor (B1, B2)
All 4 Stage 0 oracle methods are panic-recovered (B1), require zero federation signatures, and stay strictly within the pinned MaxBasePlasmaInMomentum >= 2,100,000 floor (spec/05 §2.2) and dp.MaxContractBlocks = 40 per-Momentum contract-block cap (origin/dev:dp/dp.go:259-264). Base Plasma under DynamicPlasmaSpork equals tier + 68 * (abiBytes - 4) (origin/dev:vm/plasma.go:185-200):
| ABI Method | Send Plasma Tier | Exact Max Payload | Exact Max ABI (32 B-padded) | Exact Base Plasma (QSR @ floor 1,000) | Max Storage Ops | Purpose |
|---|---|---|---|---|---|---|
SubmitHeaderBatch(headers) | 52,500 (Simple) | 160 B (2 × 80 B) | 228 B | 67,732 (33 QSR) | <= 8 | Validate 1..2 mainnet headers, 2016-block [302400, 4838400]s retarget, MTP, update ActiveChainByHeight. |
StepReorg() | 52,500 (Simple) | 0 B | 4 B | 52,500 (25 QSR) | <= 6 | Walk 1 incremental reorg step; emits deterministic reorg state transition if an admitted < 12-deep event is orphaned; flags DeepReorgAlert = 1 if ReorgSteps > 144. |
PruneStaleHeaders(hashes) | 52,500 (Simple) | 64 B (2 × 32 B) | 132 B | 61,204 (30 QSR) | <= 4 | Delete 1..2 stale HeaderNodes (height < BestTip - 144 && height % 2016 != 0 && ReorgActive == 0). |
ProveTxInclusion(...) | 73,500 (Heavy SPV) | 7,279 B | 7,620 B | 591,388 (282 QSR) | <= 8 | Verify >= N-deep strippedTx (65..6,144 B) + 1-/2-block coinbase midstate + Merkle inclusion → record VerifiedEvent[txid]. |
Exact ProveTxInclusion ABI Derivation (Full 32 B-Padded Accounting):
- Static head:
4 Bselector +8 × 32 B(blockHeight,txIndex,totalCoinbaseBytes,sha256Midstate, + 4 dynamic offsets)= 260 B. - Dynamic bodies (
32 Blength prefix +32 B-padded bytes):strippedTx(32 + 6,144 = 6,176 B) +txBranch(32 + 16 × 32 = 544 B) +coinbaseTail(32 + 64 = 96 Bfor<= 63 Btail) +coinbaseBranch(32 + 16 × 32 = 544 B)= 7,360 B. - Total ABI
= 260 + 7,360 = 7,620 B <= 16,384 B(MaxDataLength). Base Plasma= 73,500 + 68 × (7,620 - 4) = 591,388. Up to3max-sizeProveTxInclusioncalls (1,774,164 <= 2,100,000) fit inside a single Momentum even at the pinned floor (6at default4,200,000).
2.3 Exact 1- and 2-Block Coinbase Midstate Proof (CVE-2017-12842, R8-M06 Hardened)
Every ProveTxInclusion call MUST verify:
ChainMeta.ReorgActive == 0andChainMeta.PostAnchorWork >= minimumPostAnchorWork.ActiveChainByHeight[blockHeight]exists andBestTipHeight >= blockHeight + admissionDepthN - 1.65 <= len(strippedTx) <= 6,144(rejectslen == 64CVE-2017-12842 interior-node forgery AND any impossibly short< 65 Bnon-tx byte sequence, tightened perR8-M06),txIndex != 0, valid Bitcoin non-witness transaction syntax (vin_count >= 1,vout_count >= 1, exact byte consumption), and no SegWit marker (0x00 0x01) in stripped bytes.doubleSHA256(strippedTx)verifies againstmerkleRootLEviatxBranchattxIndexwithlen(txBranch) == len(coinbaseBranch) <= 16and zero duplicate-sibling CVE-2012-2459 padding.- 1- and 2-Block SHA-256 Coinbase Midstate Verification:
- Caller supplies
(sha256Midstate: bytes32, finalChunkTail: bytes, totalCoinbaseBytes: u32, coinbaseBranch: bytes32[]). - Normative Constraints:
totalCoinbaseBytes >= 65(rejectstotalCoinbaseBytes == 64leaf forgery and impossibly short transactions).len(finalChunkTail) == totalCoinbaseBytes % 64(strictly< 64; rejects any mismatched or unaligned tail!).
- Exact Final SHA-256 Padding (
100%of valid Bitcoin coinbase lengths, avoiding the12.5%single-compression rejection bug whenrem ∈ [56, 63]): Letrem = totalCoinbaseBytes % 64andbitLen = u64BE(uint64(totalCoinbaseBytes) * 8):- Case 1 (
rem < 56— 1-block final padding): Build single64 BblockB_1 = finalChunkTail[0:rem] || 0x80 || 0x00^(55 - rem) || bitLen(8B). ComputeinnerHash = SHA256_Compress(sha256Midstate, B_1). - Case 2 (
56 <= rem <= 63— 2-block final padding): BuildB_1 = finalChunkTail[0:rem] || 0x80 || 0x00^(63 - rem)andB_2 = 0x00^56 || bitLen(8B). Computestate_1 = SHA256_Compress(sha256Midstate, B_1), theninnerHash = SHA256_Compress(state_1, B_2).
- Case 1 (
- Compute
coinbaseTxid = SHA256(innerHash)and verifycoinbaseBranchat index0againstmerkleRootLEwithlen(coinbaseBranch) == len(txBranch). - Explicit Auditability Disclosure: A midstate proof proves that Merkle index
0is a valid non-64-byte leaf at the same tree depth astxIndex(completely closing CVE-2017-12842 interior-node forgery); it does not parse the prefix of the coinbase transaction itself. In Stage 1A below, full coinbase bytes are directly verified inside the off-chain ZK stripped-block scanner to extract the BIP-141 witness commitment.
- Caller supplies
2.4 Stage 0 Oracle Storage Layout (BtcSpvOracleContract)
| Prefix | Key | Value | Pruning Policy |
|---|---|---|---|
0x20 | singleton | ChainMeta (BestTipHash, BestTipHeight, BestTipWork, PostAnchorWork, ReorgActive, DeepReorgAlert) | Never pruned |
0x21 | blockHashBE(32B) | HeaderNode (160 B, incl. mtpWindow[11]) | Pruned via PruneStaleHeaders when < BestTip - 144 && height % 2016 != 0 && ReorgActive == 0 |
0x22 | u64BE(height) | ActiveChainByHeight (68 B: blockHashBE || merkleRootLE || blockTime) | NEVER PRUNED |
0x23 | txid(32B) | VerifiedEvent (blockHeight, blockHashBE, txIndex, finalized: bool) | Never pruned |
3. Stage 1A: Bitcoin-L1-Canonical Authorization Domain (0% Zenon Trust)
For pooled, fungible zBTC, Bitcoin L1 is the sole canonical ordering, data-availability, and forced-inclusion layer. Zenon Pillars act strictly as untrusted L1-subsidized soft-preconfirmation sequencers (spec/03 §2, spec/04 §2). Even if 49%–100% of Zenon Pillars are Byzantine, they cannot fork zBTC, mint 1 unbacked satoshi, or censor Bob's or Mike's exit.
3.1 Canonical Bitcoin L1 Tag Schema (OP_RETURN "ZBTX" <= 80 B + Authenticated Taproot Witness)
All Stage 1A protocol events are tagged on Bitcoin L1 with a 4 B magic prefix "ZBTX" (0x5a 0x42 0x54 0x58) and 1 B tag inside an OP_RETURN output (<= 80 B standardness limit). Bulk payloads (certBlob, complete mutated SMT leaves, π_batch, signed forced transfers) sit inside the spending transaction's Taproot script-path witness, bound by SHA-256 commitment in the OP_RETURN and verified against the block's BIP-141 coinbase witness commitment.
| Tag | Name | OP_RETURN Layout & Exact Size | Taproot Witness / Additional Outputs | Purpose |
|---|---|---|---|---|
0x00 | DEPOSIT | "ZBTX"(4) || 0x00(1) || recipientAcctHash(32) || vaultParamsHash(32) = 69 B | vin[0] = confirmed U_dep_wallet (OP_DROP certBlob 104 B <= 520 B); vin[1..3] = denomination-matched AdmissionTicketUTXOs (R8-C03); vout[0..2] = {0.50, 0.25, 0.25} BTC deleted-key vaults keyed by acyclic vault_id (R8-C01). | Register K-deep multi-tier deposit vaults (enforcing Cap_TVL_total via L1 ticket conservation & $2^M$ Hall invariant) and credit recipientAcctHash. |
0x01 | FORCED_EXIT | "ZBTX"(4) || 0x01(1) || exitCommitHash(32) = 37 B | Witness carries (acctId, nonce, grossSats >= max(dust, MIN_EXIT_SATS=100_000), maxOpFeeSats, destScriptPubKey, cancelPubKey, sig_user) (R8-M05); additional output creates active-operator (2M_active+1)-leaf ExitSlotUTXO (546 sat dust anchor, spec/01 §5). | Uncensorable L1 exit for Bob (0.50 BTC) or Mike (0.25 BTC), bypassing 49%–100% Zenon censorship & Plasma spikes. |
0x02 | BATCH_DA | "ZBTX"(4) || 0x02(1) || batchCommitHash(32) = 37 B | Witness carries prevRoot(32B) || newRoot(32B) || batcherSlotId(2B) || mutatedAccounts[] (16 B existing / 48 B new, <= 1,000 new/6-blk epoch w/ 500-sat refundable leaf deposit) || mutatedRollupLocks[] || cooperativeExits[] || creditTransfers[] || π_batch (R8-C05, R8-M01, R8-M02, R8-M04). | Anchor feeless Zenon-sequenced transfers, RollupLocks, cooperative PendingExits, and TransferCredit ops onto Bitcoin L1 with 100% self-contained state-diff DA across all non-L1-derivable SMT namespaces! |
0x03 | FORCED_TRANSFER | "ZBTX"(4) || 0x03(1) || txCommitHash(32) = 37 B | Witness carries signed 110 B rollup transfer (or RollupHTLC/RollupPTLC / TransferCredit op). | Uncensorable L1 transfer fallback if Zenon censors or Dynamic Plasma spikes. |
0x04 | CHALLENGE_CLAIM | "ZBTX"(4) || 0x04(1) || kickoffTxid(32) || verifierAcctId(4) = 41 B | Emitted on every ChallengeTx_{r,i} opened in simultaneous window [0, 144] (which also creates ChalProofConnector_{r,i} for native-L1 0.15 BTC payout from Stake_r, spec/01 §4). | Indexes active challengers on-chain for auditability and optional protocol insurance attribution (native L1 verifier EV comes strictly from Stake_r!). |
0x05 | FRONT_CLAIM | "ZBTX"(4) || 0x05(1) || exitId(32) || operatorId(4) = 41 B | Emitted when active operator $O_j$ spends ExitSlotUTXO paying destScriptPubKey >= grossSats - maxOpFeeSats in vout[0]. (Note: even untagged ExitSlotUTXO spends are caught by full stripped-vin scanning, §3.2!) | Credits ReimbursementCredit[O_j] += grossSats (tagged with exit creation height for R8-N01 oldest-exit priority; or triggers hard-partitioned B_grief slash + refund on non-paying spend!). |
0x06 | EXIT_FEE_BUMP | "ZBTX"(4) || 0x06(1) || exitId(32) || newMaxOpFeeSats(8) = 45 B | Witness carries user signature over (exitId, newMaxOpFeeSats) where newMaxOpFeeSats > oldMaxOpFeeSats. | Lets Bob/Mike raise fronting incentive during L1 fee spikes without re-queuing. |
0x07 | RELEASE_ASSIGNMENT | "ZBTX"(4) || 0x07(1) || vaultId(32) || operatorId(4) = 41 B | Witness carries explicit O_j signature voluntarily releasing an assigned vault (AssignedObligations[vaultId] -> ReimbursementCredit[O_j], Vaults[vaultId] -> UNASSIGNED). | Optional O_j-signed voluntary release preserving exact V_unassigned + V_assigned = C + L + E + R + A + B (R8-C02). |
3.2 Off-Chain Stripped-Block ZK Scanner, Fail-Closed BIP-141 Witness Completeness & Full vin Tracking (R8-C05, R8-H05)
Architecture Split (R8-H05): The full stripped-block scanner and SMT updater $\mathcal{F}$ execute inside the off-chain ZK validity prover, producing a succinct proof verified by the immutable vk_STF wrapped SNARK verifier inside BitVMX-CPU (RV32IM, <= 8^9 instructions, Gate G2). Inside the off-chain ZK circuit proved by vk_STF:
- Complete Stripped Block Verification (
<= 1,000,000 BBitcoin consensus stripped-block cap): For every confirmed block $h$ in[h_prev + 1, h_tip - K + 1], the prover feeds the complete stripped block (tx_0 .. tx_{m-1}) into $\mathcal{F}$. $\mathcal{F}$ computes everytxid_i = doubleSHA256(stripped_tx_i), reconstructs the full transaction Merkle root, and asserts equality withheader[h].merkleRoot. No transaction in block $h$ can ever be omitted or censored by a malicious prover. - Mandatory Full Stripped-
vinScan for Untagged Protocol UTXO Spends (R8-C05): $\mathcal{F}$ MUST inspect everyvinof EVERY stripped transactiontx_1 .. tx_{m-1}in blockh(regardless of whether the spending transaction carries anOP_RETURN "ZBTX"tag!) against the canonical tracked outpoint set (VaultUTXO,ExitSlotUTXO,Stake_r,VaultConnector_r,AdmissionTicketUTXO). Thus an attacker CANNOT bypassExitSlotUTXOgrief slashing,TakeTxLamport equivocation accounting,Stake_rdual-input slashing, orRetireStakeTx_rdetection by omitting a"ZBTX"tag! - Exact BIP-141 Witness Commitment Extraction & Fail-Closed vs Deterministic-Skip Rule (
R8-C05):- $\mathcal{F}$ parses the full stripped coinbase transaction
tx_0(verifyingvin[0].prevout == 0x00^32 : 0xffffffff), locates the LAST output whosescriptPubKeystarts with the 6-byte BIP-141 header0x6a24aa21a9edand satisfieslen(scriptPubKey) >= 38, and extractswitnessCommitment = scriptPubKey[6:38]. - Using coinbase
wtxid_0 = 0x00^32and the coinbase witness nonce (32 BwitnessReservedValue), $\mathcal{F}$ verifiesSHA256d(witnessRoot || witnessNonce) == witnessCommitmentand authenticates the exact BIP-141wtxid_iMerkle branch for every protocol transactiontx_icarrying witness data (0x00,0x01,0x02,0x03,0x06,0x07, or any SegWit spend of a tracked UTXO). - Strict Fail-Closed vs Skip Classification (Eliminating Witness-Withholding Censorship):
- FAIL CLOSED (
REFUSED_DATA_UNAVAILABLE— Proof Invalid!): If a prover omits the witness bytes for a SegWit protocol transaction, submits witness bytes whose computedwtxid_ifails the coinbase BIP-141witnessRootMerkle proof, or fails to locate the valid last0x6a24aa21a9edcommitment when SegWit transactions exist, the ZK circuit MUST REJECT (satisfiability = FALSE). A prover can NEVER claim a valid0x02/0x01/0x03tx was "malformed" by withholding its witness! - DETERMINISTIC SKIP (Only AFTER
wtxid_iAuthentication): ONLY AFTER the exact witness bytes oftx_ihave been cryptographically authenticated againstwitnessRootinside the coinbase commitment may $\mathcal{F}$ deterministically skiptx_iif its authenticated payload fails schema decoding,prevRoot != R_cur, slot priority, orVerify(π_batch) == false.
- FAIL CLOSED (
- $\mathcal{F}$ parses the full stripped coinbase transaction
3.3 Canonical Intra-Block Ordering & Slotted 0x02 Batcher Priority (R8-M02)
Within each K-deep Bitcoin block $h$, $\mathcal{F}$ transitions $R_{h-1} \to R_h$ in strict deterministic order:
- Pass 1 — Deposits (
0x00 DEPOSIT): Process in Bitcoin block transaction-index orderi = 1..m-1. VerifyAdmissionTicketUTXOconsumption (vin[1..3]), acyclicvault_idTaproot script derivation,wtxid-authenticatedcertBlob(104 B), validN-of-Nsetup cohort binding,{0.50, 0.25, 0.25}BTC outputs, and the $2^M$ Hall's Marriage Invariant (spec/01 §6.2). CreditAccounts[recipientAcctHash].balanceSats += D_d. - Pass 2 — First Valid Sequenced Batch (
0x02 BATCH_DA): Scan block $h$ in tx-index order and apply AT MOST ONEwtxid-authenticated valid0x02batch whoseprevRoot == R_after_pass_1,π_batchverifies against the complete mutated SMT state diff (Accounts,RollupLocks, cooperativePendingExits,TransferCredit,<= 1,000new leaves/epoch with500-sat refundable deposit), and whosebatcherSlotIdmatches the deterministic slotted batcher priority (primary_batcher = H(header[h-1].hash) mod K_batchersfor the first 2 blocks afterprevBatchHeight + 6, open permissionless fallback to any batcher thereafter — eliminating stale-root L1 fee burn races,R8-M02!). Any competing0x02batch (e.g. from a 49% Zenon fork) failsprevRootmatching and is deterministically skipped. - Pass 3 — Mandatory L1 Forced Inclusion (
0x03,0x01,0x06): Apply EVERYwtxid-authenticated valid0x03 FORCED_TRANSFER,0x01 FORCED_EXIT(grossSats >= max(dust, 100_000)sats, active-operatorExitSlotUTXO), and0x06 EXIT_FEE_BUMPin tx-index order. 100% hostile Zenon Pillars cannot delay or censor a single forced transfer or exit by even 1 Bitcoin block. - Pass 4 — Tracked-UTXO Spends, Deterministic FIFO Assignment & Slashing Events (Full
vinScan +0x04,0x05,0x07): Process ALL spends of trackedExitSlotUTXOs (universal spend-or-refund rule with hard-partitionedB_griefpro-rata burst cap,spec/01 §5),TakeTxconfirmations (V_assigned -= D_v,AssignedObligations.pop(v)),0x07 RELEASE_ASSIGNMENT(V_assigned -> V_unassigned,A[v] -> R[O_j]), deterministic tightest-slack FIFO vault assignment (V_unassigned -> V_assigned,R[O_j] -> A[v]respecting oldest-PendingExitcredit priority,R8-N01),DisproveTx/TimeoutSlashTxdual-input slashes (0vault stolen,B_custodyslashed),BurnBondTx_{r,k}Lamport equivocation slashes (D_vburned fromB_custody, innocentO_krestored ifvwas assigned toO_k,0.05 BTCbounty), andRetireStakeTx_r(gatingB_zbtcunlock onA[O_j] == 0and Hall's invariant). Assert exactV_unassigned + V_assigned == C + L + E + R + A + B(R8-C02)!
4. Launch-Time PoW Anchor, K >= 18 Unpublished-Fork Heuristic, Heaviest-Chainwork Verification & >= K Deep-Reorg Circuit Breaker (R8-H03, R8-M07)
Because Bitcoin L1 scripts without covenants cannot inspect arbitrary future chain tips directly, each finite BitVMX StakeChain lane (j, l) (R = 64 rounds, active horizon <= ~2.3 years at T_cooldown = 13.0d) anchors Bitcoin PoW at lane launch (t = 0, before Q_lane_{j,l} deletion):
- Launch-Time Lane Anchor
(h_lane_init, H_init, D_init): Pins an already-confirmed Bitcoin mainnet block at lane creation, together with its 2,016-block retarget-period start header andmtpWindow[11]. - Full 2,016-Block Retargeting & Difficulty Floor: The ZK prover validates every 80-byte Bitcoin header from
h_lane_inittoh_tipwith exact mainnetSetCompact,[302400, 4838400]s 2,016-block retarget clamping, MTP monotonicity, and minimum difficulty floorD(h) >= 0.50 * D(h_lane_init). (If mainnet difficulty grows> 2×during a lane's active lifetime, operators retire old lanes at2,016blks and launch fresh lanes re-anchored to currentD.) - Interactive Heaviest-Chainwork Competing-Header Challenge (
R8-H03— Clementine / BitVM3 Light-Client Pattern):- To prevent a malicious operator from submitting a valid but lower-work private fork anchored at
h_lane_init, any verifierV_ichallengingRoundTx_rin[0, 144]may supply a competing valid Bitcoin header-chain proof anchored to the same(h_lane_init, H_init, D_init)whose cumulative chainwork strictly exceeds the operator's claimed chain (cumWork(H_chal) > cumWork(H_op)) and which diverges at or before the claimedK-deep confirmation block. - Inside
vk_STF, comparing the two header-chain SNARK commitments deterministically proves the operator asserted a non-canonical/lower-work fork and slashesStake_r+VaultConnector_r!
- To prevent a malicious operator from submitting a valid but lower-work private fork anchored at
- Honest Private-Fork Heuristic (
K >= 18Hard Floor) & Budish Subsidy-Offset Disclosure (R8-H03):- The protocol enforces a hard minimum
K >= 18blocks (~3.0hnominal) and sizesKacross halvings againstCap_TVL_total = Cap_user + M × B_zbtcusing the conditional unpublished-fork opportunity-cost heuristic: $$0.50 \times K \times \text{Subsidy}(\text{era}) > \text{Cap}_{\text{TVL,total}}$$ - Mandatory Economic Honesty Disclosure (Budish Winning-Fork Offset): This inequality measures the unpublished/orphaned fork opportunity cost. Under a majority (
>50%) hashrate attack where the attacker publishes the winning fork and recaptures allKblock subsidies, the attacker's direct mining cost is only the net electricity/hardware flow costκ × K × Subsidy(κ ∈ [0.05, 0.50]) PLUS external reputational/BTC-price-crash losses (verify_spec_bounds.pyprints the exact Budish sensitivity table). Consequently,K >= 18delivers probabilistic PoW finality under<50%honest hashrate — NOT an unconditional economic guarantee against a>50%cartel!
- The protocol enforces a hard minimum
| Deployment Stage | Cap_user / Cap_TVL_total (incl. M × B_zbtc) | K (2024–2028, 3.125 BTC) | 0.50 × K × Sub (K × Sub nom) | K (2028–2032, 1.5625 BTC) | K (2032–2036, 0.78125 BTC) |
|---|---|---|---|---|---|
Stage 1A Pilot (M = 3) | <= 10 BTC / 11.80 BTC | 18 (~3.0h) | 28.125 (56.25) > 11.80 | 18 (14.06 > 11.80) | 32 (12.50 > 11.80) |
Stage 1A Expanded (M = 5) | <= 15 BTC / 18.00 BTC | 18 (~3.0h) | 28.125 (56.25) > 18.00 | 24 (18.75 > 18.00) | 48 (18.75 > 18.00) |
Stage 2 Scaled (M = 20) | <= 50 BTC / 62.00 BTC | 42 (~7.0h) | 65.625 (131.25) > 62.00 | 80 (62.50 > 62.00) | 160 (62.50 > 62.00) |
Stage 2 High-Cap (M = 40) | <= 200 BTC / 224.00 BTC | 144 (~24.0h) | 225.00 (450.00) > 224.00 | 288 (225.00 > 224.00) | 576 (225.00 > 224.00) |
- Fail-Closed Deep-Reorg (
>= K) Circuit Breaker (R8-M07):- All Rollup full nodes, batchers, operators, and verifiers MUST retain
>= 144-block rollback snapshots of(R_h, SMT_h). - If Bitcoin ever experiences a reorg of depth
>= K(>= 18blocks), nodes MUST immediately assertDEEP_REORG_HALT: (a) freeze new0x02batch submissions and new operator fronting, (b) rewind canonical state to the highest common ancestorh_forkand deterministically replay the heavier canonical Bitcoin chain fromh_fork + 1, (c) treat any orphanedFrontingTxas valid ONLY if confirmed on the canonical chain (operators explicitly accept< K-deep fronting risk and waitKblocks before claiming vault reimbursement), and (d) resume normal operation automatically once the canonical tip stabilizes>= Kblocks pasth_fork.
- All Rollup full nodes, batchers, operators, and verifiers MUST retain
5. Mandatory SPV & Authorization Domain Conformance Test Vectors
- Stage 0 Header & Merkle Suite: All 24 Bitcoin header, 2,016-block retarget (
[302400, 4838400]s), MTP,futureTimeGuardSecs = 7,200,LOWEST_BLOCK_HASH_BEtie-break,CVE-2012-2459, andCVE-2017-12842(len < 65rejection,R8-M06) vectors. - 1- and 2-Block Coinbase Midstate Suite: Valid coinbase proofs for BOTH
totalCoinbaseBytes % 64 ∈ [0, 55](1-block) ANDtotalCoinbaseBytes % 64 ∈ [56, 63](2-block — e.g.120 B,127 B,250 B), plus rejection oflen(finalChunkTail) != totalCoinbaseBytes % 64andtotalCoinbaseBytes <= 64. - Panic-Free & Plasma-Floor Fuzz Gate (
B1,B2): Malformed ABI inputs across all 4 Stage 0 oracle methods MUST return deterministic errors (zero panics, zero FIFO sequencer stalls), and exact ABI sizing ofProveTxInclusion(7,620 B,591,388Plasma) fits>= 3×inside the2,100,000floor and<= 40contract blocks/Momentum. - Stage 1A Stripped-Block, BIP-141 Completeness & Reorg Suite (
R8-C05,R8-M07): Rejection (REFUSED_DATA_UNAVAILABLE) of omitted orwtxid-mismatched witnesses, extraction of the LAST0x6a24aa21a9edcoinbase output when multiple matching outputs exist, full stripped-vindetection of untaggedExitSlotUTXO/VaultUTXO/Stake_rspends, deterministic skip ofwtxid-authenticated malformed0x02 BATCH_DA, slotted batcher priority, interactive heaviest-chainwork fork rejection, and>= KDEEP_REORG_HALTrewind/replay.
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.