Table of contents
ordinal number theory
In general Bitcoin network applications, Bitcoin is a homogeneous token, and the value of each Bitcoin is the same. And some applications need to distinguish different tokens, so they will give each token an id.
Ordinal number theory is a numbering scheme for the Bitcoin network.
Because the Bitcoin network adopts the utxo model, the tokens in each transaction can be traced back to the coinbase transaction it produced.
In the Bitcoin network, the smallest unit is 聪
, ie sats
. 1BTC=100,000,000sats, the total output of BTC in the whole network is 21,000,000, so there are 2,100,000,000,000,000, 2100 trillion sats.
So the ordinal number theory numbers each individual Satoshi from 0 to 2,100,000,000,000,000.
first application
ordinals.com is a protocol based on ordinal number theory NFT
that
uses taproot
scripts to upload content that conforms to World Wide Web standards to the Bitcoin network.
Each taproot address has a descriptor, and the basic structure of the descriptor is specified in the ordinals protocol.
OP_FALSE
OP_IF
OP_PUSH "ord"
OP_1
OP_PUSH "text/plain;charset=utf-8"
OP_0
OP_PUSH "Hello, world!"
OP_ENDIF
Because the plaintext of the taproot descriptor content will only be uploaded to the chain when the utxo is spent, 2 transactions are required for an NFT to be uploaded to the chain.
- Send tokens to the taproot address corresponding to the inscription
- taproot address call fee utxo send inscription to receiving address
In this project, the process of this NFT on-chain is called 铭刻(inscribe)
, and this NFT is called 铭文(inscription)
.
Note that ordinals.com will only include the first inscription inscribed on each sats. utxo
In addition, after an inscription is inscribed, it is strongly bound to the first sats output in the second transaction in the inscription step , and the ownership of the inscription is consistent with the ownership of the sats.
derivative
brc20
On the basis of the ordinals protocol, someone proposed brc20
a protocol. When the content of the inscription is a json structure that conforms to certain rules (brc-20-experiment) , it is a brc20 operation.
The brc20 protocol has nothing to do with ordinal number theory, it just uses the part where the inscription of the ordinals protocol can be a string.
The json format specified by brc20 is as follows:
deployment
{
"p": "brc-20",
"op": "deploy",
"tick": "ordi",
"max": "21000000",
"lim": "1000"
}
casting
{
"p": "brc-20",
"op": "mint",
"tick": "ordi",
"amt": "1000"
}
transfer
{
"p": "brc-20",
"op": "transfer",
"tick": "ordi",
"amt": "100"
}