astra-lightning 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1438 @@
1
+ syntax = "proto3";
2
+
3
+ package taprpc;
4
+
5
+ option go_package = "github.com/lightninglabs/taproot-assets/taprpc";
6
+
7
+ service TaprootAssets {
8
+ /* tapcli: `assets list`
9
+ ListAssets lists the set of assets owned by the target daemon.
10
+ */
11
+ rpc ListAssets (ListAssetRequest) returns (ListAssetResponse);
12
+
13
+ /* tapcli: `assets utxos`
14
+ ListUtxos lists the UTXOs managed by the target daemon, and the assets they
15
+ hold.
16
+ */
17
+ rpc ListUtxos (ListUtxosRequest) returns (ListUtxosResponse);
18
+
19
+ /* tapcli: `assets groups`
20
+ ListGroups lists the asset groups known to the target daemon, and the assets
21
+ held in each group.
22
+ */
23
+ rpc ListGroups (ListGroupsRequest) returns (ListGroupsResponse);
24
+
25
+ /* tapcli: `assets balance`
26
+ ListBalances lists asset balances
27
+ */
28
+ rpc ListBalances (ListBalancesRequest) returns (ListBalancesResponse);
29
+
30
+ /* tapcli: `assets transfers`
31
+ ListTransfers lists outbound asset transfers tracked by the target daemon.
32
+ */
33
+ rpc ListTransfers (ListTransfersRequest) returns (ListTransfersResponse);
34
+
35
+ /* tapcli: `stop`
36
+ StopDaemon will send a shutdown request to the interrupt handler, triggering
37
+ a graceful shutdown of the daemon.
38
+ */
39
+ rpc StopDaemon (StopRequest) returns (StopResponse);
40
+
41
+ /* tapcli: `debuglevel`
42
+ DebugLevel allows a caller to programmatically set the logging verbosity of
43
+ tapd. The logging can be targeted according to a coarse daemon-wide logging
44
+ level, or in a granular fashion to specify the logging for a target
45
+ sub-system.
46
+ */
47
+ rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse);
48
+
49
+ /* tapcli: `addrs query`
50
+ QueryAddrs queries the set of Taproot Asset addresses stored in the
51
+ database.
52
+ */
53
+ rpc QueryAddrs (QueryAddrRequest) returns (QueryAddrResponse);
54
+
55
+ /* tapcli: `addrs new`
56
+ NewAddr makes a new address from the set of request params.
57
+ */
58
+ rpc NewAddr (NewAddrRequest) returns (Addr);
59
+
60
+ /* tapcli: `addrs decode`
61
+ DecodeAddr decode a Taproot Asset address into a partial asset message that
62
+ represents the asset it wants to receive.
63
+ */
64
+ rpc DecodeAddr (DecodeAddrRequest) returns (Addr);
65
+
66
+ /* tapcli: `addrs receives`
67
+ List all receives for incoming asset transfers for addresses that were
68
+ created previously.
69
+ */
70
+ rpc AddrReceives (AddrReceivesRequest) returns (AddrReceivesResponse);
71
+
72
+ /* tapcli: `proofs verify`
73
+ VerifyProof attempts to verify a given proof file that claims to be anchored
74
+ at the specified genesis point.
75
+ */
76
+ rpc VerifyProof (ProofFile) returns (VerifyProofResponse);
77
+
78
+ /* tapcli: `proofs decode`
79
+ DecodeProof attempts to decode a given proof file into human readable
80
+ format.
81
+ */
82
+ rpc DecodeProof (DecodeProofRequest) returns (DecodeProofResponse);
83
+
84
+ /* tapcli: `proofs export`
85
+ ExportProof exports the latest raw proof file anchored at the specified
86
+ script_key.
87
+ */
88
+ rpc ExportProof (ExportProofRequest) returns (ProofFile);
89
+
90
+ /* tapcli: `assets send`
91
+ SendAsset uses one or multiple passed Taproot Asset address(es) to attempt
92
+ to complete an asset send. The method returns information w.r.t the on chain
93
+ send, as well as the proof file information the receiver needs to fully
94
+ receive the asset.
95
+ */
96
+ rpc SendAsset (SendAssetRequest) returns (SendAssetResponse);
97
+
98
+ /* tapcli: `assets burn`
99
+ BurnAsset burns the given number of units of a given asset by sending them
100
+ to a provably un-spendable script key. Burning means irrevocably destroying
101
+ a certain number of assets, reducing the total supply of the asset. Because
102
+ burning is such a destructive and non-reversible operation, some specific
103
+ values need to be set in the request to avoid accidental burns.
104
+ */
105
+ rpc BurnAsset (BurnAssetRequest) returns (BurnAssetResponse);
106
+
107
+ /* tapcli: `assets listburns`
108
+ ListBurns lists the asset burns that this wallet has performed. These assets
109
+ are not recoverable in any way. Filters may be applied to return more
110
+ specific results.
111
+ */
112
+ rpc ListBurns (ListBurnsRequest) returns (ListBurnsResponse);
113
+
114
+ /* tapcli: `getinfo`
115
+ GetInfo returns the information for the node.
116
+ */
117
+ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
118
+
119
+ /* tapcli: `assets meta`
120
+ FetchAssetMeta allows a caller to fetch the reveal meta data for an asset
121
+ either by the asset ID for that asset, or a meta hash.
122
+ */
123
+ rpc FetchAssetMeta (FetchAssetMetaRequest) returns (AssetMeta);
124
+
125
+ /* tapcli: `events receive`
126
+ SubscribeReceiveEvents allows a caller to subscribe to receive events for
127
+ incoming asset transfers.
128
+ */
129
+ rpc SubscribeReceiveEvents (SubscribeReceiveEventsRequest)
130
+ returns (stream ReceiveEvent);
131
+
132
+ /* tapcli: `events send`
133
+ SubscribeSendEvents allows a caller to subscribe to send events for outgoing
134
+ asset transfers.
135
+ */
136
+ rpc SubscribeSendEvents (SubscribeSendEventsRequest)
137
+ returns (stream SendEvent);
138
+ }
139
+
140
+ enum AssetType {
141
+ /*
142
+ Indicates that an asset is capable of being split/merged, with each of the
143
+ units being fungible, even across a key asset ID boundary (assuming the
144
+ key group is the same).
145
+ */
146
+ NORMAL = 0;
147
+
148
+ /*
149
+ Indicates that an asset is a collectible, meaning that each of the other
150
+ items under the same key group are not fully fungible with each other.
151
+ Collectibles also cannot be split or merged.
152
+ */
153
+ COLLECTIBLE = 1;
154
+ }
155
+
156
+ enum AssetMetaType {
157
+ /*
158
+ Opaque is used for asset meta blobs that have no true structure and instead
159
+ should be interpreted as opaque blobs.
160
+ */
161
+ META_TYPE_OPAQUE = 0;
162
+
163
+ /*
164
+ JSON is used for asset meta blobs that are to be interpreted as valid JSON
165
+ strings.
166
+ */
167
+ META_TYPE_JSON = 1;
168
+ }
169
+
170
+ message AssetMeta {
171
+ /*
172
+ The raw data of the asset meta data. Based on the type below, this may be
173
+ structured data such as a text file or PDF. The size of the data is limited
174
+ to 1MiB.
175
+ */
176
+ bytes data = 1;
177
+
178
+ // The type of the asset meta data.
179
+ AssetMetaType type = 2;
180
+
181
+ /*
182
+ The hash of the meta. This is the hash of the TLV serialization of the meta
183
+ itself.
184
+ */
185
+ bytes meta_hash = 3;
186
+ }
187
+
188
+ message ListAssetRequest {
189
+ bool with_witness = 1;
190
+ bool include_spent = 2;
191
+ bool include_leased = 3;
192
+
193
+ // List assets that aren't confirmed yet. Only freshly minted assets will
194
+ // show in the asset list with a block height of 0. All other forms of
195
+ // unconfirmed assets will not appear in the list until the transaction is
196
+ // confirmed (check either transfers or receives for unconfirmed outbound or
197
+ // inbound assets).
198
+ bool include_unconfirmed_mints = 4;
199
+ }
200
+
201
+ message AnchorInfo {
202
+ // The transaction that anchors the Taproot Asset commitment where the asset
203
+ // resides.
204
+ bytes anchor_tx = 1;
205
+
206
+ // The block hash the contains the anchor transaction above.
207
+ string anchor_block_hash = 3;
208
+
209
+ // The outpoint (txid:vout) that stores the Taproot Asset commitment.
210
+ string anchor_outpoint = 4;
211
+
212
+ /*
213
+ The raw internal key that was used to create the anchor Taproot output key.
214
+ */
215
+ bytes internal_key = 5;
216
+
217
+ /*
218
+ The Taproot merkle root hash of the anchor output the asset was committed
219
+ to. If there is no Tapscript sibling, this is equal to the Taproot Asset
220
+ root commitment hash.
221
+ */
222
+ bytes merkle_root = 6;
223
+
224
+ /*
225
+ The serialized preimage of a Tapscript sibling, if there was one. If this
226
+ is empty, then the merkle_root hash is equal to the Taproot root hash of the
227
+ anchor output.
228
+ */
229
+ bytes tapscript_sibling = 7;
230
+
231
+ // The height of the block which contains the anchor transaction.
232
+ uint32 block_height = 8;
233
+ }
234
+
235
+ message GenesisInfo {
236
+ // The first outpoint of the transaction that created the asset (txid:vout).
237
+ string genesis_point = 1;
238
+
239
+ // The name of the asset.
240
+ string name = 2;
241
+
242
+ // The hash of the meta data for this genesis asset.
243
+ bytes meta_hash = 3;
244
+
245
+ // The asset ID that uniquely identifies the asset.
246
+ bytes asset_id = 4;
247
+
248
+ // The type of the asset.
249
+ AssetType asset_type = 5;
250
+
251
+ /*
252
+ The index of the output that carries the unique Taproot Asset commitment in
253
+ the genesis transaction.
254
+ */
255
+ uint32 output_index = 6;
256
+ }
257
+
258
+ message GroupKeyRequest {
259
+ // The internal key for the asset group before any tweaks have been applied.
260
+ KeyDescriptor raw_key = 1;
261
+
262
+ /*
263
+ The genesis of the group anchor asset, which is used to derive the single
264
+ tweak for the group key. For a new group key, this will be the genesis of
265
+ new_asset.
266
+ */
267
+ GenesisInfo anchor_genesis = 2;
268
+
269
+ /*
270
+ The optional root of a tapscript tree that will be used when constructing a
271
+ new asset group key. This enables future issuance authorized with a script
272
+ witness.
273
+ */
274
+ bytes tapscript_root = 3;
275
+
276
+ /*
277
+ The serialized asset which we are requesting group membership for. A
278
+ successful request will produce a witness that authorizes this asset to be a
279
+ member of this asset group.
280
+ */
281
+ bytes new_asset = 4;
282
+ }
283
+
284
+ message TxOut {
285
+ // The value of the output being spent.
286
+ int64 value = 1;
287
+
288
+ // The script of the output being spent.
289
+ bytes pk_script = 2;
290
+ }
291
+
292
+ message GroupVirtualTx {
293
+ /*
294
+ The virtual transaction that represents the genesis state transition of a
295
+ grouped asset.
296
+ */
297
+ bytes transaction = 1;
298
+
299
+ /*
300
+ The transaction output that represents a grouped asset. The tweaked
301
+ group key is set as the PkScript of this output. This is used in combination
302
+ with Tx to produce an asset group witness.
303
+ */
304
+ TxOut prev_out = 2;
305
+
306
+ /*
307
+ The asset ID of the grouped asset in a GroupKeyRequest. This ID is
308
+ needed to construct a sign descriptor, as it is the single tweak for the
309
+ group internal key.
310
+ */
311
+ bytes genesis_id = 3;
312
+
313
+ /*
314
+ The tweaked group key for a specific GroupKeyRequest. This is used to
315
+ construct a complete group key after producing an asset group witness.
316
+ */
317
+ bytes tweaked_key = 4;
318
+ }
319
+
320
+ message GroupWitness {
321
+ // The asset ID of the pending asset that should be assigned this asset
322
+ // group witness.
323
+ bytes genesis_id = 1;
324
+
325
+ // The serialized witness stack for the asset group.
326
+ repeated bytes witness = 2;
327
+ }
328
+
329
+ message AssetGroup {
330
+ // The raw group key which is a normal public key.
331
+ bytes raw_group_key = 1;
332
+
333
+ /*
334
+ The tweaked group key, which is derived based on the genesis point and also
335
+ asset type.
336
+ */
337
+ bytes tweaked_group_key = 2;
338
+
339
+ /*
340
+ A witness that authorizes a specific asset to be part of the asset group
341
+ specified by the above key.
342
+ */
343
+ bytes asset_witness = 3;
344
+
345
+ /*
346
+ The root hash of a tapscript tree, which enables future issuance authorized
347
+ with a script witness.
348
+ */
349
+ bytes tapscript_root = 4;
350
+ }
351
+
352
+ message GroupKeyReveal {
353
+ // The raw group key which is a normal public key.
354
+ bytes raw_group_key = 1;
355
+
356
+ // The tapscript root included in the tweaked group key, which may be empty.
357
+ bytes tapscript_root = 2;
358
+ }
359
+
360
+ message GenesisReveal {
361
+ // The base genesis information in the genesis reveal.
362
+ GenesisInfo genesis_base_reveal = 1;
363
+ }
364
+
365
+ message DecimalDisplay {
366
+ /*
367
+ Decimal display dictates the number of decimal places to shift the amount to
368
+ the left converting from Taproot Asset integer representation to a
369
+ UX-recognizable fractional quantity.
370
+
371
+ For example, if the decimal_display value is 2 and there's 100 of those
372
+ assets, then a wallet would display the amount as "1.00". This field is
373
+ intended as information for wallets that display balances and has no impact
374
+ on the behavior of the daemon or any other part of the protocol. This value
375
+ is encoded in the MetaData field as a JSON field, therefore it is only
376
+ compatible with assets that have a JSON MetaData field.
377
+ */
378
+ uint32 decimal_display = 1;
379
+ }
380
+
381
+ enum AssetVersion {
382
+ // ASSET_VERSION_V0 is the default asset version. This version will include
383
+ // the witness vector in the leaf for a tap commitment.
384
+ ASSET_VERSION_V0 = 0;
385
+
386
+ // ASSET_VERSION_V1 is the asset version that leaves out the witness vector
387
+ // from the MS-SMT leaf encoding.
388
+ ASSET_VERSION_V1 = 1;
389
+ }
390
+
391
+ message Asset {
392
+ // The version of the Taproot Asset.
393
+ AssetVersion version = 1;
394
+
395
+ // The base genesis information of an asset. This information never changes.
396
+ GenesisInfo asset_genesis = 2;
397
+
398
+ // The total amount of the asset stored in this Taproot Asset UTXO.
399
+ uint64 amount = 4;
400
+
401
+ // An optional locktime, as with Bitcoin transactions.
402
+ int32 lock_time = 5;
403
+
404
+ // An optional relative lock time, same as Bitcoin transactions.
405
+ int32 relative_lock_time = 6;
406
+
407
+ // The version of the script, only version 0 is defined at present.
408
+ int32 script_version = 7;
409
+
410
+ // The script key of the asset, which can be spent under Taproot semantics.
411
+ bytes script_key = 9;
412
+
413
+ // Indicates whether the script key is known to the wallet of the lnd node
414
+ // connected to the Taproot Asset daemon.
415
+ bool script_key_is_local = 10;
416
+
417
+ // The information related to the key group of an asset (if it exists).
418
+ AssetGroup asset_group = 11;
419
+
420
+ // Describes where in the chain the asset is currently anchored.
421
+ AnchorInfo chain_anchor = 12;
422
+
423
+ repeated PrevWitness prev_witnesses = 13;
424
+
425
+ // Indicates whether the asset has been spent.
426
+ bool is_spent = 14;
427
+
428
+ // If the asset has been leased, this is the owner (application ID) of the
429
+ // lease.
430
+ bytes lease_owner = 15;
431
+
432
+ // If the asset has been leased, this is the expiry of the lease as a Unix
433
+ // timestamp in seconds.
434
+ int64 lease_expiry = 16;
435
+
436
+ // Indicates whether this transfer was an asset burn. If true, the number of
437
+ // assets in this output are destroyed and can no longer be spent.
438
+ bool is_burn = 17;
439
+
440
+ // Indicates whether this script key has either been derived by the local
441
+ // wallet or was explicitly declared to be known by using the
442
+ // DeclareScriptKey RPC. Knowing the key conceptually means the key belongs
443
+ // to the local wallet or is at least known by a software that operates on
444
+ // the local wallet. The flag is never serialized in proofs, so this is
445
+ // never explicitly set for keys foreign to the local wallet. Therefore, if
446
+ // this method returns true for a script key, it means the asset with the
447
+ // script key will be shown in the wallet balance.
448
+ bool script_key_declared_known = 18;
449
+
450
+ // Indicates whether the script key is known to have a Tapscript spend path,
451
+ // meaning that the Taproot merkle root tweak is not empty. This will only
452
+ // ever be true if either script_key_is_local or script_key_internals_known
453
+ // is true as well, since the presence of a Tapscript spend path cannot be
454
+ // determined for script keys that aren't known to the wallet of the local
455
+ // tapd node.
456
+ bool script_key_has_script_path = 19;
457
+
458
+ // This field defines a decimal display value that may be present. If this
459
+ // field is null, it means the presence of a decimal display field is
460
+ // unknown in the current context.
461
+ DecimalDisplay decimal_display = 20;
462
+ }
463
+
464
+ message PrevWitness {
465
+ PrevInputAsset prev_id = 1;
466
+
467
+ repeated bytes tx_witness = 2;
468
+
469
+ SplitCommitment split_commitment = 3;
470
+ }
471
+
472
+ message SplitCommitment {
473
+ Asset root_asset = 1;
474
+ }
475
+
476
+ message ListAssetResponse {
477
+ repeated Asset assets = 1;
478
+
479
+ // This is a count of unconfirmed outgoing transfers. Unconfirmed transfers
480
+ // do not appear as assets in this endpoint response.
481
+ uint64 unconfirmed_transfers = 2;
482
+
483
+ // This is a count of freshly minted assets that haven't been confirmed on
484
+ // chain yet. These assets will appear in the asset list with a block height
485
+ // of 0 if include_unconfirmed_mints is set to true in the request.
486
+ uint64 unconfirmed_mints = 3;
487
+ }
488
+
489
+ message ListUtxosRequest {
490
+ bool include_leased = 1;
491
+ }
492
+
493
+ message ManagedUtxo {
494
+ // The outpoint of the UTXO.
495
+ string out_point = 1;
496
+
497
+ // The UTXO amount in satoshis.
498
+ int64 amt_sat = 2;
499
+
500
+ // The internal key used for the on-chain output.
501
+ bytes internal_key = 3;
502
+
503
+ // The Taproot Asset root commitment hash.
504
+ bytes taproot_asset_root = 4;
505
+
506
+ /*
507
+ The Taproot merkle root hash committed to by the outpoint of this UTXO.
508
+ If there is no Tapscript sibling, this is equal to the Taproot Asset root
509
+ commitment hash.
510
+ */
511
+ bytes merkle_root = 5;
512
+
513
+ // The assets held at this UTXO.
514
+ repeated Asset assets = 6;
515
+
516
+ // The lease owner for this UTXO. If blank the UTXO isn't leased.
517
+ bytes lease_owner = 7;
518
+
519
+ // The expiry time as a unix time stamp for this lease. If blank the utxo
520
+ // isn't leased.
521
+ int64 lease_expiry_unix = 8;
522
+ }
523
+
524
+ message ListUtxosResponse {
525
+ // The set of UTXOs managed by the daemon.
526
+ map<string, ManagedUtxo> managed_utxos = 1;
527
+ }
528
+
529
+ message ListGroupsRequest {
530
+ }
531
+
532
+ message AssetHumanReadable {
533
+ // The ID of the asset.
534
+ bytes id = 1;
535
+
536
+ // The amount of the asset.
537
+ uint64 amount = 2;
538
+
539
+ // An optional locktime, as with Bitcoin transactions.
540
+ int32 lock_time = 3;
541
+
542
+ // An optional relative locktime, as with Bitcoin transactions.
543
+ int32 relative_lock_time = 4;
544
+
545
+ // The name of the asset.
546
+ string tag = 5;
547
+
548
+ // The metadata hash of the asset.
549
+ bytes meta_hash = 6;
550
+
551
+ // The type of the asset.
552
+ AssetType type = 7;
553
+
554
+ // The version of the asset.
555
+ AssetVersion version = 8;
556
+ }
557
+
558
+ message GroupedAssets {
559
+ // A list of assets with the same group key.
560
+ repeated AssetHumanReadable assets = 1;
561
+ }
562
+
563
+ message ListGroupsResponse {
564
+ // The set of assets with a group key.
565
+ map<string, GroupedAssets> groups = 1;
566
+ }
567
+
568
+ message ListBalancesRequest {
569
+ oneof group_by {
570
+ // Group results by asset IDs.
571
+ bool asset_id = 1;
572
+
573
+ // Group results by group keys.
574
+ bool group_key = 2;
575
+ }
576
+
577
+ // If the query results should grouped by asset ids, then an optional asset
578
+ // filter may be provided to query balance of a specific asset.
579
+ bytes asset_filter = 3;
580
+
581
+ // If the query results should be grouped by group keys, then an optional
582
+ // group key filter may be provided to query the balance of a specific
583
+ // asset group.
584
+ bytes group_key_filter = 4;
585
+
586
+ // An option to include previous leased assets in the balances.
587
+ bool include_leased = 5;
588
+ }
589
+
590
+ message AssetBalance {
591
+ // The base genesis information of an asset. This information never changes.
592
+ GenesisInfo asset_genesis = 1;
593
+
594
+ // The balance of the asset owned by the target daemon.
595
+ uint64 balance = 3;
596
+ }
597
+
598
+ message AssetGroupBalance {
599
+ // The group key or nil aggregating assets that don't have a group.
600
+ bytes group_key = 1;
601
+
602
+ // The total balance of the assets in the group.
603
+ uint64 balance = 2;
604
+ }
605
+
606
+ message ListBalancesResponse {
607
+ map<string, AssetBalance> asset_balances = 1;
608
+
609
+ map<string, AssetGroupBalance> asset_group_balances = 2;
610
+ }
611
+
612
+ message ListTransfersRequest {
613
+ // anchor_txid specifies the hexadecimal encoded txid string of the anchor
614
+ // transaction for which to retrieve transfers. An empty value indicates
615
+ // that this parameter should be disregarded in transfer selection.
616
+ string anchor_txid = 1;
617
+ }
618
+
619
+ message ListTransfersResponse {
620
+ // The unordered list of outgoing asset transfers.
621
+ repeated AssetTransfer transfers = 1;
622
+ }
623
+
624
+ // ChainHash represents a hash value, typically a double SHA-256 of some data.
625
+ // Common examples include block hashes and transaction hashes.
626
+ //
627
+ // This versatile message type is used in various Bitcoin-related messages and
628
+ // structures, providing two different formats of the same hash to accommodate
629
+ // both developer and user needs.
630
+ message ChainHash {
631
+ // The raw hash value in byte format.
632
+ //
633
+ // This format is optimized for programmatic use, particularly for Go
634
+ // developers, enabling easy integration with other RPC calls or binary
635
+ // operations.
636
+ bytes hash = 1;
637
+
638
+ // The byte-reversed hash value as a hexadecimal string.
639
+ //
640
+ // This format is intended for human interaction, making it easy to copy,
641
+ // paste, and use in contexts like command-line arguments or configuration
642
+ // files.
643
+ string hash_str = 2;
644
+ }
645
+
646
+ message AssetTransfer {
647
+ int64 transfer_timestamp = 1;
648
+
649
+ // The new transaction that commits to the set of Taproot Assets found
650
+ // at the above new anchor point.
651
+ bytes anchor_tx_hash = 2;
652
+
653
+ uint32 anchor_tx_height_hint = 3;
654
+
655
+ int64 anchor_tx_chain_fees = 4;
656
+
657
+ // Describes the set of spent assets.
658
+ repeated TransferInput inputs = 5;
659
+
660
+ // Describes the set of newly created asset outputs.
661
+ repeated TransferOutput outputs = 6;
662
+
663
+ // The block hash of the blockchain block that contains the anchor
664
+ // transaction. If this value is unset, the anchor transaction is
665
+ // unconfirmed.
666
+ ChainHash anchor_tx_block_hash = 7;
667
+ }
668
+
669
+ message TransferInput {
670
+ // The old/current location of the Taproot Asset commitment that was spent
671
+ // as an input.
672
+ string anchor_point = 1;
673
+
674
+ // The ID of the asset that was spent.
675
+ bytes asset_id = 2;
676
+
677
+ // The script key of the asset that was spent.
678
+ bytes script_key = 3;
679
+
680
+ // The amount of the asset that was spent.
681
+ uint64 amount = 4;
682
+ }
683
+
684
+ message TransferOutputAnchor {
685
+ // The new location of the Taproot Asset commitment that was created on
686
+ // chain.
687
+ string outpoint = 1;
688
+
689
+ int64 value = 2;
690
+
691
+ bytes internal_key = 3;
692
+
693
+ bytes taproot_asset_root = 4;
694
+
695
+ bytes merkle_root = 5;
696
+
697
+ bytes tapscript_sibling = 6;
698
+
699
+ uint32 num_passive_assets = 7;
700
+ }
701
+
702
+ enum OutputType {
703
+ // OUTPUT_TYPE_SIMPLE is a plain full-value or split output that is not a
704
+ // split root and does not carry passive assets. In case of a split, the
705
+ // asset of this output has a split commitment.
706
+ OUTPUT_TYPE_SIMPLE = 0;
707
+
708
+ // OUTPUT_TYPE_SPLIT_ROOT is a split root output that carries the change
709
+ // from a split or a tombstone from a non-interactive full value send
710
+ // output. In either case, the asset of this output has a tx witness.
711
+ OUTPUT_TYPE_SPLIT_ROOT = 1;
712
+
713
+ reserved 2;
714
+
715
+ reserved 3;
716
+
717
+ reserved 4;
718
+ }
719
+
720
+ // ProofDeliveryStatus is an enum that describes the status of the delivery of
721
+ // a proof associated with an asset transfer output.
722
+ enum ProofDeliveryStatus {
723
+ // Delivery is not applicable; the proof will not be delivered.
724
+ PROOF_DELIVERY_STATUS_NOT_APPLICABLE = 0;
725
+
726
+ // The proof has been successfully delivered.
727
+ PROOF_DELIVERY_STATUS_COMPLETE = 1;
728
+
729
+ // The proof is pending delivery. This status indicates that the proof has
730
+ // not yet been delivered successfully. One or more attempts at proof
731
+ // delivery may have been made.
732
+ PROOF_DELIVERY_STATUS_PENDING = 2;
733
+ }
734
+
735
+ message TransferOutput {
736
+ TransferOutputAnchor anchor = 1;
737
+
738
+ bytes script_key = 2;
739
+
740
+ bool script_key_is_local = 3;
741
+
742
+ uint64 amount = 4;
743
+
744
+ // The new individual transition proof (not a full proof file) that proves
745
+ // the inclusion of the new asset within the new AnchorTx.
746
+ bytes new_proof_blob = 5;
747
+
748
+ bytes split_commit_root_hash = 6;
749
+
750
+ OutputType output_type = 7;
751
+
752
+ AssetVersion asset_version = 8;
753
+
754
+ uint64 lock_time = 9;
755
+
756
+ uint64 relative_lock_time = 10;
757
+
758
+ // The delivery status of the proof associated with this output.
759
+ ProofDeliveryStatus proof_delivery_status = 11;
760
+ }
761
+
762
+ message StopRequest {
763
+ }
764
+
765
+ message StopResponse {
766
+ }
767
+
768
+ message DebugLevelRequest {
769
+ // If true, all the valid debug sub-systems will be returned.
770
+ bool show = 1;
771
+
772
+ string level_spec = 2;
773
+ }
774
+ message DebugLevelResponse {
775
+ string sub_systems = 1;
776
+ }
777
+
778
+ enum AddrVersion {
779
+ // ADDR_VERSION_UNSPECIFIED is the default value for an address version in
780
+ // an RPC message. It is unmarshalled to the latest address version.
781
+ ADDR_VERSION_UNSPECIFIED = 0;
782
+
783
+ // ADDR_VERSION_V0 is the initial address version.
784
+ ADDR_VERSION_V0 = 1;
785
+
786
+ // ADDR_VERSION_V1 is the address version that uses V2 Taproot Asset
787
+ // commitments.
788
+ ADDR_VERSION_V1 = 2;
789
+ }
790
+
791
+ message Addr {
792
+ // The bech32 encoded Taproot Asset address.
793
+ string encoded = 1;
794
+
795
+ // The asset ID that uniquely identifies the asset.
796
+ bytes asset_id = 2;
797
+
798
+ // The type of the asset.
799
+ AssetType asset_type = 3;
800
+
801
+ // The total amount of the asset stored in this Taproot Asset UTXO.
802
+ uint64 amount = 4;
803
+
804
+ // The group key of the asset (if it exists)
805
+ bytes group_key = 5;
806
+
807
+ /*
808
+ The specific script key the asset must commit to in order to transfer
809
+ ownership to the creator of the address.
810
+ */
811
+ bytes script_key = 6;
812
+
813
+ // The internal key used for the on-chain output.
814
+ bytes internal_key = 7;
815
+
816
+ /*
817
+ The optional serialized tapscript sibling preimage to use for the receiving
818
+ asset. This is usually empty as it is only needed when there should be an
819
+ additional script path in the Taproot tree alongside the Taproot Asset
820
+ commitment of the asset.
821
+ */
822
+ bytes tapscript_sibling = 8;
823
+
824
+ /*
825
+ The tweaked internal key that commits to the asset and represents the
826
+ on-chain output key the Bitcoin transaction must send to in order to
827
+ transfer assets described in this address.
828
+ */
829
+ bytes taproot_output_key = 9;
830
+
831
+ // The address of the proof courier service used in proof transfer.
832
+ string proof_courier_addr = 10;
833
+
834
+ // The asset version of the address.
835
+ AssetVersion asset_version = 11;
836
+
837
+ // The version of the address.
838
+ AddrVersion address_version = 12;
839
+ }
840
+
841
+ message QueryAddrRequest {
842
+ /*
843
+ If set, then only addresses created after this Unix timestamp will be
844
+ returned.
845
+ */
846
+ int64 created_after = 1;
847
+
848
+ /*
849
+ If set, then only addresses created before this Unix timestamp will be
850
+ returned.
851
+ */
852
+ int64 created_before = 2;
853
+
854
+ // The max number of addresses that should be returned.
855
+ int32 limit = 3;
856
+
857
+ // The offset from the addresses that should be returned.
858
+ int32 offset = 4;
859
+ }
860
+
861
+ message QueryAddrResponse {
862
+ repeated Addr addrs = 1;
863
+ }
864
+
865
+ message NewAddrRequest {
866
+ bytes asset_id = 1;
867
+
868
+ uint64 amt = 2;
869
+
870
+ /*
871
+ The optional script key that the receiving asset should be locked to. If no
872
+ script key is provided, a normal BIP-86 key will be derived from the
873
+ underlying wallet.
874
+
875
+ NOTE: The script_key and internal_key fields should either both be set or
876
+ both be empty.
877
+ */
878
+ ScriptKey script_key = 3;
879
+
880
+ /*
881
+ The optional internal key of the receiving BTC level transaction output on
882
+ which the receiving asset transfers will be committed to. If no internal key
883
+ is provided, a key will be derived from the underlying wallet.
884
+
885
+ NOTE: The script_key and internal_key fields should either both be set or
886
+ both be empty.
887
+ */
888
+ KeyDescriptor internal_key = 4;
889
+
890
+ /*
891
+ The optional serialized tapscript sibling preimage to use for the receiving
892
+ asset. This is usually empty as it is only needed when there should be an
893
+ additional script path in the Taproot tree alongside the Taproot Asset
894
+ commitment of the asset.
895
+ */
896
+ bytes tapscript_sibling = 5;
897
+
898
+ /*
899
+ An optional proof courier address for use in proof transfer. If unspecified,
900
+ the daemon configured default address will be used.
901
+ */
902
+ string proof_courier_addr = 6;
903
+
904
+ /*
905
+ The asset version to use when sending/receiving to/from this address.
906
+ */
907
+ AssetVersion asset_version = 7;
908
+
909
+ /*
910
+ The version of this address.
911
+ */
912
+ AddrVersion address_version = 8;
913
+ }
914
+
915
+ message ScriptKey {
916
+ /*
917
+ The full Taproot output key the asset is locked to. This is either a BIP-86
918
+ key if the tap_tweak below is empty, or a key with the tap tweak applied to
919
+ it.
920
+ */
921
+ bytes pub_key = 1;
922
+
923
+ /*
924
+ The key descriptor describing the internal key of the above Taproot key.
925
+ */
926
+ KeyDescriptor key_desc = 2;
927
+
928
+ /*
929
+ The optional Taproot tweak to apply to the above internal key. If this is
930
+ empty then a BIP-86 style tweak is applied to the internal key.
931
+ */
932
+ bytes tap_tweak = 3;
933
+ }
934
+
935
+ message KeyLocator {
936
+ /*
937
+ The family of key being identified.
938
+ */
939
+ int32 key_family = 1;
940
+
941
+ /*
942
+ The precise index of the key being identified.
943
+ */
944
+ int32 key_index = 2;
945
+ }
946
+
947
+ message KeyDescriptor {
948
+ /*
949
+ The raw bytes of the key being identified.
950
+ */
951
+ bytes raw_key_bytes = 1;
952
+
953
+ /*
954
+ The key locator that identifies which key to use for signing.
955
+ */
956
+ KeyLocator key_loc = 2;
957
+ }
958
+
959
+ message TapscriptFullTree {
960
+ /*
961
+ The complete, ordered list of all tap leaves of the tree.
962
+ */
963
+ repeated TapLeaf all_leaves = 1;
964
+ }
965
+
966
+ message TapLeaf {
967
+ // The script of the tap leaf.
968
+ bytes script = 2;
969
+ }
970
+
971
+ message TapBranch {
972
+ // The TapHash of the left child of the root hash of a Tapscript tree.
973
+ bytes left_taphash = 1;
974
+
975
+ // The TapHash of the right child of the root hash of a Tapscript tree.
976
+ bytes right_taphash = 2;
977
+ }
978
+
979
+ message DecodeAddrRequest {
980
+ string addr = 1;
981
+ }
982
+
983
+ message ProofFile {
984
+ // The raw proof file encoded as bytes. Must be a file and not just an
985
+ // individual mint/transfer proof.
986
+ bytes raw_proof_file = 1;
987
+
988
+ string genesis_point = 2;
989
+ }
990
+
991
+ message DecodedProof {
992
+ // The index depth of the decoded proof, with 0 being the latest proof.
993
+ uint32 proof_at_depth = 1;
994
+
995
+ // The total number of proofs contained in the decoded proof file (this will
996
+ // always be 1 if a single mint/transition proof was given as the raw_proof
997
+ // instead of a file).
998
+ uint32 number_of_proofs = 2;
999
+
1000
+ // The asset referenced in the proof.
1001
+ Asset asset = 3;
1002
+
1003
+ // The reveal meta data associated with the proof, if available.
1004
+ AssetMeta meta_reveal = 4;
1005
+
1006
+ // The merkle proof for AnchorTx used to prove its
1007
+ // inclusion within BlockHeader.
1008
+ bytes tx_merkle_proof = 5;
1009
+
1010
+ // The TaprootProof proving the new inclusion of the
1011
+ // resulting asset within AnchorTx.
1012
+ bytes inclusion_proof = 6;
1013
+
1014
+ // The set of TaprootProofs proving the exclusion of
1015
+ // the resulting asset from all other Taproot outputs within AnchorTx.
1016
+ repeated bytes exclusion_proofs = 7;
1017
+
1018
+ // An optional TaprootProof needed if this asset is
1019
+ // the result of a split. SplitRootProof proves inclusion of the root
1020
+ // asset of the split.
1021
+ bytes split_root_proof = 8;
1022
+
1023
+ // The number of additional nested full proofs for any inputs found within
1024
+ // the resulting asset.
1025
+ uint32 num_additional_inputs = 9;
1026
+
1027
+ // ChallengeWitness is an optional virtual transaction witness that serves
1028
+ // as an ownership proof for the asset. If this is non-nil, then it is a
1029
+ // valid transfer witness for a 1-input, 1-output virtual transaction that
1030
+ // spends the asset in this proof and sends it to the NUMS key, to prove
1031
+ // that the creator of the proof is able to produce a valid signature to
1032
+ // spend the asset.
1033
+ repeated bytes challenge_witness = 10;
1034
+
1035
+ // Indicates whether the state transition this proof represents is a burn,
1036
+ // meaning that the assets were provably destroyed and can no longer be
1037
+ // spent.
1038
+ bool is_burn = 11;
1039
+
1040
+ // GenesisReveal is an optional field that is the Genesis information for
1041
+ // the asset. This is required for minting proofs.
1042
+ GenesisReveal genesis_reveal = 12;
1043
+
1044
+ // GroupKeyReveal is an optional field that includes the information needed
1045
+ // to derive the tweaked group key.
1046
+ GroupKeyReveal group_key_reveal = 13;
1047
+
1048
+ // AltLeaves represent data used to construct an Asset commitment, that
1049
+ // will be inserted in the input anchor Tap commitment. These data-carrying
1050
+ // leaves are used for a purpose distinct from representing individual
1051
+ // individual Taproot Assets.
1052
+ bytes alt_leaves = 14;
1053
+ }
1054
+
1055
+ message VerifyProofResponse {
1056
+ bool valid = 1;
1057
+
1058
+ // The decoded last proof in the file if the proof file was valid.
1059
+ DecodedProof decoded_proof = 2;
1060
+ }
1061
+
1062
+ message DecodeProofRequest {
1063
+ // The raw proof bytes to decode. This can be a full proof file or a single
1064
+ // mint/transition proof. If it is a full proof file, the proof_at_depth
1065
+ // field will be used to determine which individual proof within the file to
1066
+ // decode.
1067
+ bytes raw_proof = 1;
1068
+
1069
+ // The index depth of the decoded proof, with 0 being the latest proof. This
1070
+ // is ignored if the raw_proof is a single mint/transition proof and not a
1071
+ // proof file.
1072
+ uint32 proof_at_depth = 2;
1073
+
1074
+ // An option to include previous witnesses in decoding.
1075
+ bool with_prev_witnesses = 3;
1076
+
1077
+ // An option to attempt to retrieve the meta data associated with the proof.
1078
+ bool with_meta_reveal = 4;
1079
+ }
1080
+
1081
+ message DecodeProofResponse {
1082
+ DecodedProof decoded_proof = 1;
1083
+ }
1084
+
1085
+ message ExportProofRequest {
1086
+ bytes asset_id = 1;
1087
+ bytes script_key = 2;
1088
+ OutPoint outpoint = 3;
1089
+
1090
+ // TODO(roasbeef): specify information to make new state transition in proof
1091
+ // file?
1092
+ }
1093
+
1094
+ enum AddrEventStatus {
1095
+ ADDR_EVENT_STATUS_UNKNOWN = 0;
1096
+ ADDR_EVENT_STATUS_TRANSACTION_DETECTED = 1;
1097
+ ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED = 2;
1098
+ ADDR_EVENT_STATUS_PROOF_RECEIVED = 3;
1099
+ ADDR_EVENT_STATUS_COMPLETED = 4;
1100
+ }
1101
+
1102
+ message AddrEvent {
1103
+ // The time the event was created in unix timestamp seconds.
1104
+ uint64 creation_time_unix_seconds = 1;
1105
+
1106
+ // The address the event was created for.
1107
+ Addr addr = 2;
1108
+
1109
+ // The current status of the event.
1110
+ AddrEventStatus status = 3;
1111
+
1112
+ // The outpoint that contains the inbound asset transfer.
1113
+ string outpoint = 4;
1114
+
1115
+ /*
1116
+ The amount in satoshis that were transferred on chain along with the asset.
1117
+ This amount is independent of the requested asset amount, which can be
1118
+ looked up on the address.
1119
+ */
1120
+ uint64 utxo_amt_sat = 5;
1121
+
1122
+ /*
1123
+ The taproot sibling hash that was used to send to the Taproot output.
1124
+ */
1125
+ bytes taproot_sibling = 6;
1126
+
1127
+ /*
1128
+ The height at which the on-chain output was confirmed. If this is zero, it
1129
+ means the output is unconfirmed.
1130
+ */
1131
+ uint32 confirmation_height = 7;
1132
+
1133
+ /*
1134
+ Indicates whether a proof file can be found for the address' asset ID and
1135
+ script key.
1136
+ */
1137
+ bool has_proof = 8;
1138
+ }
1139
+
1140
+ message AddrReceivesRequest {
1141
+ // Filter receives by a specific address. Leave empty to get all receives.
1142
+ string filter_addr = 1;
1143
+
1144
+ // Filter receives by a specific status. Leave empty to get all receives.
1145
+ AddrEventStatus filter_status = 2;
1146
+ }
1147
+
1148
+ message AddrReceivesResponse {
1149
+ // The events that match the filter criteria.
1150
+ repeated AddrEvent events = 1;
1151
+ }
1152
+
1153
+ message SendAssetRequest {
1154
+ repeated string tap_addrs = 1;
1155
+
1156
+ // The optional fee rate to use for the minting transaction, in sat/kw.
1157
+ uint32 fee_rate = 2;
1158
+ // TODO(roasbeef): maybe in future add details re type of ProofCourier or
1159
+ // w/e
1160
+ }
1161
+
1162
+ message PrevInputAsset {
1163
+ string anchor_point = 1;
1164
+ bytes asset_id = 2;
1165
+ bytes script_key = 3;
1166
+ uint64 amount = 4;
1167
+ }
1168
+
1169
+ message SendAssetResponse {
1170
+ AssetTransfer transfer = 1;
1171
+ }
1172
+
1173
+ message GetInfoRequest {
1174
+ }
1175
+
1176
+ message GetInfoResponse {
1177
+ string version = 1;
1178
+ string lnd_version = 2;
1179
+ string network = 3;
1180
+ string lnd_identity_pubkey = 4;
1181
+ string node_alias = 5;
1182
+ uint32 block_height = 6;
1183
+ string block_hash = 7;
1184
+ bool sync_to_chain = 8;
1185
+ }
1186
+
1187
+ message FetchAssetMetaRequest {
1188
+ oneof asset {
1189
+ // The asset ID of the asset to fetch the meta for.
1190
+ bytes asset_id = 1;
1191
+
1192
+ // The 32-byte meta hash of the asset meta.
1193
+ bytes meta_hash = 2;
1194
+
1195
+ // The hex encoded asset ID of the asset to fetch the meta for.
1196
+ string asset_id_str = 3;
1197
+
1198
+ // The hex encoded meta hash of the asset meta.
1199
+ string meta_hash_str = 4;
1200
+ }
1201
+ }
1202
+
1203
+ message BurnAssetRequest {
1204
+ oneof asset {
1205
+ // The asset ID of the asset to burn units of.
1206
+ bytes asset_id = 1;
1207
+
1208
+ // The hex encoded asset ID of the asset to burn units of.
1209
+ string asset_id_str = 2;
1210
+ }
1211
+
1212
+ uint64 amount_to_burn = 3;
1213
+
1214
+ // A safety check to ensure the user is aware of the destructive nature of
1215
+ // the burn. This needs to be set to the value "assets will be destroyed"
1216
+ // for the burn to succeed.
1217
+ string confirmation_text = 4;
1218
+
1219
+ // A note that may contain user defined metadata related to this burn.
1220
+ string note = 5;
1221
+ }
1222
+
1223
+ message BurnAssetResponse {
1224
+ // The asset transfer that contains the asset burn as an output.
1225
+ AssetTransfer burn_transfer = 1;
1226
+
1227
+ // The burn transition proof for the asset burn output.
1228
+ DecodedProof burn_proof = 2;
1229
+ }
1230
+
1231
+ message ListBurnsRequest {
1232
+ // The asset id of the burnt asset.
1233
+ bytes asset_id = 1;
1234
+
1235
+ // The tweaked group key of the group this asset belongs to.
1236
+ bytes tweaked_group_key = 3;
1237
+
1238
+ // The txid of the transaction that the burn was anchored to.
1239
+ bytes anchor_txid = 4;
1240
+ }
1241
+
1242
+ message AssetBurn {
1243
+ // A note that may contain user defined metadata related to this burn.
1244
+ string note = 1;
1245
+
1246
+ // The asset id of the burnt asset.
1247
+ bytes asset_id = 2;
1248
+
1249
+ // The tweaked group key of the group this asset belongs to.
1250
+ bytes tweaked_group_key = 3;
1251
+
1252
+ // The amount of burnt assets.
1253
+ uint64 amount = 4;
1254
+
1255
+ // The txid of the transaction that the burn was anchored to.
1256
+ bytes anchor_txid = 5;
1257
+ }
1258
+
1259
+ message ListBurnsResponse {
1260
+ repeated AssetBurn burns = 1;
1261
+ }
1262
+
1263
+ message OutPoint {
1264
+ /*
1265
+ Raw bytes representing the transaction id.
1266
+ */
1267
+ bytes txid = 1;
1268
+
1269
+ /*
1270
+ The index of the output on the transaction.
1271
+ */
1272
+ uint32 output_index = 2;
1273
+ }
1274
+
1275
+ message SubscribeReceiveEventsRequest {
1276
+ // Filter receives by a specific address. Leave empty to get all receive
1277
+ // events for all addresses.
1278
+ string filter_addr = 1;
1279
+
1280
+ // The start time as a Unix timestamp in microseconds. If not set (default
1281
+ // value 0), the daemon will start streaming events from the current time.
1282
+ int64 start_timestamp = 2;
1283
+ }
1284
+
1285
+ message ReceiveEvent {
1286
+ // Event creation timestamp (Unix timestamp in microseconds).
1287
+ int64 timestamp = 1;
1288
+
1289
+ // The address that received the asset.
1290
+ taprpc.Addr address = 2;
1291
+
1292
+ // The outpoint of the transaction that was used to receive the asset.
1293
+ string outpoint = 3;
1294
+
1295
+ // The status of the event. If error below is set, then the status is the
1296
+ // state that lead to the error during its execution.
1297
+ AddrEventStatus status = 4;
1298
+
1299
+ // The height of the block the asset receive transaction was mined in. This
1300
+ // is only set if the status is ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED or
1301
+ // later.
1302
+ uint32 confirmation_height = 5;
1303
+
1304
+ // An optional error, indicating that executing the status above failed.
1305
+ string error = 6;
1306
+ }
1307
+
1308
+ message SubscribeSendEventsRequest {
1309
+ // Filter send events by a specific recipient script key. Leave empty to get
1310
+ // all receive events for all parcels.
1311
+ bytes filter_script_key = 1;
1312
+ }
1313
+
1314
+ enum SendState {
1315
+ // Input coin selection to pick out which asset inputs should be spent is
1316
+ // executed during this state.
1317
+ SEND_STATE_VIRTUAL_INPUT_SELECT = 0;
1318
+
1319
+ // The virtual transaction is signed during this state.
1320
+ SEND_STATE_VIRTUAL_SIGN = 1;
1321
+
1322
+ // The Bitcoin anchor transaction is signed during this state.
1323
+ SEND_STATE_ANCHOR_SIGN = 2;
1324
+
1325
+ // The outbound packet is written to the database during this state,
1326
+ // including the partial proof suffixes. Only parcels that complete this
1327
+ // state can be resumed on restart.
1328
+ SEND_STATE_LOG_COMMITMENT = 3;
1329
+
1330
+ // The Bitcoin anchor transaction is broadcast to the network during this
1331
+ // state.
1332
+ SEND_STATE_BROADCAST = 4;
1333
+
1334
+ // The on-chain anchor transaction needs to reach at least 1 confirmation.
1335
+ // This state waits for the confirmation.
1336
+ SEND_STATE_WAIT_CONFIRMATION = 5;
1337
+
1338
+ // The anchor transaction was confirmed in a block and the full proofs can
1339
+ // now be constructed during this stage.
1340
+ SEND_STATE_STORE_PROOFS = 6;
1341
+
1342
+ // The full proofs are sent to the recipient(s) with the proof courier
1343
+ // service during this state.
1344
+ SEND_STATE_TRANSFER_PROOFS = 7;
1345
+
1346
+ // The send state machine has completed the send process.
1347
+ SEND_STATE_COMPLETED = 8;
1348
+ }
1349
+
1350
+ enum ParcelType {
1351
+ // The parcel is an address parcel.
1352
+ PARCEL_TYPE_ADDRESS = 0;
1353
+
1354
+ // The parcel type is a pre-signed parcel where the virtual transactions are
1355
+ // signed outside of the send state machine. Parcels of this type will only
1356
+ // get send states starting from SEND_STATE_ANCHOR_SIGN.
1357
+ PARCEL_TYPE_PRE_SIGNED = 1;
1358
+
1359
+ // The parcel is pending and was resumed on the latest restart of the
1360
+ // daemon. The original parcel type (address or pre-signed) is not known
1361
+ // anymore, as it's not relevant for the remaining steps. Parcels of this
1362
+ // type will only get send states starting from SEND_STATE_BROADCAST.
1363
+ PARCEL_TYPE_PENDING = 2;
1364
+
1365
+ // The parcel type is a pre-anchored parcel where the full anchor
1366
+ // transaction and all proofs are already available. Parcels of this type
1367
+ // will only get send states starting from SEND_STATE_LOG_COMMITMENT.
1368
+ PARCEL_TYPE_PRE_ANCHORED = 3;
1369
+ }
1370
+
1371
+ message SendEvent {
1372
+ // Execute timestamp (Unix timestamp in microseconds).
1373
+ int64 timestamp = 1;
1374
+
1375
+ // The send state that was executed successfully. If error below is set,
1376
+ // then the send_state is the state that lead to the error during its
1377
+ // execution.
1378
+ string send_state = 2;
1379
+
1380
+ // The type of the outbound send parcel.
1381
+ ParcelType parcel_type = 3;
1382
+
1383
+ // The list of addresses the parcel sends to (recipient addresses only, not
1384
+ // including change going back to own wallet). This is only set for parcels
1385
+ // of type PARCEL_TYPE_ADDRESS.
1386
+ repeated taprpc.Addr addresses = 4;
1387
+
1388
+ // The virtual packets that are part of the parcel.
1389
+ repeated bytes virtual_packets = 5;
1390
+
1391
+ // The passive virtual packets that are carried along with the parcel. This
1392
+ // is empty if there were no other assets in the input commitment that is
1393
+ // being spent with the "active" virtual packets above.
1394
+ repeated bytes passive_virtual_packets = 6;
1395
+
1396
+ // The Bitcoin on-chain anchor transaction that commits the sent assets
1397
+ // on-chain. This is only set after the send state SEND_STATE_ANCHOR_SIGN.
1398
+ AnchorTransaction anchor_transaction = 7;
1399
+
1400
+ // The final transfer as it will be stored in the database. This is only set
1401
+ // after the send state SEND_STATE_LOG_COMMITMENT.
1402
+ AssetTransfer transfer = 8;
1403
+
1404
+ // An optional error, indicating that executing the send_state failed.
1405
+ string error = 9;
1406
+ }
1407
+
1408
+ message AnchorTransaction {
1409
+ bytes anchor_psbt = 1;
1410
+
1411
+ /*
1412
+ The index of the (added) change output or -1 if no change was left over.
1413
+ */
1414
+ int32 change_output_index = 2;
1415
+
1416
+ /*
1417
+ The total number of satoshis in on-chain fees paid by the anchor
1418
+ transaction.
1419
+ */
1420
+ int64 chain_fees_sats = 3;
1421
+
1422
+ /*
1423
+ The fee rate in sat/kWU that was targeted by the anchor transaction.
1424
+ */
1425
+ int32 target_fee_rate_sat_kw = 4;
1426
+
1427
+ /*
1428
+ The list of UTXO lock leases that were acquired for the inputs in the funded
1429
+ PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked,
1430
+ inputs that were already present in the PSBT are not locked.
1431
+ */
1432
+ repeated taprpc.OutPoint lnd_locked_utxos = 5;
1433
+
1434
+ /*
1435
+ The final, signed anchor transaction that was broadcast to the network.
1436
+ */
1437
+ bytes final_tx = 6;
1438
+ }