Skip to content

Commit 09c12ef

Browse files
committed
feat: initial support for tapd methods
1 parent 3958862 commit 09c12ef

File tree

13 files changed

+2493
-1
lines changed

13 files changed

+2493
-1
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,37 @@ Methods for working with the Lightning Network
4242

4343
To connect to an LND node, authentication details are required.
4444

45+
## Taproot Assets Support
46+
47+
This library includes support for Taproot Assets via the `tapd` daemon. Currently supported methods:
48+
49+
- **listTaprootAssetBalances**: List Taproot Asset balances
50+
51+
## Tapd Authentication
52+
53+
To connect to a Tapd node, authentication details are required, similar to LND.
54+
55+
Export credentials via CLI or manually:
56+
57+
Run `base64` on the tls.cert and admin.macaroon files to get the encoded
58+
authentication data to create the Tapd connection. You can find these files in
59+
the Tapd directory. (~/.tapd or ~/Library/Application Support/Tapd)
60+
61+
base64 -w0 ~/.tapd/tls.cert
62+
base64 -w0 ~/.tapd/data/mainnet/admin.macaroon
63+
64+
You can then use these to interact with your Tapd node directly:
65+
66+
```node
67+
const {authenticatedTapdGrpc} = require('lightning');
68+
69+
const {tapd} = authenticatedTapdGrpc({
70+
cert: 'base64 encoded tls.cert file',
71+
macaroon: 'base64 encoded admin.macaroon file',
72+
socket: '127.0.0.1:10029',
73+
});
74+
```
75+
4576
Export credentials via CLI:
4677
[balanceofsatoshis](https://github.com/alexbosworth/balanceofsatoshis):
4778
`npm install -g balanceofsatoshis` and export via `bos credentials --cleartext`
@@ -393,3 +424,7 @@ variables set:
393424
Verify that a chain address message has a valid ECDSA signature
394425
- [verifyMessage](https://github.com/alexbosworth/ln-service#verifymessage): Check that a
395426
message from a node in the graph has a valid signature.
427+
428+
## Taproot Assets Methods
429+
430+
- **listTaprootAssetBalances**: List Taproot Asset balances grouped by asset ID or group key.

grpc/protos/tapcommon.proto

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
syntax = "proto3";
2+
3+
package taprpc;
4+
5+
option go_package = "github.com/lightninglabs/taproot-assets/taprpc";
6+
7+
// Represents a Bitcoin transaction outpoint.
8+
message OutPoint {
9+
/*
10+
Raw bytes representing the transaction id.
11+
*/
12+
bytes txid = 1;
13+
14+
/*
15+
The index of the output on the transaction.
16+
*/
17+
uint32 output_index = 2;
18+
}
19+
20+
// A transaction outpoint annotated with TAP-level asset metadata. It uniquely
21+
// identifies an asset anchored at a specific outpoint.
22+
message AssetOutPoint {
23+
// The outpoint of the asset anchor, represented as a string in the
24+
// format "<txid>:<vout>". The <txid> is the transaction ID of the UTXO,
25+
// hex-encoded and byte-reversed (i.e., the internal little-endian
26+
// 32-byte value is reversed to big-endian hex format) to match standard
27+
// Bitcoin RPC and UI conventions.
28+
string anchor_out_point = 1;
29+
30+
// The asset ID of the asset anchored at the outpoint.
31+
bytes asset_id = 2;
32+
33+
// The script key of the asset. This is the taproot output key that the
34+
// asset is locked to.
35+
bytes script_key = 3;
36+
}

0 commit comments

Comments
 (0)