Ordinals on Bitcoin without SegWit and Taproot

sCrypt
3 min readFeb 21, 2023

--

Ordinals has become a hot topic in BTC circles to create non-fungible tokens (NFTs). It main feature is storing the NFT itself entirely on chain.

We show that the original Bitcoin protocol can already support it. No breaking changes, including both SegWit and Taproot, are needed for Ordinals to work. Actually, it works better on the original protocol: 100,000X cheaper and 12.5X bigger.

How Ordinals Works

Ordinals is the latest manifestation of color coins, which marks individual satoshis (thus “coloring” them) such that they can carry extra information. More specifically, every satoshi is sequentially ordered based on the time it is mined, which was first proposed in the bitcoin forum in 2012. Each satoshi will have an ordinal number between 0 and 2,100,000,000,000,000 (hence the term “ordinals”) assigned. Each unique satoshi can then be inscribed with some other information, to create NFTs (aka inscriptions).

When an Ordinal NFT is minted in a transaction, it is inscribed on the first satoshi of the first output of the transaction. The transaction contains some extra data: text, images, videos, and etc. Afterwards, it can be transferred just like regular bitcoins.

Consider an example transaction with three inputs and two outputs.

Credit

There are 6 satoshis from 3 addresses in the inputs. The outputs contain 5 satoshis to 2 different addresses. The remaining 1 satoshi is used as fee to pay the miner.

Ordinals uses the first-in-first-out algorithm to assign each satoshi of the inputs to the outputs. Any missing ordinals go to the miner. In the example, Ordinals (and their represented NFTs, if any) A, B, C, and D go to the first output, E to the second, and F to the miner.

Compare with other Bitcoin-based NFTs

Previous colored coins usually use OP_RETURN, an unspendable output with only 80 bytes of metadata maximally, which means a link/reference to NFT is stored.

Ordinals stores the entire NFT image/content on-chain, using these techniques.

  1. The Taproot upgrade in 2021 removed the data limit entirely, as long as it fits inside a block. Segregated Witness (Segwit) software upgrade in 2017 allows up to 3MB of witness data to be stored, ‘outside’ of the 1MB block limit. Together, they provide up to 4MB worth of storage space for the inscription content.
  2. Inscriptions are stored in an “envelope” between Opcodes OP_IF and OP_ENDIF. OP_FALSE precedes OP_IF to ensure that this data is never actually used in script execution and does not take up stack space. No OP_RETURN is used and the output containing an inscription is spendable and thus unprunable. The following example inscribes the text “Hello, world!”:
Credit

Ordinals on Bitcoin SV

The original Bitcoin protocol of today, BSV, pioneered storing NFT entirely on chain as early as 2021. Since BSV and BTC share the same algorithm for issuing satothis, it can assign satoshis ordinal numbers in the same way. Ordinals on BSV works overwhelmingly better than on BTC.

  1. Cost: BTC fees are around 10 sat/byte, while BSV’s are only 0.05 sat/byte¹. Given the price of $25,000/BTC vs $45/BSV as of today, minting the same NFT is >100,000X cheaper!
  2. Data size: BSV has restored the full Script after the Genesis upgrade, so the same envelope works. It also has more ways to embed the data in a transaction. For example, OP_RETURN can be used in a spendable output. Currently, up to 50MB of data can be included in a single transaction, 12.5X bigger than the 4MB limit on BTC. Here is a transaction of 27MB and another of 12MB. Data limit is expected to increase continuously as usage grows. More advanced NFT protocol on top has already stored NFT over 1 GB, by breaking it up across multiple transactions.

BSV does so without changing the protocol. No SegWit and Taproot is needed.

References

[1] https://docs.ordinals.com/

[2] https://medium.com/coinmonks/ordinals-an-overview-of-bitcoin-nfts-795c39447e23

[3] https://tara-annison.medium.com/a-comprehensive-explanation-of-ordinals-nfts-on-bitcoin-67b11868e74f

[4] https://www.chain.com/blog/what-are-bitcoin-ordinals

[1] We compare average fee rate. In BTC, SegWit can bring 4X discount, and in BSV, some miners take 0.01 sat/byte, a 5X discount.

--

--

sCrypt
sCrypt

Written by sCrypt

sCrypt (https://scrypt.io) is a web3 development platform specialized in UTXO-blockchains like Bitcoin

Responses (1)