in ,

How Runes Work on Bitcoin (UTXO and OP RETURN)


The blockchain of Bitcoin it is basically a database that contains transactions, however no one forbids adding text, images or videos. Messages written on the Bitcoin blockchain have always been there, however in recent years one of the best known theories has been that of ordinals which basically arbitrarily numbers Satoshis via Ord software (this concept has been exploited by tokens Brc20 and give them Inscriptions in which arbitrary data, i.e. texts, images and so on, are added to a transaction where BTC is moved). It should be underlined that all this works outside the consensus of the Bitcoin blockchain (miners only see the movement of Satoshi) and uses its own rules.

BITCOIN TRANSACTIONS: UTXO AND OP_RETURN

Let's assume we send 0.2 BTC to an address, these 0.2 BTC are initially associated with a public address and then with a private key and are UTXOs (unspent). Each UTXO contains a hash (fingerprint associated with the public key) and the amount of BTC. Once sent, that UTXO becomes “spent” and a new UTXO is created associated with a new private key (the recipient of the transaction).

Already in the first years of Bitcoin's life, instead of the reception address, random messages were inserted (obviously respecting the format of a public key) “burning” fractions of BTC (which in fact became forever “unspendable” being associated with public keys for which no one had the private key. Basically this is based on sending a transaction to a public address with random data (UTXO not spendable but saved forever on Bitcoin full nodes).

However, it is possible to send a message on the Bitcoin blockchain using an operation called OP_RETURN within a transaction. OP_RETURN is an opcode within Bitcoin transaction scripts that allows additional, arbitrary data to be inserted onto the blockchain without requiring a destination for BTC. This is useful for including metadata or messages on the blockchain without actually transferring BTC. The message to be sent must be formatted correctly and comply with the size limits for inserting data into the Bitcoin blockchain. After creating the transaction with the OP_RETURN message, just send it to the Bitcoin network using the chosen wallet. The transaction will then be transmitted across the Bitcoin network and included in a block by a miner. Once the transaction has been confirmed and included in a block on the Bitcoin blockchain, you can verify the message by consulting the transaction output containing the OP_RETURN operation. You will be able to read the included message and confirm that it was successfully recorded on the blockchain. Obviously, inserting a message onto the Bitcoin blockchain through the OP_RETURN operation requires the payment of fees, and there are also limits to the size of the data that can be included in a single transaction.

RUNES ARE RUNESTONES

Runes allow you to create fungible tokens on Bitcoin using the UTXO model. This is UTXO with amount sent equal to 0 (apart from network fees). Runestones are messages specific to the Runes protocol, which are inserted into an output following OP_RETURN followed by OP_13. The output will be like:

OP_RETURN + OP_13 +

where is the actual specific content relating to the Runes protocol. OP_RETURN tells the Bitcoin protocol to ignore from then on (the messages have value only in the Runestone protocol with its rules).

Through the “edicts” function it is possible to introduce custom logic in the rune transfers between the inputs and outputs of a transaction. “Etching” allows you to create a rune, following a commit-reveal pattern. “Mint” allows you to mint a rune. When creating a rune, through “etching” it is possible to set a series of attributes:

-premine

-total supply

-number of runes for each transaction

-divisibility (how many digits after the decimal point can it have)

To create a rune, the first step is to execute a transaction that contains an output with a runestone inside it. And this runestone must also contain an etching message. What we will need is:

-the ticker: let's assume the XXX rune (in reality now the minimum is 13e up to 28 characters but over time it will be possible to create shorter symbols. It decreases by one character every 4 months until reaching just 1 character in the 2028 halving)

-the supply: for example maximum 21 units

-premine a part of the supply (on your own address) or not premine (mintable by everyone)

Furthermore, we could choose whether to do “open mint”, i.e. allow everyone to mint this rune until the supply runs out, or allow it only to some, or not allow minting to anyone.

Once this is done, simply publish a Bitcoin transaction in which one of the outputs is:

OP_RETURN + OP_13 + RUNESTONE

where the runestone includes etching with the ticker, supply and premine.

As soon as this transaction is added to the Bitcoin blockchain our rune is created and, if we had set a premine, we would immediately have a part of the supply.

Having chosen not to have premines, at this exact moment the rune has been created but no one yet has one, not even us creators. At this point we need to make a transaction in which we will include a new runestone, this time containing no longer an etching message, but a minting one. In this case the runestone includes only the minting message of the rune previously created through etching. Having set the limit of one mintable rune per minting transaction, only one will be minted with this transaction.

Once we have our rune we can transfer it to other addresses. This is based on Bitcoin's UTXO model, and our rune is contained in a UTXO. To move it, simply make a normal Bitcoin transaction in which you spend the UTXO to move it from a sender address to a recipient. To view them you can use OKX Wallet, Unisat, Xverse, Leather, etc. Here instead you can mint them: Ordiscan

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Elber Reble610 M/ODU XPIC IP-ASI-SDH Microwave Link Device Config Disclosure

Microsoft PlayReady Cryptography Weakness