Skip to content
lightninglabsPublic

Latest commit

 

History

292 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tap-sdk

Build Taproot Assets applications

Go Reference CI MIT Licensed Go 1.26.0+

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:

  • AssetRef as the stable handle for assets across wallet, issuer, proof, burn, balance, event, and universe flows.
  • Asset, Collection, and Issuance as distinct business concepts.
  • High-level Wallet, Issuer, and Universe surfaces for common workflows.
  • Direct grpc and rest transport 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.

Install

go get github.com/lightninglabs/tap-sdk@v0.2.0

Add the protobuf replacement required by the LND and tapd RPC packages to your application module (Go does not inherit dependency replacements):

go mod edit -replace=google.golang.org/protobuf=github.com/lightninglabs/protobuf-go-hex-display@v1.34.2-hex-display
go mod tidy

Compatibility

tap-sdk tapd / Taproot Assets lnd Go
main v0.8.5 or newer v0.21.4-beta 1.26.0+
v0.2.x v0.8.3 v0.21.3-beta 1.26.0+
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 SDK remains pre-v1; public APIs may change between minor releases.

Quick Start

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)
}

Packages

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.

What You Can Build Today

  • 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.

Demos

  • Remote Signing Coordinator - runnable regtest demo for reviewing and signing external Issuance requests through a Go coordinator and Next.js dashboard.

Documentation

License

Licensed under the MIT License.

Releases

Packages

Contributors

Languages