Ordinals

Today’s Agenda

Feel free to interrupt and ask questions!

Who am I?

Why ordinals?

What are ordinals?

Ordinals are just serial numbers for satoshis

They start at 0, and go up to 1,906,077,499,999,999 (so far!)

Are transferred with a simple first-in-first-out algorithm

[2] [1] [3] → [4] [2]
[a b] [c] [d e f] → [? ? ? ?] [? ?]
[a b] [c] [d e f] → [a b c d] [e f]

What about fees?

[2] [1] [3] → [4]
[a b] [c] [d e f] → [a b c d]
[SUBSIDY] [e f] → [SUBSIDY e f]

Specification

# subsidy of block at given height
def subsidy(height):
  return 50 * 100_000_000 >> height // 210_000

# first ordinal of subsidy of block at given height
def first_ordinal(height):
  start = 0
  for height in range(height):
    start += subsidy(height)
  return start

# assign ordinals in given block
def assign_ordinals(block):
  first = first_ordinal(block.height)
  last = first + subsidy(block.height)
  coinbase_ordinals = list(range(first, last))

  for transaction in block.transactions[1:]:
    ordinals = []
    for input in transaction.inputs:
      ordinals.extend(input.ordinals)

    for output in transaction.outputs:
      output.ordinals = ordinals[:output.value]
      del ordinals[:output.value]

    coinbase_ordinals.extend(ordinals)

  for output in block.transaction[0].outputs:
    output.ordinals = coinbase_ordinals[:output.value]
    del coinbase_ordinals[:output.value]

What are ordinals good for?

Rare and exotic sats

Tokens and NFTs

If you want a token, you can just pick an ordinal to represent your token, and use the location of the ordinal to represent ownership.

The person who controls the private key that corresponds to the public key of the UTXO that contains the ordinal is the current owner of the token.

What else are ordinals good for?

The Index

What are ordinals not good for?

Ordinal NFTs: The Basic Idea

  1. Hash: (ordinal || content hash)
  2. Sign
  3. Append pubkey, signature, and content
  4. Et voilà: 736172790a20202020636f6e73656e74732c207065726d697373...

Ordinal NFTs

Ordinal NFT Upgrades: Issued by ordinal owner

Ordinal NFT Upgrades: Timestamping

Ordinal NFT Upgrades: Publicity