Here are all the instruction for the hands-on portion of the TABConf 2022 Taproot Assets Workshop. This is available for you to prep before the workshop, follow along during the workshop, or to review or try it again after the workshop!

The goal here is get you familiar with installing, configuring, and running a few basic commands using the Taproot Assets alpha daemon. The instructions here based on installation on a Unix (Ubuntu) based machine, connecting to an LND node that is running either on testnet or on a local regtest network via Polar. You will need command line access to the machine where you will be installing Taro.

The first step is to decide between a testnet or Polar/regtest setup. First up are the instructions for a testnet setup.

Setup via Testnet

Requirements:

  • A Unix based machine/server
  • A running LND testnet node
  • GoLang 1.18+

SSH into the machine where your testnet LND node is running. As we’ll be installing from source you’ll need GoLang 1.18 or greater. Taproot Assets is being build to work with LND version 0.16, however, as that’s not out yet, we’ll need to switch to the master branch of the LND repo and rebuild.

If you attempt to connect Taproot Assets to LND on a 0.14 or 0.15 node you’ll get an error message that tells you that LND 15.99 or greater is required. So you’ll need to…

  • CD in the the LND directory
  • Switch to the master branch
  • Pull down the latest code from the repo
  • Rebuild using the below command or whatever is appropriate for your system noting that the signrpc, walletrpc, chainrpc, and invoicesrpc tags are required.
  • $ make install tags="signrpc walletrpc chainrpc invoicesrpc"

You can also reference the installation instructions from the Taproot Assets repo, https://github.com/lightninglabs/Taproot Assets/

Be sure that LND has restarted correctly and run the below command to verify that you now have the correct version of LND.

$ lncli --network=testnet version

The output should show "version": "0.15.99-beta"

Step two is to install Taproot Assets! Here we will show installation from source.

You’ll want to install Taproot Assets as the same user that runs LND and in the same directory where LND is installed (where the .lnd directory is located).

Installation:

Then verify that you now have two new binaries in your go path, tarod & tarocli.

To connect tarod to LND we’ll need to give it the paths to find the LND admin macaroon, the LND tls cert and let tarod know which port LND is listening on. Generally these values are…

  • Admin macaroon: /home/user/.lnd/data/chain/bitcoin/testnet/admin.macaroon
  • TLS cert: /home/user/.lnd/tls.cert
  • LND port: 10009

Note: tarod may throw an error when using the abbreviated ~/ path. You can find the port LND is running on via this command $ sudo lsof -i -P -n | grep LISTEN

With this data we should be able to get tarod to talk to LND and get it started!

Starting tarod:

$ tarod --network=testnet --debuglevel=debug --lnd.host=localhost:10009 --lnd.macaroonpath=/path/to/admin.macaroon --lnd.tlspath=/path/to/tls.cert

Check our output!

Setup via Polar

To try out Taproot Assets on your local machine on a local regtest network step one is to get Polar installed!

You can download the Polar app image here, https://lightningpolar.com/

Taproot Assets is being build to work with LND version 0.16, however, as that’s not out yet, so to get a Taro compatible version of LND you’ll need to be running a node that was built from the latest on the master branch on the LND repo. That is not yet built into Polar, so we’ll need to build a custom docker image.

You can follow along with the below instructions to build that image.

Build a custom Docker LND image: https://github.com/jamaljsr/polar/blob/master/docs/custom-nodes.md

Once you have acquired the custom LND 0.15.99-beta image, we’ll need to import it into Polar. We can reference these instructions, https://github.com/jamaljsr/polar/pull/299

Once we have imported the custom image, we’ll create a new network being sure that at least one the nodes on that new network is running our custom LND image. Then start the network, click on the node with the custom image, go to the info tab and check the version shows “custom”.

You’ll then need to install Taproot Assets and run tarod. See the instructions above in the testnet setup section.

To connect your local tarod on the custom LND node running via Polar first find the port that the Polar LND node you want to use is running on.

Click the node -> Connect -> GRPC Host

Can use $ sudo lsof -i -P -n | grep LISTEN

Then use the below command to start the Taproot Assets daemon.

$ tarod --network=regtest --lnd.host=127.0.0.1:[custom nodes port] --lnd.macaroonpath=/home/[user]/.polar/networks/[network number]/volumes/lnd/[custom node name]/data/chain/bitcoin/regtest/admin.macaroon --lnd.tlspath=/home/[user]/.polar/networks/[network number]/volumes/lnd/[custom node name]/tls.cert

Minting assets!

Once tarod is running successfully open a new terminal window to run some tarocli commands.

To mint some assets you’ll need to decide on a name, a supply, and perhaps some meta data.

Here is an example command for minting assets on testnet:

$ tarocli --network=testnet assets mint --type normal --name magicinternetmoney --supply 100 --meta "fantastic money" --skip_batch

If the command executed successfully the output should include a “batch_key”

We can then use the list command to view the assets you own.

$ tarocli --network=testnet assets list

Sending assets

If you are running on the testnet, or have a sophisticated Polar network running, you can send Taproot Assets between nodes. Here is the workflow…

  • the sending node needs to communicate to the receiving node how many units of the asset they intend to send, and the genesis_bootstrap_info key, which contains the asset id.
  • The receiving node needs to generate a receiving address and communicate that to the sending node.
  • The sending node sends the assets to the receiving node.

The genesis_bootstrap_info key can be found in the output of the assets list command.

A Taproot Assets address can be generated with the below command…

$ tarocli addrs new –genesis_bootstrap_info [genesis_bootstrap_info key] –amt [amount]