Skip to content

Instantly share code, notes, and snippets.

@straumat
Created June 14, 2023 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save straumat/bc6a4bf98ada230d5443bcf814c87530 to your computer and use it in GitHub Desktop.
Save straumat/bc6a4bf98ada230d5443bcf814c87530 to your computer and use it in GitHub Desktop.
## Introduction
We are going to build and run Taproot Assets Protocol daemon on Ubuntu.
We will need a running LND node and Btcd this way:
<div class="mermaid">
graph LR
TAPD["Taproot Assets Protocol daemon"]
TAPD --> LND["LND"]
LND --> BTCD["Btcd"]
</div>
## Using Docker
With Sashimi, you can easily run an LND node and Tapd:
```
git clone https://github.com/davisv7/sashimi
cd sashimi
docker-compose up
```
When you run this command for the first time, LND will first synchronise with the Bitcoin blockchain. It can take a
long time and tapd won't start before LND is done. Tapd will be ready when the message `Taproot Asset Daemon fully
active!` is displayed in the logs.
## Creating an address
First, I get the docker container ID of the lnd and tapd with: `docker ps`
Then, I create a wallet with: `docker exec -it -u lnd <LND Container Id> lncli --network=testnet create` (password :
C4-t]-#6uV{BVPQ~).
Then, I create an address with: `docker exec -it -u lnd <LND Container Id> lncli --network=testnet newaddress p2wkh`
If you are running on testnet, you now need to get some testnet bitcoin [here](https://bitcoinfaucet.uo1.net).
## Creating an asset
We run this command (it doesn't create the asset right away as you can add several and do it in only one transaction).
```bash
docker exec -it -u tap <TAPD Container Id> \
tapcli assets mint \
--type normal \
--name myRoylloCoin \
--supply 999 \
--meta_bytes "Used by Royllo"
```
The output is something like this:
```
{
"batch_key": "025720830b02a85857ffbc827ad7ae5cef404b45d7c5e0b9015441d0bf033ba7a1"
}
```
You can create the asset with the batch key with this command:
```bash
docker exec -it -u tap <TAPD Container Id> \
tapcli assets mint finalize
```
You can then see your asset here :
```bash
docker exec -it -u tap <TAPD Container Id> \
tapcli assets list
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment