Every previous chapter has treated satoshis as interchangeable. A sat is a satโ1/100,000,000 of a bitcoin, fungible by design. Ordinal theory upends this assumption: by assigning a unique serial number to every satoshi ever mined and tracking transfers via a deterministic first-in-first-out rule, it turns each sat into a distinct, identifiable object.
Inscriptions build on this foundation. Using a Taproot script-path spend (Chapter 13), arbitrary dataโimages, text, HTML, even programsโcan be embedded in the witness of a reveal transaction. The inscription is permanently bound to a specific sat, which can then be transferred, sold, or held like any other UTXO.
This chapter examines both the numbering scheme and the transaction anatomy that makes inscriptions possible.โ
Every sat receives a serial number based on the order in which it is mined. The whole algorithm is two short functions โ together they answer "given a block height, what are the ordinal numbers of the sats that block minted?" The algorithm is purely interpretive: no consensus rule changes, no extra bytes on chain, no new transaction field. Any node can recompute every ordinal from chain history.
# โโ Constants โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ SATS_PER_BTC = 100_000_000 # 1 BTC = 10^8 sats HALVING_INTERVAL = 210_000 # blocks per halving epoch (~4 yrs) INITIAL_SUBSIDY = 50 * SATS_PER_BTC # 5,000,000,000 sats (block 0's reward) # โโ 1. How many sats does block <height> mint? โโโโโโโโโโโโโโโโโโโโ def subsidy(height): halvings = height // HALVING_INTERVAL # 0 in epoch 0, 1 in epoch 1, ... return INITIAL_SUBSIDY >> halvings # halve `halvings` times (>> 1 โก รท 2) # โโ 2. What ordinal is the FIRST sat of block <height>? โโโโโโโโโโโ def first_ordinal(height): total = 0 for h in range(height): # sum every prior block's reward total += subsidy(h) return total # picks up where block (height-1) left off
That's it. Five active lines once you strip the comments. Let's actually run it on real heights so the abstraction stops being abstract:
subsidy(h) โ the per-block reward at four landmark heights:
| height | halvings = height // 210,000 | 50e8 >> halvings | = sats | = BTC |
|---|---|---|---|---|
| 0 | 0 | 5,000,000,000 >> 0 | 5,000,000,000 | 50 |
| 209,999 | 0 | 5,000,000,000 >> 0 | 5,000,000,000 | 50 |
| 210,000 | 1 | 5,000,000,000 >> 1 | 2,500,000,000 | 25 โ first halving |
| 840,000 | 4 | 5,000,000,000 >> 4 | 312,500,000 | 3.125 โ 4th halving (Apr 2024) |
first_ordinal(h) โ the ordinal of the first sat of each landmark block. (At each halving boundary the per-block step shrinks because the subsidy halved.)
| height | first_ordinal(h) | meaning |
|---|---|---|
| 0 | 0 | the mythic genesis sat |
| 1 | 5,000,000,000 | = subsidy(0); first sat of block 1 |
| 2 | 10,000,000,000 | = subsidy(0) + subsidy(1) |
| 210,000 | 1,050,000,000,000,000 | = 210,000 ร 5e9; first epic sat (start of epoch 1) |
| 420,000 | 1,575,000,000,000,000 | + 210,000 ร 2.5e9 (epoch 1 added 525e12 sats) |
| 840,000 | 1,968,750,000,000,000 | start of epoch 4 (3.125 BTC subsidy) |
No memorization required. The point: a single 64-bit integer per sat, computed by a 5-line algorithm from public chain history.
The same data, grouped by halving epoch:
| Epoch | Blocks | Subsidy | First Ordinal of Epoch |
|---|---|---|---|
| 0 | 0โ209,999 | 50 BTC | 0 |
| 1 | 210,000โ419,999 | 25 BTC | 1,050,000,000,000,000 |
| 2 | 420,000โ629,999 | 12.5 BTC | 1,575,000,000,000,000 |
| 3 | 630,000โ839,999 | 6.25 BTC | 1,837,500,000,000,000 |
| 4 | 840,000โ1,049,999 | 3.125 BTC | 1,968,750,000,000,000 |
Once a sat exists, where it ends up after a transaction is also fully determined by a simple rule: FIFO. Stack all the input sats in order (input 0's sats first, then input 1's, then input 2'sโฆ), then pour them into the outputs in order until each output is full. Any sats left over after every output is full constitute the fee and are claimed by the miner via the block's coinbase transaction.
A 2-input / 2-output transaction. Inputs total 150 sats; outputs total 130; the difference is a 20-sat fee that goes to the miner via the block's coinbase. Click Step to pour the input sats into the outputs one batch at a time. The colors track which input each output's sats came from.
Color key: input 0 sats came from input 0 (ordinals 1000โ1099); input 1 sats came from input 1 (ordinals 2000โ2049). Same color = same source โ at a glance you can see which input contributed which slice of each output.
Why this matters in practice. The fee bin in step 4 contains ordinals 2030โ2049. If ordinal 2040 was an inscription Alice cared about, she just paid it as a fee โ it now belongs to whoever mined this block. Standard ("non-ordinal-aware") wallets treat sats as interchangeable and routinely make this mistake. Ordinal-aware wallets work backwards from "where do I want ordinal N to land?" and then choose input order and output sizes so FIFO routes N to the intended output. Try moving back to step 0 and re-running โ the FIFO rule is fully deterministic, so the only way to change the destination of any specific ordinal is to change the inputs or outputs.
Ordinal theory is purely interpretiveโit requires no changes to Bitcoin's consensus rules, transaction format, or network protocol. Any node can independently compute the ordinal number of any sat by replaying the blockchain. Ordinals exist in the same sense that block height exists: as a deterministic function of the chain's history.
Bitcoin's periodic events create natural rarity tiers:
| Rarity | Definition | Total Supply |
|---|---|---|
| Common | Any sat not first in its block | 2.1 quadrillion |
| Uncommon | First sat of each block (excl. higher tiers) | 6,926,535 |
| Rare | First sat of each difficulty adjustment | 3,432 |
| Epic | First sat of each halving epoch | 27 |
| Legendary | First sat of each cycle (6 halvings) | 5 |
| Mythic | First sat of the genesis block | 1 |
A cycle is the period between conjunctions of a halving and a difficulty adjustment (\(6 \times 210,000 = 1,260,000\) blocks, 24 years). The first conjunction has not yet occurred.
Inscriptions embed data inside a Taproot witness script using a construct called an envelope: an OP_FALSE OP_IF block that is syntactically valid but never executed.
OP_FALSE
OP_IF
OP_PUSH "ord" protocol tag
OP_PUSH 1 content-type tag
OP_PUSH "<MIME type>" e.g., "image/png"
OP_PUSH 0 body separator
OP_PUSH <data> content (may span multiple pushes)
OP_ENDIF
Key design properties:
OP_FALSE OP_IF โฆ OP_ENDIF is never entered during script execution. The envelope does not affect the spending conditionโit can be combined with any locking script.0x6f7264 (ASCII "ord") disambiguates inscriptions from other uses of envelopes.0x0b) = delegate (inscription inherits its content from another inscription). Tag 0 signals the start of the body. Odd-numbered tags are unrecognized-safe; see the Ordinals specification for the full registry.A common misconception is that the inscription data "runs" on-chain. It does not. The OP_FALSE ensures the OP_IF branch is never entered. The data pushes inside the envelope are parsed by indexers (like ord) but ignored by Bitcoin's script interpreter. The actual spending conditionโtypically a simple <pubkey> OP_CHECKSIGโappears before the envelope.
Inscriptions require a two-phase process because Taproot script-path spends can only be made from existing Taproot outputs. You cannot create and spend a Taproot output in the same transaction.
The commit transaction creates a P2TR output whose internal key or script tree commits to the inscription content. From the outside, this looks like an ordinary Taproot outputโnothing reveals the inscription until the output is spent.
The reveal transaction spends the commit output via script-path (Chapter 13). The witness contains:
The inscription content becomes visible on-chain only in the reveal transaction's witnessโpermanently recorded in the blockchain.
The very first Ordinals inscription โ a 100×100 pixel skull image โ was inscribed by Casey Rodarmor on December 14, 2022 at 20:32 UTC in block 767,430. Two transactions in two blocks: a commit that creates a P2TR output, then a reveal that spends it script-path with the inscription embedded in the witness.
| txid | 274bda66โฆ 6358 |
| Input | P2WPKH ยท 111,794 sats |
| Output 0 | P2TR ยท 10,000 sats (the inscription commit) |
| Output 1 | P2WPKH ยท 101,531 sats (change) |
| Fee | 263 sats (234 B / 153 vB) |
| txid | 6fb976abโฆ 2799 |
| Input | spends commit Output 0 ยท P2TR script-path |
| Output | P2WPKH ยท 9,678 sats |
| Fee | 322 sats (1,040 B / 322 vB โ 1 sat/vB) |
| nSequence | 0xFFFFFFFD (RBF-signaling) |
| Witness | 3 items, ~953 bytes โ |
Below is the full reveal-transaction hex โ hover any byte for a field tooltip:
Any Bitcoin node will serve the raw transaction bytes for any confirmed txid. Three common ways to fetch them: bitcoin-cli getrawtransaction <txid> against your own node, the mempool.space API (or the mempool.space โ link in the header of the hex widget below), or any Esplora-compatible block-explorer endpoint. All three return the same 1,040-byte hex string โ chain state is deterministic, and so is the byte representation of a tx in it.
The bulk of those 1,040 bytes is a single witness element โ the tapscript, witness item 1, which carries both the spending condition and the inscription. Below is its anatomy.
The 853-byte tapscript splits into seven distinct regions. Each row below shows the actual hex from this specimen, the opcode interpretation, byte count, and purpose:
Color key: spending condition · envelope no-op · protocol marker · content-type tag · body separator · payload
89 50 4e 47 0d 0a 1a 0a are the standard PNG file header (you can paste them into any hex editor and the OS will recognize the file). Look at chunk 2's tail: 49 45 4e 44 ae 42 60 82 is "IEND" + CRC โ the PNG end-of-file marker. The image is bit-for-bit identical to the file Casey inscribed.Why the dead-code trick works. The Bitcoin script interpreter sees OP_FALSE OP_IF, evaluates the top-of-stack as zero, and jumps to the matching OP_ENDIF without parsing the contents. Everything between them is bytes the interpreter never reads as opcodes. The OP_PUSHDATA2 520 <520 bytes> would otherwise consume 520 bytes from the script stream and push them as a stack item โ but inside OP_FALSE OP_IF โฆ OP_ENDIF, the interpreter is skipping, not executing. The data is therefore stored on chain without ever touching the script semantics. Ordinals indexers (like ord) parse the same bytes as data, not script โ that's the entire trick.
6fb976abโฆ2799?Inscriptions have a human-friendly identifier called the inscription ID (formally defined in ยง19.7.1):
<reveal_txid>i<index>
For Inscription #0 specifically, the ID is 6fb976abโฆ2799i0 โ strip the i0 suffix and you have the reveal txid. To get from a name like "Inscription #0" to that ID, query any indexer that has scanned the chain for envelopes:
ord indexer reads blocks from a Bitcoin Core node and exposes /inscription/<number> and /inscription/<id> endpoints locally โ the canonical lookup.Indexers do exactly what ยง19.4.2 documents โ scan every Taproot script-path spend for an OP_FALSE OP_IF "ord" envelope and record the txid + index. The ID is a deterministic function of chain state; any two indexers produce identical results for the same chain tip.
Once you have the reveal txid, the procedure to recover the inscribed image from on-chain bytes alone is:
6fb976abโฆ2799 via any of the routes above (bitcoin-cli getrawtransaction, mempool.space, Esplora).00 63 (envelope open).03 6f 72 64 (the "ord" marker).01 01 09 69 6d 61 67 65 2f 70 6e 67 (the content-type tag).00 (the body separator).OP_PUSHDATA2 + length + payload bytes. Concatenate the payloads.OP_ENDIF.The concatenated bytes are the literal contents of the PNG file. Save them to inscription_0.png, double-click, see the skull.
Inscriptions exploit three properties of the Taproot upgrade that converge to make on-chain data storage economical:
Witness data is counted at 1 WU per byte (vs. 4 WU per byte for non-witness data). For inscription #0:
| Non-witness | Witness | |
|---|---|---|
| Bytes | 82 | 958 |
| Weight contribution | \(82 \times 4 = 328\) WU | \(958 \times 1 = 958\) WU |
| Total weight | 1,286 WU (322 vB) |
Without the witness discount, the same 1,040 bytes would cost \(1,040 \times 4 = 4,160\) WU (1,040 vB)โmore than three times the actual cost. The witness discount provides a 69% fee reduction for data-heavy transactions like inscriptions.
Pre-Taproot scripts were limited to 10,000 bytes (the MAX_SCRIPT_SIZE consensus rule). BIP 342 (Tapscript) removed this limit for Taproot script-path spends. The only remaining constraint is the 4,000,000 WU block weight limitโa single inscription can theoretically consume nearly an entire block.
Because OP_FALSE OP_IF โฆ OP_ENDIF is never entered during script execution, the data inside the envelope is not subject to script-execution rules (like the stack element size limit for operations). The 520-byte push limit still applies at the serialization level, but arbitrarily large content can be split across multiple pushes.
Inscriptions reignited a long-standing argument about what data belongs on the Bitcoin blockchain. The technical reality is more nuanced than either side typically acknowledges.
"Pruning" in Bitcoin is not a single operation โ it operates at several distinct layers, each discarding different data with different trade-offs:
| Layer | What gets discarded | Who does it | User-facing? |
|---|---|---|---|
| Block file pruning | Old blk*.dat and rev*.dat files after validation | -prune=N flag | Yes โ the primary meaning of "pruned node" |
| UTXO pruning | OP_RETURN outputs โ provably unspendable, never enter the UTXO set | Every node, automatically | No โ invisible to the operator |
| Mempool pruning | Lowest-feerate unconfirmed transactions when mempool exceeds -maxmempool (default 300 MB) | Every node, automatically | No โ happens silently under load |
| Manual pruning | Blocks below a specified height via pruneblockchain RPC | Operator via RPC call | Yes โ fine-grained control |
| Ultraprune (v0.8.0) | The old BerkeleyDB database โ replaced with a lean UTXO-only LevelDB | Pieter Wuille, 2013 | No โ architectural prerequisite that made all other pruning possible |
| UTXO set pruning (Utreexo, proposed) | The UTXO set itself โ replaced with a cryptographic accumulator; transactions carry their own existence proofs | Not yet implemented | Would eliminate the ~8 GB in-memory UTXO database |
| Witness pruning (never built) | Witness data stripped from blocks while keeping block structure | Not yet implemented | Would allow selective deletion of inscription data |
The common thread: at each layer, the question is what data can the node discard and still validate fully? Block pruning discards historical evidence. UTXO pruning discards provably dead outputs. Mempool pruning discards low-priority unconfirmed transactions. Utreexo would discard the UTXO set itself. Witness pruning would discard signatures and inscription data. They are all "pruning," but they operate on completely different data structures โ and only the first is available as a user setting today.
"Prunable" is used loosely in the Bitcoin community, but it refers to two completely different operations that happen at different layers:
blk*.dat files) is deleted after validation. This only happens if the operator sets -prune=N, and it deletes entire blocks โ not individual outputs or fields. Archive nodes (the default) never delete block files.With this distinction, the storage picture becomes more precise:
| Component | Where it lives | UTXO-set pruned? | Block-file pruned? |
|---|---|---|---|
| Inscription content (image, text) | Witness field in blk*.dat | N/A โ never in UTXO set | Only if -prune is on (deletes whole block) |
| OP_RETURN metadata | Output script in blk*.dat | Yes โ automatically excluded, every node | Only if -prune is on (deletes whole block) |
| Fake P2WSH output (data as script hash) | UTXO set + blk*.dat | No โ appears spendable, permanent | Only if -prune is on (but UTXO entry remains) |
| Inscription output (carries the inscribed sat) | UTXO set + blk*.dat | No โ persists until spent | Only if -prune is on (but UTXO entry remains) |
When gmaxwell says OP_RETURN data is "completely prunable and pruned," he means UTXO-set pruning โ the output never enters the expensive in-memory database. The raw bytes still sit in blk*.dat on every archive node's disk. On a pruned node, those bytes eventually disappear when the entire block is deleted โ but that's not special to OP_RETURN; every byte in the block goes with it.
The real advantage of OP_RETURN is not that the data vanishes from disk. It's that the data never touches the UTXO set. Block files are cheap sequential storage. The UTXO set is a live database queried on every transaction validation, held in RAM or fast SSD, growing permanently with every unspent output. An OP_RETURN output creates zero burden on this critical resource. A fake P2WSH output creates a permanent entry that every full node on the network must maintain โ forever, or until someone "spends" it (which, for a fake script hash, is never).
The 75% witness discount (1 WU per witness byte vs. 4 WU per non-witness byte) was designed to incentivize SegWit adoption. The economic rationale: witness data is prunable and does not affect the UTXO set, so it should be cheaper. The discount assumed witness data would consist of signatures (64โ73 bytes per input). Inscriptions exploit the same discount to store megabytes of arbitrary content at one-quarter the effective fee rate โ an application the discount's designers did not anticipate.
Not with Bitcoin Core's current tools. The -prune flag operates at the block level โ it discards entire old blocks after validation, keeping only the most recent blocks (the value is a disk budget in MiB; the 550 minimum keeps roughly a day or two of blocks). There is no option to selectively strip witness data while preserving the rest of the block.
The options available to a node operator are:
-prune=550): Discards block data beyond the disk budget (~1โ2 days of blocks at the 550 MiB minimum). Disk usage stays around 5โ10 GB. All inscription witness data is eventually deleted โ but so is everything else. The node cannot serve historical blocks to peers.There is no middle option in Bitcoin Core. A node operator who wants to validate the full chain and serve blocks to peers, but does not want to store hundreds of gigabytes of inscription images, has no recourse.
Short answer: not without modifying Bitcoin Core's storage layer or rewriting the entire blockchain on disk. The block-serialization format interleaves witness data inside each transaction (not appended at the end), so removing a witness shifts every byte offset that follows in the file, which invalidates every subsequent block's index entry. The full code-level walk-through โ the actual BlockManager::WriteBlock() source, the FlatFilePos index structure, and the two architectures (external post-processor / separate witness files) that could make selective pruning practical โ lives in Appendix G.
Appendix G addresses the chain-bytes side of the question (can we delete the data?). The design memo addresses the UTXO-set side (can we make the spending claim expire?). They're sister rabbit holes from the same concern about long-term storage cost.
Chapter 15 introduces the Three Doors framework developed by the BitcoinTalk user d5000 during the 2025 debate over Bitcoin Core 30's OP_RETURN change. The framework ranks on-chain data-embedding methods by how much harm they do to the network: Door 1 is fake public keys (permanent UTXO pollution), Door 2 is Taproot witness embedding (moderate, theoretically prunable, never actually pruned), Door 3 is OP_RETURN (never enters the UTXO set).
Inscriptions are Door 2. An inscription envelope lives in the Taproot script-path witness; the actual reveal output is a normal P2TR UTXO (~43 bytes of UTXO-set weight) that eventually gets spent or sits in limbo. The content itself rides on the witness discount (1 WU per byte instead of 4) and is not counted against any per-tx relay cap โ the only brake on inscription size is the 4 MB block weight limit itself.
The key observation from the v30 debate, echoed by Greg Maxwell and d5000, is that Door 2 is architecturally the strangest of the three: its data is theoretically deletable (the coinbase's witness commitment, ยง14.4.3, proves the witness existed even after the bytes are gone), but no Bitcoin client has ever implemented selective witness pruning. The witness discount was priced on a prunability that was never built. So while inscriptions sound cleaner than OP_RETURN ("it's in the witness, it doesn't hit the UTXO set"), in practice every archive node stores every inscription byte forever. If the goal is truly prunable on-chain data, Door 3 โ not the witness โ is where it belongs. That is precisely the argument that carried Bitcoin Core 30 across the line.
The debate around on-chain data storage is full of claims that sound technical but collapse under scrutiny. A rigorous reader should challenge each one:
| Claim | Reality |
|---|---|
| "OP_RETURN data is fully prunable" | Half true. It is automatically excluded from the UTXO set (the expensive part). But the raw bytes persist in blk*.dat on every archive node forever. Only full block pruning (-prune=N) removes them โ and that removes everything else too. There is no way to selectively delete OP_RETURN data while keeping the block. |
| "Witness data is prunable" | Theoretically. The witness commitment in the coinbase makes it architecturally safe to delete witness data. But no Bitcoin client has ever implemented selective witness pruning. The only way to "prune" witness data today is to prune entire blocks. The discount was priced on a prunability that was never built. |
| "Inscriptions don't affect the UTXO set because the data is in the witness" | The inscription content doesn't affect the UTXO set. But every inscription creates at least one spendable output โ the UTXO that carries the inscribed sat. That output entry (~43 bytes) sits in the UTXO set of every full node on the planet until it is spent. Millions of abandoned inscriptions mean millions of permanent UTXO entries. |
| "Just run a pruned node if you don't want the data" | Pruned nodes cannot serve historical blocks to peers. If everyone prunes, new nodes cannot sync. The network requires a sufficient number of archive nodes. Pruning shifts the burden โ it doesn't eliminate it. |
| "Miners already filter transactions they don't like" | Miners can choose not to include data transactions, but they cannot prevent other miners from including them. And rational miners will include any transaction that pays a sufficient fee. Filtering is a unilateral decision with no network effect โ it just means the filtering miner earns less revenue. |
| "The 80-byte OP_RETURN limit protects the network" | It protects the network from 80+ byte OP_RETURN outputs. It does not protect the network from data storage โ it merely redirects embedders to the witness (Door 2) or fake outputs (Door 1), both of which are more harmful. The limit displaces the problem; it does not solve it. |
The honest conclusion: there is no free lunch. Every method of embedding data on-chain has costs. The question is not whether data storage should be prevented (it can't be โ the bytes are valid transactions) but which costs are acceptable and who bears them. OP_RETURN imposes the least cost (no UTXO burden, block-file only). Witness inscriptions impose moderate cost (UTXO entry + block-file data). Fake outputs impose the highest cost (permanent UTXO entry + block-file data, with no way to ever remove the UTXO entry). The tooling to prune witness data โ the middle option โ was never built, despite the witness discount being justified by its theoretical prunability.
OP_RETURN was explicitly designed as the "clean" way to put data on-chain: unspendable, no UTXO entry, prunable. But its long-standing 80-byte standardness default (a policy rule, not consensus) made it useless for large content until Core 30.0 lifted the default (ยง19.6.7). Inscriptions bypass this limit entirely by using the witness, which has no standardness cap and gets the 75% discount. If inscriptions used OP_RETURN, they would be limited to 80 bytes โ no images, no HTML, no games. The protocol that was designed for data storage is too small; the field that was designed for signatures is used instead.
Each inscription is identified by its reveal transaction's txid and an index:
6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0
The i0 suffix indicates this is the first (index 0) inscription in the reveal transaction. A single transaction can contain multiple inscriptions across its inputs.
The inscription is bound to the first sat of the reveal transaction's first input. From that point, the sat (and its inscription) follows the FIFO transfer rule through subsequent transactions.
Ordinal-aware wallets must carefully control input/output ordering to avoid accidentally sending an inscribed sat to an unintended recipientโor worse, losing it to fees. A standard (non-ordinal-aware) wallet treats all sats as fungible and may inadvertently relinquish a valuable inscribed sat.
OP_FALSE OP_IF โฆ OP_ENDIF....i0) and are bound to the first sat of the reveal input.Inscriptions use the witness to embed non-fungible contentโone inscription per sat. Chapter 20 examines Runes, a protocol that uses OP_RETURN to create fungible tokens on Bitcoin, with an entirely different transaction anatomy.
text/plain;charset=utf-8) is revealed in a transaction with 82 bytes of non-witness data. Estimate the total witness size and the transaction's weight.OP_FALSE OP_IF โฆ OP_ENDIF is a no-op in Bitcoin Script. Why is this property essential for inscriptions?L1. Ordinals are assigned sequentially in the order sats are mined. The first sat of the genesis block is ordinal 0. Each block's subsidy adds the next batch. The first sat of block \(h\) has ordinal \(\sum_{i=0}^{h-1} \texttt{subsidy}(i)\).
L2. The "ord" marker (0x6f7264) disambiguates Ordinals inscriptions from other potential uses of the OP_FALSE OP_IF envelope pattern. It is the first push inside the envelope and identifies the protocol.
L3. Taproot script-path spends can only be made from existing Taproot outputs. The commit transaction creates the P2TR output that commits to the script tree containing the inscription. The reveal transaction then spends it, exposing the tapscript (and the embedded data) in the witness. You cannot create and spend a Taproot output in the same transaction.
L4. 520 bytes. This is a Taproot consensus rule inherited from the original script push limit. Larger content is split across multiple pushes within the envelope.
L5. Unclaimed sats (the transaction fee) flow to the coinbase transaction of the block. In ordinal theory, the coinbase has implicit inputs for fees, so these sats are assigned to the miner's coinbase outputs following the standard FIFO rule.
H1. Block 767,430 is in epoch 3 (blocks 630,000โ839,999).
| Epoch | Sats Contributed | Calculation |
|---|---|---|
| 0 | 1,050,000,000,000,000 | \(210,000 \times 5,000,000,000\) |
| 1 | 525,000,000,000,000 | \(210,000 \times 2,500,000,000\) |
| 2 | 262,500,000,000,000 | \(210,000 \times 1,250,000,000\) |
| 3 (partial) | 85,893,750,000,000 | \(137,430 \times 625,000,000\) |
| Total | 1,923,393,750,000,000 |
The first sat of block 767,430 is ordinal 1,923,393,750,000,000. The 137,430 partial-epoch blocks come from \(767,430 - 630,000\).
H2. The tapscript contains:
<pubkey>) + 1 byte (OP_CHECKSIG) = 34 bytesOP_0(1) + OP_IF(1) + push "ord"(1+3) + push tag 1(1+1) + push MIME(1+24) + OP_0(1) + OP_ENDIF(1) = 35 bytesOP_PUSHBYTES_13)Tapscript total: \(34 + 35 + 14 = 83\) bytes. Add Schnorr signature (64 bytes) and control block (33 bytes). Witness items with varints: \(1 + 64 + 1 + 83 + 1 + 33 = 183\) bytes. Add witness item count (1 byte) and marker+flag (2 bytes): total transaction \(\approx 82 + 2 + 1 + 183 = 268\) bytes.
Weight: \(82 \times 3 + 268 = 246 + 268 = 514\) WU, or \(\lceil 514/4 \rceil = 129\) vB.
H3. Weight \(= \text{stripped\_size} \times 3 + \text{total\_size} = 82 \times 3 + 1{,}040 = 246 + 1{,}040 = 1{,}286\) WU.
vsize \(= \lceil 1{,}286 / 4 \rceil = \lceil 321.5 \rceil = 322\) vB.
Fee rate: \(322 \div 322 \approx 1\) sat/vB.
P1. In Bitcoin Script, OP_IF pops the top stack element and executes the following code only if the element is nonzero (true). OP_FALSE pushes zero, so OP_IF always takes the "else" branchโwhich, in the absence of an OP_ELSE, means jumping directly to OP_ENDIF. All data pushes between OP_IF and OP_ENDIF are parsed but never executed. This is essential because inscription data (binary images, HTML, etc.) would cause script failures if executedโthey are not valid opcodes or stack elements in an execution context. The envelope ensures the data is recorded on-chain (in the witness) but ignored by the script interpreter.
P2. The witness discount reduces the cost per byte of inscription data by 75% (1 WU vs. 4 WU). But the 10,000-byte script limit would have capped inscription size to 10 KB regardless of cost. BIP 342's removal of this limit changed the maximum possible size from 10 KB to 4 MB (the entire block weight budget). Without the size limit removal, inscriptions would be limited to small text or tiny images. The discount makes large inscriptions affordable; the size limit removal makes them possible.
P3. Suppose Alice holds three UTXOs: input 0 has 5,000 sats (with an inscription on sat 0), input 1 has 3,000 sats, input 2 has 2,000 sats. Total: 10,000 sats. She creates a transaction with output 0 = 4,000 sats and output 1 = 5,500 sats, paying a 500-sat fee.
FIFO assignment: output 0 gets the first 4,000 sats from input 0 (ordinals 0โ3,999). Output 1 gets the remaining 1,000 from input 0 (ordinals 4,000โ4,999), then 3,000 from input 1, then 1,500 from input 2. The last 500 sats from input 2 are the fee.
The inscription (on sat 0 of input 0) ends up in output 0. Now change the outputs: output 0 = 4,000 sats, output 1 = 5,000 sats, fee = 1,000. If Alice carelessly sets output 0 = 0 sats and output 1 = 9,000 sats, then the first 9,000 sats fill output 1 and the final 1,000 sats (from input 2) are the fee. The inscribed sat (sat 0 of input 0) goes to output 1.
For the sat to be lost to the fee, its position in the combined input stream must exceed the total output value. Put the inscription late in the stream: inputs = [5,000, 3,000, 2,000] with the inscription on sat 1,500 of input 2 โ stream position \(5{,}000 + 3{,}000 + 1{,}500 = 9{,}500\). Set output 0 = 4,000 sats and output 1 = 5,000 sats, fee = 1,000. FIFO: output 0 takes positions 0โ3,999, output 1 takes 4,000โ8,999, and positions 9,000โ9,999 โ including the inscribed sat at 9,500 โ fall into the fee. The ordinal protocol treats fee sats as flowing to the block's coinbase: the inscription now belongs to the miner.
C1. OP_RETURN (Chapter 15) embeds data in a scriptPubKey output, which is non-witness data (4 WU/byte). Maximum: 80 bytes of data. Inscriptions embed data in the witness, which costs 1 WU/byte, and have no practical size limit beyond the block weight.
Tradeoffs: OP_RETURN is 4\(\times\) more expensive per byte but creates a provably unspendable output (no UTXO bloat). Inscriptions are 4\(\times\) cheaper per byte but require a spendable Taproot output, increasing UTXO set pressure. OP_RETURN is limited to 80 bytes; inscriptions can store megabytes. For small metadata (transaction timestamps, proof anchors), OP_RETURN is simpler and cheaper in absolute terms. For large data (images, media), only inscriptions are feasible.
C2. A 400,000-byte JPEG in the witness, with 82 bytes of non-witness data:
Weight \(= 82 \times 3 + (82 + 2 + 400,000 + overhead) \approx 246 + 400,200 \approx 400,446\) WU.
As a fraction of the 4,000,000 WU block limit: \(400,446 / 4,000,000 \approx 10.0\%\). A single large inscription consumes roughly 10% of a block's capacity, leaving 90% for other transactions. A 4 MB inscription (the theoretical maximum) would consume the entire block.
B1. Inscriptions store data in the witness at 1 WU/byte. Rune etchings store protocol data in OP_RETURN outputs at 4 WU/byte. Per byte of protocol data, inscriptions are 4\(\times\) more weight-efficient. However, Rune protocol messages are small (typically \(<\)80 bytes), so the absolute weight difference is modest. Inscriptions are designed for large payloads (images, media); Runes are designed for compact token operations (etch, mint, transfer) where the total data is tiny.
B2. The OP_FALSE OP_IF envelope is syntactically valid in any script context, so it could appear in a P2WSH witness script. However, pre-Taproot scripts have a 10,000-byte MAX_SCRIPT_SIZE consensus limit, capping inscription size to 10 KB. Additionally, P2WSH witness data still receives the SegWit discount (1 WU/byte), but the script size limit makes it impractical for anything beyond small text. BIP 342 (Tapscript) removed this limit specifically for Taproot script-path spends, which is why inscriptions require Taproot.