tap-sdk is the application SDK for
Taproot Assets. It wraps a
running tapd node with a typed, developer-facing API for issuing, receiving,
sending, proving, burning, and discovering assets.
The SDK intentionally does not mirror tapd one-to-one. It exposes the asset model developers usually want:
AssetRefas the stable handle for assets across wallet, issuer, proof, burn, balance, event, and universe flows.Asset,Collection, andIssuanceas distinct business concepts.- High-level
Wallet,Issuer, andUniversesurfaces for common workflows. - Direct
grpcandresttransport packages for connection setup and advanced RPC-shaped access.
The Go package is the first implementation. The API model is designed to be portable to TypeScript, Rust, Python, Kotlin, and Swift bindings over time.
go get github.com/lightninglabs/tap-sdk| tap-sdk | tapd / Taproot Assets | lnd | Go |
|---|---|---|---|
main |
tapd main after v0.8.0 |
v0.21.0-beta or newer | 1.25.10+ |
v0.1.x |
v0.8.0 or newer | v0.21.0-beta or newer | 1.25.10+ |
Older tapd versions are unsupported. See Compatibility for the detailed matrix.
The first public SDK tag is v0.1.0. The SDK remains pre-v1 because some
Taproot Assets workflows are intentionally still outside the current surface
and the API has not yet been broadly exercised by external developers.
package main
import (
"context"
"log"
tapsdk "github.com/lightninglabs/tap-sdk"
tapgrpc "github.com/lightninglabs/tap-sdk/grpc"
)
func main() {
ctx := context.Background()
client, err := tapgrpc.NewClient(&tapgrpc.Config{
Host: "localhost:10029",
Network: tapsdk.NetworkRegtest,
TLS: tapgrpc.TLSFromPath("/path/to/tls.cert"),
Macaroon: tapsdk.MacaroonFromPath("/path/to/admin.macaroon"),
})
if err != nil {
log.Fatal(err)
}
defer client.Close()
wallet := tapsdk.NewWallet(client, tapsdk.NetworkRegtest)
issuer := wallet.NewIssuer()
token, err := issuer.CreateFungible(ctx, tapsdk.FungibleAssetSpec{
Name: "example-token",
Amount: 1_000_000,
})
if err != nil {
log.Fatal(err)
}
balance, err := wallet.GetBalance(ctx, token.AssetRef)
if err != nil {
log.Fatal(err)
}
log.Printf("asset=%s balance=%d", token.AssetRef, balance)
}| Package | Role |
|---|---|
github.com/lightninglabs/tap-sdk |
Public asset model, Wallet, Issuer, Universe, builders, errors, and all business types |
github.com/lightninglabs/tap-sdk/grpc |
gRPC transport, TLS config, macaroon auth, tapd marshal/unmarshal |
github.com/lightninglabs/tap-sdk/rest |
REST transport, TLS config, macaroon auth, WebSocket event streams |
github.com/lightninglabs/tap-sdk/macaroon |
Low-level macaroon source helpers |
Most application code imports the root package plus one transport package.
Advanced integrations can use wallet.Client() to reach low-level methods
without importing taprpc.
- Wallet apps that issue, receive, send, burn, and list Taproot Assets.
- Services that mint fungibles, standalone NFTs, and NFT collections.
- Indexing and discovery tools backed by universe roots and proofs.
- Proof import/export flows for out-of-band delivery.
- Ownership proof flows for proving wallet control of assets.
- Regtest-backed test suites that exercise both gRPC and REST transports.
Lightning-native Taproot Assets flows such as RFQ, price oracles, asset channels, and Portfolio Pilot are intentionally outside the current SDK surface.
- Remote Signing Coordinator - runnable regtest demo for reviewing and signing external Issuance requests through a Go coordinator and Next.js dashboard.
- Getting Started
- Asset Model
- Transports and Auth
- Compatibility
- Architecture
- Design Decisions
- Integration Tests
- Contributing
Licensed under the MIT License.