paint-brush
Creating NFTs on the Bitcoin Networkby@alfredodecandia
232 reads

Creating NFTs on the Bitcoin Network

by Alfredo de CandiaFebruary 28th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The world of NFTs is vast and although this type of asset has been in circulation for several years now, the news and developments related to them have not stopped. This trend that has launched the various blockchains to be more used has led to some blockchains achieving greater success than others. Some remaining behind, such as that of Bitcoin, which, due to its structure and characteristics focused more on security than on speed or cost, is not configured as an optimal blockchain for NFT minting.

People Mentioned

Mention Thumbnail
featured image - Creating NFTs on the Bitcoin Network
Alfredo de Candia HackerNoon profile picture


The world of NFTs is vast and although this type of asset has been in circulation for several years now, the news and developments related to them have not stopped, bringing novelty and innovation in the creation and in providing additional previously unthinkable features.


Apparently, this trend that has launched the various blockchains to be more used, thanks to the simplicity of creating NFTs, has led to some blockchains achieving greater success than others, with some remaining behind, such as that of Bitcoin, which, due to its structure and characteristics focused more on security than on speed or cost, is not configured as an optimal blockchain for NFT minting.


Despite this, it doesn't mean that we cannot create NFTs on this blockchain, however by paying high fees and obviously also clogging up the related blockchain, creating heavy blocks containing information other than those for which the blockchain was designed.


We will go into detail about how to create NFTs on Bitcoin and what the process is for creating both a compatible wallet and the NFTs themselves.

NFT with the Ordinals protocol

Some of you may know that 1 bitcoin is made up of 100 million units, called satoshis or sat for short, and these satoshis are numbered in order starting from 0. In fact, these numbers are “ordinal numbers”, and because of this, it is possible to exploit them to create NFTs.


For those who want to learn more about this protocol, we recommend checking here, instead below there is the algorithm that was created:


# 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]
of ordinals[:output.value]
coinbase_ordinals.extend(ordinals)
for output in block.transaction[0].outputs:
output.ordinals = coinbase_ordinals[:output.value]
from coinbase_ordinals[:output.value]


How to create a Bitcoin address for NFTs

These NFTs exploit the satoshis and since the satoshis themselves are fungible, if we don't take precautions, we could end up transferring in a transaction even those satoshis to which the NFTs we have created are connected.


We need to create a new address and wallet that allows us to have greater control over the movements of the satoshis in our address, and a useful tool for this purpose is certainly Sparrow Wallet.


The first step is to download Sparrow wallet and create a new bitcoin address. After installing the wallet, we will have to create a new wallet and to do this we go to File and New Wallet:


In the next screen, we will have to set a new address and to do it in the "Address" section we must choose "Taproot (P2TR)":


Then we will need to click on the "New or Imported Bitcoin Address" button below to create a new Bitcoin address with those characteristics:


At this point we should create the words relating to our address and we opt to use the number of words we prefer, in our case 12 words and press the "Generate New" button:


Let's remember to type these words into the next step we will have to insert them and then press the "Create Keystore" button:


Now we can import the keystore we created earlier, by clicking on the Import button:


Finally, after we have created everything, we will have to press the "Apply" button:


How to receive Bitcoin NFTs

Using this wallet, we can also receive NFTs and we must remember to always create a new account to receive the different NFTs, and to do so, in the "Receive" menu, we find the button below to create a new address "Get Next Address" and use the address shown to us:


To receive Bitcoin NFTs, we should freeze the UTXOs related to the NFTs and do so, we should right-click on the related transaction, then click the "Freeze UTXO" item. This will ensure that we will not send these NFTs by mistake. When we should transfer them, just do the reverse process and click on "Unfreze UTXO".


How to mint an NFT on Bitcoin

Now that we have all the tools to receive and avoid losing NFTs by mistake, it's time to see how to create our NFTs and do this we have two solutions, either by taking advantage of the related algorithm created and therefore all at the command line, or take advantage of some convenient and practical services.


For those more geeks, they can check out the code directly on GitHub here, instead for those who want the simplest approach we can take advantage of this service or this other, also because the procedure is simple and the steps are similar.


The first thing you need to do is load the image we want to transform into an NFT:


After that, we have to enter our address where our NFT will be sent:


At this point, we just have to pay the lee fee and wait for the transaction to arrive at our address, and in this case, we see that we are going to spend just under $13 and wait over 24 hours, while if we want the transaction to be processed in 30 minutes, then we should pay more around $70:


How to see Bitcoin NFTs

Once we have created the NFT, we can see it through some platforms like this, and just enter the hash of the transaction relating to the NFT to see all the information relating to it:


Conclusions

Bitcoin-based tokens are possible even if they are a little complicated and require a higher investment than on other platforms. Additionally, the cost of creating them is not as cheap as on other platforms.


Finally I conclude with a video of the process: