How to etch and mint runes ᛯ on Bitcoin via the CLI
Learn how to etch and mint runes on Bitcon without overpaying discord echo-chamber groups to get the real sauce!
Hi guys!
You have probably seen the hype about Runes on Bitcoin, and if you haven’t allow me to introduce it to you.
Runes are basically the equivalent to ERC-20 on Ethereum, but on Bitcoin. They are fungible tokens which data is fully stored on chain, it doesn’t rely on third parties servers or anything to store the data.
The wizard behind runes is Casey, and if you want to learn the history on ordinals, BRC-20 and get into the very details about how he made it possible, I recommend you to watch the interview on Bankless.
What will you learn in this tutorial?
sync bitcoind and ord
Etch (create) runes
Mint runes
The real sauce
I read pretty much everything I could find about runes, but there’s no a single source with clear technical instructions on how to do this. People who know are gatekeeping it from you on gated discord servers. So to learn this, I had to play with the software and even read the source code to understand how to use it. I did this for the last week or so and after digging, testing and failing for a while, I managed to crack the code and figured how it works.
What you will need to make this happen:
A bitcoin node
The ord software
Setting up a bitcoin node is out of the scope of this tutorial, however, a friend of mine recommended me this youtube playlist, which I myself followed and it’s pretty much fool proof. Sure, you need some technical knowledge, but if you know how to connect to a server and can manage the command line (just a bit) , this will be very easy.
It takes time to sync the bitcoin node, as the bitcoin blockchain is about 650 GB as of the time of this post. Run it and let it sync in the background, it will take a few days, depending on your internet connection.
Now let’s install and run ord, the software that makes it possible to create and mint runes. This is where all the info has been obscured, imo in purpose, so you can’t participate on this stuff.
I did this tutorial with ord 0.18.1, but i see there’s already 0.18.3 on Github. I believe any of them will do. To install it, run this command:
curl --proto '=https' --tlsv1.2 -fsLS https://ordinals.com/install.sh | bash -s
Once you have it ready, make sure you can execute it on your terminal by running `ord`. If it’s not on your PATH, make sure to add it there so you can execute it from anywhere in the terminal.
Playing with the Testnet (regtest)
Bitcoin has a few testnets, but there’s one you can run locally called regtest. That one allows you to generate blocks at will and all that.
To play with ord on testnet, you can type the following command:
ord env <test-folder>
This command will create a folder with the given name, and run a copy of bitcoind and ord server locally (regtest).
This takes a second or two to spin off, it’s very quick. It will also give you instructions on how to input bitcoin-cli and ord commands on the terminal. You see, the way it works, is that both bitcoind and ord have a database, and you should tell the software where the data is being stored.
The flags for specifying where the bitcoin data is stored, assuming you are working on the testnet, are:
bitcoind -datadir=<test-folder> [command]
ord --datadir=<test-folder> [command]
Let’s see what commands you can execute with `ord`:
Commands:
balances List all rune balances
decode Decode a transaction
env Start a regtest ord and bitcoind instance
epochs List the first satoshis of each reward epoch
find Find a satoshi's current location
index Index commands
list List the satoshis in an output
parse Parse a satoshi from ordinal notation
runes List all runes
server Run the explorer server
settings Display settings
subsidy Display information about a block's subsidy
supply Display Bitcoin supply information
teleburn Generate teleburn addresses
traits Display satoshi traits
wallet Wallet commands
help Print this message or the help of the given subcommand(s)
A big list! But fear not, we will mostly use `wallet` and `env`.
If you do for example `ord --datadir=<test-folder> wallet balance
` you will get the balance of the test wallet.
Let’s go straight into the fun part.
Etching runes ᛯᚠᚢᚸᛉᛔᛦ
To etch a rune (i.e. to create it) you need to do an inscription. To make it simple for you, there’s a yaml file you can use to do all this work, i.e. making the inscription, etching the rune… think about it as a template. Here it is:
# example batch.yaml file
# inscription modes:
# - `same-sat`: inscribe on the same sat
# - `satpoints`: inscribe on the first sat of specified satpoint's output
# - `separate-outputs`: inscribe on separate postage-sized outputs
# - `shared-output`: inscribe on a single output separated by postage
mode: separate-outputs
# parent inscription:
parent: 6ac5cacb768794f4fd7a78bf00f2074891fce68bd65c4ff36e77177237aacacai0
# postage for each inscription:
postage: 12345
# allow reinscribing
reinscribe: true
# sat to inscribe on, can only be used with `same-sat`:
# sat: 5000000000
# rune to etch (optional)
etching:
# rune name
rune: THE•BEST•RUNE
# allow subdividing super-unit into `10^divisibility` sub-units
divisibility: 2
# premine
premine: 1000.00
# total supply, must be equal to `premine + terms.cap * terms.amount`
supply: 10000.00
# currency symbol
symbol: $
# mint terms (optional)
terms:
# amount per mint
amount: 100.00
# maximum number of mints
cap: 90
# mint start and end absolute block height (optional)
height:
start: 840000
end: 850000
# mint start and end block height relative to etching height (optional)
offset:
start: 1000
end: 9000
# future runes protocol changes may be opt-in. this may be for a variety of
# reasons, including that they make light client validation harder, or simply
# because they are too degenerate.
#
# setting `turbo` to `true` opts in to these future protocol changes,
# whatever they may be.
turbo: true
# inscriptions to inscribe
inscriptions:
# path to inscription content
- file: mango.avif
# inscription to delegate content to (optional)
delegate: 6ac5cacb768794f4fd7a78bf00f2074891fce68bd65c4ff36e77177237aacacai0
# destination (optional, if no destination is specified a new wallet change address will be used)
destination: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
# inscription metadata (optional)
metadata:
title: Delicious Mangos
description: >
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam semper,
ligula ornare laoreet tincidunt, odio nisi euismod tortor, vel blandit
metus est et odio. Nullam venenatis, urna et molestie vestibulum, orci
mi efficitur risus, eu malesuada diam lorem sed velit. Nam fermentum
dolor et luctus euismod.
- file: token.json
# inscription metaprotocol (optional)
metaprotocol: DOPEPROTOCOL-42069
- file: tulip.png
destination: bc1pdqrcrxa8vx6gy75mfdfj84puhxffh4fq46h3gkp6jxdd0vjcsdyspfxcv6
metadata:
author: Satoshi Nakamoto
This file contains information about the inscription and the rune. You cannot etch a rune without an inscription as far as I know, but if you know how, pls let me know.
The most important thing here is the etching parameters, which are really just a few:
Keep reading with a 7-day free trial
Subscribe to CosmWasm Dev Digest to keep reading this post and get 7 days of free access to the full post archives.