From d626c36856bbe7a5277c88b52c36c155f66fc0ee Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Wed, 18 Dec 2024 16:56:26 -0500 Subject: [PATCH] LNC: update protos to v0.18.4-beta + --- .../types/proto/lnd/invoicesrpc/invoices.ts | 64 +- .../lnc-core/lib/types/proto/lnd/lightning.ts | 72 ++- .../lib/types/proto/lnd/routerrpc/router.ts | 118 ++++ .../lnc-core/lib/types/proto/loop/client.ts | 379 ++++++++++++ .../proto/pool/auctioneerrpc/auctioneer.ts | 4 - .../lnc-core/lib/types/proto/schema.ts | 6 +- .../proto/tapd/assetwalletrpc/assetwallet.ts | 258 +++++++- .../lib/types/proto/tapd/mintrpc/mint.ts | 196 +++++- .../lib/types/proto/tapd/taprootassets.ts | 563 +++++++++++++---- .../types/proto/tapd/universerpc/universe.ts | 49 +- .../@lightninglabs/lnc-core/package.json | 10 +- .../firewall.proto | 0 .../lit-autopilot.proto | 0 .../lit-sessions.proto | 0 .../lit-status.proto | 0 .../autopilotrpc/autopilot.proto | 0 .../chainrpc/chainnotifier.proto | 0 .../invoicesrpc/invoices.proto | 59 +- .../lightning.proto | 77 ++- .../routerrpc/router.proto | 91 +++ .../signrpc/signer.proto | 0 .../walletrpc/walletkit.proto | 0 .../walletunlocker.proto | 0 .../watchtowerrpc/watchtower.proto | 0 .../wtclientrpc/wtclient.proto | 0 .../client.proto | 568 ++++++++++++++++- .../debug.proto | 0 .../swapserverrpc/common.proto | 0 .../swapserverrpc/server.proto | 50 +- .../auctioneerrpc/auctioneer.proto | 10 - .../auctioneerrpc/hashmail.proto | 0 .../{v0.6.5-beta => v0.6.4-beta}/trader.proto | 0 .../assetwalletrpc/assetwallet.proto | 213 ------- .../tapd/v0-3-3-lnd-18/mintrpc/mint.proto | 210 ------- .../assetwalletrpc/assetwallet.proto | 480 +++++++++++++++ .../protos/tapd/v0.5.0-rc2/mintrpc/mint.proto | 411 +++++++++++++ .../taprootassets.proto | 574 ++++++++++++++---- .../universerpc/universe.proto | 45 +- 38 files changed, 3815 insertions(+), 692 deletions(-) rename zeus_modules/@lightninglabs/lnc-core/protos/lit/{v0.13.2-alpha => v0.13.6-alpha}/firewall.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lit/{v0.13.2-alpha => v0.13.6-alpha}/lit-autopilot.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lit/{v0.13.2-alpha => v0.13.6-alpha}/lit-sessions.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lit/{v0.13.2-alpha => v0.13.6-alpha}/lit-status.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/autopilotrpc/autopilot.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/chainrpc/chainnotifier.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/invoicesrpc/invoices.proto (73%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/lightning.proto (98%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/routerrpc/router.proto (89%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/signrpc/signer.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/walletrpc/walletkit.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/walletunlocker.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/watchtowerrpc/watchtower.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/lnd/{v0.18.3-beta => v0.18.4-beta}/wtclientrpc/wtclient.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/loop/{v0.28.5-beta => v0.29.0-beta}/client.proto (75%) rename zeus_modules/@lightninglabs/lnc-core/protos/loop/{v0.28.5-beta => v0.29.0-beta}/debug.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/loop/{v0.28.5-beta => v0.29.0-beta}/swapserverrpc/common.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/loop/{v0.28.5-beta => v0.29.0-beta}/swapserverrpc/server.proto (92%) rename zeus_modules/@lightninglabs/lnc-core/protos/pool/{v0.6.5-beta => v0.6.4-beta}/auctioneerrpc/auctioneer.proto (99%) rename zeus_modules/@lightninglabs/lnc-core/protos/pool/{v0.6.5-beta => v0.6.4-beta}/auctioneerrpc/hashmail.proto (100%) rename zeus_modules/@lightninglabs/lnc-core/protos/pool/{v0.6.5-beta => v0.6.4-beta}/trader.proto (100%) delete mode 100644 zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto delete mode 100644 zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto create mode 100644 zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto create mode 100644 zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto rename zeus_modules/@lightninglabs/lnc-core/protos/tapd/{v0-3-3-lnd-18 => v0.5.0-rc2}/taprootassets.proto (63%) rename zeus_modules/@lightninglabs/lnc-core/protos/tapd/{v0-3-3-lnd-18 => v0.5.0-rc2}/universerpc/universe.proto (91%) diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts index f326b4f71..61d2fa290 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts @@ -121,6 +121,57 @@ export interface LookupInvoiceMsg { lookupModifier: LookupModifier; } +/** CircuitKey is a unique identifier for an HTLC. */ +export interface CircuitKey { + /** The id of the channel that the is part of this circuit. */ + chanId: string; + /** The index of the incoming htlc in the incoming channel. */ + htlcId: string; +} + +export interface HtlcModifyRequest { + /** + * The invoice the intercepted HTLC is attempting to settle. The HTLCs in + * the invoice are only HTLCs that have already been accepted or settled, + * not including the current intercepted HTLC. + */ + invoice: Invoice | undefined; + /** The unique identifier of the HTLC of this intercepted HTLC. */ + exitHtlcCircuitKey: CircuitKey | undefined; + /** The amount in milli-satoshi that the exit HTLC is attempting to pay. */ + exitHtlcAmt: string; + /** The absolute expiry height of the exit HTLC. */ + exitHtlcExpiry: number; + /** The current block height. */ + currentHeight: number; + /** The wire message custom records of the exit HTLC. */ + exitHtlcWireCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface HtlcModifyRequest_ExitHtlcWireCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + +export interface HtlcModifyResponse { + /** The circuit key of the HTLC that the client wants to modify. */ + circuitKey: CircuitKey | undefined; + /** + * The modified amount in milli-satoshi that the exit HTLC is paying. This + * value can be different from the actual on-chain HTLC amount, in case the + * HTLC carries other valuable items, as can be the case with custom channel + * types. + */ + amtPaid?: string | undefined; + /** + * This flag indicates whether the HTLCs associated with the invoices should + * be cancelled. The interceptor client may set this field if some + * unexpected behavior is encountered. Setting this will ignore the amt_paid + * field. + */ + cancelSet: boolean; +} + /** * Invoices is a service that can be used to create, accept, settle and cancel * invoices. @@ -162,10 +213,21 @@ export interface Invoices { request?: DeepPartial ): Promise; /** - * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + * LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced * using either its payment hash, payment address, or set ID. */ lookupInvoiceV2(request?: DeepPartial): Promise; + /** + * HtlcModifier is a bidirectional streaming RPC that allows a client to + * intercept and modify the HTLCs that attempt to settle the given invoice. The + * server will send HTLCs of invoices to the client and the client can modify + * some aspects of the HTLC in order to pass the invoice acceptance tests. + */ + htlcModifier( + request?: DeepPartial, + onMessage?: (msg: HtlcModifyRequest) => void, + onError?: (err: Error) => void + ): void; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts index e777b5147..de8a03c7a 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts @@ -73,8 +73,17 @@ export enum CommitmentType { * channel before its maturity date. */ SCRIPT_ENFORCED_LEASE = 'SCRIPT_ENFORCED_LEASE', - /** SIMPLE_TAPROOT - TODO(roasbeef): need script enforce mirror type for the above as well? */ + /** + * SIMPLE_TAPROOT - A channel that uses musig2 for the funding output, and the new tapscript + * features where relevant. + */ SIMPLE_TAPROOT = 'SIMPLE_TAPROOT', + /** + * SIMPLE_TAPROOT_OVERLAY - Identical to the SIMPLE_TAPROOT channel type, but with extra functionality. + * This channel type also commits to additional meta data in the tapscript + * leaves for the scripts in a channel. + */ + SIMPLE_TAPROOT_OVERLAY = 'SIMPLE_TAPROOT_OVERLAY', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -1030,6 +1039,8 @@ export interface Channel { * the channel's operation. */ memo: string; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface ListChannelsRequest { @@ -1359,9 +1370,39 @@ export interface ChannelOpenUpdate { channelPoint: ChannelPoint | undefined; } +export interface CloseOutput { + /** + * The amount in satoshi of this close output. This amount is the final + * commitment balance of the channel and the actual amount paid out on chain + * might be smaller due to subtracted fees. + */ + amountSat: string; + /** The pkScript of the close output. */ + pkScript: Uint8Array | string; + /** Whether this output is for the local or remote node. */ + isLocal: boolean; + /** + * The TLV encoded custom channel data records for this output, which might + * be set for custom channels. + */ + customChannelData: Uint8Array | string; +} + export interface ChannelCloseUpdate { closingTxid: Uint8Array | string; success: boolean; + /** + * The local channel close output. If the local channel balance was dust to + * begin with, this output will not be set. + */ + localCloseOutput: CloseOutput | undefined; + /** + * The remote channel close output. If the remote channel balance was dust + * to begin with, this output will not be set. + */ + remoteCloseOutput: CloseOutput | undefined; + /** Any additional outputs that might be added for custom channel types. */ + additionalOutputs: CloseOutput[]; } export interface CloseChannelRequest { @@ -1994,6 +2035,8 @@ export interface PendingChannelsResponse_PendingChannel { * impacts the channel's operation. */ memo: string; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface PendingChannelsResponse_PendingOpenChannel { @@ -2215,6 +2258,11 @@ export interface ChannelBalanceResponse { pendingOpenLocalBalance: Amount | undefined; /** Sum of channels pending remote balances. */ pendingOpenRemoteBalance: Amount | undefined; + /** + * Custom channel data that might be populated if there are custom channels + * present. + */ + customChannelData: Uint8Array | string; } export interface QueryRoutesRequest { @@ -2510,6 +2558,16 @@ export interface Route { totalFeesMsat: string; /** The total amount in millisatoshis. */ totalAmtMsat: string; + /** + * The actual on-chain amount that was sent out to the first hop. This value is + * only different from the total_amt_msat field if this is a custom channel + * payment and the value transported in the HTLC is different from the BTC + * amount in the HTLC. If this value is zero, then this is an old payment that + * didn't have this value yet and can be ignored. + */ + firstHopAmountMsat: string; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface NodeInfoRequest { @@ -3093,6 +3151,8 @@ export interface InvoiceHTLC { mppTotalAmtMsat: string; /** Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. */ amp: AMP | undefined; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface InvoiceHTLC_CustomRecordsEntry { @@ -3275,6 +3335,11 @@ export interface Payment { */ paymentIndex: string; failureReason: PaymentFailureReason; + /** + * The custom TLV records that were sent to the first hop as part of the HTLC + * wire message for this payment. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; } export enum Payment_PaymentStatus { @@ -3295,6 +3360,11 @@ export enum Payment_PaymentStatus { UNRECOGNIZED = 'UNRECOGNIZED' } +export interface Payment_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + export interface HTLCAttempt { /** The unique ID that is used for this attempt. */ attemptId: string; diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts index d07488cdb..9a1be5629 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts @@ -8,6 +8,7 @@ import type { Failure, HTLCAttempt, ChannelPoint, + AliasMap, Payment } from '../lightning'; @@ -63,9 +64,20 @@ export enum PaymentState { } export enum ResolveHoldForwardAction { + /** + * SETTLE - SETTLE is an action that is used to settle an HTLC instead of forwarding + * it. + */ SETTLE = 'SETTLE', + /** FAIL - FAIL is an action that is used to fail an HTLC backwards. */ FAIL = 'FAIL', + /** RESUME - RESUME is an action that is used to resume a forward HTLC. */ RESUME = 'RESUME', + /** + * RESUME_MODIFIED - RESUME_MODIFIED is an action that is used to resume a hold forward HTLC + * with modifications specified during interception. + */ + RESUME_MODIFIED = 'RESUME_MODIFIED', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -210,6 +222,14 @@ export interface SendPaymentRequest { * being sent. */ cancelable: boolean; + /** + * An optional field that can be used to pass an arbitrary set of TLV records + * to the first hop peer of this payment. This can be used to pass application + * specific data during the payment attempt. Record types are required to be in + * the custom range >= 65536. When using REST, the values must be encoded as + * base64. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; } export interface SendPaymentRequest_DestCustomRecordsEntry { @@ -217,6 +237,11 @@ export interface SendPaymentRequest_DestCustomRecordsEntry { value: Uint8Array | string; } +export interface SendPaymentRequest_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + export interface TrackPaymentRequest { /** The hash of the payment to look up. */ paymentHash: Uint8Array | string; @@ -300,6 +325,19 @@ export interface SendToRouteRequest { * routes, incorrect payment details, or insufficient funds. */ skipTempErr: boolean; + /** + * An optional field that can be used to pass an arbitrary set of TLV records + * to the first hop peer of this payment. This can be used to pass application + * specific data during the payment attempt. Record types are required to be in + * the custom range >= 65536. When using REST, the values must be encoded as + * base64. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface SendToRouteRequest_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; } export interface SendToRouteResponse { @@ -536,6 +574,19 @@ export interface BuildRouteRequest { * This is also called payment secret in specifications (e.g. BOLT 11). */ paymentAddr: Uint8Array | string; + /** + * An optional field that can be used to pass an arbitrary set of TLV records + * to the first hop peer of this payment. This can be used to pass application + * specific data during the payment attempt. Record types are required to be in + * the custom range >= 65536. When using REST, the values must be encoded as + * base64. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface BuildRouteRequest_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; } export interface BuildRouteResponse { @@ -693,6 +744,8 @@ export interface ForwardHtlcInterceptRequest { * channel from force-closing. */ autoFailHeight: number; + /** The custom records of the peer's incoming p2p wire message. */ + inWireCustomRecords: { [key: string]: Uint8Array | string }; } export interface ForwardHtlcInterceptRequest_CustomRecordsEntry { @@ -700,10 +753,17 @@ export interface ForwardHtlcInterceptRequest_CustomRecordsEntry { value: Uint8Array | string; } +export interface ForwardHtlcInterceptRequest_InWireCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + /** * ForwardHtlcInterceptResponse enables the caller to resolve a previously hold * forward. The caller can choose either to: * - `Resume`: Execute the default behavior (usually forward). + * - `ResumeModified`: Execute the default behavior (usually forward) with HTLC + * field modifications. * - `Reject`: Fail the htlc backwards. * - `Settle`: Settle this htlc with a given preimage. */ @@ -734,6 +794,28 @@ export interface ForwardHtlcInterceptResponse { * default value for this field. */ failureCode: Failure_FailureCode; + /** + * The amount that was set on the p2p wire message of the incoming HTLC. + * This field is ignored if the action is not RESUME_MODIFIED or the amount + * is zero. + */ + inAmountMsat: string; + /** + * The amount to set on the p2p wire message of the resumed HTLC. This field + * is ignored if the action is not RESUME_MODIFIED or the amount is zero. + */ + outAmountMsat: string; + /** + * Any custom records that should be set on the p2p wire message message of + * the resumed HTLC. This field is ignored if the action is not + * RESUME_MODIFIED. + */ + outWireCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface ForwardHtlcInterceptResponse_OutWireCustomRecordsEntry { + key: string; + value: Uint8Array | string; } export interface UpdateChanStatusRequest { @@ -743,6 +825,22 @@ export interface UpdateChanStatusRequest { export interface UpdateChanStatusResponse {} +export interface AddAliasesRequest { + aliasMaps: AliasMap[]; +} + +export interface AddAliasesResponse { + aliasMaps: AliasMap[]; +} + +export interface DeleteAliasesRequest { + aliasMaps: AliasMap[]; +} + +export interface DeleteAliasesResponse { + aliasMaps: AliasMap[]; +} + /** * Router is a service that offers advanced interaction with the router * subsystem of the daemon. @@ -930,6 +1028,26 @@ export interface Router { updateChanStatus( request?: DeepPartial ): Promise; + /** + * XAddLocalChanAliases is an experimental API that creates a set of new + * channel SCID alias mappings. The final total set of aliases in the manager + * after the add operation is returned. This is only a locally stored alias, + * and will not be communicated to the channel peer via any message. Therefore, + * routing over such an alias will only work if the peer also calls this same + * RPC on their end. If an alias already exists, an error is returned + */ + xAddLocalChanAliases( + request?: DeepPartial + ): Promise; + /** + * XDeleteLocalChanAliases is an experimental API that deletes a set of alias + * mappings. The final total set of aliases in the manager after the delete + * operation is returned. The deletion will not be communicated to the channel + * peer via any message. + */ + xDeleteLocalChanAliases( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts index 8d6838c60..11e4edf0d 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts @@ -185,6 +185,89 @@ export enum AutoReason { UNRECOGNIZED = 'UNRECOGNIZED' } +export enum DepositState { + /** UNKNOWN_STATE - UNKNOWN_STATE is the default state of a deposit. */ + UNKNOWN_STATE = 'UNKNOWN_STATE', + /** + * DEPOSITED - DEPOSITED indicates that the deposit has been sufficiently confirmed on + * chain. + */ + DEPOSITED = 'DEPOSITED', + /** + * WITHDRAWING - WITHDRAWING indicates that the deposit is currently being withdrawn. It + * flips to WITHDRAWN once the withdrawal transaction has been sufficiently + * confirmed. + */ + WITHDRAWING = 'WITHDRAWING', + /** WITHDRAWN - WITHDRAWN indicates that the deposit has been withdrawn. */ + WITHDRAWN = 'WITHDRAWN', + /** + * LOOPING_IN - LOOPING_IN indicates that the deposit is currently being used in a static + * address loop-in swap. + */ + LOOPING_IN = 'LOOPING_IN', + /** + * LOOPED_IN - LOOPED_IN indicates that the deposit was used in a static address loop-in + * swap. + */ + LOOPED_IN = 'LOOPED_IN', + /** + * SWEEP_HTLC_TIMEOUT - SWEEP_HTLC_TIMEOUT indicates that the deposit is part of an active loop-in + * of which the respective htlc was published by the server and the timeout + * path has opened up for the client to sweep. + */ + SWEEP_HTLC_TIMEOUT = 'SWEEP_HTLC_TIMEOUT', + /** + * HTLC_TIMEOUT_SWEPT - HTLC_TIMEOUT_SWEPT indicates that the timeout path of the htlc has been + * swept by the client. + */ + HTLC_TIMEOUT_SWEPT = 'HTLC_TIMEOUT_SWEPT', + /** + * PUBLISH_EXPIRED - PUBLISH_EXPIRED indicates that the deposit has expired and the sweep + * transaction has been published. + */ + PUBLISH_EXPIRED = 'PUBLISH_EXPIRED', + /** + * WAIT_FOR_EXPIRY_SWEEP - WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep + * transaction has not yet been sufficiently confirmed. + */ + WAIT_FOR_EXPIRY_SWEEP = 'WAIT_FOR_EXPIRY_SWEEP', + /** + * EXPIRED - EXPIRED indicates that the deposit has expired and the sweep transaction + * has been sufficiently confirmed. + */ + EXPIRED = 'EXPIRED', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum StaticAddressLoopInSwapState { + /** UNKNOWN_STATIC_ADDRESS_SWAP_STATE - */ + UNKNOWN_STATIC_ADDRESS_SWAP_STATE = 'UNKNOWN_STATIC_ADDRESS_SWAP_STATE', + /** INIT_HTLC - */ + INIT_HTLC = 'INIT_HTLC', + /** SIGN_HTLC_TX - */ + SIGN_HTLC_TX = 'SIGN_HTLC_TX', + /** MONITOR_INVOICE_HTLC_TX - */ + MONITOR_INVOICE_HTLC_TX = 'MONITOR_INVOICE_HTLC_TX', + /** PAYMENT_RECEIVED - */ + PAYMENT_RECEIVED = 'PAYMENT_RECEIVED', + /** SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT - */ + SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT = 'SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT', + /** MONITOR_HTLC_TIMEOUT_SWEEP - */ + MONITOR_HTLC_TIMEOUT_SWEEP = 'MONITOR_HTLC_TIMEOUT_SWEEP', + /** HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT - */ + HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT = 'HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT', + /** SUCCEEDED - */ + SUCCEEDED = 'SUCCEEDED', + /** SUCCEEDED_TRANSITIONING_FAILED - */ + SUCCEEDED_TRANSITIONING_FAILED = 'SUCCEEDED_TRANSITIONING_FAILED', + /** UNLOCK_DEPOSITS - */ + UNLOCK_DEPOSITS = 'UNLOCK_DEPOSITS', + /** FAILED_STATIC_ADDRESS_SWAP - */ + FAILED_STATIC_ADDRESS_SWAP = 'FAILED_STATIC_ADDRESS_SWAP', + UNRECOGNIZED = 'UNRECOGNIZED' +} + export interface LoopOutRequest { /** Requested swap amount in sat. This does not include the swap and miner fee. */ amt: string; @@ -554,6 +637,12 @@ export interface QuoteRequest { * probing and payment. */ private: boolean; + /** + * Static address deposit outpoints that will be quoted for. This option only + * pertains to loop in swaps. Either this or the amt parameter can be set at + * the same time. + */ + depositOutpoints: string[]; } export interface InQuoteResponse { @@ -613,6 +702,10 @@ export interface TokensResponse { tokens: L402Token[]; } +export interface FetchL402TokenRequest {} + +export interface FetchL402TokenResponse {} + export interface L402Token { /** The base macaroon that was baked by the auth server. */ baseMacaroon: Uint8Array | string; @@ -974,6 +1067,232 @@ export interface InstantOut { sweepTxId: string; } +export interface NewStaticAddressRequest { + /** The client's public key for the 2-of-2 MuSig2 taproot static address. */ + clientKey: Uint8Array | string; +} + +export interface NewStaticAddressResponse { + /** The taproot static address. */ + address: string; + /** The CSV expiry of the static address. */ + expiry: number; +} + +export interface ListUnspentDepositsRequest { + /** The number of minimum confirmations a utxo must have to be listed. */ + minConfs: number; + /** + * The number of maximum confirmations a utxo may have to be listed. A zero + * value indicates that there is no maximum. + */ + maxConfs: number; +} + +export interface ListUnspentDepositsResponse { + /** A list of utxos behind the static address. */ + utxos: Utxo[]; +} + +export interface Utxo { + /** The static address of the utxo. */ + staticAddress: string; + /** The value of the unspent coin in satoshis. */ + amountSat: string; + /** The outpoint in the form txid:index. */ + outpoint: string; + /** The number of confirmations for the Utxo. */ + confirmations: string; +} + +export interface WithdrawDepositsRequest { + /** The outpoints of the deposits to withdraw. */ + outpoints: OutPoint[]; + /** If set to true, all deposits will be withdrawn. */ + all: boolean; + /** The address to withdraw the funds to. */ + destAddr: string; + /** The fee rate in sat/vbyte to use for the withdrawal transaction. */ + satPerVbyte: string; +} + +export interface WithdrawDepositsResponse { + /** The transaction hash of the withdrawal transaction. */ + withdrawalTxHash: string; + /** The pkscript of the withdrawal transaction. */ + pkScript: string; +} + +export interface OutPoint { + /** Raw bytes representing the transaction id. */ + txidBytes: Uint8Array | string; + /** Reversed, hex-encoded string representing the transaction id. */ + txidStr: string; + /** The index of the output on the transaction. */ + outputIndex: number; +} + +export interface ListStaticAddressDepositsRequest { + /** Filters the list of all stored deposits by deposit state. */ + stateFilter: DepositState; + /** Filters the list of all stored deposits by the outpoint. */ + outpoints: string[]; +} + +export interface ListStaticAddressDepositsResponse { + /** A list of all deposits that match the filtered state. */ + filteredDeposits: Deposit[]; +} + +export interface ListStaticAddressSwapsRequest {} + +export interface ListStaticAddressSwapsResponse { + /** A list of all swaps known static address loop-in swaps. */ + swaps: StaticAddressLoopInSwap[]; +} + +export interface StaticAddressSummaryRequest {} + +export interface StaticAddressSummaryResponse { + /** The static address of the client. */ + staticAddress: string; + /** The CSV expiry of the static address. */ + relativeExpiryBlocks: string; + /** The total number of deposits. */ + totalNumDeposits: number; + /** The total value of unconfirmed deposits. */ + valueUnconfirmedSatoshis: string; + /** The total value of confirmed deposits. */ + valueDepositedSatoshis: string; + /** The total value of all expired deposits. */ + valueExpiredSatoshis: string; + /** The total value of all deposits that have been withdrawn. */ + valueWithdrawnSatoshis: string; + /** The total value of all loop-ins that have been finalized. */ + valueLoopedInSatoshis: string; + /** The total value of all htlc timeout sweeps that the client swept. */ + valueHtlcTimeoutSweepsSatoshis: string; +} + +export interface Deposit { + /** The identifier of the deposit. */ + id: Uint8Array | string; + /** The state of the deposit. */ + state: DepositState; + /** The outpoint of the deposit in format txid:index. */ + outpoint: string; + /** The value of the deposit in satoshis. */ + value: string; + /** The block height at which the deposit was confirmed. */ + confirmationHeight: string; + /** + * The number of blocks that are left until the deposit cannot be used for a + * loop-in swap anymore. + */ + blocksUntilExpiry: string; +} + +export interface StaticAddressLoopInSwap { + /** The swap hash of the swap. It represents the unique identifier of the swap. */ + swapHash: Uint8Array | string; + /** */ + depositOutpoints: string[]; + /** */ + state: StaticAddressLoopInSwapState; + /** + * The swap amount of the swap. It is the sum of the values of the deposit + * outpoints that were used for this swap. + */ + swapAmountSatoshis: string; + /** + * The invoiced swap amount. It is the swap amount minus the quoted server + * fees. + */ + paymentRequestAmountSatoshis: string; +} + +export interface StaticAddressLoopInRequest { + /** The outpoints of the deposits to loop-in. */ + outpoints: string[]; + /** + * Maximum satoshis we are willing to pay the server for the swap. This value + * is not disclosed in the swap initiation call, but if the server asks for a + * higher fee, we abort the swap. Typically this value is taken from the + * response of the GetQuote call. + */ + maxSwapFeeSatoshis: string; + /** + * Optionally the client can specify the last hop pubkey when requesting a + * loop-in quote. This is useful to get better off-chain routing fee from the + * server. + */ + lastHop: Uint8Array | string; + /** + * An optional label for this swap. This field is limited to 500 characters and + * may not be one of the reserved values in loop/labels Reserved list. + */ + label: string; + /** + * An optional identification string that will be appended to the user agent + * string sent to the server to give information about the usage of loop. This + * initiator part is meant for user interfaces to add their name to give the + * full picture of the binary used (loopd, LiT) and the method used for + * triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + initiator: string; + /** Optional route hints to reach the destination through private channels. */ + routeHints: RouteHint[]; + /** + * Private indicates whether the destination node should be considered private. + * In which case, loop will generate hop hints to assist with probing and + * payment. + */ + private: boolean; + /** + * The swap payment timeout allows the user to specify an upper limit for the + * amount of time the server is allowed to take to fulfill the off-chain swap + * payment. If the timeout is reached the swap will be aborted on the server + * side and the client can retry the swap with different parameters. + */ + paymentTimeoutSeconds: number; +} + +export interface StaticAddressLoopInResponse { + /** The swap hash that identifies this swap. */ + swapHash: Uint8Array | string; + /** The state the swap is in. */ + state: string; + /** The amount of the swap. */ + amount: string; + /** The htlc cltv expiry height of the swap. */ + htlcCltv: number; + /** The quoted swap fee in satoshis. */ + quotedSwapFeeSatoshis: string; + /** The maximum total swap fee the client is willing to pay for the swap. */ + maxSwapFeeSatoshis: string; + /** The block height at which the swap was initiated. */ + initiationHeight: number; + /** The static address protocol version. */ + protocolVersion: string; + /** An optional label for this swap. */ + label: string; + /** + * An optional identification string that will be appended to the user agent + * string sent to the server to give information about the usage of loop. This + * initiator part is meant for user interfaces to add their name to give the + * full picture of the binary used (loopd, LiT) and the method used for + * triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + initiator: string; + /** + * The swap payment timeout allows the user to specify an upper limit for the + * amount of time the server is allowed to take to fulfill the off-chain swap + * payment. If the timeout is reached the swap will be aborted on the server + * side and the client can retry the swap with different parameters. + */ + paymentTimeoutSeconds: number; +} + /** * SwapClient is a service that handles the client side process of onchain/offchain * swaps. The service is designed for a single client. @@ -1075,6 +1394,14 @@ export interface SwapClient { getLsatTokens( request?: DeepPartial ): Promise; + /** + * loop: `fetchl402` + * FetchL402Token fetches an L402 token from the server, this is required in + * order to receive reservation notifications from the server. + */ + fetchL402Token( + request?: DeepPartial + ): Promise; /** * loop: `getinfo` * GetInfo gets basic information about the loop daemon. @@ -1139,6 +1466,58 @@ export interface SwapClient { listInstantOuts( request?: DeepPartial ): Promise; + /** + * loop: `static newstaticaddress` + * NewStaticAddress requests a new static address for loop-ins from the server. + */ + newStaticAddress( + request?: DeepPartial + ): Promise; + /** + * loop: `static listunspentdeposits` + * ListUnspentDeposits returns a list of utxos deposited at a static address. + */ + listUnspentDeposits( + request?: DeepPartial + ): Promise; + /** + * loop:`static withdraw` + * WithdrawDeposits withdraws a selection or all deposits of a static address. + */ + withdrawDeposits( + request?: DeepPartial + ): Promise; + /** + * loop:`listdeposits` + * ListStaticAddressDeposits returns a list of filtered static address + * deposits. + */ + listStaticAddressDeposits( + request?: DeepPartial + ): Promise; + /** + * loop:`listswaps` + * ListStaticAddressSwaps returns a list of filtered static address + * swaps. + */ + listStaticAddressSwaps( + request?: DeepPartial + ): Promise; + /** + * loop:`static summary` + * GetStaticAddressSummary returns a summary of static address related + * statistics. + */ + getStaticAddressSummary( + request?: DeepPartial + ): Promise; + /** + * loop:`static` + * StaticAddressLoopIn initiates a static address loop-in swap. + */ + staticAddressLoopIn( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts index 1d57f65e7..c4d7538c5 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts @@ -11,8 +11,6 @@ export enum ChannelType { * outputs that pay directly to the channel initiator (the seller). */ SCRIPT_ENFORCED_LEASE = 'SCRIPT_ENFORCED_LEASE', - /** SIMPLE_TAPROOT - A channel type that uses a Pay-to-Taproot output for the funding output. */ - SIMPLE_TAPROOT = 'SIMPLE_TAPROOT', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -62,8 +60,6 @@ export enum OrderChannelType { * channel initiator/seller. */ ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED = 'ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED', - /** ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT - A channel type that uses a Pay-to-Taproot output for the funding output. */ - ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT = 'ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT', UNRECOGNIZED = 'UNRECOGNIZED' } diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts index d32d01e85..144032370 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts @@ -46,6 +46,7 @@ export const subscriptionMethods = [ 'chainrpc.ChainNotifier.RegisterSpendNtfn', 'chainrpc.ChainNotifier.RegisterBlockEpochNtfn', 'invoicesrpc.Invoices.SubscribeSingleInvoice', + 'invoicesrpc.Invoices.HtlcModifier', 'lnrpc.Lightning.SubscribeTransactions', 'lnrpc.Lightning.SubscribePeerEvents', 'lnrpc.Lightning.SubscribeChannelEvents', @@ -70,6 +71,7 @@ export const subscriptionMethods = [ 'poolrpc.ChannelAuctioneer.SubscribeBatchAuction', 'poolrpc.ChannelAuctioneer.SubscribeSidecar', 'poolrpc.HashMail.RecvStream', - 'taprpc.TaprootAssets.SubscribeSendAssetEventNtfns', - 'taprpc.TaprootAssets.SubscribeReceiveAssetEventNtfns' + 'mintrpc.Mint.SubscribeMintEvents', + 'taprpc.TaprootAssets.SubscribeReceiveEvents', + 'taprpc.TaprootAssets.SubscribeSendEvents' ]; diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts index 4cef8d06a..57a96712e 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts @@ -6,24 +6,55 @@ import type { SendAssetResponse } from '../taprootassets'; -export interface FundVirtualPsbtRequest { +export enum CoinSelectType { /** - * Use an existing PSBT packet as the template for the funded PSBT. - * - * TODO(guggero): Actually implement this. We can't use the "reserved" - * keyword here because we're in a oneof, so we add the field but implement - * it later. + * COIN_SELECT_DEFAULT - Use the default coin selection type, which currently allows script keys and + * key spend paths. + */ + COIN_SELECT_DEFAULT = 'COIN_SELECT_DEFAULT', + /** + * COIN_SELECT_BIP86_ONLY - Explicitly only select inputs that are known to be BIP-086 compliant (have + * a key-spend path only and no script tree). + */ + COIN_SELECT_BIP86_ONLY = 'COIN_SELECT_BIP86_ONLY', + /** + * COIN_SELECT_SCRIPT_TREES_ALLOWED - Allow the selection of inputs that have a script tree spend path as well as + * a key spend path. */ + COIN_SELECT_SCRIPT_TREES_ALLOWED = 'COIN_SELECT_SCRIPT_TREES_ALLOWED', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export interface FundVirtualPsbtRequest { + /** Use an existing PSBT packet as the template for the funded PSBT. */ psbt: Uint8Array | string | undefined; /** Use the asset outputs and optional asset inputs from this raw template. */ raw: TxTemplate | undefined; + /** + * Specify the type of coins that should be selected. Defaults to allowing both + * script trees and BIP-086 compliant inputs. + */ + coinSelectType: CoinSelectType; } export interface FundVirtualPsbtResponse { - /** The funded but not yet signed PSBT packet. */ + /** The funded but not yet signed virtual PSBT packet. */ fundedPsbt: Uint8Array | string; /** The index of the added change output or -1 if no change was left over. */ changeOutputIndex: number; + /** + * The list of passive virtual transactions that are anchored in the same BTC + * level anchor transaction inputs as the funded "active" asset above. These + * assets can be ignored when using the AnchorVirtualPsbts RPC, since they are + * retrieved, signed and committed automatically in that method. But the + * passive assets have to be included in the CommitVirtualPsbts RPC which is + * used when custom BTC level anchor transactions are created. + * The main difference to the "active" asset above is that the passive assets + * will not get their own entry in the transfer table of the database, since + * they are just carried along and not directly affected by the direct user + * action. + */ + passiveAssetPsbts: Uint8Array | string[]; } export interface TxTemplate { @@ -84,6 +115,116 @@ export interface AnchorVirtualPsbtsRequest { virtualPsbts: Uint8Array | string[]; } +export interface CommitVirtualPsbtsRequest { + /** + * The list of virtual transactions that should be mapped to the given BTC + * level anchor transaction template. The virtual transactions are expected to + * be signed (or use ASSET_VERSION_V1 with segregated witness to allow for + * signing after committing) and ready to be committed to the anchor + * transaction. + */ + virtualPsbts: Uint8Array | string[]; + /** + * The list of passive virtual transactions that are anchored in the same BTC + * level anchor transaction inputs as the "active" assets above. These can be + * obtained by calling FundVirtualPsbt and using the passive assets returned. + * The virtual transactions are expected to be signed (or use ASSET_VERSION_V1 + * with segregated witness to allow for signing after committing) and ready to + * be committed to the anchor transaction. + * The main difference to the "active" assets above is that the passive assets + * will not get their own entry in the transfer table of the database, since + * they are just carried along and not directly affected by the direct user + * action. + */ + passiveAssetPsbts: Uint8Array | string[]; + /** + * The template of the BTC level anchor transaction that the virtual + * transactions should be mapped to. The template is expected to already + * contain all asset related inputs and outputs corresponding to the virtual + * transactions given above. This can be achieved by using + * tapfreighter.PrepareAnchoringTemplate for example. + */ + anchorPsbt: Uint8Array | string; + /** + * Use the existing output within the anchor PSBT with the specified + * index as the change output. Any leftover change will be added to the + * already specified amount of that output. To add a new change output to + * the PSBT, set the "add" field below instead. + */ + existingOutputIndex: number | undefined; + /** Add a new P2TR change output to the PSBT if required. */ + add: boolean | undefined; + /** The target number of blocks that the transaction should be confirmed in. */ + targetConf: number | undefined; + /** + * The fee rate, expressed in sat/vbyte, that should be used to fund the + * BTC level anchor transaction. + */ + satPerVbyte: string | undefined; +} + +export interface CommitVirtualPsbtsResponse { + /** + * The funded BTC level anchor transaction with all outputs updated to commit + * to the virtual transactions given. The transaction is ready to be signed, + * unless some of the asset inputs don't belong to this daemon, in which case + * the anchor input derivation info must be added to those inputs first. + */ + anchorPsbt: Uint8Array | string; + /** + * The updated virtual transactions that now contain the state transition + * proofs for being committed to the BTC level anchor transaction above. If the + * assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + * signed, then the proofs need to be updated to include the witness before + * they become fully valid. + */ + virtualPsbts: Uint8Array | string[]; + /** + * The updated passive virtual transactions that were committed to the same BTC + * level anchor transaction as the "active" virtual transactions given. If the + * assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + * signed, then the proofs need to be updated to include the witness before + * they become fully valid. + */ + passiveAssetPsbts: Uint8Array | string[]; + /** The index of the (added) change output or -1 if no change was left over. */ + changeOutputIndex: number; + /** + * The list of UTXO lock leases that were acquired for the inputs in the funded + * PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + * inputs that were already present in the PSBT are not locked. + */ + lndLockedUtxos: OutPoint[]; +} + +export interface PublishAndLogRequest { + /** + * The funded BTC level anchor transaction with all outputs updated to commit + * to the virtual transactions given. The transaction is ready to be signed, + * unless some of the asset inputs don't belong to this daemon, in which case + * the anchor input derivation info must be added to those inputs first. + */ + anchorPsbt: Uint8Array | string; + /** + * The updated virtual transactions that contain the state transition proofs + * of being committed to the BTC level anchor transaction above. + */ + virtualPsbts: Uint8Array | string[]; + /** + * The updated passive virtual transactions that contain the state transition + * proofs of being committed to the BTC level anchor transaction above. + */ + passiveAssetPsbts: Uint8Array | string[]; + /** The index of the (added) change output or -1 if no change was left over. */ + changeOutputIndex: number; + /** + * The list of UTXO lock leases that were acquired for the inputs in the funded + * PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + * inputs that were already present in the PSBT are not locked. + */ + lndLockedUtxos: OutPoint[]; +} + export interface NextInternalKeyRequest { keyFamily: number; } @@ -100,10 +241,41 @@ export interface NextScriptKeyResponse { scriptKey: ScriptKey | undefined; } +export interface QueryInternalKeyRequest { + /** + * The internal key to look for. This can either be the 32-byte x-only raw + * internal key or the 33-byte raw internal key with the parity byte. + */ + internalKey: Uint8Array | string; +} + +export interface QueryInternalKeyResponse { + internalKey: KeyDescriptor | undefined; +} + +export interface QueryScriptKeyRequest { + /** + * The tweaked script key to look for. This can either be the 32-byte + * x-only tweaked script key or the 33-byte tweaked script key with the + * parity byte. + */ + tweakedScriptKey: Uint8Array | string; +} + +export interface QueryScriptKeyResponse { + scriptKey: ScriptKey | undefined; +} + export interface ProveAssetOwnershipRequest { assetId: Uint8Array | string; scriptKey: Uint8Array | string; outpoint: OutPoint | undefined; + /** + * An optional 32-byte challenge that may be used to bind the generated + * proof. This challenge needs to be also presented on the + * VerifyAssetOwnership RPC in order to check the proof against it. + */ + challenge: Uint8Array | string; } export interface ProveAssetOwnershipResponse { @@ -112,10 +284,26 @@ export interface ProveAssetOwnershipResponse { export interface VerifyAssetOwnershipRequest { proofWithWitness: Uint8Array | string; + /** + * An optional 32-byte challenge that may be used to check the ownership + * proof against. This challenge must match the one that the prover used + * on the ProveAssetOwnership RPC. + */ + challenge: Uint8Array | string; } export interface VerifyAssetOwnershipResponse { validProof: boolean; + /** The outpoint the proof commits to. */ + outpoint: OutPoint | undefined; + /** The outpoint in the human-readable form "hash:index". */ + outpointStr: string; + /** The block hash the output is part of. */ + blockHash: Uint8Array | string; + /** The block hash as hexadecimal string of the byte-reversed hash. */ + blockHashStr: string; + /** The block height of the block the output is part of. */ + blockHeight: number; } export interface RemoveUTXOLeaseRequest { @@ -125,6 +313,14 @@ export interface RemoveUTXOLeaseRequest { export interface RemoveUTXOLeaseResponse {} +export interface DeclareScriptKeyRequest { + scriptKey: ScriptKey | undefined; +} + +export interface DeclareScriptKeyResponse { + scriptKey: ScriptKey | undefined; +} + export interface AssetWallet { /** * FundVirtualPsbt selects inputs from the available asset commitments to fund @@ -142,14 +338,34 @@ export interface AssetWallet { ): Promise; /** * AnchorVirtualPsbts merges and then commits multiple virtual transactions in - * a single BTC level anchor transaction. - * - * TODO(guggero): Actually implement accepting and merging multiple - * transactions. + * a single BTC level anchor transaction. This RPC should be used if the BTC + * level anchor transaction of the assets to be spent are encumbered by a + * normal key and don't require any special spending conditions. For any custom + * spending conditions on the BTC level, the two RPCs CommitVirtualPsbts and + * PublishAndLogTransfer should be used instead (which in combination do the + * same as this RPC but allow for more flexibility). */ anchorVirtualPsbts( request?: DeepPartial ): Promise; + /** + * CommitVirtualPsbts creates the output commitments and proofs for the given + * virtual transactions by committing them to the BTC level anchor transaction. + * In addition, the BTC level anchor transaction is funded and prepared up to + * the point where it is ready to be signed. + */ + commitVirtualPsbts( + request?: DeepPartial + ): Promise; + /** + * PublishAndLogTransfer accepts a fully committed and signed anchor + * transaction and publishes it to the Bitcoin network. It also logs the + * transfer of the given active and passive assets in the database and ships + * any outgoing proofs to the counterparties. + */ + publishAndLogTransfer( + request?: DeepPartial + ): Promise; /** * NextInternalKey derives the next internal key for the given key family and * stores it as an internal key in the database to make sure it is identified @@ -169,6 +385,17 @@ export interface AssetWallet { nextScriptKey( request?: DeepPartial ): Promise; + /** QueryInternalKey returns the key descriptor for the given internal key. */ + queryInternalKey( + request?: DeepPartial + ): Promise; + /** + * QueryScriptKey returns the full script key descriptor for the given tweaked + * script key. + */ + queryScriptKey( + request?: DeepPartial + ): Promise; /** * tapcli: `proofs proveownership` * ProveAssetOwnership creates an ownership proof embedded in an asset @@ -194,6 +421,15 @@ export interface AssetWallet { removeUTXOLease( request?: DeepPartial ): Promise; + /** + * DeclareScriptKey declares a new script key to the wallet. This is useful + * when the script key contains scripts, which would mean it wouldn't be + * recognized by the wallet automatically. Declaring a script key will make any + * assets sent to the script key be recognized as being local assets. + */ + declareScriptKey( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts index 597333d51..2ba97625c 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts @@ -1,5 +1,16 @@ /* eslint-disable */ -import type { AssetVersion, AssetType, AssetMeta } from '../taprootassets'; +import type { + AssetVersion, + AssetType, + AssetMeta, + KeyDescriptor, + ScriptKey, + GroupKeyRequest, + GroupVirtualTx, + TapscriptFullTree, + TapBranch, + GroupWitness +} from '../taprootassets'; export enum BatchState { BATCH_STATE_UNKNOWN = 'BATCH_STATE_UNKNOWN', @@ -36,13 +47,38 @@ export interface PendingAsset { * for future asset issuance. */ newGroupedAsset: boolean; - /** The specific group key this asset should be minted with. */ + /** The specific existing group key this asset should be minted with. */ groupKey: Uint8Array | string; /** * The name of the asset in the batch that will anchor a new asset group. * This asset will be minted with the same group key as the anchor asset. */ groupAnchor: string; + /** + * The optional key that will be used as the internal key for an asset group + * created with this asset. + */ + groupInternalKey: KeyDescriptor | undefined; + /** + * The optional root of a tapscript tree that will be used when constructing a + * new asset group key. This enables future issuance authorized with a script + * witness. + */ + groupTapscriptRoot: Uint8Array | string; + /** + * The optional script key to use for the new asset. If no script key is given, + * a BIP-86 key will be derived from the underlying wallet. + */ + scriptKey: ScriptKey | undefined; +} + +export interface UnsealedAsset { + /** The pending asset with an unsealed asset group. */ + asset: PendingAsset | undefined; + /** The group key request for the asset. */ + groupKeyRequest: GroupKeyRequest | undefined; + /** The group virtual transaction for the asset. */ + groupVirtualTx: GroupVirtualTx | undefined; } export interface MintAsset { @@ -72,13 +108,42 @@ export interface MintAsset { * an existing asset group. */ groupedAsset: boolean; - /** The specific group key this asset should be minted with. */ + /** The specific existing group key this asset should be minted with. */ groupKey: Uint8Array | string; /** * The name of the asset in the batch that will anchor a new asset group. * This asset will be minted with the same group key as the anchor asset. */ groupAnchor: string; + /** + * The optional key that will be used as the internal key for an asset group + * created with this asset. + */ + groupInternalKey: KeyDescriptor | undefined; + /** + * The optional root of a tapscript tree that will be used when constructing a + * new asset group key. This enables future issuance authorized with a script + * witness. + */ + groupTapscriptRoot: Uint8Array | string; + /** + * The optional script key to use for the new asset. If no script key is given, + * a BIP-86 key will be derived from the underlying wallet. + */ + scriptKey: ScriptKey | undefined; + /** + * Decimal display dictates the number of decimal places to shift the amount to + * the left converting from Taproot Asset integer representation to a + * UX-recognizable fractional quantity. + * + * For example, if the decimal_display value is 2 and there's 100 of those + * assets, then a wallet would display the amount as "1.00". This field is + * intended as information for wallets that display balances and has no impact + * on the behavior of the daemon or any other part of the protocol. This value + * is encoded in the MetaData field as a JSON field, therefore it is only + * compatible with assets that have a JSON MetaData field. + */ + decimalDisplay: number; } export interface MintAssetRequest { @@ -113,6 +178,61 @@ export interface MintingBatch { state: BatchState; /** The assets that are part of the batch. */ assets: PendingAsset[]; + /** The time the batch was created as a Unix timestamp (in seconds). */ + createdAt: string; + /** The current height of the block chain at the time of the batch creation. */ + heightHint: number; + /** + * The genesis transaction as a PSBT packet. Only populated if the batch has + * been committed. + */ + batchPsbt: Uint8Array | string; +} + +export interface VerboseBatch { + /** The minting batch, without any assets. */ + batch: MintingBatch | undefined; + /** The assets that are part of the batch. */ + unsealedAssets: UnsealedAsset[]; +} + +export interface FundBatchRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * response. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; + /** The optional fee rate to use for the minting transaction, in sat/kw. */ + feeRate: number; + /** + * An ordered list of TapLeafs, which will be used to construct a + * Tapscript tree. + */ + fullTree: TapscriptFullTree | undefined; + /** A TapBranch that represents a Tapscript tree managed externally. */ + branch: TapBranch | undefined; +} + +export interface FundBatchResponse { + /** The funded batch. */ + batch: MintingBatch | undefined; +} + +export interface SealBatchRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * response. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; + /** The assetID, witness pairs that authorize asset membership in a group. */ + groupWitnesses: GroupWitness[]; +} + +export interface SealBatchResponse { + /** The sealed batch. */ + batch: MintingBatch | undefined; } export interface FinalizeBatchRequest { @@ -124,6 +244,13 @@ export interface FinalizeBatchRequest { shortResponse: boolean; /** The optional fee rate to use for the minting transaction, in sat/kw. */ feeRate: number; + /** + * An ordered list of TapLeafs, which will be used to construct a + * Tapscript tree. + */ + fullTree: TapscriptFullTree | undefined; + /** A TapBranch that represents a Tapscript tree managed externally. */ + branch: TapBranch | undefined; } export interface FinalizeBatchResponse { @@ -149,10 +276,39 @@ export interface ListBatchRequest { * encoded string (use this for REST). */ batchKeyStr: string | undefined; + /** + * If true, pending asset group information will be shown for the pending + * batch. + */ + verbose: boolean; } export interface ListBatchResponse { - batches: MintingBatch[]; + batches: VerboseBatch[]; +} + +export interface SubscribeMintEventsRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * event's batch. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; +} + +export interface MintEvent { + /** Execute timestamp (Unix timestamp in microseconds). */ + timestamp: string; + /** + * The last state of the batch that was successfully executed. If error + * below is set, then the batch_state is the state that lead to the error + * during its execution. + */ + batchState: BatchState; + /** The batch that the event is for. */ + batch: MintingBatch | undefined; + /** An optional error, indicating that executing the batch_state failed. */ + error: string; } export interface Mint { @@ -167,6 +323,28 @@ export interface Mint { mintAsset( request?: DeepPartial ): Promise; + /** + * tapcli `assets mint fund` + * FundBatch will attempt to fund the current pending batch with a genesis + * input, or create a new funded batch if no batch exists yet. This RPC is only + * needed if a custom witness is needed to finalize the batch. Otherwise, + * FinalizeBatch can be called directly. + */ + fundBatch( + request?: DeepPartial + ): Promise; + /** + * tapcli `assets mint seal` + * SealBatch will attempt to seal the current pending batch by creating and + * validating asset group witness for all assets in the batch. If a witness + * is not provided, a signature will be derived to serve as the witness. This + * RPC is only needed if any assets in the batch have a custom asset group key + * that require an external signer. Otherwise, FinalizeBatch can be called + * directly. + */ + sealBatch( + request?: DeepPartial + ): Promise; /** * tapcli: `assets mint finalize` * FinalizeBatch will attempt to finalize the current pending batch. @@ -189,6 +367,16 @@ export interface Mint { listBatches( request?: DeepPartial ): Promise; + /** + * tapcli: `events mint` + * SubscribeMintEvents allows a caller to subscribe to mint events for asset + * creation batches. + */ + subscribeMintEvents( + request?: DeepPartial, + onMessage?: (msg: MintEvent) => void, + onError?: (err: Error) => void + ): void; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts index 410877bb8..660b1f8f6 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts @@ -22,6 +22,11 @@ export enum AssetMetaType { * should be interpreted as opaque blobs. */ META_TYPE_OPAQUE = 'META_TYPE_OPAQUE', + /** + * META_TYPE_JSON - JSON is used for asset meta blobs that are to be interpreted as valid JSON + * strings. + */ + META_TYPE_JSON = 'META_TYPE_JSON', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -52,28 +57,40 @@ export enum OutputType { * output. In either case, the asset of this output has a tx witness. */ OUTPUT_TYPE_SPLIT_ROOT = 'OUTPUT_TYPE_SPLIT_ROOT', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +/** + * ProofDeliveryStatus is an enum that describes the status of the delivery of + * a proof associated with an asset transfer output. + */ +export enum ProofDeliveryStatus { + /** PROOF_DELIVERY_STATUS_NOT_APPLICABLE - Delivery is not applicable; the proof will not be delivered. */ + PROOF_DELIVERY_STATUS_NOT_APPLICABLE = 'PROOF_DELIVERY_STATUS_NOT_APPLICABLE', + /** PROOF_DELIVERY_STATUS_COMPLETE - The proof has been successfully delivered. */ + PROOF_DELIVERY_STATUS_COMPLETE = 'PROOF_DELIVERY_STATUS_COMPLETE', /** - * OUTPUT_TYPE_PASSIVE_ASSETS_ONLY - OUTPUT_TYPE_PASSIVE_ASSETS_ONLY indicates that this output only carries - * passive assets and therefore the asset in this output is nil. The passive - * assets themselves are signed in their own virtual transactions and - * are not present in this packet. + * PROOF_DELIVERY_STATUS_PENDING - The proof is pending delivery. This status indicates that the proof has + * not yet been delivered successfully. One or more attempts at proof + * delivery may have been made. */ - OUTPUT_TYPE_PASSIVE_ASSETS_ONLY = 'OUTPUT_TYPE_PASSIVE_ASSETS_ONLY', + PROOF_DELIVERY_STATUS_PENDING = 'PROOF_DELIVERY_STATUS_PENDING', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum AddrVersion { /** - * OUTPUT_TYPE_PASSIVE_SPLIT_ROOT - OUTPUT_TYPE_PASSIVE_SPLIT_ROOT is a split root output that carries the - * change from a split or a tombstone from a non-interactive full value send - * output, as well as passive assets. + * ADDR_VERSION_UNSPECIFIED - ADDR_VERSION_UNSPECIFIED is the default value for an address version in + * an RPC message. It is unmarshalled to the latest address version. */ - OUTPUT_TYPE_PASSIVE_SPLIT_ROOT = 'OUTPUT_TYPE_PASSIVE_SPLIT_ROOT', + ADDR_VERSION_UNSPECIFIED = 'ADDR_VERSION_UNSPECIFIED', + /** ADDR_VERSION_V0 - ADDR_VERSION_V0 is the initial address version. */ + ADDR_VERSION_V0 = 'ADDR_VERSION_V0', /** - * OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS is a plain full-value interactive send - * output that also carries passive assets. This is a special case where we - * send the full value of a single asset in a commitment to a new script - * key, but also carry passive assets in the same output. This is useful for - * key rotation (send-to-self) scenarios or asset burns where we burn the - * full supply of a single asset within a commitment. + * ADDR_VERSION_V1 - ADDR_VERSION_V1 is the address version that uses V2 Taproot Asset + * commitments. */ - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS = 'OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS', + ADDR_VERSION_V1 = 'ADDR_VERSION_V1', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -86,23 +103,69 @@ export enum AddrEventStatus { UNRECOGNIZED = 'UNRECOGNIZED' } -/** - * ProofTransferType is the type of proof transfer attempt. The transfer is - * either a proof delivery to the transfer counterparty or receiving a proof - * from the transfer counterparty. Note that the transfer counterparty is - * usually the proof courier service. - */ -export enum ProofTransferType { +export enum SendState { + /** + * SEND_STATE_VIRTUAL_INPUT_SELECT - Input coin selection to pick out which asset inputs should be spent is + * executed during this state. + */ + SEND_STATE_VIRTUAL_INPUT_SELECT = 'SEND_STATE_VIRTUAL_INPUT_SELECT', + /** SEND_STATE_VIRTUAL_SIGN - The virtual transaction is signed during this state. */ + SEND_STATE_VIRTUAL_SIGN = 'SEND_STATE_VIRTUAL_SIGN', + /** SEND_STATE_ANCHOR_SIGN - The Bitcoin anchor transaction is signed during this state. */ + SEND_STATE_ANCHOR_SIGN = 'SEND_STATE_ANCHOR_SIGN', + /** + * SEND_STATE_LOG_COMMITMENT - The outbound packet is written to the database during this state, + * including the partial proof suffixes. Only parcels that complete this + * state can be resumed on restart. + */ + SEND_STATE_LOG_COMMITMENT = 'SEND_STATE_LOG_COMMITMENT', + /** + * SEND_STATE_BROADCAST - The Bitcoin anchor transaction is broadcast to the network during this + * state. + */ + SEND_STATE_BROADCAST = 'SEND_STATE_BROADCAST', + /** + * SEND_STATE_WAIT_CONFIRMATION - The on-chain anchor transaction needs to reach at least 1 confirmation. + * This state waits for the confirmation. + */ + SEND_STATE_WAIT_CONFIRMATION = 'SEND_STATE_WAIT_CONFIRMATION', + /** + * SEND_STATE_STORE_PROOFS - The anchor transaction was confirmed in a block and the full proofs can + * now be constructed during this stage. + */ + SEND_STATE_STORE_PROOFS = 'SEND_STATE_STORE_PROOFS', + /** + * SEND_STATE_TRANSFER_PROOFS - The full proofs are sent to the recipient(s) with the proof courier + * service during this state. + */ + SEND_STATE_TRANSFER_PROOFS = 'SEND_STATE_TRANSFER_PROOFS', + /** SEND_STATE_COMPLETED - The send state machine has completed the send process. */ + SEND_STATE_COMPLETED = 'SEND_STATE_COMPLETED', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum ParcelType { + /** PARCEL_TYPE_ADDRESS - The parcel is an address parcel. */ + PARCEL_TYPE_ADDRESS = 'PARCEL_TYPE_ADDRESS', + /** + * PARCEL_TYPE_PRE_SIGNED - The parcel type is a pre-signed parcel where the virtual transactions are + * signed outside of the send state machine. Parcels of this type will only + * get send states starting from SEND_STATE_ANCHOR_SIGN. + */ + PARCEL_TYPE_PRE_SIGNED = 'PARCEL_TYPE_PRE_SIGNED', /** - * PROOF_TRANSFER_TYPE_SEND - This value indicates that the proof transfer attempt is a delivery to the - * transfer counterparty. + * PARCEL_TYPE_PENDING - The parcel is pending and was resumed on the latest restart of the + * daemon. The original parcel type (address or pre-signed) is not known + * anymore, as it's not relevant for the remaining steps. Parcels of this + * type will only get send states starting from SEND_STATE_BROADCAST. */ - PROOF_TRANSFER_TYPE_SEND = 'PROOF_TRANSFER_TYPE_SEND', + PARCEL_TYPE_PENDING = 'PARCEL_TYPE_PENDING', /** - * PROOF_TRANSFER_TYPE_RECEIVE - This value indicates that the proof transfer attempt is a receive from - * the transfer counterparty. + * PARCEL_TYPE_PRE_ANCHORED - The parcel type is a pre-anchored parcel where the full anchor + * transaction and all proofs are already available. Parcels of this type + * will only get send states starting from SEND_STATE_LOG_COMMITMENT. */ - PROOF_TRANSFER_TYPE_RECEIVE = 'PROOF_TRANSFER_TYPE_RECEIVE', + PARCEL_TYPE_PRE_ANCHORED = 'PARCEL_TYPE_PRE_ANCHORED', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -126,6 +189,14 @@ export interface ListAssetRequest { withWitness: boolean; includeSpent: boolean; includeLeased: boolean; + /** + * List assets that aren't confirmed yet. Only freshly minted assets will + * show in the asset list with a block height of 0. All other forms of + * unconfirmed assets will not appear in the list until the transaction is + * confirmed (check either transfers or receives for unconfirmed outbound or + * inbound assets). + */ + includeUnconfirmedMints: boolean; } export interface AnchorInfo { @@ -172,8 +243,71 @@ export interface GenesisInfo { * the genesis transaction. */ outputIndex: number; - /** The version of the Taproot Asset commitment that created this asset. */ - version: number; +} + +export interface GroupKeyRequest { + /** The internal key for the asset group before any tweaks have been applied. */ + rawKey: KeyDescriptor | undefined; + /** + * The genesis of the group anchor asset, which is used to derive the single + * tweak for the group key. For a new group key, this will be the genesis of + * new_asset. + */ + anchorGenesis: GenesisInfo | undefined; + /** + * The optional root of a tapscript tree that will be used when constructing a + * new asset group key. This enables future issuance authorized with a script + * witness. + */ + tapscriptRoot: Uint8Array | string; + /** + * The serialized asset which we are requesting group membership for. A + * successful request will produce a witness that authorizes this asset to be a + * member of this asset group. + */ + newAsset: Uint8Array | string; +} + +export interface TxOut { + /** The value of the output being spent. */ + value: string; + /** The script of the output being spent. */ + pkScript: Uint8Array | string; +} + +export interface GroupVirtualTx { + /** + * The virtual transaction that represents the genesis state transition of a + * grouped asset. + */ + transaction: Uint8Array | string; + /** + * The transaction output that represents a grouped asset. The tweaked + * group key is set as the PkScript of this output. This is used in combination + * with Tx to produce an asset group witness. + */ + prevOut: TxOut | undefined; + /** + * The asset ID of the grouped asset in a GroupKeyRequest. This ID is + * needed to construct a sign descriptor, as it is the single tweak for the + * group internal key. + */ + genesisId: Uint8Array | string; + /** + * The tweaked group key for a specific GroupKeyRequest. This is used to + * construct a complete group key after producing an asset group witness. + */ + tweakedKey: Uint8Array | string; +} + +export interface GroupWitness { + /** + * The asset ID of the pending asset that should be assigned this asset + * group witness. + */ + genesisId: Uint8Array | string; + /** The serialized witness stack for the asset group. */ + witness: Uint8Array | string[]; } export interface AssetGroup { @@ -189,6 +323,11 @@ export interface AssetGroup { * specified by the above key. */ assetWitness: Uint8Array | string; + /** + * The root hash of a tapscript tree, which enables future issuance authorized + * with a script witness. + */ + tapscriptRoot: Uint8Array | string; } export interface GroupKeyReveal { @@ -203,6 +342,22 @@ export interface GenesisReveal { genesisBaseReveal: GenesisInfo | undefined; } +export interface DecimalDisplay { + /** + * Decimal display dictates the number of decimal places to shift the amount to + * the left converting from Taproot Asset integer representation to a + * UX-recognizable fractional quantity. + * + * For example, if the decimal_display value is 2 and there's 100 of those + * assets, then a wallet would display the amount as "1.00". This field is + * intended as information for wallets that display balances and has no impact + * on the behavior of the daemon or any other part of the protocol. This value + * is encoded in the MetaData field as a JSON field, therefore it is only + * compatible with assets that have a JSON MetaData field. + */ + decimalDisplay: number; +} + export interface Asset { /** The version of the Taproot Asset. */ version: AssetVersion; @@ -245,6 +400,32 @@ export interface Asset { * assets in this output are destroyed and can no longer be spent. */ isBurn: boolean; + /** + * Indicates whether this script key has either been derived by the local + * wallet or was explicitly declared to be known by using the + * DeclareScriptKey RPC. Knowing the key conceptually means the key belongs + * to the local wallet or is at least known by a software that operates on + * the local wallet. The flag is never serialized in proofs, so this is + * never explicitly set for keys foreign to the local wallet. Therefore, if + * this method returns true for a script key, it means the asset with the + * script key will be shown in the wallet balance. + */ + scriptKeyDeclaredKnown: boolean; + /** + * Indicates whether the script key is known to have a Tapscript spend path, + * meaning that the Taproot merkle root tweak is not empty. This will only + * ever be true if either script_key_is_local or script_key_internals_known + * is true as well, since the presence of a Tapscript spend path cannot be + * determined for script keys that aren't known to the wallet of the local + * tapd node. + */ + scriptKeyHasScriptPath: boolean; + /** + * This field defines a decimal display value that may be present. If this + * field is null, it means the presence of a decimal display field is + * unknown in the current context. + */ + decimalDisplay: DecimalDisplay | undefined; } export interface PrevWitness { @@ -259,6 +440,17 @@ export interface SplitCommitment { export interface ListAssetResponse { assets: Asset[]; + /** + * This is a count of unconfirmed outgoing transfers. Unconfirmed transfers + * do not appear as assets in this endpoint response. + */ + unconfirmedTransfers: string; + /** + * This is a count of freshly minted assets that haven't been confirmed on + * chain yet. These assets will appear in the asset list with a block height + * of 0 if include_unconfirmed_mints is set to true in the request. + */ + unconfirmedMints: string; } export interface ListUtxosRequest { @@ -282,6 +474,13 @@ export interface ManagedUtxo { merkleRoot: Uint8Array | string; /** The assets held at this UTXO. */ assets: Asset[]; + /** The lease owner for this UTXO. If blank the UTXO isn't leased. */ + leaseOwner: Uint8Array | string; + /** + * The expiry time as a unix time stamp for this lease. If blank the utxo + * isn't leased. + */ + leaseExpiryUnix: string; } export interface ListUtxosResponse { @@ -346,6 +545,8 @@ export interface ListBalancesRequest { * asset group. */ groupKeyFilter: Uint8Array | string; + /** An option to include previous leased assets in the balances. */ + includeLeased: boolean; } export interface AssetBalance { @@ -377,13 +578,47 @@ export interface ListBalancesResponse_AssetGroupBalancesEntry { value: AssetGroupBalance | undefined; } -export interface ListTransfersRequest {} +export interface ListTransfersRequest { + /** + * anchor_txid specifies the hexadecimal encoded txid string of the anchor + * transaction for which to retrieve transfers. An empty value indicates + * that this parameter should be disregarded in transfer selection. + */ + anchorTxid: string; +} export interface ListTransfersResponse { /** The unordered list of outgoing asset transfers. */ transfers: AssetTransfer[]; } +/** + * ChainHash represents a hash value, typically a double SHA-256 of some data. + * Common examples include block hashes and transaction hashes. + * + * This versatile message type is used in various Bitcoin-related messages and + * structures, providing two different formats of the same hash to accommodate + * both developer and user needs. + */ +export interface ChainHash { + /** + * The raw hash value in byte format. + * + * This format is optimized for programmatic use, particularly for Go + * developers, enabling easy integration with other RPC calls or binary + * operations. + */ + hash: Uint8Array | string; + /** + * The byte-reversed hash value as a hexadecimal string. + * + * This format is intended for human interaction, making it easy to copy, + * paste, and use in contexts like command-line arguments or configuration + * files. + */ + hashStr: string; +} + export interface AssetTransfer { transferTimestamp: string; /** @@ -397,6 +632,12 @@ export interface AssetTransfer { inputs: TransferInput[]; /** Describes the set of newly created asset outputs. */ outputs: TransferOutput[]; + /** + * The block hash of the blockchain block that contains the anchor + * transaction. If this value is unset, the anchor transaction is + * unconfirmed. + */ + anchorTxBlockHash: ChainHash | undefined; } export interface TransferInput { @@ -440,6 +681,10 @@ export interface TransferOutput { splitCommitRootHash: Uint8Array | string; outputType: OutputType; assetVersion: AssetVersion; + lockTime: string; + relativeLockTime: string; + /** The delivery status of the proof associated with this output. */ + proofDeliveryStatus: ProofDeliveryStatus; } export interface StopRequest {} @@ -491,6 +736,8 @@ export interface Addr { proofCourierAddr: string; /** The asset version of the address. */ assetVersion: AssetVersion; + /** The version of the address. */ + addressVersion: AddrVersion; } export interface QueryAddrRequest { @@ -549,6 +796,8 @@ export interface NewAddrRequest { proofCourierAddr: string; /** The asset version to use when sending/receiving to/from this address. */ assetVersion: AssetVersion; + /** The version of this address. */ + addressVersion: AddrVersion; } export interface ScriptKey { @@ -581,6 +830,23 @@ export interface KeyDescriptor { keyLoc: KeyLocator | undefined; } +export interface TapscriptFullTree { + /** The complete, ordered list of all tap leaves of the tree. */ + allLeaves: TapLeaf[]; +} + +export interface TapLeaf { + /** The script of the tap leaf. */ + script: Uint8Array | string; +} + +export interface TapBranch { + /** The TapHash of the left child of the root hash of a Tapscript tree. */ + leftTaphash: Uint8Array | string; + /** The TapHash of the right child of the root hash of a Tapscript tree. */ + rightTaphash: Uint8Array | string; +} + export interface DecodeAddrRequest { addr: string; } @@ -767,61 +1033,6 @@ export interface GetInfoResponse { syncToChain: boolean; } -export interface SubscribeSendAssetEventNtfnsRequest {} - -export interface SendAssetEvent { - /** An event which indicates that a send state is about to be executed. */ - executeSendStateEvent: ExecuteSendStateEvent | undefined; - /** - * An event which indicates that the proof transfer backoff wait period - * will start imminently. - */ - proofTransferBackoffWaitEvent: ProofTransferBackoffWaitEvent | undefined; -} - -export interface ExecuteSendStateEvent { - /** Execute timestamp (microseconds). */ - timestamp: string; - /** The send state that is about to be executed. */ - sendState: string; -} - -export interface ProofTransferBackoffWaitEvent { - /** Transfer attempt timestamp (microseconds). */ - timestamp: string; - /** Backoff is the active backoff wait duration. */ - backoff: string; - /** - * Tries counter is the number of tries we've made so far during the - * course of the current backoff procedure to deliver the proof to the - * receiver. - */ - triesCounter: string; - /** The type of proof transfer attempt. */ - transferType: ProofTransferType; -} - -export interface SubscribeReceiveAssetEventNtfnsRequest {} - -export interface AssetReceiveCompleteEvent { - /** Event creation timestamp. */ - timestamp: string; - /** The address that received the asset. */ - address: Addr | undefined; - /** The outpoint of the transaction that was used to receive the asset. */ - outpoint: string; -} - -export interface ReceiveAssetEvent { - /** - * An event which indicates that the proof transfer backoff wait period - * will start imminently. - */ - proofTransferBackoffWaitEvent: ProofTransferBackoffWaitEvent | undefined; - /** An event which indicates that an asset receive process has finished. */ - assetReceiveCompleteEvent: AssetReceiveCompleteEvent | undefined; -} - export interface FetchAssetMetaRequest { /** The asset ID of the asset to fetch the meta for. */ assetId: Uint8Array | string | undefined; @@ -845,6 +1056,8 @@ export interface BurnAssetRequest { * for the burn to succeed. */ confirmationText: string; + /** A note that may contain user defined metadata related to this burn. */ + note: string; } export interface BurnAssetResponse { @@ -854,6 +1067,32 @@ export interface BurnAssetResponse { burnProof: DecodedProof | undefined; } +export interface ListBurnsRequest { + /** The asset id of the burnt asset. */ + assetId: Uint8Array | string; + /** The tweaked group key of the group this asset belongs to. */ + tweakedGroupKey: Uint8Array | string; + /** The txid of the transaction that the burn was anchored to. */ + anchorTxid: Uint8Array | string; +} + +export interface AssetBurn { + /** A note that may contain user defined metadata related to this burn. */ + note: string; + /** The asset id of the burnt asset. */ + assetId: Uint8Array | string; + /** The tweaked group key of the group this asset belongs to. */ + tweakedGroupKey: Uint8Array | string; + /** The amount of burnt assets. */ + amount: string; + /** The txid of the transaction that the burn was anchored to. */ + anchorTxid: Uint8Array | string; +} + +export interface ListBurnsResponse { + burns: AssetBurn[]; +} + export interface OutPoint { /** Raw bytes representing the transaction id. */ txid: Uint8Array | string; @@ -861,6 +1100,109 @@ export interface OutPoint { outputIndex: number; } +export interface SubscribeReceiveEventsRequest { + /** + * Filter receives by a specific address. Leave empty to get all receive + * events for all addresses. + */ + filterAddr: string; + /** + * The start time as a Unix timestamp in microseconds. If not set (default + * value 0), the daemon will start streaming events from the current time. + */ + startTimestamp: string; +} + +export interface ReceiveEvent { + /** Event creation timestamp (Unix timestamp in microseconds). */ + timestamp: string; + /** The address that received the asset. */ + address: Addr | undefined; + /** The outpoint of the transaction that was used to receive the asset. */ + outpoint: string; + /** + * The status of the event. If error below is set, then the status is the + * state that lead to the error during its execution. + */ + status: AddrEventStatus; + /** + * The height of the block the asset receive transaction was mined in. This + * is only set if the status is ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED or + * later. + */ + confirmationHeight: number; + /** An optional error, indicating that executing the status above failed. */ + error: string; +} + +export interface SubscribeSendEventsRequest { + /** + * Filter send events by a specific recipient script key. Leave empty to get + * all receive events for all parcels. + */ + filterScriptKey: Uint8Array | string; +} + +export interface SendEvent { + /** Execute timestamp (Unix timestamp in microseconds). */ + timestamp: string; + /** + * The send state that was executed successfully. If error below is set, + * then the send_state is the state that lead to the error during its + * execution. + */ + sendState: string; + /** The type of the outbound send parcel. */ + parcelType: ParcelType; + /** + * The list of addresses the parcel sends to (recipient addresses only, not + * including change going back to own wallet). This is only set for parcels + * of type PARCEL_TYPE_ADDRESS. + */ + addresses: Addr[]; + /** The virtual packets that are part of the parcel. */ + virtualPackets: Uint8Array | string[]; + /** + * The passive virtual packets that are carried along with the parcel. This + * is empty if there were no other assets in the input commitment that is + * being spent with the "active" virtual packets above. + */ + passiveVirtualPackets: Uint8Array | string[]; + /** + * The Bitcoin on-chain anchor transaction that commits the sent assets + * on-chain. This is only set after the send state SEND_STATE_ANCHOR_SIGN. + */ + anchorTransaction: AnchorTransaction | undefined; + /** + * The final transfer as it will be stored in the database. This is only set + * after the send state SEND_STATE_LOG_COMMITMENT. + */ + transfer: AssetTransfer | undefined; + /** An optional error, indicating that executing the send_state failed. */ + error: string; +} + +export interface AnchorTransaction { + anchorPsbt: Uint8Array | string; + /** The index of the (added) change output or -1 if no change was left over. */ + changeOutputIndex: number; + /** + * The total number of satoshis in on-chain fees paid by the anchor + * transaction. + */ + chainFeesSats: string; + /** The fee rate in sat/kWU that was targeted by the anchor transaction. */ + targetFeeRateSatKw: number; + /** + * The list of UTXO lock leases that were acquired for the inputs in the funded + * PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + * inputs that were already present in the PSBT are not locked. + */ + lndLockedUtxos: OutPoint[]; + /** The final, signed anchor transaction that was broadcast to the network. */ + finalTx: Uint8Array | string; +} + export interface TaprootAssets { /** * tapcli: `assets list` @@ -983,29 +1325,20 @@ export interface TaprootAssets { burnAsset( request?: DeepPartial ): Promise; + /** + * tapcli: `assets listburns` + * ListBurns lists the asset burns that this wallet has performed. These assets + * are not recoverable in any way. Filters may be applied to return more + * specific results. + */ + listBurns( + request?: DeepPartial + ): Promise; /** * tapcli: `getinfo` * GetInfo returns the information for the node. */ getInfo(request?: DeepPartial): Promise; - /** - * SubscribeSendAssetEventNtfns registers a subscription to the event - * notification stream which relates to the asset sending process. - */ - subscribeSendAssetEventNtfns( - request?: DeepPartial, - onMessage?: (msg: SendAssetEvent) => void, - onError?: (err: Error) => void - ): void; - /** - * SubscribeReceiveAssetEventNtfns registers a subscription to the event - * notification stream which relates to the asset receive process. - */ - subscribeReceiveAssetEventNtfns( - request?: DeepPartial, - onMessage?: (msg: ReceiveAssetEvent) => void, - onError?: (err: Error) => void - ): void; /** * tapcli: `assets meta` * FetchAssetMeta allows a caller to fetch the reveal meta data for an asset @@ -1014,6 +1347,26 @@ export interface TaprootAssets { fetchAssetMeta( request?: DeepPartial ): Promise; + /** + * tapcli: `events receive` + * SubscribeReceiveEvents allows a caller to subscribe to receive events for + * incoming asset transfers. + */ + subscribeReceiveEvents( + request?: DeepPartial, + onMessage?: (msg: ReceiveEvent) => void, + onError?: (err: Error) => void + ): void; + /** + * tapcli: `events send` + * SubscribeSendEvents allows a caller to subscribe to send events for outgoing + * asset transfers. + */ + subscribeSendEvents( + request?: DeepPartial, + onMessage?: (msg: SendEvent) => void, + onError?: (err: Error) => void + ): void; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts index c490eed15..c6f7d36b6 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts @@ -47,6 +47,23 @@ export enum AssetTypeFilter { UNRECOGNIZED = 'UNRECOGNIZED' } +export interface MultiverseRootRequest { + /** The proof type to calculate the multiverse root for. */ + proofType: ProofType; + /** + * An optional list of universe IDs to include in the multiverse root. If + * none are specified, then all known universes of the given proof type are + * included. NOTE: The proof type within the IDs must either be unspecified + * or match the proof type above. + */ + specificIds: ID[]; +} + +export interface MultiverseRootResponse { + /** The root of the multiverse tree. */ + multiverseRoot: MerkleSumNode | undefined; +} + export interface AssetRootRequest { /** * If true, then the response will include the amounts for each asset ID @@ -199,7 +216,7 @@ export interface UniverseKey { } export interface AssetProofResponse { - /** The request original request for the issuance proof. */ + /** The original request for the issuance proof. */ req: UniverseKey | undefined; /** The Universe root that includes this asset leaf. */ universeRoot: UniverseRoot | undefined; @@ -229,6 +246,18 @@ export interface AssetProof { assetLeaf: AssetLeaf | undefined; } +export interface PushProofRequest { + /** The ID of the asset to push the proof for. */ + key: UniverseKey | undefined; + /** The universe server to push the proof to. */ + server: UniverseFederationServer | undefined; +} + +export interface PushProofResponse { + /** The ID of the asset a push was requested for. */ + key: UniverseKey | undefined; +} + export interface InfoRequest {} export interface InfoResponse { @@ -439,6 +468,15 @@ export interface QueryFederationSyncConfigResponse { } export interface Universe { + /** + * tapcli: `universe multiverse` + * MultiverseRoot returns the root of the multiverse tree. This is useful to + * determine the equality of two multiverse trees, since the root can directly + * be compared to another multiverse root to find out if a sync is required. + */ + multiverseRoot( + request?: DeepPartial + ): Promise; /** * tapcli: `universe roots` * AssetRoots queries for the known Universe roots associated with each known @@ -502,6 +540,15 @@ export interface Universe { * updated asset_id/group_key. */ insertProof(request?: DeepPartial): Promise; + /** + * tapcli: `universe proofs push` + * PushProof attempts to query the local universe for a proof specified by a + * UniverseKey. If found, a connection is made to a remote Universe server to + * attempt to upload the asset leaf. + */ + pushProof( + request?: DeepPartial + ): Promise; /** * tapcli: `universe info` * Info returns a set of information about the current state of the Universe. diff --git a/zeus_modules/@lightninglabs/lnc-core/package.json b/zeus_modules/@lightninglabs/lnc-core/package.json index 3e4d1f391..42da9b37d 100644 --- a/zeus_modules/@lightninglabs/lnc-core/package.json +++ b/zeus_modules/@lightninglabs/lnc-core/package.json @@ -5,12 +5,12 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "config": { - "lnd_release_tag": "v0.18.3-beta", - "loop_release_tag": "v0.28.5-beta", - "pool_release_tag": "v0.6.5-beta", + "lnd_release_tag": "v0.18.4-beta", + "loop_release_tag": "v0.29.0-beta", + "pool_release_tag": "v0.6.4-beta", "faraday_release_tag": "v0.2.13-alpha", - "tapd_release_tag": "v0-3-3-lnd-18", - "lit_release_tag": "v0.13.2-alpha", + "tapd_release_tag": "v0.5.0-rc2", + "lit_release_tag": "v0.13.6-alpha", "protoc_version": "21.9" }, "scripts": { diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/firewall.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/firewall.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/firewall.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/firewall.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-autopilot.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-autopilot.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-autopilot.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-autopilot.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-sessions.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-sessions.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-sessions.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-sessions.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-status.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-status.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-status.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-status.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/autopilotrpc/autopilot.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/autopilotrpc/autopilot.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/autopilotrpc/autopilot.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/autopilotrpc/autopilot.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/chainrpc/chainnotifier.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/chainrpc/chainnotifier.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/chainrpc/chainnotifier.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/chainrpc/chainnotifier.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/invoicesrpc/invoices.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto similarity index 73% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/invoicesrpc/invoices.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto index 7afffba4e..d9d3bc123 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/invoicesrpc/invoices.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto @@ -55,10 +55,19 @@ service Invoices { rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp); /* - LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced using either its payment hash, payment address, or set ID. */ rpc LookupInvoiceV2 (LookupInvoiceMsg) returns (lnrpc.Invoice); + + /* + HtlcModifier is a bidirectional streaming RPC that allows a client to + intercept and modify the HTLCs that attempt to settle the given invoice. The + server will send HTLCs of invoices to the client and the client can modify + some aspects of the HTLC in order to pass the invoice acceptance tests. + */ + rpc HtlcModifier (stream HtlcModifyResponse) + returns (stream HtlcModifyRequest); } message CancelInvoiceMsg { @@ -192,3 +201,51 @@ message LookupInvoiceMsg { LookupModifier lookup_modifier = 4; } + +// CircuitKey is a unique identifier for an HTLC. +message CircuitKey { + // The id of the channel that the is part of this circuit. + uint64 chan_id = 1; + + // The index of the incoming htlc in the incoming channel. + uint64 htlc_id = 2; +} + +message HtlcModifyRequest { + // The invoice the intercepted HTLC is attempting to settle. The HTLCs in + // the invoice are only HTLCs that have already been accepted or settled, + // not including the current intercepted HTLC. + lnrpc.Invoice invoice = 1; + + // The unique identifier of the HTLC of this intercepted HTLC. + CircuitKey exit_htlc_circuit_key = 2; + + // The amount in milli-satoshi that the exit HTLC is attempting to pay. + uint64 exit_htlc_amt = 3; + + // The absolute expiry height of the exit HTLC. + uint32 exit_htlc_expiry = 4; + + // The current block height. + uint32 current_height = 5; + + // The wire message custom records of the exit HTLC. + map exit_htlc_wire_custom_records = 6; +} + +message HtlcModifyResponse { + // The circuit key of the HTLC that the client wants to modify. + CircuitKey circuit_key = 1; + + // The modified amount in milli-satoshi that the exit HTLC is paying. This + // value can be different from the actual on-chain HTLC amount, in case the + // HTLC carries other valuable items, as can be the case with custom channel + // types. + optional uint64 amt_paid = 2; + + // This flag indicates whether the HTLCs associated with the invoices should + // be cancelled. The interceptor client may set this field if some + // unexpected behavior is encountered. Setting this will ignore the amt_paid + // field. + bool cancel_set = 3; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/lightning.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/lightning.proto similarity index 98% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/lightning.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/lightning.proto index 201bb0df2..644930515 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/lightning.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/lightning.proto @@ -1388,8 +1388,14 @@ enum CommitmentType { A channel that uses musig2 for the funding output, and the new tapscript features where relevant. */ - // TODO(roasbeef): need script enforce mirror type for the above as well? SIMPLE_TAPROOT = 5; + + /* + Identical to the SIMPLE_TAPROOT channel type, but with extra functionality. + This channel type also commits to additional meta data in the tapscript + leaves for the scripts in a channel. + */ + SIMPLE_TAPROOT_OVERLAY = 6; } message ChannelConstraints { @@ -1592,6 +1598,11 @@ message Channel { the channel's operation. */ string memo = 36; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 37; } message ListChannelsRequest { @@ -2028,10 +2039,38 @@ message ChannelOpenUpdate { ChannelPoint channel_point = 1; } +message CloseOutput { + // The amount in satoshi of this close output. This amount is the final + // commitment balance of the channel and the actual amount paid out on chain + // might be smaller due to subtracted fees. + int64 amount_sat = 1; + + // The pkScript of the close output. + bytes pk_script = 2; + + // Whether this output is for the local or remote node. + bool is_local = 3; + + // The TLV encoded custom channel data records for this output, which might + // be set for custom channels. + bytes custom_channel_data = 4; +} + message ChannelCloseUpdate { bytes closing_txid = 1; bool success = 2; + + // The local channel close output. If the local channel balance was dust to + // begin with, this output will not be set. + CloseOutput local_close_output = 3; + + // The remote channel close output. If the remote channel balance was dust + // to begin with, this output will not be set. + CloseOutput remote_close_output = 4; + + // Any additional outputs that might be added for custom channel types. + repeated CloseOutput additional_outputs = 5; } message CloseChannelRequest { @@ -2709,6 +2748,11 @@ message PendingChannelsResponse { impacts the channel's operation. */ string memo = 13; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 34; } message PendingOpenChannel { @@ -2968,6 +3012,12 @@ message ChannelBalanceResponse { // Sum of channels pending remote balances. Amount pending_open_remote_balance = 8; + + /* + Custom channel data that might be populated if there are custom channels + present. + */ + bytes custom_channel_data = 9; } message QueryRoutesRequest { @@ -3293,6 +3343,20 @@ message Route { The total amount in millisatoshis. */ int64 total_amt_msat = 6; + + /* + The actual on-chain amount that was sent out to the first hop. This value is + only different from the total_amt_msat field if this is a custom channel + payment and the value transported in the HTLC is different from the BTC + amount in the HTLC. If this value is zero, then this is an old payment that + didn't have this value yet and can be ignored. + */ + int64 first_hop_amount_msat = 7; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 8; } message NodeInfoRequest { @@ -3922,6 +3986,11 @@ message InvoiceHTLC { // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. AMP amp = 11; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 12; } // Details specific to AMP HTLCs. @@ -4162,6 +4231,12 @@ message Payment { uint64 payment_index = 15; PaymentFailureReason failure_reason = 16; + + /* + The custom TLV records that were sent to the first hop as part of the HTLC + wire message for this payment. + */ + map first_hop_custom_records = 17; } message HTLCAttempt { diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/routerrpc/router.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/routerrpc/router.proto similarity index 89% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/routerrpc/router.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/routerrpc/router.proto index 1856bccbe..92da75192 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/routerrpc/router.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/routerrpc/router.proto @@ -176,6 +176,25 @@ service Router { */ rpc UpdateChanStatus (UpdateChanStatusRequest) returns (UpdateChanStatusResponse); + + /* + XAddLocalChanAliases is an experimental API that creates a set of new + channel SCID alias mappings. The final total set of aliases in the manager + after the add operation is returned. This is only a locally stored alias, + and will not be communicated to the channel peer via any message. Therefore, + routing over such an alias will only work if the peer also calls this same + RPC on their end. If an alias already exists, an error is returned + */ + rpc XAddLocalChanAliases (AddAliasesRequest) returns (AddAliasesResponse); + + /* + XDeleteLocalChanAliases is an experimental API that deletes a set of alias + mappings. The final total set of aliases in the manager after the delete + operation is returned. The deletion will not be communicated to the channel + peer via any message. + */ + rpc XDeleteLocalChanAliases (DeleteAliasesRequest) + returns (DeleteAliasesResponse); } message SendPaymentRequest { @@ -339,6 +358,15 @@ message SendPaymentRequest { being sent. */ bool cancelable = 24; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 25; } message TrackPaymentRequest { @@ -432,6 +460,15 @@ message SendToRouteRequest { routes, incorrect payment details, or insufficient funds. */ bool skip_temp_err = 3; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 4; } message SendToRouteResponse { @@ -707,6 +744,15 @@ message BuildRouteRequest { This is also called payment secret in specifications (e.g. BOLT 11). */ bytes payment_addr = 5; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 6; } message BuildRouteResponse { @@ -963,12 +1009,17 @@ message ForwardHtlcInterceptRequest { // The block height at which this htlc will be auto-failed to prevent the // channel from force-closing. int32 auto_fail_height = 10; + + // The custom records of the peer's incoming p2p wire message. + map in_wire_custom_records = 11; } /** ForwardHtlcInterceptResponse enables the caller to resolve a previously hold forward. The caller can choose either to: - `Resume`: Execute the default behavior (usually forward). +- `ResumeModified`: Execute the default behavior (usually forward) with HTLC + field modifications. - `Reject`: Fail the htlc backwards. - `Settle`: Settle this htlc with a given preimage. */ @@ -999,12 +1050,36 @@ message ForwardHtlcInterceptResponse { // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the // default value for this field. lnrpc.Failure.FailureCode failure_code = 5; + + // The amount that was set on the p2p wire message of the incoming HTLC. + // This field is ignored if the action is not RESUME_MODIFIED or the amount + // is zero. + uint64 in_amount_msat = 6; + + // The amount to set on the p2p wire message of the resumed HTLC. This field + // is ignored if the action is not RESUME_MODIFIED or the amount is zero. + uint64 out_amount_msat = 7; + + // Any custom records that should be set on the p2p wire message message of + // the resumed HTLC. This field is ignored if the action is not + // RESUME_MODIFIED. + map out_wire_custom_records = 8; } enum ResolveHoldForwardAction { + // SETTLE is an action that is used to settle an HTLC instead of forwarding + // it. SETTLE = 0; + + // FAIL is an action that is used to fail an HTLC backwards. FAIL = 1; + + // RESUME is an action that is used to resume a forward HTLC. RESUME = 2; + + // RESUME_MODIFIED is an action that is used to resume a hold forward HTLC + // with modifications specified during interception. + RESUME_MODIFIED = 3; } message UpdateChanStatusRequest { @@ -1021,3 +1096,19 @@ enum ChanStatusAction { message UpdateChanStatusResponse { } + +message AddAliasesRequest { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message AddAliasesResponse { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message DeleteAliasesRequest { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message DeleteAliasesResponse { + repeated lnrpc.AliasMap alias_maps = 1; +} \ No newline at end of file diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/signrpc/signer.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/signrpc/signer.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/signrpc/signer.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/signrpc/signer.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletrpc/walletkit.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletrpc/walletkit.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletunlocker.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletunlocker.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletunlocker.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletunlocker.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/watchtowerrpc/watchtower.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/watchtowerrpc/watchtower.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/watchtowerrpc/watchtower.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/watchtowerrpc/watchtower.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/wtclientrpc/wtclient.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/wtclientrpc/wtclient.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/wtclientrpc/wtclient.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/wtclientrpc/wtclient.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/client.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/client.proto similarity index 75% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/client.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/client.proto index 24c5df3ea..78677826e 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/client.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/client.proto @@ -89,6 +89,12 @@ service SwapClient { */ rpc GetLsatTokens (TokensRequest) returns (TokensResponse); + /* loop: `fetchl402` + FetchL402Token fetches an L402 token from the server, this is required in + order to receive reservation notifications from the server. + */ + rpc FetchL402Token (FetchL402TokenRequest) returns (FetchL402TokenResponse); + /* loop: `getinfo` GetInfo gets basic information about the loop daemon. */ @@ -143,6 +149,51 @@ service SwapClient { */ rpc ListInstantOuts (ListInstantOutsRequest) returns (ListInstantOutsResponse); + + /* loop: `static newstaticaddress` + NewStaticAddress requests a new static address for loop-ins from the server. + */ + rpc NewStaticAddress (NewStaticAddressRequest) + returns (NewStaticAddressResponse); + + /* loop: `static listunspentdeposits` + ListUnspentDeposits returns a list of utxos deposited at a static address. + */ + rpc ListUnspentDeposits (ListUnspentDepositsRequest) + returns (ListUnspentDepositsResponse); + + /* loop:`static withdraw` + WithdrawDeposits withdraws a selection or all deposits of a static address. + */ + rpc WithdrawDeposits (WithdrawDepositsRequest) + returns (WithdrawDepositsResponse); + + /* loop:`listdeposits` + ListStaticAddressDeposits returns a list of filtered static address + deposits. + */ + rpc ListStaticAddressDeposits (ListStaticAddressDepositsRequest) + returns (ListStaticAddressDepositsResponse); + + /* loop:`listswaps` + ListStaticAddressSwaps returns a list of filtered static address + swaps. + */ + rpc ListStaticAddressSwaps (ListStaticAddressSwapsRequest) + returns (ListStaticAddressSwapsResponse); + + /* loop:`static summary` + GetStaticAddressSummary returns a summary of static address related + statistics. + */ + rpc GetStaticAddressSummary (StaticAddressSummaryRequest) + returns (StaticAddressSummaryResponse); + + /* loop:`static` + StaticAddressLoopIn initiates a static address loop-in swap. + */ + rpc StaticAddressLoopIn (StaticAddressLoopInRequest) + returns (StaticAddressLoopInResponse); } message LoopOutRequest { @@ -735,6 +786,13 @@ message QuoteRequest { probing and payment. */ bool private = 7; + + /* + Static address deposit outpoints that will be quoted for. This option only + pertains to loop in swaps. Either this or the amt parameter can be set at + the same time. + */ + repeated string deposit_outpoints = 8; } message InQuoteResponse { @@ -830,6 +888,12 @@ message TokensResponse { repeated L402Token tokens = 1; } +message FetchL402TokenRequest { +} + +message FetchL402TokenResponse { +} + message L402Token { /* The base macaroon that was baked by the auth server. @@ -1326,20 +1390,24 @@ message ClientReservation { The state the reservation is in. */ string state = 2; + /* - The amount that the reservation is for. + The amount that the reservation is for. */ uint64 amount = 3; + /* - The transaction id of the reservation. + The transaction id of the reservation. */ string tx_id = 4; + /* - The vout of the reservation. + The vout of the reservation. */ uint32 vout = 5; + /* - The expiry of the reservation. + The expiry of the reservation. */ uint32 expiry = 6; } @@ -1369,10 +1437,12 @@ message InstantOutResponse { The hash of the swap preimage. */ bytes instant_out_hash = 1; + /* The transaction id of the sweep transaction. */ string sweep_tx_id = 2; + /* The state of the swap. */ @@ -1440,3 +1510,493 @@ message InstantOut { */ string sweep_tx_id = 5; } + +message NewStaticAddressRequest { + /* + The client's public key for the 2-of-2 MuSig2 taproot static address. + */ + bytes client_key = 1; +} + +message NewStaticAddressResponse { + /* + The taproot static address. + */ + string address = 1; + + /* + The CSV expiry of the static address. + */ + uint32 expiry = 2; +} + +message ListUnspentDepositsRequest { + /* + The number of minimum confirmations a utxo must have to be listed. + */ + int32 min_confs = 1; + + /* + The number of maximum confirmations a utxo may have to be listed. A zero + value indicates that there is no maximum. + */ + int32 max_confs = 2; +} + +message ListUnspentDepositsResponse { + /* + A list of utxos behind the static address. + */ + repeated Utxo utxos = 1; +} + +message Utxo { + /* + The static address of the utxo. + */ + string static_address = 1; + + /* + The value of the unspent coin in satoshis. + */ + int64 amount_sat = 2; + + /* + The outpoint in the form txid:index. + */ + string outpoint = 3; + + /* + The number of confirmations for the Utxo. + */ + int64 confirmations = 4; +} + +message WithdrawDepositsRequest { + /* + The outpoints of the deposits to withdraw. + */ + repeated OutPoint outpoints = 1; + + /* + If set to true, all deposits will be withdrawn. + */ + bool all = 2; + + /* + The address to withdraw the funds to. + */ + string dest_addr = 3; + + /* + The fee rate in sat/vbyte to use for the withdrawal transaction. + */ + int64 sat_per_vbyte = 4; +} + +message WithdrawDepositsResponse { + /* + The transaction hash of the withdrawal transaction. + */ + string withdrawal_tx_hash = 1; + + /* + The pkscript of the withdrawal transaction. + */ + string pk_script = 2; +} + +message OutPoint { + /* + Raw bytes representing the transaction id. + */ + bytes txid_bytes = 1; + + /* + Reversed, hex-encoded string representing the transaction id. + */ + string txid_str = 2; + + /* + The index of the output on the transaction. + */ + uint32 output_index = 3; +} + +message ListStaticAddressDepositsRequest { + /* + Filters the list of all stored deposits by deposit state. + */ + DepositState state_filter = 1; + + /* + Filters the list of all stored deposits by the outpoint. + */ + repeated string outpoints = 2; +} + +message ListStaticAddressDepositsResponse { + /* + A list of all deposits that match the filtered state. + */ + repeated Deposit filtered_deposits = 1; +} + +message ListStaticAddressSwapsRequest { +} + +message ListStaticAddressSwapsResponse { + /* + A list of all swaps known static address loop-in swaps. + */ + repeated StaticAddressLoopInSwap swaps = 1; +} + +message StaticAddressSummaryRequest { +} + +message StaticAddressSummaryResponse { + /* + The static address of the client. + */ + string static_address = 1; + + /* + The CSV expiry of the static address. + */ + uint64 relative_expiry_blocks = 2; + + /* + The total number of deposits. + */ + uint32 total_num_deposits = 3; + + /* + The total value of unconfirmed deposits. + */ + int64 value_unconfirmed_satoshis = 4; + + /* + The total value of confirmed deposits. + */ + int64 value_deposited_satoshis = 5; + + /* + The total value of all expired deposits. + */ + int64 value_expired_satoshis = 6; + + /* + The total value of all deposits that have been withdrawn. + */ + int64 value_withdrawn_satoshis = 7; + + /* + The total value of all loop-ins that have been finalized. + */ + int64 value_looped_in_satoshis = 8; + + /* + The total value of all htlc timeout sweeps that the client swept. + */ + int64 value_htlc_timeout_sweeps_satoshis = 9; +} + +enum DepositState { + /* + UNKNOWN_STATE is the default state of a deposit. + */ + UNKNOWN_STATE = 0; + + /* + DEPOSITED indicates that the deposit has been sufficiently confirmed on + chain. + */ + DEPOSITED = 1; + + /* + WITHDRAWING indicates that the deposit is currently being withdrawn. It + flips to WITHDRAWN once the withdrawal transaction has been sufficiently + confirmed. + */ + WITHDRAWING = 2; + + /* + WITHDRAWN indicates that the deposit has been withdrawn. + */ + WITHDRAWN = 3; + + /* + LOOPING_IN indicates that the deposit is currently being used in a static + address loop-in swap. + */ + LOOPING_IN = 4; + + /* + LOOPED_IN indicates that the deposit was used in a static address loop-in + swap. + */ + LOOPED_IN = 5; + + /* + SWEEP_HTLC_TIMEOUT indicates that the deposit is part of an active loop-in + of which the respective htlc was published by the server and the timeout + path has opened up for the client to sweep. + */ + SWEEP_HTLC_TIMEOUT = 6; + + /* + HTLC_TIMEOUT_SWEPT indicates that the timeout path of the htlc has been + swept by the client. + */ + HTLC_TIMEOUT_SWEPT = 7; + + /* + PUBLISH_EXPIRED indicates that the deposit has expired and the sweep + transaction has been published. + */ + PUBLISH_EXPIRED = 8; + + /* + WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep + transaction has not yet been sufficiently confirmed. + */ + WAIT_FOR_EXPIRY_SWEEP = 9; + + /* + EXPIRED indicates that the deposit has expired and the sweep transaction + has been sufficiently confirmed. + */ + EXPIRED = 10; +} + +message Deposit { + /* + The identifier of the deposit. + */ + bytes id = 1; + + /* + The state of the deposit. + */ + DepositState state = 2; + + /* + The outpoint of the deposit in format txid:index. + */ + string outpoint = 3; + + /* + The value of the deposit in satoshis. + */ + int64 value = 4; + + /* + The block height at which the deposit was confirmed. + */ + int64 confirmation_height = 5; + + /* + The number of blocks that are left until the deposit cannot be used for a + loop-in swap anymore. + */ + int64 blocks_until_expiry = 6; +} + +message StaticAddressLoopInSwap { + /* + The swap hash of the swap. It represents the unique identifier of the swap. + */ + bytes swap_hash = 1; + + /* + */ + repeated string deposit_outpoints = 2; + + /* + */ + StaticAddressLoopInSwapState state = 3; + + /* + The swap amount of the swap. It is the sum of the values of the deposit + outpoints that were used for this swap. + */ + int64 swap_amount_satoshis = 4; + + /* + The invoiced swap amount. It is the swap amount minus the quoted server + fees. + */ + int64 payment_request_amount_satoshis = 5; +} + +enum StaticAddressLoopInSwapState { + /* + */ + UNKNOWN_STATIC_ADDRESS_SWAP_STATE = 0; + + /* + */ + INIT_HTLC = 1; + + /* + */ + SIGN_HTLC_TX = 2; + + /* + */ + MONITOR_INVOICE_HTLC_TX = 3; + + /* + */ + PAYMENT_RECEIVED = 4; + + /* + */ + SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT = 5; + + /* + */ + MONITOR_HTLC_TIMEOUT_SWEEP = 6; + + /* + */ + HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT = 7; + + /* + */ + SUCCEEDED = 8; + + /* + */ + SUCCEEDED_TRANSITIONING_FAILED = 9; + + /* + */ + UNLOCK_DEPOSITS = 10; + + /* + */ + FAILED_STATIC_ADDRESS_SWAP = 11; +} + +message StaticAddressLoopInRequest { + /* + The outpoints of the deposits to loop-in. + */ + repeated string outpoints = 1; + + /* + Maximum satoshis we are willing to pay the server for the swap. This value + is not disclosed in the swap initiation call, but if the server asks for a + higher fee, we abort the swap. Typically this value is taken from the + response of the GetQuote call. + */ + int64 max_swap_fee_satoshis = 2; + + /* + Optionally the client can specify the last hop pubkey when requesting a + loop-in quote. This is useful to get better off-chain routing fee from the + server. + */ + bytes last_hop = 3; + + /* + An optional label for this swap. This field is limited to 500 characters and + may not be one of the reserved values in loop/labels Reserved list. + */ + string label = 4; + + /* + An optional identification string that will be appended to the user agent + string sent to the server to give information about the usage of loop. This + initiator part is meant for user interfaces to add their name to give the + full picture of the binary used (loopd, LiT) and the method used for + triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + string initiator = 5; + + /* + Optional route hints to reach the destination through private channels. + */ + repeated looprpc.RouteHint route_hints = 6; + + /* + Private indicates whether the destination node should be considered private. + In which case, loop will generate hop hints to assist with probing and + payment. + */ + bool private = 7; + + /* + The swap payment timeout allows the user to specify an upper limit for the + amount of time the server is allowed to take to fulfill the off-chain swap + payment. If the timeout is reached the swap will be aborted on the server + side and the client can retry the swap with different parameters. + */ + uint32 payment_timeout_seconds = 8; +} + +message StaticAddressLoopInResponse { + /* + The swap hash that identifies this swap. + */ + bytes swap_hash = 1; + + /* + The state the swap is in. + */ + string state = 2; + + /* + The amount of the swap. + */ + uint64 amount = 3; + + /* + The htlc cltv expiry height of the swap. + */ + int32 htlc_cltv = 4; + + /* + The quoted swap fee in satoshis. + */ + int64 quoted_swap_fee_satoshis = 5; + + /* + The maximum total swap fee the client is willing to pay for the swap. + */ + int64 max_swap_fee_satoshis = 6; + + /* + The block height at which the swap was initiated. + */ + uint32 initiation_height = 7; + + /* + The static address protocol version. + */ + string protocol_version = 8; + + /* + An optional label for this swap. + */ + string label = 9; + + /* + An optional identification string that will be appended to the user agent + string sent to the server to give information about the usage of loop. This + initiator part is meant for user interfaces to add their name to give the + full picture of the binary used (loopd, LiT) and the method used for + triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + string initiator = 10; + + /* + The swap payment timeout allows the user to specify an upper limit for the + amount of time the server is allowed to take to fulfill the off-chain swap + payment. If the timeout is reached the swap will be aborted on the server + side and the client can retry the swap with different parameters. + */ + uint32 payment_timeout_seconds = 11; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/debug.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/debug.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/debug.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/debug.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/common.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/common.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/common.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/common.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/server.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/server.proto similarity index 92% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/server.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/server.proto index 9362b8804..23195a874 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/server.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/server.proto @@ -6,6 +6,7 @@ syntax = "proto3"; // different golang and RPC package names to fix protobuf namespace conflicts. package looprpc; import "common.proto"; +import "reservation.proto"; option go_package = "github.com/lightninglabs/loop/swapserverrpc"; @@ -50,6 +51,9 @@ service SwapServer { // FetchL402 is a simple non-l402-allowlisted request that is required // in order to force the creation of an l402. rpc FetchL402 (FetchL402Request) returns (FetchL402Response); + + rpc SubscribeNotifications (SubscribeNotificationsRequest) + returns (stream SubscribeNotificationsResponse); } /** @@ -284,6 +288,12 @@ message ServerLoopInQuoteRequest { // loopd/v0.10.0-beta/commit=3b635821 // litd/v0.2.0-alpha/commit=326d754 string user_agent = 6; + + // The number of static address deposits the client wants to quote for. + // If the number of deposits exceeds one the server will apply a per-input + // service fee. This is to cover for the increased on-chain fee the server + // has to pay when the sweeping transaction is broadcast. + uint32 num_static_address_deposits = 7; } message ServerLoopInQuoteResponse { @@ -514,6 +524,7 @@ message ServerProbeRequest { // The protocol version that the client adheres to. ProtocolVersion protocol_version = 1; + // The probe amount. uint64 amt = 2; // The target node for the probe. @@ -638,18 +649,41 @@ message ServerPushKeyRes { } // FetchL402Request is an empty request sent from the client to the server to -// fetch the lnd l402. +// fetch the lnd L402. message FetchL402Request { } // FetchL402Response is an empty response sent from the server to the client to -// confirm the lnd l402. +// confirm the lnd L402. message FetchL402Response { } -// StaticAddressProtocolVersion represents the static address protocol version -// the client adheres to. -enum StaticAddressProtocolVersion { - // V0 is the initially released static address protocol version. - V0 = 0; -} \ No newline at end of file +// SubscribeNotificationsRequest is a request to subscribe to notifications. +message SubscribeNotificationsRequest { +} + +// SubscribeNotificationsResponse is a response to a +// SubscribeNotificationsRequest. +message SubscribeNotificationsResponse { + oneof notification { + ServerReservationNotification reservation_notification = 1; + ServerStaticLoopInSweepNotification static_loop_in_sweep = 2; + } +} + +// ServerStaticLoopInSweepNotification is a request from the server to the +// client to cosign a transaction that contains deposits from a finished static +// loop ins. +message ServerStaticLoopInSweepNotification { + // The psbt of the sweep transaction. + bytes sweep_tx_psbt = 1; + + // The swap hash the deposits are associated with. + bytes swap_hash = 2; + + // The map of deposit txid:idx to the nonce used by the server. + map deposit_to_nonces = 3; + + // The prevout information of the sweep txn. + repeated PrevoutInfo prevout_info = 4; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/auctioneer.proto similarity index 99% rename from zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/auctioneer.proto index dae9d6bf7..a753511ef 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/auctioneer.proto @@ -373,11 +373,6 @@ enum ChannelType { outputs that pay directly to the channel initiator (the seller). */ SCRIPT_ENFORCED_LEASE = 2; - - /* - A channel type that uses a Pay-to-Taproot output for the funding output. - */ - SIMPLE_TAPROOT = 3; } message ChannelInfo { @@ -902,11 +897,6 @@ enum OrderChannelType { channel initiator/seller. */ ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED = 2; - - /* - A channel type that uses a Pay-to-Taproot output for the funding output. - */ - ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT = 3; } enum AuctionType { diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/hashmail.proto b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/hashmail.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/hashmail.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/hashmail.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/trader.proto b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/trader.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/trader.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/trader.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto deleted file mode 100644 index c73240d76..000000000 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto +++ /dev/null @@ -1,213 +0,0 @@ -syntax = "proto3"; - -import "taprootassets.proto"; - -package assetwalletrpc; - -option go_package = "github.com/lightninglabs/taproot-assets/taprpc/assetwalletrpc"; - -service AssetWallet { - /* - FundVirtualPsbt selects inputs from the available asset commitments to fund - a virtual transaction matching the template. - */ - rpc FundVirtualPsbt (FundVirtualPsbtRequest) - returns (FundVirtualPsbtResponse); - - /* - SignVirtualPsbt signs the inputs of a virtual transaction and prepares the - commitments of the inputs and outputs. - */ - rpc SignVirtualPsbt (SignVirtualPsbtRequest) - returns (SignVirtualPsbtResponse); - - /* - AnchorVirtualPsbts merges and then commits multiple virtual transactions in - a single BTC level anchor transaction. - - TODO(guggero): Actually implement accepting and merging multiple - transactions. - */ - rpc AnchorVirtualPsbts (AnchorVirtualPsbtsRequest) - returns (taprpc.SendAssetResponse); - - /* - NextInternalKey derives the next internal key for the given key family and - stores it as an internal key in the database to make sure it is identified - as a local key later on when importing proofs. While an internal key can - also be used as the internal key of a script key, it is recommended to use - the NextScriptKey RPC instead, to make sure the tweaked Taproot output key - is also recognized as a local key. - */ - rpc NextInternalKey (NextInternalKeyRequest) - returns (NextInternalKeyResponse); - - /* - NextScriptKey derives the next script key (and its corresponding internal - key) and stores them both in the database to make sure they are identified - as local keys later on when importing proofs. - */ - rpc NextScriptKey (NextScriptKeyRequest) returns (NextScriptKeyResponse); - - /* tapcli: `proofs proveownership` - ProveAssetOwnership creates an ownership proof embedded in an asset - transition proof. That ownership proof is a signed virtual transaction - spending the asset with a valid witness to prove the prover owns the keys - that can spend the asset. - */ - rpc ProveAssetOwnership (ProveAssetOwnershipRequest) - returns (ProveAssetOwnershipResponse); - - /* tapcli: `proofs verifyownership` - VerifyAssetOwnership verifies the asset ownership proof embedded in the - given transition proof of an asset and returns true if the proof is valid. - */ - rpc VerifyAssetOwnership (VerifyAssetOwnershipRequest) - returns (VerifyAssetOwnershipResponse); - - /* - RemoveUTXOLease removes the lease/lock/reservation of the given managed - UTXO. - */ - rpc RemoveUTXOLease (RemoveUTXOLeaseRequest) - returns (RemoveUTXOLeaseResponse); -} - -message FundVirtualPsbtRequest { - oneof template { - /* - Use an existing PSBT packet as the template for the funded PSBT. - - TODO(guggero): Actually implement this. We can't use the "reserved" - keyword here because we're in a oneof, so we add the field but implement - it later. - */ - bytes psbt = 1; - - /* - Use the asset outputs and optional asset inputs from this raw template. - */ - TxTemplate raw = 2; - } -} - -message FundVirtualPsbtResponse { - /* - The funded but not yet signed PSBT packet. - */ - bytes funded_psbt = 1; - - /* - The index of the added change output or -1 if no change was left over. - */ - int32 change_output_index = 2; -} - -message TxTemplate { - /* - An optional list of inputs to use. Every input must be an asset UTXO known - to the wallet. The sum of all inputs must be greater than or equal to the - sum of all outputs. - - If no inputs are specified, asset coin selection will be performed instead - and inputs of sufficient value will be added to the resulting PSBT. - */ - repeated PrevId inputs = 1; - - /* - A map of all Taproot Asset addresses mapped to the anchor transaction's - output index that should be sent to. - */ - map recipients = 2; -} - -message PrevId { - /* - The bitcoin anchor output on chain that contains the input asset. - */ - taprpc.OutPoint outpoint = 1; - - /* - The asset ID of the previous asset tree. - */ - bytes id = 2; - - /* - The tweaked Taproot output key committing to the possible spending - conditions of the asset. - */ - bytes script_key = 3; -} - -message SignVirtualPsbtRequest { - /* - The PSBT of the virtual transaction that should be signed. The PSBT must - contain all required inputs, outputs, UTXO data and custom fields required - to identify the signing key. - */ - bytes funded_psbt = 1; -} - -message SignVirtualPsbtResponse { - /* - The signed virtual transaction in PSBT format. - */ - bytes signed_psbt = 1; - - /* - The indices of signed inputs. - */ - repeated uint32 signed_inputs = 2; -} - -message AnchorVirtualPsbtsRequest { - /* - The list of virtual transactions that should be merged and committed to in - the BTC level anchor transaction. - */ - repeated bytes virtual_psbts = 1; -} - -message NextInternalKeyRequest { - uint32 key_family = 1; -} - -message NextInternalKeyResponse { - taprpc.KeyDescriptor internal_key = 1; -} - -message NextScriptKeyRequest { - uint32 key_family = 1; -} - -message NextScriptKeyResponse { - taprpc.ScriptKey script_key = 1; -} - -message ProveAssetOwnershipRequest { - bytes asset_id = 1; - - bytes script_key = 2; - - taprpc.OutPoint outpoint = 3; -} - -message ProveAssetOwnershipResponse { - bytes proof_with_witness = 1; -} - -message VerifyAssetOwnershipRequest { - bytes proof_with_witness = 1; -} - -message VerifyAssetOwnershipResponse { - bool valid_proof = 1; -} - -message RemoveUTXOLeaseRequest { - // The outpoint of the UTXO to remove the lease for. - taprpc.OutPoint outpoint = 1; -} - -message RemoveUTXOLeaseResponse { -} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto deleted file mode 100644 index d632e02e9..000000000 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto +++ /dev/null @@ -1,210 +0,0 @@ -syntax = "proto3"; - -import "taprootassets.proto"; - -package mintrpc; - -option go_package = "github.com/lightninglabs/taproot-assets/taprpc/mintrpc"; - -service Mint { - /* tapcli: `assets mint` - MintAsset will attempt to mint the set of assets (async by default to - ensure proper batching) specified in the request. The pending batch is - returned that shows the other pending assets that are part of the next - batch. This call will block until the operation succeeds (asset is staged - in the batch) or fails. - */ - rpc MintAsset (MintAssetRequest) returns (MintAssetResponse); - - /* tapcli: `assets mint finalize` - FinalizeBatch will attempt to finalize the current pending batch. - */ - rpc FinalizeBatch (FinalizeBatchRequest) returns (FinalizeBatchResponse); - - /* tapcli: `assets mint cancel` - CancelBatch will attempt to cancel the current pending batch. - */ - rpc CancelBatch (CancelBatchRequest) returns (CancelBatchResponse); - - /* tapcli: `assets mint batches` - ListBatches lists the set of batches submitted to the daemon, including - pending and cancelled batches. - */ - rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); -} - -message PendingAsset { - // The version of asset to mint. - taprpc.AssetVersion asset_version = 1; - - // The type of the asset to be created. - taprpc.AssetType asset_type = 2; - - // The name, or "tag" of the asset. This will affect the final asset ID. - string name = 3; - - /* - A blob that resents metadata related to the asset. This will affect the - final asset ID. - */ - taprpc.AssetMeta asset_meta = 4; - - /* - The total amount of units of the new asset that should be created. If the - AssetType is Collectible, then this field cannot be set. - */ - uint64 amount = 5; - - /* - If true, then the asset will be created with a new group key, which allows - for future asset issuance. - */ - bool new_grouped_asset = 6; - - // The specific group key this asset should be minted with. - bytes group_key = 7; - - /* - The name of the asset in the batch that will anchor a new asset group. - This asset will be minted with the same group key as the anchor asset. - */ - string group_anchor = 8; -} - -message MintAsset { - // The version of asset to mint. - taprpc.AssetVersion asset_version = 1; - - // The type of the asset to be created. - taprpc.AssetType asset_type = 2; - - // The name, or "tag" of the asset. This will affect the final asset ID. - string name = 3; - - /* - A blob that resents metadata related to the asset. This will affect the - final asset ID. - */ - taprpc.AssetMeta asset_meta = 4; - - /* - The total amount of units of the new asset that should be created. If the - AssetType is Collectible, then this field cannot be set. - */ - uint64 amount = 5; - - /* - If true, then the asset will be created with a group key, which allows for - future asset issuance. - */ - bool new_grouped_asset = 6; - - /* - If true, then a group key or group anchor can be set to mint this asset into - an existing asset group. - */ - bool grouped_asset = 7; - - // The specific group key this asset should be minted with. - bytes group_key = 8; - - /* - The name of the asset in the batch that will anchor a new asset group. - This asset will be minted with the same group key as the anchor asset. - */ - string group_anchor = 9; -} - -message MintAssetRequest { - /* - The asset to be minted. - */ - MintAsset asset = 1; - - /* - If true, then the assets currently in the batch won't be returned in the - response. This is mainly to avoid a lot of data being transmitted and - possibly printed on the command line in the case of a very large batch. - */ - bool short_response = 2; -} - -message MintAssetResponse { - // The pending batch the asset was added to. - MintingBatch pending_batch = 1; -} - -message MintingBatch { - /* - A public key serialized in compressed format that can be used to uniquely - identify a pending minting batch. Responses that share the same key will be - batched into the same minting transaction. - */ - bytes batch_key = 1; - - /* - The transaction ID of the batch. Only populated if the batch has been - committed. - */ - string batch_txid = 2; - - // The state of the batch. - BatchState state = 3; - - // The assets that are part of the batch. - repeated PendingAsset assets = 4; -} - -enum BatchState { - BATCH_STATE_UNKNOWN = 0; - BATCH_STATE_PENDING = 1; - BATCH_STATE_FROZEN = 2; - BATCH_STATE_COMMITTED = 3; - BATCH_STATE_BROADCAST = 4; - BATCH_STATE_CONFIRMED = 5; - BATCH_STATE_FINALIZED = 6; - BATCH_STATE_SEEDLING_CANCELLED = 7; - BATCH_STATE_SPROUT_CANCELLED = 8; -} - -message FinalizeBatchRequest { - /* - If true, then the assets currently in the batch won't be returned in the - response. This is mainly to avoid a lot of data being transmitted and - possibly printed on the command line in the case of a very large batch. - */ - bool short_response = 1; - - // The optional fee rate to use for the minting transaction, in sat/kw. - uint32 fee_rate = 2; -} - -message FinalizeBatchResponse { - // The finalized batch. - MintingBatch batch = 1; -} - -message CancelBatchRequest { -} - -message CancelBatchResponse { - // The internal public key of the batch. - bytes batch_key = 1; -} - -message ListBatchRequest { - // The optional batch key of the batch to list. - oneof filter { - // The optional batch key of the batch to list, specified as raw bytes - // (gRPC only). - bytes batch_key = 1; - - // The optional batch key of the batch to list, specified as a hex - // encoded string (use this for REST). - string batch_key_str = 2; - } -} - -message ListBatchResponse { - repeated MintingBatch batches = 1; -} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto new file mode 100644 index 000000000..1fac8a5dd --- /dev/null +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto @@ -0,0 +1,480 @@ +syntax = "proto3"; + +import "taprootassets.proto"; + +package assetwalletrpc; + +option go_package = "github.com/lightninglabs/taproot-assets/taprpc/assetwalletrpc"; + +service AssetWallet { + /* + FundVirtualPsbt selects inputs from the available asset commitments to fund + a virtual transaction matching the template. + */ + rpc FundVirtualPsbt (FundVirtualPsbtRequest) + returns (FundVirtualPsbtResponse); + + /* + SignVirtualPsbt signs the inputs of a virtual transaction and prepares the + commitments of the inputs and outputs. + */ + rpc SignVirtualPsbt (SignVirtualPsbtRequest) + returns (SignVirtualPsbtResponse); + + /* + AnchorVirtualPsbts merges and then commits multiple virtual transactions in + a single BTC level anchor transaction. This RPC should be used if the BTC + level anchor transaction of the assets to be spent are encumbered by a + normal key and don't require any special spending conditions. For any custom + spending conditions on the BTC level, the two RPCs CommitVirtualPsbts and + PublishAndLogTransfer should be used instead (which in combination do the + same as this RPC but allow for more flexibility). + */ + rpc AnchorVirtualPsbts (AnchorVirtualPsbtsRequest) + returns (taprpc.SendAssetResponse); + + /* + CommitVirtualPsbts creates the output commitments and proofs for the given + virtual transactions by committing them to the BTC level anchor transaction. + In addition, the BTC level anchor transaction is funded and prepared up to + the point where it is ready to be signed. + */ + rpc CommitVirtualPsbts (CommitVirtualPsbtsRequest) + returns (CommitVirtualPsbtsResponse); + + /* + PublishAndLogTransfer accepts a fully committed and signed anchor + transaction and publishes it to the Bitcoin network. It also logs the + transfer of the given active and passive assets in the database and ships + any outgoing proofs to the counterparties. + */ + rpc PublishAndLogTransfer (PublishAndLogRequest) + returns (taprpc.SendAssetResponse); + + /* + NextInternalKey derives the next internal key for the given key family and + stores it as an internal key in the database to make sure it is identified + as a local key later on when importing proofs. While an internal key can + also be used as the internal key of a script key, it is recommended to use + the NextScriptKey RPC instead, to make sure the tweaked Taproot output key + is also recognized as a local key. + */ + rpc NextInternalKey (NextInternalKeyRequest) + returns (NextInternalKeyResponse); + + /* + NextScriptKey derives the next script key (and its corresponding internal + key) and stores them both in the database to make sure they are identified + as local keys later on when importing proofs. + */ + rpc NextScriptKey (NextScriptKeyRequest) returns (NextScriptKeyResponse); + + /* + QueryInternalKey returns the key descriptor for the given internal key. + */ + rpc QueryInternalKey (QueryInternalKeyRequest) + returns (QueryInternalKeyResponse); + + /* + QueryScriptKey returns the full script key descriptor for the given tweaked + script key. + */ + rpc QueryScriptKey (QueryScriptKeyRequest) returns (QueryScriptKeyResponse); + + /* tapcli: `proofs proveownership` + ProveAssetOwnership creates an ownership proof embedded in an asset + transition proof. That ownership proof is a signed virtual transaction + spending the asset with a valid witness to prove the prover owns the keys + that can spend the asset. + */ + rpc ProveAssetOwnership (ProveAssetOwnershipRequest) + returns (ProveAssetOwnershipResponse); + + /* tapcli: `proofs verifyownership` + VerifyAssetOwnership verifies the asset ownership proof embedded in the + given transition proof of an asset and returns true if the proof is valid. + */ + rpc VerifyAssetOwnership (VerifyAssetOwnershipRequest) + returns (VerifyAssetOwnershipResponse); + + /* + RemoveUTXOLease removes the lease/lock/reservation of the given managed + UTXO. + */ + rpc RemoveUTXOLease (RemoveUTXOLeaseRequest) + returns (RemoveUTXOLeaseResponse); + + /* + DeclareScriptKey declares a new script key to the wallet. This is useful + when the script key contains scripts, which would mean it wouldn't be + recognized by the wallet automatically. Declaring a script key will make any + assets sent to the script key be recognized as being local assets. + */ + rpc DeclareScriptKey (DeclareScriptKeyRequest) + returns (DeclareScriptKeyResponse); +} + +enum CoinSelectType { + /* + Use the default coin selection type, which currently allows script keys and + key spend paths. + */ + COIN_SELECT_DEFAULT = 0; + + /* + Explicitly only select inputs that are known to be BIP-086 compliant (have + a key-spend path only and no script tree). + */ + COIN_SELECT_BIP86_ONLY = 1; + + /* + Allow the selection of inputs that have a script tree spend path as well as + a key spend path. + */ + COIN_SELECT_SCRIPT_TREES_ALLOWED = 2; +} + +message FundVirtualPsbtRequest { + oneof template { + /* + Use an existing PSBT packet as the template for the funded PSBT. + */ + bytes psbt = 1; + + /* + Use the asset outputs and optional asset inputs from this raw template. + */ + TxTemplate raw = 2; + } + + /* + Specify the type of coins that should be selected. Defaults to allowing both + script trees and BIP-086 compliant inputs. + */ + CoinSelectType coin_select_type = 3; +} + +message FundVirtualPsbtResponse { + /* + The funded but not yet signed virtual PSBT packet. + */ + bytes funded_psbt = 1; + + /* + The index of the added change output or -1 if no change was left over. + */ + int32 change_output_index = 2; + + /* + The list of passive virtual transactions that are anchored in the same BTC + level anchor transaction inputs as the funded "active" asset above. These + assets can be ignored when using the AnchorVirtualPsbts RPC, since they are + retrieved, signed and committed automatically in that method. But the + passive assets have to be included in the CommitVirtualPsbts RPC which is + used when custom BTC level anchor transactions are created. + The main difference to the "active" asset above is that the passive assets + will not get their own entry in the transfer table of the database, since + they are just carried along and not directly affected by the direct user + action. + */ + repeated bytes passive_asset_psbts = 3; +} + +message TxTemplate { + /* + An optional list of inputs to use. Every input must be an asset UTXO known + to the wallet. The sum of all inputs must be greater than or equal to the + sum of all outputs. + + If no inputs are specified, asset coin selection will be performed instead + and inputs of sufficient value will be added to the resulting PSBT. + */ + repeated PrevId inputs = 1; + + /* + A map of all Taproot Asset addresses mapped to the anchor transaction's + output index that should be sent to. + */ + map recipients = 2; +} + +message PrevId { + /* + The bitcoin anchor output on chain that contains the input asset. + */ + taprpc.OutPoint outpoint = 1; + + /* + The asset ID of the previous asset tree. + */ + bytes id = 2; + + /* + The tweaked Taproot output key committing to the possible spending + conditions of the asset. + */ + bytes script_key = 3; +} + +message SignVirtualPsbtRequest { + /* + The PSBT of the virtual transaction that should be signed. The PSBT must + contain all required inputs, outputs, UTXO data and custom fields required + to identify the signing key. + */ + bytes funded_psbt = 1; +} + +message SignVirtualPsbtResponse { + /* + The signed virtual transaction in PSBT format. + */ + bytes signed_psbt = 1; + + /* + The indices of signed inputs. + */ + repeated uint32 signed_inputs = 2; +} + +message AnchorVirtualPsbtsRequest { + /* + The list of virtual transactions that should be merged and committed to in + the BTC level anchor transaction. + */ + repeated bytes virtual_psbts = 1; +} + +message CommitVirtualPsbtsRequest { + /* + The list of virtual transactions that should be mapped to the given BTC + level anchor transaction template. The virtual transactions are expected to + be signed (or use ASSET_VERSION_V1 with segregated witness to allow for + signing after committing) and ready to be committed to the anchor + transaction. + */ + repeated bytes virtual_psbts = 1; + + /* + The list of passive virtual transactions that are anchored in the same BTC + level anchor transaction inputs as the "active" assets above. These can be + obtained by calling FundVirtualPsbt and using the passive assets returned. + The virtual transactions are expected to be signed (or use ASSET_VERSION_V1 + with segregated witness to allow for signing after committing) and ready to + be committed to the anchor transaction. + The main difference to the "active" assets above is that the passive assets + will not get their own entry in the transfer table of the database, since + they are just carried along and not directly affected by the direct user + action. + */ + repeated bytes passive_asset_psbts = 2; + + /* + The template of the BTC level anchor transaction that the virtual + transactions should be mapped to. The template is expected to already + contain all asset related inputs and outputs corresponding to the virtual + transactions given above. This can be achieved by using + tapfreighter.PrepareAnchoringTemplate for example. + */ + bytes anchor_psbt = 3; + + oneof anchor_change_output { + /* + Use the existing output within the anchor PSBT with the specified + index as the change output. Any leftover change will be added to the + already specified amount of that output. To add a new change output to + the PSBT, set the "add" field below instead. + */ + int32 existing_output_index = 4; + + /* + Add a new P2TR change output to the PSBT if required. + */ + bool add = 5; + } + + oneof fees { + /* + The target number of blocks that the transaction should be confirmed in. + */ + uint32 target_conf = 6; + + /* + The fee rate, expressed in sat/vbyte, that should be used to fund the + BTC level anchor transaction. + */ + uint64 sat_per_vbyte = 7; + } +} + +message CommitVirtualPsbtsResponse { + /* + The funded BTC level anchor transaction with all outputs updated to commit + to the virtual transactions given. The transaction is ready to be signed, + unless some of the asset inputs don't belong to this daemon, in which case + the anchor input derivation info must be added to those inputs first. + */ + bytes anchor_psbt = 1; + + /* + The updated virtual transactions that now contain the state transition + proofs for being committed to the BTC level anchor transaction above. If the + assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + signed, then the proofs need to be updated to include the witness before + they become fully valid. + */ + repeated bytes virtual_psbts = 2; + + /* + The updated passive virtual transactions that were committed to the same BTC + level anchor transaction as the "active" virtual transactions given. If the + assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + signed, then the proofs need to be updated to include the witness before + they become fully valid. + */ + repeated bytes passive_asset_psbts = 4; + + /* + The index of the (added) change output or -1 if no change was left over. + */ + int32 change_output_index = 5; + + /* + The list of UTXO lock leases that were acquired for the inputs in the funded + PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + inputs that were already present in the PSBT are not locked. + */ + repeated taprpc.OutPoint lnd_locked_utxos = 6; +} + +message PublishAndLogRequest { + /* + The funded BTC level anchor transaction with all outputs updated to commit + to the virtual transactions given. The transaction is ready to be signed, + unless some of the asset inputs don't belong to this daemon, in which case + the anchor input derivation info must be added to those inputs first. + */ + bytes anchor_psbt = 1; + + /* + The updated virtual transactions that contain the state transition proofs + of being committed to the BTC level anchor transaction above. + */ + repeated bytes virtual_psbts = 2; + + /* + The updated passive virtual transactions that contain the state transition + proofs of being committed to the BTC level anchor transaction above. + */ + repeated bytes passive_asset_psbts = 3; + + /* + The index of the (added) change output or -1 if no change was left over. + */ + int32 change_output_index = 4; + + /* + The list of UTXO lock leases that were acquired for the inputs in the funded + PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + inputs that were already present in the PSBT are not locked. + */ + repeated taprpc.OutPoint lnd_locked_utxos = 5; +} + +message NextInternalKeyRequest { + uint32 key_family = 1; +} + +message NextInternalKeyResponse { + taprpc.KeyDescriptor internal_key = 1; +} + +message NextScriptKeyRequest { + uint32 key_family = 1; +} + +message NextScriptKeyResponse { + taprpc.ScriptKey script_key = 1; +} + +message QueryInternalKeyRequest { + // The internal key to look for. This can either be the 32-byte x-only raw + // internal key or the 33-byte raw internal key with the parity byte. + bytes internal_key = 1; +} + +message QueryInternalKeyResponse { + taprpc.KeyDescriptor internal_key = 1; +} + +message QueryScriptKeyRequest { + // The tweaked script key to look for. This can either be the 32-byte + // x-only tweaked script key or the 33-byte tweaked script key with the + // parity byte. + bytes tweaked_script_key = 1; +} + +message QueryScriptKeyResponse { + taprpc.ScriptKey script_key = 1; +} + +message ProveAssetOwnershipRequest { + bytes asset_id = 1; + + bytes script_key = 2; + + taprpc.OutPoint outpoint = 3; + + // An optional 32-byte challenge that may be used to bind the generated + // proof. This challenge needs to be also presented on the + // VerifyAssetOwnership RPC in order to check the proof against it. + bytes challenge = 4; +} + +message ProveAssetOwnershipResponse { + bytes proof_with_witness = 1; +} + +message VerifyAssetOwnershipRequest { + bytes proof_with_witness = 1; + + // An optional 32-byte challenge that may be used to check the ownership + // proof against. This challenge must match the one that the prover used + // on the ProveAssetOwnership RPC. + bytes challenge = 2; +} + +message VerifyAssetOwnershipResponse { + bool valid_proof = 1; + + // The outpoint the proof commits to. + taprpc.OutPoint outpoint = 2; + + // The outpoint in the human-readable form "hash:index". + string outpoint_str = 3; + + // The block hash the output is part of. + bytes block_hash = 4; + + // The block hash as hexadecimal string of the byte-reversed hash. + string block_hash_str = 5; + + // The block height of the block the output is part of. + uint32 block_height = 6; +} + +message RemoveUTXOLeaseRequest { + // The outpoint of the UTXO to remove the lease for. + taprpc.OutPoint outpoint = 1; +} + +message RemoveUTXOLeaseResponse { +} + +message DeclareScriptKeyRequest { + taprpc.ScriptKey script_key = 1; +} + +message DeclareScriptKeyResponse { + taprpc.ScriptKey script_key = 1; +} \ No newline at end of file diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto new file mode 100644 index 000000000..abc446bf7 --- /dev/null +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto @@ -0,0 +1,411 @@ +syntax = "proto3"; + +import "taprootassets.proto"; + +package mintrpc; + +option go_package = "github.com/lightninglabs/taproot-assets/taprpc/mintrpc"; + +service Mint { + /* tapcli: `assets mint` + MintAsset will attempt to mint the set of assets (async by default to + ensure proper batching) specified in the request. The pending batch is + returned that shows the other pending assets that are part of the next + batch. This call will block until the operation succeeds (asset is staged + in the batch) or fails. + */ + rpc MintAsset (MintAssetRequest) returns (MintAssetResponse); + + /* tapcli `assets mint fund` + FundBatch will attempt to fund the current pending batch with a genesis + input, or create a new funded batch if no batch exists yet. This RPC is only + needed if a custom witness is needed to finalize the batch. Otherwise, + FinalizeBatch can be called directly. + */ + rpc FundBatch (FundBatchRequest) returns (FundBatchResponse); + + /* tapcli `assets mint seal` + SealBatch will attempt to seal the current pending batch by creating and + validating asset group witness for all assets in the batch. If a witness + is not provided, a signature will be derived to serve as the witness. This + RPC is only needed if any assets in the batch have a custom asset group key + that require an external signer. Otherwise, FinalizeBatch can be called + directly. + */ + rpc SealBatch (SealBatchRequest) returns (SealBatchResponse); + + /* tapcli: `assets mint finalize` + FinalizeBatch will attempt to finalize the current pending batch. + */ + rpc FinalizeBatch (FinalizeBatchRequest) returns (FinalizeBatchResponse); + + /* tapcli: `assets mint cancel` + CancelBatch will attempt to cancel the current pending batch. + */ + rpc CancelBatch (CancelBatchRequest) returns (CancelBatchResponse); + + /* tapcli: `assets mint batches` + ListBatches lists the set of batches submitted to the daemon, including + pending and cancelled batches. + */ + rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); + + /* tapcli: `events mint` + SubscribeMintEvents allows a caller to subscribe to mint events for asset + creation batches. + */ + rpc SubscribeMintEvents (SubscribeMintEventsRequest) + returns (stream MintEvent); +} + +message PendingAsset { + // The version of asset to mint. + taprpc.AssetVersion asset_version = 1; + + // The type of the asset to be created. + taprpc.AssetType asset_type = 2; + + // The name, or "tag" of the asset. This will affect the final asset ID. + string name = 3; + + /* + A blob that resents metadata related to the asset. This will affect the + final asset ID. + */ + taprpc.AssetMeta asset_meta = 4; + + /* + The total amount of units of the new asset that should be created. If the + AssetType is Collectible, then this field cannot be set. + */ + uint64 amount = 5; + + /* + If true, then the asset will be created with a new group key, which allows + for future asset issuance. + */ + bool new_grouped_asset = 6; + + // The specific existing group key this asset should be minted with. + bytes group_key = 7; + + /* + The name of the asset in the batch that will anchor a new asset group. + This asset will be minted with the same group key as the anchor asset. + */ + string group_anchor = 8; + + /* + The optional key that will be used as the internal key for an asset group + created with this asset. + */ + taprpc.KeyDescriptor group_internal_key = 9; + + /* + The optional root of a tapscript tree that will be used when constructing a + new asset group key. This enables future issuance authorized with a script + witness. + */ + bytes group_tapscript_root = 10; + + /* + The optional script key to use for the new asset. If no script key is given, + a BIP-86 key will be derived from the underlying wallet. + */ + taprpc.ScriptKey script_key = 11; +} + +message UnsealedAsset { + // The pending asset with an unsealed asset group. + PendingAsset asset = 1; + + // The group key request for the asset. + taprpc.GroupKeyRequest group_key_request = 2; + + // The group virtual transaction for the asset. + taprpc.GroupVirtualTx group_virtual_tx = 3; +} + +message MintAsset { + // The version of asset to mint. + taprpc.AssetVersion asset_version = 1; + + // The type of the asset to be created. + taprpc.AssetType asset_type = 2; + + // The name, or "tag" of the asset. This will affect the final asset ID. + string name = 3; + + /* + A blob that resents metadata related to the asset. This will affect the + final asset ID. + */ + taprpc.AssetMeta asset_meta = 4; + + /* + The total amount of units of the new asset that should be created. If the + AssetType is Collectible, then this field cannot be set. + */ + uint64 amount = 5; + + /* + If true, then the asset will be created with a group key, which allows for + future asset issuance. + */ + bool new_grouped_asset = 6; + + /* + If true, then a group key or group anchor can be set to mint this asset into + an existing asset group. + */ + bool grouped_asset = 7; + + // The specific existing group key this asset should be minted with. + bytes group_key = 8; + + /* + The name of the asset in the batch that will anchor a new asset group. + This asset will be minted with the same group key as the anchor asset. + */ + string group_anchor = 9; + + /* + The optional key that will be used as the internal key for an asset group + created with this asset. + */ + taprpc.KeyDescriptor group_internal_key = 10; + + /* + The optional root of a tapscript tree that will be used when constructing a + new asset group key. This enables future issuance authorized with a script + witness. + */ + bytes group_tapscript_root = 11; + + /* + The optional script key to use for the new asset. If no script key is given, + a BIP-86 key will be derived from the underlying wallet. + */ + taprpc.ScriptKey script_key = 12; + + /* + Decimal display dictates the number of decimal places to shift the amount to + the left converting from Taproot Asset integer representation to a + UX-recognizable fractional quantity. + + For example, if the decimal_display value is 2 and there's 100 of those + assets, then a wallet would display the amount as "1.00". This field is + intended as information for wallets that display balances and has no impact + on the behavior of the daemon or any other part of the protocol. This value + is encoded in the MetaData field as a JSON field, therefore it is only + compatible with assets that have a JSON MetaData field. + */ + uint32 decimal_display = 13; +} + +message MintAssetRequest { + /* + The asset to be minted. + */ + MintAsset asset = 1; + + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 2; +} + +message MintAssetResponse { + // The pending batch the asset was added to. + MintingBatch pending_batch = 1; +} + +message MintingBatch { + /* + A public key serialized in compressed format that can be used to uniquely + identify a pending minting batch. Responses that share the same key will be + batched into the same minting transaction. + */ + bytes batch_key = 1; + + /* + The transaction ID of the batch. Only populated if the batch has been + committed. + */ + string batch_txid = 2; + + // The state of the batch. + BatchState state = 3; + + // The assets that are part of the batch. + repeated PendingAsset assets = 4; + + // The time the batch was created as a Unix timestamp (in seconds). + int64 created_at = 5; + + // The current height of the block chain at the time of the batch creation. + uint32 height_hint = 6; + + // The genesis transaction as a PSBT packet. Only populated if the batch has + // been committed. + bytes batch_psbt = 7; +} + +message VerboseBatch { + // The minting batch, without any assets. + MintingBatch batch = 1; + + // The assets that are part of the batch. + repeated UnsealedAsset unsealed_assets = 2; +} + +enum BatchState { + BATCH_STATE_UNKNOWN = 0; + BATCH_STATE_PENDING = 1; + BATCH_STATE_FROZEN = 2; + BATCH_STATE_COMMITTED = 3; + BATCH_STATE_BROADCAST = 4; + BATCH_STATE_CONFIRMED = 5; + BATCH_STATE_FINALIZED = 6; + BATCH_STATE_SEEDLING_CANCELLED = 7; + BATCH_STATE_SPROUT_CANCELLED = 8; +} + +message FundBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The optional fee rate to use for the minting transaction, in sat/kw. + uint32 fee_rate = 2; + + /* + The optional tapscript sibling that will be used when deriving the genesis + output for the batch. This sibling is a tapscript tree, which allows the + minter to encumber future transfers of assets in the batch with Tapscript. + */ + oneof batch_sibling { + /* + An ordered list of TapLeafs, which will be used to construct a + Tapscript tree. + */ + taprpc.TapscriptFullTree full_tree = 3; + + // A TapBranch that represents a Tapscript tree managed externally. + taprpc.TapBranch branch = 4; + } +} + +message FundBatchResponse { + // The funded batch. + MintingBatch batch = 1; +} + +message SealBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The assetID, witness pairs that authorize asset membership in a group. + repeated taprpc.GroupWitness group_witnesses = 2; +} + +message SealBatchResponse { + // The sealed batch. + MintingBatch batch = 1; +} + +message FinalizeBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The optional fee rate to use for the minting transaction, in sat/kw. + uint32 fee_rate = 2; + + /* + The optional tapscript sibling that will be used when deriving the genesis + output for the batch. This sibling is a tapscript tree, which allows the + minter to encumber future transfers of assets in the batch with Tapscript. + */ + oneof batch_sibling { + /* + An ordered list of TapLeafs, which will be used to construct a + Tapscript tree. + */ + taprpc.TapscriptFullTree full_tree = 3; + + // A TapBranch that represents a Tapscript tree managed externally. + taprpc.TapBranch branch = 4; + } +} + +message FinalizeBatchResponse { + // The finalized batch. + MintingBatch batch = 1; +} + +message CancelBatchRequest { +} + +message CancelBatchResponse { + // The internal public key of the batch. + bytes batch_key = 1; +} + +message ListBatchRequest { + // The optional batch key of the batch to list. + oneof filter { + // The optional batch key of the batch to list, specified as raw bytes + // (gRPC only). + bytes batch_key = 1; + + // The optional batch key of the batch to list, specified as a hex + // encoded string (use this for REST). + string batch_key_str = 2; + } + + // If true, pending asset group information will be shown for the pending + // batch. + bool verbose = 3; +} + +message ListBatchResponse { + repeated VerboseBatch batches = 1; +} + +message SubscribeMintEventsRequest { + /* + If true, then the assets currently in the batch won't be returned in the + event's batch. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; +} + +message MintEvent { + // Execute timestamp (Unix timestamp in microseconds). + int64 timestamp = 1; + + // The last state of the batch that was successfully executed. If error + // below is set, then the batch_state is the state that lead to the error + // during its execution. + BatchState batch_state = 2; + + // The batch that the event is for. + MintingBatch batch = 3; + + // An optional error, indicating that executing the batch_state failed. + string error = 4; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/taprootassets.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/taprootassets.proto similarity index 63% rename from zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/taprootassets.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/taprootassets.proto index 18ec0311a..84d54e767 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/taprootassets.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/taprootassets.proto @@ -104,30 +104,37 @@ service TaprootAssets { */ rpc BurnAsset (BurnAssetRequest) returns (BurnAssetResponse); + /* tapcli: `assets listburns` + ListBurns lists the asset burns that this wallet has performed. These assets + are not recoverable in any way. Filters may be applied to return more + specific results. + */ + rpc ListBurns (ListBurnsRequest) returns (ListBurnsResponse); + /* tapcli: `getinfo` GetInfo returns the information for the node. */ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); - /* - SubscribeSendAssetEventNtfns registers a subscription to the event - notification stream which relates to the asset sending process. - */ - rpc SubscribeSendAssetEventNtfns (SubscribeSendAssetEventNtfnsRequest) - returns (stream SendAssetEvent); - - /* - SubscribeReceiveAssetEventNtfns registers a subscription to the event - notification stream which relates to the asset receive process. - */ - rpc SubscribeReceiveAssetEventNtfns (SubscribeReceiveAssetEventNtfnsRequest) - returns (stream ReceiveAssetEvent); - /* tapcli: `assets meta` FetchAssetMeta allows a caller to fetch the reveal meta data for an asset either by the asset ID for that asset, or a meta hash. */ rpc FetchAssetMeta (FetchAssetMetaRequest) returns (AssetMeta); + + /* tapcli: `events receive` + SubscribeReceiveEvents allows a caller to subscribe to receive events for + incoming asset transfers. + */ + rpc SubscribeReceiveEvents (SubscribeReceiveEventsRequest) + returns (stream ReceiveEvent); + + /* tapcli: `events send` + SubscribeSendEvents allows a caller to subscribe to send events for outgoing + asset transfers. + */ + rpc SubscribeSendEvents (SubscribeSendEventsRequest) + returns (stream SendEvent); } enum AssetType { @@ -152,6 +159,12 @@ enum AssetMetaType { should be interpreted as opaque blobs. */ META_TYPE_OPAQUE = 0; + + /* + JSON is used for asset meta blobs that are to be interpreted as valid JSON + strings. + */ + META_TYPE_JSON = 1; } message AssetMeta { @@ -176,6 +189,13 @@ message ListAssetRequest { bool with_witness = 1; bool include_spent = 2; bool include_leased = 3; + + // List assets that aren't confirmed yet. Only freshly minted assets will + // show in the asset list with a block height of 0. All other forms of + // unconfirmed assets will not appear in the list until the transaction is + // confirmed (check either transfers or receives for unconfirmed outbound or + // inbound assets). + bool include_unconfirmed_mints = 4; } message AnchorInfo { @@ -233,9 +253,77 @@ message GenesisInfo { the genesis transaction. */ uint32 output_index = 6; +} + +message GroupKeyRequest { + // The internal key for the asset group before any tweaks have been applied. + KeyDescriptor raw_key = 1; + + /* + The genesis of the group anchor asset, which is used to derive the single + tweak for the group key. For a new group key, this will be the genesis of + new_asset. + */ + GenesisInfo anchor_genesis = 2; + + /* + The optional root of a tapscript tree that will be used when constructing a + new asset group key. This enables future issuance authorized with a script + witness. + */ + bytes tapscript_root = 3; - // The version of the Taproot Asset commitment that created this asset. - int32 version = 7; + /* + The serialized asset which we are requesting group membership for. A + successful request will produce a witness that authorizes this asset to be a + member of this asset group. + */ + bytes new_asset = 4; +} + +message TxOut { + // The value of the output being spent. + int64 value = 1; + + // The script of the output being spent. + bytes pk_script = 2; +} + +message GroupVirtualTx { + /* + The virtual transaction that represents the genesis state transition of a + grouped asset. + */ + bytes transaction = 1; + + /* + The transaction output that represents a grouped asset. The tweaked + group key is set as the PkScript of this output. This is used in combination + with Tx to produce an asset group witness. + */ + TxOut prev_out = 2; + + /* + The asset ID of the grouped asset in a GroupKeyRequest. This ID is + needed to construct a sign descriptor, as it is the single tweak for the + group internal key. + */ + bytes genesis_id = 3; + + /* + The tweaked group key for a specific GroupKeyRequest. This is used to + construct a complete group key after producing an asset group witness. + */ + bytes tweaked_key = 4; +} + +message GroupWitness { + // The asset ID of the pending asset that should be assigned this asset + // group witness. + bytes genesis_id = 1; + + // The serialized witness stack for the asset group. + repeated bytes witness = 2; } message AssetGroup { @@ -254,7 +342,11 @@ message AssetGroup { */ bytes asset_witness = 3; - // TODO(jhb): update to include tapscript_root + /* + The root hash of a tapscript tree, which enables future issuance authorized + with a script witness. + */ + bytes tapscript_root = 4; } message GroupKeyReveal { @@ -270,6 +362,22 @@ message GenesisReveal { GenesisInfo genesis_base_reveal = 1; } +message DecimalDisplay { + /* + Decimal display dictates the number of decimal places to shift the amount to + the left converting from Taproot Asset integer representation to a + UX-recognizable fractional quantity. + + For example, if the decimal_display value is 2 and there's 100 of those + assets, then a wallet would display the amount as "1.00". This field is + intended as information for wallets that display balances and has no impact + on the behavior of the daemon or any other part of the protocol. This value + is encoded in the MetaData field as a JSON field, therefore it is only + compatible with assets that have a JSON MetaData field. + */ + uint32 decimal_display = 1; +} + enum AssetVersion { // ASSET_VERSION_V0 is the default asset version. This version will include // the witness vector in the leaf for a tap commitment. @@ -328,6 +436,29 @@ message Asset { // Indicates whether this transfer was an asset burn. If true, the number of // assets in this output are destroyed and can no longer be spent. bool is_burn = 17; + + // Indicates whether this script key has either been derived by the local + // wallet or was explicitly declared to be known by using the + // DeclareScriptKey RPC. Knowing the key conceptually means the key belongs + // to the local wallet or is at least known by a software that operates on + // the local wallet. The flag is never serialized in proofs, so this is + // never explicitly set for keys foreign to the local wallet. Therefore, if + // this method returns true for a script key, it means the asset with the + // script key will be shown in the wallet balance. + bool script_key_declared_known = 18; + + // Indicates whether the script key is known to have a Tapscript spend path, + // meaning that the Taproot merkle root tweak is not empty. This will only + // ever be true if either script_key_is_local or script_key_internals_known + // is true as well, since the presence of a Tapscript spend path cannot be + // determined for script keys that aren't known to the wallet of the local + // tapd node. + bool script_key_has_script_path = 19; + + // This field defines a decimal display value that may be present. If this + // field is null, it means the presence of a decimal display field is + // unknown in the current context. + DecimalDisplay decimal_display = 20; } message PrevWitness { @@ -344,6 +475,15 @@ message SplitCommitment { message ListAssetResponse { repeated Asset assets = 1; + + // This is a count of unconfirmed outgoing transfers. Unconfirmed transfers + // do not appear as assets in this endpoint response. + uint64 unconfirmed_transfers = 2; + + // This is a count of freshly minted assets that haven't been confirmed on + // chain yet. These assets will appear in the asset list with a block height + // of 0 if include_unconfirmed_mints is set to true in the request. + uint64 unconfirmed_mints = 3; } message ListUtxosRequest { @@ -372,6 +512,13 @@ message ManagedUtxo { // The assets held at this UTXO. repeated Asset assets = 6; + + // The lease owner for this UTXO. If blank the UTXO isn't leased. + bytes lease_owner = 7; + + // The expiry time as a unix time stamp for this lease. If blank the utxo + // isn't leased. + int64 lease_expiry_unix = 8; } message ListUtxosResponse { @@ -435,6 +582,9 @@ message ListBalancesRequest { // group key filter may be provided to query the balance of a specific // asset group. bytes group_key_filter = 4; + + // An option to include previous leased assets in the balances. + bool include_leased = 5; } message AssetBalance { @@ -460,6 +610,10 @@ message ListBalancesResponse { } message ListTransfersRequest { + // anchor_txid specifies the hexadecimal encoded txid string of the anchor + // transaction for which to retrieve transfers. An empty value indicates + // that this parameter should be disregarded in transfer selection. + string anchor_txid = 1; } message ListTransfersResponse { @@ -467,6 +621,28 @@ message ListTransfersResponse { repeated AssetTransfer transfers = 1; } +// ChainHash represents a hash value, typically a double SHA-256 of some data. +// Common examples include block hashes and transaction hashes. +// +// This versatile message type is used in various Bitcoin-related messages and +// structures, providing two different formats of the same hash to accommodate +// both developer and user needs. +message ChainHash { + // The raw hash value in byte format. + // + // This format is optimized for programmatic use, particularly for Go + // developers, enabling easy integration with other RPC calls or binary + // operations. + bytes hash = 1; + + // The byte-reversed hash value as a hexadecimal string. + // + // This format is intended for human interaction, making it easy to copy, + // paste, and use in contexts like command-line arguments or configuration + // files. + string hash_str = 2; +} + message AssetTransfer { int64 transfer_timestamp = 1; @@ -483,6 +659,11 @@ message AssetTransfer { // Describes the set of newly created asset outputs. repeated TransferOutput outputs = 6; + + // The block hash of the blockchain block that contains the anchor + // transaction. If this value is unset, the anchor transaction is + // unconfirmed. + ChainHash anchor_tx_block_hash = 7; } message TransferInput { @@ -529,24 +710,26 @@ enum OutputType { // output. In either case, the asset of this output has a tx witness. OUTPUT_TYPE_SPLIT_ROOT = 1; - // OUTPUT_TYPE_PASSIVE_ASSETS_ONLY indicates that this output only carries - // passive assets and therefore the asset in this output is nil. The passive - // assets themselves are signed in their own virtual transactions and - // are not present in this packet. - OUTPUT_TYPE_PASSIVE_ASSETS_ONLY = 2; + reserved 2; - // OUTPUT_TYPE_PASSIVE_SPLIT_ROOT is a split root output that carries the - // change from a split or a tombstone from a non-interactive full value send - // output, as well as passive assets. - OUTPUT_TYPE_PASSIVE_SPLIT_ROOT = 3; + reserved 3; - // OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS is a plain full-value interactive send - // output that also carries passive assets. This is a special case where we - // send the full value of a single asset in a commitment to a new script - // key, but also carry passive assets in the same output. This is useful for - // key rotation (send-to-self) scenarios or asset burns where we burn the - // full supply of a single asset within a commitment. - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS = 4; + reserved 4; +} + +// ProofDeliveryStatus is an enum that describes the status of the delivery of +// a proof associated with an asset transfer output. +enum ProofDeliveryStatus { + // Delivery is not applicable; the proof will not be delivered. + PROOF_DELIVERY_STATUS_NOT_APPLICABLE = 0; + + // The proof has been successfully delivered. + PROOF_DELIVERY_STATUS_COMPLETE = 1; + + // The proof is pending delivery. This status indicates that the proof has + // not yet been delivered successfully. One or more attempts at proof + // delivery may have been made. + PROOF_DELIVERY_STATUS_PENDING = 2; } message TransferOutput { @@ -567,6 +750,13 @@ message TransferOutput { OutputType output_type = 7; AssetVersion asset_version = 8; + + uint64 lock_time = 9; + + uint64 relative_lock_time = 10; + + // The delivery status of the proof associated with this output. + ProofDeliveryStatus proof_delivery_status = 11; } message StopRequest { @@ -585,6 +775,19 @@ message DebugLevelResponse { string sub_systems = 1; } +enum AddrVersion { + // ADDR_VERSION_UNSPECIFIED is the default value for an address version in + // an RPC message. It is unmarshalled to the latest address version. + ADDR_VERSION_UNSPECIFIED = 0; + + // ADDR_VERSION_V0 is the initial address version. + ADDR_VERSION_V0 = 1; + + // ADDR_VERSION_V1 is the address version that uses V2 Taproot Asset + // commitments. + ADDR_VERSION_V1 = 2; +} + message Addr { // The bech32 encoded Taproot Asset address. string encoded = 1; @@ -630,6 +833,9 @@ message Addr { // The asset version of the address. AssetVersion asset_version = 11; + + // The version of the address. + AddrVersion address_version = 12; } message QueryAddrRequest { @@ -699,6 +905,11 @@ message NewAddrRequest { The asset version to use when sending/receiving to/from this address. */ AssetVersion asset_version = 7; + + /* + The version of this address. + */ + AddrVersion address_version = 8; } message ScriptKey { @@ -745,6 +956,26 @@ message KeyDescriptor { KeyLocator key_loc = 2; } +message TapscriptFullTree { + /* + The complete, ordered list of all tap leaves of the tree. + */ + repeated TapLeaf all_leaves = 1; +} + +message TapLeaf { + // The script of the tap leaf. + bytes script = 2; +} + +message TapBranch { + // The TapHash of the left child of the root hash of a Tapscript tree. + bytes left_taphash = 1; + + // The TapHash of the right child of the root hash of a Tapscript tree. + bytes right_taphash = 2; +} + message DecodeAddrRequest { string addr = 1; } @@ -947,83 +1178,6 @@ message GetInfoResponse { bool sync_to_chain = 8; } -message SubscribeSendAssetEventNtfnsRequest { -} - -message SendAssetEvent { - oneof event { - // An event which indicates that a send state is about to be executed. - ExecuteSendStateEvent execute_send_state_event = 1; - - // An event which indicates that the proof transfer backoff wait period - // will start imminently. - ProofTransferBackoffWaitEvent proof_transfer_backoff_wait_event = 2; - } -} - -message ExecuteSendStateEvent { - // Execute timestamp (microseconds). - int64 timestamp = 1; - - // The send state that is about to be executed. - string send_state = 2; -} - -// ProofTransferType is the type of proof transfer attempt. The transfer is -// either a proof delivery to the transfer counterparty or receiving a proof -// from the transfer counterparty. Note that the transfer counterparty is -// usually the proof courier service. -enum ProofTransferType { - // This value indicates that the proof transfer attempt is a delivery to the - // transfer counterparty. - PROOF_TRANSFER_TYPE_SEND = 0; - - // This value indicates that the proof transfer attempt is a receive from - // the transfer counterparty. - PROOF_TRANSFER_TYPE_RECEIVE = 1; -} - -message ProofTransferBackoffWaitEvent { - // Transfer attempt timestamp (microseconds). - int64 timestamp = 1; - - // Backoff is the active backoff wait duration. - int64 backoff = 2; - - // Tries counter is the number of tries we've made so far during the - // course of the current backoff procedure to deliver the proof to the - // receiver. - int64 tries_counter = 3; - - // The type of proof transfer attempt. - ProofTransferType transfer_type = 4; -} - -message SubscribeReceiveAssetEventNtfnsRequest { -} - -message AssetReceiveCompleteEvent { - // Event creation timestamp. - int64 timestamp = 1; - - // The address that received the asset. - Addr address = 2; - - // The outpoint of the transaction that was used to receive the asset. - string outpoint = 3; -} - -message ReceiveAssetEvent { - oneof event { - // An event which indicates that the proof transfer backoff wait period - // will start imminently. - ProofTransferBackoffWaitEvent proof_transfer_backoff_wait_event = 1; - - // An event which indicates that an asset receive process has finished. - AssetReceiveCompleteEvent asset_receive_complete_event = 2; - } -} - message FetchAssetMetaRequest { oneof asset { // The asset ID of the asset to fetch the meta for. @@ -1055,6 +1209,9 @@ message BurnAssetRequest { // the burn. This needs to be set to the value "assets will be destroyed" // for the burn to succeed. string confirmation_text = 4; + + // A note that may contain user defined metadata related to this burn. + string note = 5; } message BurnAssetResponse { @@ -1065,6 +1222,38 @@ message BurnAssetResponse { DecodedProof burn_proof = 2; } +message ListBurnsRequest { + // The asset id of the burnt asset. + bytes asset_id = 1; + + // The tweaked group key of the group this asset belongs to. + bytes tweaked_group_key = 3; + + // The txid of the transaction that the burn was anchored to. + bytes anchor_txid = 4; +} + +message AssetBurn { + // A note that may contain user defined metadata related to this burn. + string note = 1; + + // The asset id of the burnt asset. + bytes asset_id = 2; + + // The tweaked group key of the group this asset belongs to. + bytes tweaked_group_key = 3; + + // The amount of burnt assets. + uint64 amount = 4; + + // The txid of the transaction that the burn was anchored to. + bytes anchor_txid = 5; +} + +message ListBurnsResponse { + repeated AssetBurn burns = 1; +} + message OutPoint { /* Raw bytes representing the transaction id. @@ -1076,3 +1265,168 @@ message OutPoint { */ uint32 output_index = 2; } + +message SubscribeReceiveEventsRequest { + // Filter receives by a specific address. Leave empty to get all receive + // events for all addresses. + string filter_addr = 1; + + // The start time as a Unix timestamp in microseconds. If not set (default + // value 0), the daemon will start streaming events from the current time. + int64 start_timestamp = 2; +} + +message ReceiveEvent { + // Event creation timestamp (Unix timestamp in microseconds). + int64 timestamp = 1; + + // The address that received the asset. + taprpc.Addr address = 2; + + // The outpoint of the transaction that was used to receive the asset. + string outpoint = 3; + + // The status of the event. If error below is set, then the status is the + // state that lead to the error during its execution. + AddrEventStatus status = 4; + + // The height of the block the asset receive transaction was mined in. This + // is only set if the status is ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED or + // later. + uint32 confirmation_height = 5; + + // An optional error, indicating that executing the status above failed. + string error = 6; +} + +message SubscribeSendEventsRequest { + // Filter send events by a specific recipient script key. Leave empty to get + // all receive events for all parcels. + bytes filter_script_key = 1; +} + +enum SendState { + // Input coin selection to pick out which asset inputs should be spent is + // executed during this state. + SEND_STATE_VIRTUAL_INPUT_SELECT = 0; + + // The virtual transaction is signed during this state. + SEND_STATE_VIRTUAL_SIGN = 1; + + // The Bitcoin anchor transaction is signed during this state. + SEND_STATE_ANCHOR_SIGN = 2; + + // The outbound packet is written to the database during this state, + // including the partial proof suffixes. Only parcels that complete this + // state can be resumed on restart. + SEND_STATE_LOG_COMMITMENT = 3; + + // The Bitcoin anchor transaction is broadcast to the network during this + // state. + SEND_STATE_BROADCAST = 4; + + // The on-chain anchor transaction needs to reach at least 1 confirmation. + // This state waits for the confirmation. + SEND_STATE_WAIT_CONFIRMATION = 5; + + // The anchor transaction was confirmed in a block and the full proofs can + // now be constructed during this stage. + SEND_STATE_STORE_PROOFS = 6; + + // The full proofs are sent to the recipient(s) with the proof courier + // service during this state. + SEND_STATE_TRANSFER_PROOFS = 7; + + // The send state machine has completed the send process. + SEND_STATE_COMPLETED = 8; +} + +enum ParcelType { + // The parcel is an address parcel. + PARCEL_TYPE_ADDRESS = 0; + + // The parcel type is a pre-signed parcel where the virtual transactions are + // signed outside of the send state machine. Parcels of this type will only + // get send states starting from SEND_STATE_ANCHOR_SIGN. + PARCEL_TYPE_PRE_SIGNED = 1; + + // The parcel is pending and was resumed on the latest restart of the + // daemon. The original parcel type (address or pre-signed) is not known + // anymore, as it's not relevant for the remaining steps. Parcels of this + // type will only get send states starting from SEND_STATE_BROADCAST. + PARCEL_TYPE_PENDING = 2; + + // The parcel type is a pre-anchored parcel where the full anchor + // transaction and all proofs are already available. Parcels of this type + // will only get send states starting from SEND_STATE_LOG_COMMITMENT. + PARCEL_TYPE_PRE_ANCHORED = 3; +} + +message SendEvent { + // Execute timestamp (Unix timestamp in microseconds). + int64 timestamp = 1; + + // The send state that was executed successfully. If error below is set, + // then the send_state is the state that lead to the error during its + // execution. + string send_state = 2; + + // The type of the outbound send parcel. + ParcelType parcel_type = 3; + + // The list of addresses the parcel sends to (recipient addresses only, not + // including change going back to own wallet). This is only set for parcels + // of type PARCEL_TYPE_ADDRESS. + repeated taprpc.Addr addresses = 4; + + // The virtual packets that are part of the parcel. + repeated bytes virtual_packets = 5; + + // The passive virtual packets that are carried along with the parcel. This + // is empty if there were no other assets in the input commitment that is + // being spent with the "active" virtual packets above. + repeated bytes passive_virtual_packets = 6; + + // The Bitcoin on-chain anchor transaction that commits the sent assets + // on-chain. This is only set after the send state SEND_STATE_ANCHOR_SIGN. + AnchorTransaction anchor_transaction = 7; + + // The final transfer as it will be stored in the database. This is only set + // after the send state SEND_STATE_LOG_COMMITMENT. + AssetTransfer transfer = 8; + + // An optional error, indicating that executing the send_state failed. + string error = 9; +} + +message AnchorTransaction { + bytes anchor_psbt = 1; + + /* + The index of the (added) change output or -1 if no change was left over. + */ + int32 change_output_index = 2; + + /* + The total number of satoshis in on-chain fees paid by the anchor + transaction. + */ + int64 chain_fees_sats = 3; + + /* + The fee rate in sat/kWU that was targeted by the anchor transaction. + */ + int32 target_fee_rate_sat_kw = 4; + + /* + The list of UTXO lock leases that were acquired for the inputs in the funded + PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + inputs that were already present in the PSBT are not locked. + */ + repeated taprpc.OutPoint lnd_locked_utxos = 5; + + /* + The final, signed anchor transaction that was broadcast to the network. + */ + bytes final_tx = 6; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/universerpc/universe.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/universerpc/universe.proto similarity index 91% rename from zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/universerpc/universe.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/universerpc/universe.proto index 20db15825..f719fb9f2 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/universerpc/universe.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/universerpc/universe.proto @@ -7,6 +7,13 @@ package universerpc; option go_package = "github.com/lightninglabs/taproot-assets/taprpc/universerpc"; service Universe { + /* tapcli: `universe multiverse` + MultiverseRoot returns the root of the multiverse tree. This is useful to + determine the equality of two multiverse trees, since the root can directly + be compared to another multiverse root to find out if a sync is required. + */ + rpc MultiverseRoot (MultiverseRootRequest) returns (MultiverseRootResponse); + /* tapcli: `universe roots` AssetRoots queries for the known Universe roots associated with each known asset. These roots represent the supply/audit state for each known asset. @@ -65,6 +72,13 @@ service Universe { */ rpc InsertProof (AssetProof) returns (AssetProofResponse); + /* tapcli: `universe proofs push` + PushProof attempts to query the local universe for a proof specified by a + UniverseKey. If found, a connection is made to a remote Universe server to + attempt to upload the asset leaf. + */ + rpc PushProof (PushProofRequest) returns (PushProofResponse); + // TODO(roasbeef): rename resp to UniverseStateUpdate? ^ /* tapcli: `universe info` @@ -142,6 +156,22 @@ service Universe { returns (QueryFederationSyncConfigResponse); } +message MultiverseRootRequest { + // The proof type to calculate the multiverse root for. + ProofType proof_type = 1; + + // An optional list of universe IDs to include in the multiverse root. If + // none are specified, then all known universes of the given proof type are + // included. NOTE: The proof type within the IDs must either be unspecified + // or match the proof type above. + repeated ID specific_ids = 2; +} + +message MultiverseRootResponse { + // The root of the multiverse tree. + MerkleSumNode multiverse_root = 1; +} + message AssetRootRequest { // If true, then the response will include the amounts for each asset ID // of grouped assets. @@ -317,7 +347,7 @@ message UniverseKey { } message AssetProofResponse { - // The request original request for the issuance proof. + // The original request for the issuance proof. UniverseKey req = 1; // The Universe root that includes this asset leaf. @@ -347,6 +377,19 @@ message AssetProof { AssetLeaf asset_leaf = 4; } +message PushProofRequest { + // The ID of the asset to push the proof for. + UniverseKey key = 1; + + // The universe server to push the proof to. + UniverseFederationServer server = 2; +} + +message PushProofResponse { + // The ID of the asset a push was requested for. + UniverseKey key = 1; +} + message InfoRequest { }