• Stars
    star
    458
  • Rank 95,591 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 2 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)

Taproot Assets

The Taproot Assets Daemon tapd implements the Taproot Assets Protocol for issuing assets on the Bitcoin blockchain. Taproot Assets leverage Taproot transactions to commit to newly created assets and their transfers in an efficient and scalable manner. Multiple assets can be created and transferred in a single bitcoin UTXO, while witness data is transacted and stored off-chain.

Features:

  • Mint assets
  • Synchronize to universes
  • Send and receive assets
  • Export and import Taproot Asset proofs
  • Create and manage CLI profiles

How it works:

When minting a new asset, Taproot Assets will generate the relevant witness data, assign the asset to a key held by you and publish the corresponding bitcoin UTXO -- the minting transaction.

The outpoint this minting transaction consumes becomes the genesis_point of the newly minted asset, acting as its unique identifier. Assets can be spent to a new recipient, who provides the sender with the necessary information encoded in their Taproot Asset address.

To transact assets, the witnesses in the prior transaction are recommitted into one or multiple taproot outputs while the necessary witness data is passed to the recipient. Similar to bitcoin transactions, the remaining balance is spent back to the sender as a change output.

Learn more about the Taproot Assets Protocol.

Architecture:

Taproot Assets are implemented as the Taproot Assets Daemon tapd and the Taproot Assets Command Line Interface tapcli. Additionally, tapd exposes a GRPC interface to allow for a direct integration into applications.

Taproot Assets leverage several LND features including the Taproot wallet and signing capabilities. These facilities are accessed through LND’s GRPC.

The Taproot Assets stack:

Bitcoin blockchain backend <-> LND <-> Taproot Assets

Custody of Taproot Assets is segmented across LND and Tapd to maximize security. LND holds the private key, which has had a taproot tweak applied to it, controlling the bitcoin UTXO holding the Taproot Asset. The taproot tweak on the other hand is held by Tapd. This increases the requirements for asset recovery as both the internal key as well as the taproot tweak are necessary to spend the output. This prevents LND from accidentally burning Taproot assets.

Prerequisites:

Taproot Assets require LND version v0.16.2-beta or later to be synced and running on the same Bitcoin network as Taproot Assets (e.g. regtest, simnet, testnet3). RPC connections need to be accepted and a valid macaroon needs to be present.

git clone https://github.com/lightningnetwork/lnd.git
cd lnd 
make install tags="signrpc walletrpc chainrpc invoicesrpc"

Installation:

From source:

Compile Taproot Assets from source by cloning this repository. Go version 1.19 or higher is required.

git clone --recurse-submodules https://github.com/lightninglabs/taproot-assets.git
cd taproot-assets
make install

Initialization:

Run Taproot Assets with the command tapd. Specify how Taproot Assets can reach LND and what network to run Tapd with by passing it additional flags. The Bitcoin backend and LND need to be running and synced before the Taproot Assets daemon can be started.

tapd --network=testnet --debuglevel=debug --lnd.host=localhost:10009 --lnd.macaroonpath=~/.lnd/data/chain/bitcoin/testnet/admin.macaroon --lnd.tlspath=~/.lnd/tls.cert

Usage:

See a full list of options by executing:

tapd --help

Use tapcli to interact with tapd

tapcli assets mint --type normal --name fantasycoin --supply 100 --meta_bytes "fantastic money"
tapcli assets mint finalize
tapcli assets list

Synchronize yourself with a universe, for example the one running as part of the issuer's tapd.

tapcli universe sync --universe_host testnet.universe.lightning.finance

Add multiple universes to your local federation to always stay up to date. You can also use the universe to query existing assets and their metadata. You may also configure your tapd instance to listen to incoming requests with --rpclisten 0.0.0.0:10029 to run your own universe.

tapcli universe federation add --universe_host testnet.universe.lightning.finance
tapcli universe roots

Once you have obtained the necessary proofs and asset IDs, you can generate a Taproot Asset address for a specific asset and amount.

tapcli addrs new --asset_id bab08407[...]129bf6d0 --amt 21

The sender can now fulfill the request by initiating the transfer.

tapcli assets send --addr taptb1q[...]tywpre3a

Development

API

Taproot Assets exposes a GRPC (port 10029) and a REST (port 8089) API. Connections are encrypted with TLS and authenticated using macaroons. The API is documented here. Further guides can be found here.

Mainnet

The current codebase does not support the Bitcoin mainnet. Patching the code to run on mainnet will very likely lead to loss of funds (both the minted assets and the BTC UTXO) as things will break or change in the future.

Submit feature requests

The GitHub issue tracker can be used to request specific improvements or report bugs.

Join us on Slack

Join us in the Lightning Labs Slack and join the #taproot-assets channel to ask questions and interact with the community.

More Repositories

1

lightning-app

An easy-to-use cross-platform Lightning wallet
JavaScript
901
star
2

neutrino

Privacy-Preserving Bitcoin Light Client
Go
899
star
3

loop

Lightning Loop: A Non-Custodial Off/On Chain Bridge
Go
558
star
4

lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
Go
499
star
5

pool

Lightning Pool: a non-custodial batched uniform clearing-price auction for Lightning Channel Leases (LCL). An LCL packages up inbound channel liquidity (ability to receive funds) as a fixed income asset with a maturity date expressed in blocks.
Go
253
star
6

aperture

⚑️L402 (Lightning HTTP 402) Reverse Proxy ⚑️
Go
233
star
7

chantools

A loose collection of tools all somehow related to lnd and Lightning Network channels.
Go
219
star
8

lndmon

πŸ”Žlndmon: A drop-in monitoring solution for your lnd node using Prometheus+Grafana
Go
151
star
9

faraday

Lightning Channel Management & Optimization Tool
Go
130
star
10

LangChainBitcoin

AI tools for giving LangChain agents access to Bitcoin and the ability to traverse L402 APIs
Python
128
star
11

lightning-node-connect

Go
78
star
12

L402

lsat protocol specification
71
star
13

lightning-faucet

A faucet for the Lightning Network!
Go
71
star
14

lightning-coindesk

A tutorial news app exemplifying Lightning Network micropayments integration
Python
54
star
15

docs.lightning.engineering

Building lapps, running lnd, and more
Markdown
50
star
16

lndclient

Golang client library for lnd
Go
48
star
17

lnc-web

Lightning Node Connect npm module for web
TypeScript
48
star
18

lightning-api

JavaScript
35
star
19

falafel

Go tool to generate go APIs for gRPC services for use on mobile/WASM platforms.
Go
34
star
20

lndinit

cloud infra tooling for lnd provisioning/unlocking
Go
26
star
21

lightning-dev-site

Lightning Network Daemon Developer Site
CSS
25
star
22

builders-guide-sample-app

TypeScript
14
star
23

lightninglabs.github.io

CSS
13
star
24

pool-paper

Lightning Pool: A Non-Custodial Channel Lease Marketplace
TeX
11
star
25

chanleakcheck

A tool to check if your lnd node was targeted by CVE-2019-12999
Go
10
star
26

lnc-rn

Lightning Node Connect npm module for React Native
TypeScript
8
star
27

lnc-core

Type definitions and utilities for Lightning Node Connect, leveraged by lnc-web and lnc-rn
TypeScript
7
star
28

dust-tool

dust exposure tool
Go
6
star
29

lightning-api-ng

Automated API-documentation generation source code for Lightning Lab's FOSS software suite
Go
5
star
30

lnd-fuzz

Shell
3
star
31

gh-actions

Vendored GitHub Action scripts
TypeScript
3
star
32

aezeedcheck

A offline CLI that allows one to verify their aezeed mnemonic
Go
2
star