Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Full v1 Design Document

One-liner: A zero-sequencer, zero-bridge Proof-of-Work mini-chain and meme-coin launchpad whose entire ruleset, UI, and verifier live inside a single Genesis Inscription on Bitcoin.


1. Core Architecture

eyezero (i0) separates live UX from final settlement without introducing any centralized sequencer, validator server, or custodial bridge.

LayerComponentRole
Rules & AppGenesis Inscription (G)Immutable HTML/JS app on Bitcoin holding the deterministic applyBlock() state machine, bonding-curve math, verifier, and UI.
Live MempoolEntmoot (entmoot-lite)WebRTC-direct P2P gossip (works inside ord’s strict sandbox CSP). Propagates signed orders (#i0-tx) and block announcements (#i0-blk) in <1s.
Settlement & PoWVanity Inscriptions (000000…i0)Anyone packs pending orders, grinds reveal_txid offline until the inscription ID meets dynamic PoW difficulty, and inscribes on Bitcoin.
Verifying NodesEvery User’s BrowserOpening G on ordinals.com verifies PoW, /r/inscription/<id>, signatures, and state transitions locally. Zero dedicated validator fleet.
BTC On/Off-RampBuilt-in HTLC SwapsTrustless P2P swaps between real Bitcoin L1 and native $I0 coins using standard Hash Time-Locked Contracts.

2. Consensus, Vanity PoW & Fork Choice

2.1 Vanity-ID PoW (Zero Wasted BTC Fees)

An Ordinal inscription ID is <reveal_txid>i0. Because reveal_tx spends the commit_tx output (whose Taproot script commits to the exact block payload bytes), modifying any byte of the block changes commit_txid and therefore reveal_txid.

Miners grind non-content fields (e.g. nLockTime, miner nonce in payload, or commit/reveal tweaking) entirely offline until the display-order reveal_txid satisfies the difficulty target 000000…i0. Only once a valid hash is found do they broadcast commit + reveal on Bitcoin — failed hashes cost $0 in BTC fees.

2.2 Block Validity Rules

Every browser verifier rejects a block inscription B unless all 6 checks pass:

  1. Confirmed on Bitcoin: GET /r/inscription/<B.id> succeeds, B.id ends with i0, and B is confirmed in a Bitcoin block (btc_height(B)).
  2. Chain Continuity: B.prev equals the parent block’s ID (or G at height 1), B.height === prev.height + 1, and btc_height(B) > btc_height(prev) (at most one canonical i0 block per Bitcoin block).
  3. Anti-Premine Anchor: B includes btcRefHeight and btcRefHash, verified against GET /r/blockhash/<btcRefHeight>, where btc_height(prev) <= btcRefHeight < btc_height(B) and btc_height(B) - btcRefHeight <= 6.
  4. PoW Difficulty Target: Interpreting B.id.slice(0, 64) as a 256-bit unsigned integer satisfies \( \text{uint256}(B.\text{id}) \le \text{target}(B.\text{height}) \). Retargets smoothly every 72 blocks (~12h) toward 1 i0 block per Bitcoin block, clamped 0.25x–4x, with a minimum floor of 20 leading zero bits (00000…i0).
  5. Valid Transactions & Nonces: Every tx in B.txs has a valid signature, chainId === G.slice(0, 16), strictly sequential nonce === account.nonce + 1, and sufficient balance.
  6. Deterministic State Root & Diff: Running applyBlock(prevState, B) in pure BigInt integer math produces exact matches for B.stateRoot and B.diff (and B.checkpoint on checkpoint heights).

2.3 Fork Choice & Orphan Tie-Break

  • Primary: Highest cumulative PoW work (\( \sum 2^{256} / \text{target} \)).
  • Same-work tie-break: (1) Earliest Bitcoin confirmation block (lowest btc_height), then (2) lowest inscription_number from /r/inscription/<id>.

2.4 Block Discovery & Cold Recovery

  • Fast path: Miners announce confirmed blocks on Entmoot (#i0-blk: { id, height, prev }). Browsers cache tips in IndexedDB and re-gossip.
  • Cold recovery: Given any single latest block ID, any browser walks B.prev backwards via /content/<id> all the way to Genesis G without needing Entmoot.

3. Native Coin ($I0) & Miner Economics

Miners expend compute/electricity + real BTC L1 fees and earn:

  1. Fair-Launch Block Reward ($I0): Minted solely to B.miner on a Bitcoin-style halving schedule (0% premine). Serves as the quote currency for all meme-coin curves.
  2. 100% of Protocol Trading & Launch Fees: 1.0% on every BUY/SELL + flat launch fee on every LAUNCH + optional priority tips.

4. MEV-Free Batch-Auction Bonding Curve

All curve math lives inside Genesis Inscription G in deterministic BigInt arithmetic.

4.1 Six Primitives

TRANSFER, LAUNCH (referencing any Bitcoin Ordinal inscription_id as permanent meme art), BUY, SELL, HTLC_LOCK, and HTLC_CLAIM / HTLC_REFUND.

4.2 Uniform Batch Clearing

For reserves \( X = V_{I0} + R_{I0} \) and \( Y = V_{\text{tok}} + R_{\text{tok}} \), net buy inputs \( B = \sum b_i \) (after 1% fee), and net sell inputs \( S = \sum s_j \) (after 1% fee):

\[ \text{out}_{\text{tok}} = \left\lfloor \frac{B \cdot (Y + S)}{X + B} \right\rfloor, \qquad \text{out}_{I0} = \left\lfloor \frac{S \cdot (X + B)}{Y + S} \right\rfloor \]

Payouts distribute pro-rata (\( \lfloor b_i \cdot \text{out}_{\text{tok}} / B \rfloor \) and \( \lfloor s_j \cdot \text{out}_{I0} / S \rfloor \)), and reserves update to \( X^{\prime} = X + B - \text{out}_{I0} \), \( Y^{\prime} = Y + S - \text{out}_{\text{tok}} \).

  • Every buyer and seller receives the exact same uniform price \( P = (X + B) / (Y + S) \) (zero sandwiching / MEV).
  • \( X^{\prime} \cdot Y^{\prime} \ge X \cdot Y \) and \( R_{I0}^{\prime} \ge 0 \) hold mathematically; reduces identically to \( x \cdot y = k \) when only buys or sells occur.
  • Every included order must satisfy actualOut >= order.minOut.
  • Crossing GRAD_TARGET permanently locks the curve into a constant-product AMM pool using the same formula.

4.3 Live UX & Sandbox Keys

  • Signed orders over Entmoot #i0-tx update charts and balances in <1s as Pending (Entmoot) and flip to Final (Bitcoin) when 000000…i0 confirms.
  • Genesis Inscription G holds a local BIP-340 Schnorr trading keypair in IndexedDB (exportable via 12-word recovery phrase) because ord sandboxes iframes from external browser wallet extensions.

5. Trustless BTC ↔ $I0 Swaps (HTLC)

  1. Alice ($I0 seller) and Bob (BTC buyer) match on Entmoot.
  2. Alice locks $I0 on eyezero via HTLC_LOCK (H = SHA256(S), timeout T + 18).
  3. Bob locks real BTC on Bitcoin L1 in a standard Taproot/P2WSH HTLC (H, timeout T + 6).
  4. Alice claims Bob’s BTC on Bitcoin L1 by revealing S.
  5. Bob submits HTLC_CLAIM(swapId, S) on eyezero; browsers verify SHA256(S) === H and release $I0 to Bob.

6. Block Format, Checkpoints & v1 → v2 Scaling

{
  "v": 1,
  "h": 4201,
  "prev": "0000007a...9f1ei0",
  "btcRef": { "h": 924110, "hash": "00000000000000000002..." },
  "miner": "<32-byte pubkey>",
  "nonce": 18492011,
  "stateRoot": "<32-byte SHA-256 Merkle root>",
  "diff": [ [104, 0, "495000000"], [104, 17, "12840000"] ],
  "checkpoint": null,
  "txs": [ "...compact signed txs..." ]
}
  • v1: prev + diff + checkpoint + raw txs → ~3,500–4,200 txs / block (~6–7 TPS), pure JS verification, 100% on Bitcoin.
  • v2: Swap txs for a ~200-byte ZK proof while keeping diff on Bitcoin → hundreds of TPS, ~5 ms browser verification, and zero Entmoot data-availability risk.