LND

The current implementation of Taro requires LND v0.15.99 or later, so git clone it from the master branch on GitHub.

export GOPATH=$HOME/go
export PATH=$GOPATH:$PATH
git clone https://github.com/lightningnetwork/lnd.git
cd lnd
make install tags="signrpc,walletrpc,chainrpc,invoicesrpc"

The lnd.conf file should be the same as usual, but note that Taro supports only regtest, testnet, and simnet.

Start lnd, create a wallet, and wait until it becomes lncli state is SERVER_ACTIVE.

Create a Bitcoin address( lncli newaddress p2wkh) and send some Bitcoin. You should have more than one UTXO.

tarod / tarocli

Clone and build Taro.

git clone https://github.com/lightninglabs/taro.git
cd taro
make install

The taro.conf file also seems to be available, but it worked without it. Instead, some tarodoptions are required.

NETWORK=testnet
LNDDIR=$HOME/.lnd
MACAROON=${LNDDIR}/data/chain/bitcoin/${NETWORK}/admin.macaroon
tarod \
--network=${NETWORK} \
--debuglevel=debug \
--lnd.host=localhost:10009 \
--lnd.macaroonpath=${MACAROON}\
--lnd.tlspath=${LNDDIR}/tls.cert

Similarly, taroclirequires several options.

tarocli --network=${NETWORK} COMMAND...

Tutorial

Enter the command according to README.

  • assets mint
$ tarocli assets mint --type normal --name fantasycoin --supply 100 --meta "fantastic money" --skip_batch
{
"batch_key": "026cde3c73a76bab4434dbb95d24cefaa1385df5cb5593128e7b7a6f43f5da5bfd"
}

When assets mint, the Bitcoin transaction will be published. You can check it with lncli listchaintxns(“label” is “tarod-asset-minting”).

  • assets list
$ tarocli assets list
{
"assets": [
{
"version": 0,
"asset_genesis": {
"genesis_point": "9b4d554ff8cfc3d75bdb2b93bfe2c0aad893b6e1616ad2677f27a5a67206bd7a:0",
"name": "fantasycoin",
"meta": "66616e746173746963",
"asset_id": "08e04b11060d3cfb2071dcc9297b99d73e33ee853dd7f6462e1873593d5c6485",
"output_index": 0,
"genesis_bootstrap_info": "7abd0672a6a5277f67d26a61e1b693d8aac0e2bf932bdb5bd7c3cff84f554d9b000000000b66616e74617379636f696e0966616e7461737469630000000000",
"version": 0
},
"asset_type": "NORMAL",
"amount": "100",
"lock_time": 0,
"relative_lock_time": 0,
"script_version": 0,
"script_key": "024a2065f0cacf4f8f9537f474929364fa76e2277f90551f4ffdfd48690bea5a0c",
"asset_family": null,
"chain_anchor": {
"anchor_tx": "020000000001017abd0672a6a5277f67d26a61e1b693d8aac0e2bf932bdb5bd7c3cff84f554d9b0000000000ffffffff02e8030000000000002251202733c21a33083335911e972dee33620eda399575dabdd2bed5ae9fa3ab24341bd66401000000000016001440dca633d29573a2f122a1ba201b51b6d445059202483045022100a91ae195c3320bba2f5ec05a62eb9af672a8641d0241189c1dd3a416de88096f02201c7c7011e0c150ddbb92c3362d9da9f8cee3683202eb9053743eb8a9edaa493c012103f3df64c50d6d7475d426df62ef96e3ce57c97554d446435cc99bd951adef164e00000000",
"anchor_txid": "196b27b58ad78632719c9cda5f9f996bca9117b18a5099e58db237ea9318cd64",
"anchor_block_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"anchor_outpoint": "64cd1893ea37b28de599508ab11791ca6b999f5fda9c9c713286d78ab5276b19:0",
"internal_key": "026cde3c73a76bab4434dbb95d24cefaa1385df5cb5593128e7b7a6f43f5da5bfd"
}
}
]
}

The order of anchor_txid is not RPC byte order but Internal byte order. genesis_bootstrap_infois used in the next section.

$ tarocli  assets list | jq '.assets[].asset_genesis.genesis_bootstrap_info'
"7abd0672a6a5277f67d26a61e1b693d8aac0e2bf932bdb5bd7c3cff84f554d9b000000000b66616e74617379636f696e0966616e7461737469630000000000"
  • addrs new
$ tarocli addrs new --genesis_bootstrap_info 7abd0672a6a5277f67d26a61e1b693d8aac0e2bf932bdb5bd7c3cff84f554d9b000000000b66616e74617379636f696e0966616e7461737469630000000000 --amt 21
{
"encoded": "tarotb1qqqsqq3l027svu4x55nh7e7jdfs7rd5nmz4vpc4ljv4akk7hc08lsn64fkdsqqqqqq9kvctww3shx7trda5kuztxv9h8gctnw35kxqqqqqqqqppqa2576pak4fyjgrduzne0mh527fa59knwpmmtjstsrdff4ak7v2hsvgpjf0hfksmvv5j6sjj40nczr7c84fw25z375fa7n6ltn4hl776tyvyqz9gwqtt59",
"asset_id": "08e04b11060d3cfb2071dcc9297b99d73e33ee853dd7f6462e1873593d5c6485",
"asset_type": "NORMAL",
"amount": "21",
"family_key": null,
"script_key": "02eaa9ed07b6aa49240dbc14f2fdde8af27b42da6e0ef6b941701b529af6de62af",
"internal_key": "03324bee9b436c6525a84a557cf021fb07aa5caa0a3ea27be9ebeb9d6fff7b4b23",
"taproot_output_key": "ca8ee4dd3a195c893b806a95978abd4e2595f6f86dd2c0204b58ff1bfc1bf4d7"
}

encoded is the generated address.

  • assets send
$ tarocli assets send --addr tarotb1qqqsqq3l027svu4x55nh7e7jdfs7rd5nmz4vpc4ljv4akk7hc08lsn64fkdsqqqqqq9kvctww3shx7trda5kuztxv9h8gctnw35kxqqqqqqqqppqa2576pak4fyjgrduzne0mh527fa59knwpmmtjstsrdff4ak7v2hsvgpjf0hfksmvv5j6sjj40nczr7c84fw25z375fa7n6ltn4hl776tyvyqz9gwqtt59
{
"transfer_txid": "ace43908616a4595cf78b46eb994f6408b291d4cd28f6b196fc465e260d15170",
"anchor_output_index": 0,
"transfer_tx_bytes": "02000000000102a662530de3c35eb1ed29b54653fe7e739fa91721c4e0ea5d272ee966c851f15a0000000000ffffffff196b27b58ad78632719c9cda5f9f996bca9117b18a5099e58db237ea9318cd6400000000000000000003e8030000000000002251209ed36e3a0e2e497e8f04d430d58c6d5c44382bf5440892d0edf01c3b6300b2c9e803000000000000225120ca8ee4dd3a195c893b806a95978abd4e2595f6f86dd2c0204b58ff1bfc1bf4d79e670100000000001600146d91315c4279c0f06a6c24da80e0502083cdfaa80248304502210088e4f376cbff8dd73e51da97e32eed8242cd10279b5e6a2a88d8b95b88a4086402200f029c1e456eac82f04cf93c1b01b76bad7b035809a45606a33390eed7c03f94012103f3df64c50d6d7475d426df62ef96e3ce57c97554d446435cc99bd951adef164e01401fbb7c77a81ef0298fbf0bcceb7edd28c561eb5a62163cb4cbd480a929338625b616e361355480d81ec60246f2bc1bfa5f4c6ec825bef58a3fe17925408ea64500000000",
"taro_transfer": {
"old_taro_root": "45320e9e98c3d3cb5f8187b8130cfc8ab808b9db5c49a653af0ba7c8a61383a1",
"new_taro_root": "39b39331e8a269b60796b33ca9182ad2d5cf3a55342ab0d71f9f5b5997b9b842",
"prev_inputs": [
{
"anchor_point": "64cd1893ea37b28de599508ab11791ca6b999f5fda9c9c713286d78ab5276b19:0",
"asset_id": "08e04b11060d3cfb2071dcc9297b99d73e33ee853dd7f6462e1873593d5c6485",
"script_key": "024a2065f0cacf4f8f9537f474929364fa76e2277f90551f4ffdfd48690bea5a0c",
"amount": "100"
}
],
"new_outputs": [
{
"anchor_point": "7051d160e265c46f196b8fd24c1d298b40f694b96eb478cf95456a610839e4ac:0",
"asset_id": "08e04b11060d3cfb2071dcc9297b99d73e33ee853dd7f6462e1873593d5c6485",
"script_key": "02eaa9ed07b6aa49240dbc14f2fdde8af27b42da6e0ef6b941701b529af6de62af",
"amount": "79",
"new_proof_blob": null,
"split_commit_proof": null
},
{
"anchor_point": "7051d160e265c46f196b8fd24c1d298b40f694b96eb478cf95456a610839e4ac:0",
"asset_id": "08e04b11060d3cfb2071dcc9297b99d73e33ee853dd7f6462e1873593d5c6485",
"script_key": "02eaa9ed07b6aa49240dbc14f2fdde8af27b42da6e0ef6b941701b529af6de62af",
"amount": "21",
"new_proof_blob": null,
"split_commit_proof": null
}
]
},
"total_fee_sats": "0"
}

The end!

--

--