From 29849cade62d861bd7b115174cf0edfccbf16133 Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Wed, 5 Oct 2022 17:21:25 -0400 Subject: [PATCH] Update protos for 0.1.12-alpha release --- lib/types/proto/faraday/faraday.ts | 21 +- lib/types/proto/lnd/chainrpc/chainnotifier.ts | 14 +- lib/types/proto/lnd/invoicesrpc/invoices.ts | 11 +- lib/types/proto/lnd/lightning.ts | 217 +++++- lib/types/proto/lnd/routerrpc/router.ts | 31 +- lib/types/proto/lnd/signrpc/signer.ts | 360 +++++++++- lib/types/proto/lnd/walletrpc/walletkit.ts | 34 +- lib/types/proto/loop/client.ts | 4 + .../proto/pool/auctioneerrpc/auctioneer.ts | 16 + lib/types/proto/pool/trader.ts | 10 + package-lock.json | 128 +++- package.json | 10 +- .../faraday.proto | 22 +- protos/lnd/v0.14.3-beta/signrpc/signer.proto | 250 ------- .../autopilotrpc/autopilot.proto | 0 .../chainrpc/chainnotifier.proto | 14 +- .../invoicesrpc/invoices.proto | 7 +- .../lightning.proto | 251 ++++++- .../routerrpc/router.proto | 31 +- protos/lnd/v0.15.1-beta/signrpc/signer.proto | 640 ++++++++++++++++++ .../walletrpc/walletkit.proto | 41 +- .../walletunlocker.proto | 0 .../watchtowerrpc/watchtower.proto | 0 .../wtclientrpc/wtclient.proto | 0 .../client.proto | 6 + .../debug.proto | 0 .../swapserverrpc/common.proto | 0 .../swapserverrpc/server.proto | 32 + .../auctioneerrpc/auctioneer.proto | 15 + .../auctioneerrpc/hashmail.proto | 0 .../trader.proto | 8 + 31 files changed, 1826 insertions(+), 347 deletions(-) rename protos/faraday/{v0.2.5-alpha => v0.2.8-alpha}/faraday.proto (95%) delete mode 100644 protos/lnd/v0.14.3-beta/signrpc/signer.proto rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/autopilotrpc/autopilot.proto (100%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/chainrpc/chainnotifier.proto (89%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/invoicesrpc/invoices.proto (95%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/lightning.proto (94%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/routerrpc/router.proto (95%) create mode 100644 protos/lnd/v0.15.1-beta/signrpc/signer.proto rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/walletrpc/walletkit.proto (95%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/walletunlocker.proto (100%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/watchtowerrpc/watchtower.proto (100%) rename protos/lnd/{v0.14.3-beta => v0.15.1-beta}/wtclientrpc/wtclient.proto (100%) rename protos/loop/{v0.19.1-beta => v0.20.1-beta}/client.proto (99%) rename protos/loop/{v0.19.1-beta => v0.20.1-beta}/debug.proto (100%) rename protos/loop/{v0.19.1-beta => v0.20.1-beta}/swapserverrpc/common.proto (100%) rename protos/loop/{v0.19.1-beta => v0.20.1-beta}/swapserverrpc/server.proto (95%) rename protos/pool/{v0.5.6-alpha => v0.5.8-alpha}/auctioneerrpc/auctioneer.proto (98%) rename protos/pool/{v0.5.6-alpha => v0.5.8-alpha}/auctioneerrpc/hashmail.proto (100%) rename protos/pool/{v0.5.6-alpha => v0.5.8-alpha}/trader.proto (99%) diff --git a/lib/types/proto/faraday/faraday.ts b/lib/types/proto/faraday/faraday.ts index 49928e6..8ebad6f 100644 --- a/lib/types/proto/faraday/faraday.ts +++ b/lib/types/proto/faraday/faraday.ts @@ -32,6 +32,14 @@ export enum FiatBackend { * https://api.coindesk.com/v1/bpi/historical/close.json */ COINDESK = 'COINDESK', + /** CUSTOM - Use custom price data provided in a CSV file for fiat price information. */ + CUSTOM = 'CUSTOM', + /** + * COINGECKO - Use the CoinGecko API for fiat price information. + * This API is reached through the following URL: + * https://api.coingecko.com/api/v3/coins/bitcoin/market_chart + */ + COINGECKO = 'COINGECKO', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -298,6 +306,8 @@ export interface ExchangeRateRequest { granularity: Granularity; /** The api to be used for fiat related queries. */ fiatBackend: FiatBackend; + /** Custom price points to use if the CUSTOM FiatBackend option is set. */ + customPrices: BitcoinPrice[]; } export interface ExchangeRateResponse { @@ -310,6 +320,8 @@ export interface BitcoinPrice { price: string; /** The timestamp for this price price provided. */ priceTimestamp: string; + /** The currency that the price is denoted in. */ + currency: string; } export interface ExchangeRate { @@ -344,6 +356,8 @@ export interface NodeAuditRequest { customCategories: CustomCategory[]; /** The api to be used for fiat related queries. */ fiatBackend: FiatBackend; + /** Custom price points to use if the CUSTOM FiatBackend option is set. */ + customPrices: BitcoinPrice[]; } export interface CustomCategory { @@ -397,13 +411,16 @@ export interface ReportEntry { customCategory: string; /** The transaction id of the entry. */ txid: string; - /** The fiat amount of the entry's amount in USD. */ + /** + * The fiat amount of the entry's amount in the currency specified in the + * btc_price field. + */ fiat: string; /** A unique identifier for the entry, if available. */ reference: string; /** An additional note for the entry, providing additional context. */ note: string; - /** The bitcoin price and timestamp used to calcualte our fiat value. */ + /** The bitcoin price and timestamp used to calculate our fiat value. */ btcPrice: BitcoinPrice | undefined; } diff --git a/lib/types/proto/lnd/chainrpc/chainnotifier.ts b/lib/types/proto/lnd/chainrpc/chainnotifier.ts index 0e34933..d972cdd 100644 --- a/lib/types/proto/lnd/chainrpc/chainnotifier.ts +++ b/lib/types/proto/lnd/chainrpc/chainnotifier.ts @@ -68,7 +68,11 @@ export interface SpendRequest { /** * The outpoint for which we should request a spend notification for. If set to * a zero outpoint, then the spend notification will be requested for the - * script instead. + * script instead. A zero or nil outpoint is not supported for Taproot spends + * because the output script cannot reliably be computed from the witness alone + * and the spent output script is not always available in the rescan context. + * So an outpoint must _always_ be specified when registering a spend + * notification for a Taproot output. */ outpoint: Outpoint | undefined; /** @@ -128,9 +132,11 @@ export interface ChainNotifier { * registers an intent for a client to be notified once a confirmation request * has reached its required number of confirmations on-chain. * - * A client can specify whether the confirmation request should be for a - * particular transaction by its hash or for an output script by specifying a - * zero hash. + * A confirmation request must have a valid output script. It is also possible + * to give a transaction ID. If the transaction ID is not set, a notification + * is sent once the output script confirms. If the transaction ID is also set, + * a notification is sent once the output script confirms in the given + * transaction. */ registerConfirmationsNtfn(request?: DeepPartial, onMessage?: (msg: ConfEvent) => void, onError?: (err: Error) => void): void; /** diff --git a/lib/types/proto/lnd/invoicesrpc/invoices.ts b/lib/types/proto/lnd/invoicesrpc/invoices.ts index 7b24d3a..c178d4c 100644 --- a/lib/types/proto/lnd/invoicesrpc/invoices.ts +++ b/lib/types/proto/lnd/invoicesrpc/invoices.ts @@ -20,7 +20,10 @@ export enum LookupModifier { } export interface CancelInvoiceMsg { - /** Hash corresponding to the (hold) invoice to cancel. */ + /** + * Hash corresponding to the (hold) invoice to cancel. When using + * REST, this field must be encoded as base64. + */ paymentHash: Uint8Array | string; } @@ -102,11 +105,15 @@ export interface SettleInvoiceMsg { export interface SettleInvoiceResp {} export interface SubscribeSingleInvoiceRequest { - /** Hash corresponding to the (hold) invoice to subscribe to. */ + /** + * Hash corresponding to the (hold) invoice to subscribe to. When using + * REST, this field must be encoded as base64url. + */ rHash: Uint8Array | string; } export interface LookupInvoiceMsg { + /** When using REST, this field must be encoded as base64. */ paymentHash: Uint8Array | string | undefined; paymentAddr: Uint8Array | string | undefined; setId: Uint8Array | string | undefined; diff --git a/lib/types/proto/lnd/lightning.ts b/lib/types/proto/lnd/lightning.ts index a10eecd..144cf02 100644 --- a/lib/types/proto/lnd/lightning.ts +++ b/lib/types/proto/lnd/lightning.ts @@ -1,16 +1,32 @@ /* eslint-disable */ +export enum OutputScriptType { + SCRIPT_TYPE_PUBKEY_HASH = 'SCRIPT_TYPE_PUBKEY_HASH', + SCRIPT_TYPE_SCRIPT_HASH = 'SCRIPT_TYPE_SCRIPT_HASH', + SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 'SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH', + SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 'SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH', + SCRIPT_TYPE_PUBKEY = 'SCRIPT_TYPE_PUBKEY', + SCRIPT_TYPE_MULTISIG = 'SCRIPT_TYPE_MULTISIG', + SCRIPT_TYPE_NULLDATA = 'SCRIPT_TYPE_NULLDATA', + SCRIPT_TYPE_NON_STANDARD = 'SCRIPT_TYPE_NON_STANDARD', + SCRIPT_TYPE_WITNESS_UNKNOWN = 'SCRIPT_TYPE_WITNESS_UNKNOWN', + UNRECOGNIZED = 'UNRECOGNIZED' +} + /** * `AddressType` has to be one of: * * - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) * - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) + * - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) */ export enum AddressType { WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH', NESTED_PUBKEY_HASH = 'NESTED_PUBKEY_HASH', UNUSED_WITNESS_PUBKEY_HASH = 'UNUSED_WITNESS_PUBKEY_HASH', UNUSED_NESTED_PUBKEY_HASH = 'UNUSED_NESTED_PUBKEY_HASH', + TAPROOT_PUBKEY = 'TAPROOT_PUBKEY', + UNUSED_TAPROOT_PUBKEY = 'UNUSED_TAPROOT_PUBKEY', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -210,6 +226,21 @@ export interface Utxo { confirmations: string; } +export interface OutputDetail { + /** The type of the output */ + outputType: OutputScriptType; + /** The address */ + address: string; + /** The pkscript in hex */ + pkScript: string; + /** The output index used in the raw transaction */ + outputIndex: string; + /** The value of the output coin in satoshis */ + amount: string; + /** Denotes if the output is controlled by the internal wallet */ + isOurAddress: boolean; +} + export interface Transaction { /** The transaction hash */ txHash: string; @@ -225,12 +256,21 @@ export interface Transaction { timeStamp: string; /** Fees paid for this transaction */ totalFees: string; - /** Addresses that received funds for this transaction */ + /** + * Addresses that received funds for this transaction. Deprecated as it is + * now incorporated in the output_details field. + * + * @deprecated + */ destAddresses: string[]; + /** Outputs that received funds for this transaction */ + outputDetails: OutputDetail[]; /** The raw transaction hex. */ rawTxHex: string; /** A label that was optionally set on transaction broadcast. */ label: string; + /** PreviousOutpoints/Inputs of this transaction. */ + previousOutpoints: PreviousOutPoint[]; } export interface GetTransactionsRequest { @@ -440,6 +480,16 @@ export interface ChannelAcceptRequest { channelFlags: number; /** The commitment type the initiator wishes to use for the proposed channel. */ commitmentType: CommitmentType; + /** + * Whether the initiator wants to open a zero-conf channel via the channel + * type. + */ + wantsZeroConf: boolean; + /** + * Whether the initiator wants to use the scid-alias channel type. This is + * separate from the feature bit. + */ + wantsScidAlias: boolean; } export interface ChannelAcceptResponse { @@ -483,6 +533,12 @@ export interface ChannelAcceptResponse { minHtlcIn: string; /** The number of confirmations we require before we consider the channel open. */ minAcceptDepth: number; + /** + * Whether the responder wants this to be a zero-conf channel. This will fail + * if either side does not have the scid-alias feature bit set. The minimum + * depth field must be zero if this is true. + */ + zeroConf: boolean; } export interface ChannelPoint { @@ -509,12 +565,22 @@ export interface OutPoint { outputIndex: number; } +export interface PreviousOutPoint { + /** The outpoint in format txid:n. */ + outpoint: string; + /** + * Denotes if the outpoint is controlled by the internal wallet. + * The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. + */ + isOurOutput: boolean; +} + export interface LightningAddress { - /** The identity pubkey of the Lightning node */ + /** The identity pubkey of the Lightning node. */ pubkey: string; /** * The network location of the lightning node, e.g. `69.69.69.69:1337` or - * `localhost:10011` + * `localhost:10011`. */ host: string; } @@ -707,7 +773,7 @@ export interface VerifyMessageResponse { } export interface ConnectPeerRequest { - /** Lightning address of the peer, in the format `@host` */ + /** Lightning address of the peer to connect to. */ addr: LightningAddress | undefined; /** * If set, the daemon will attempt to persistently connect to the target @@ -898,6 +964,15 @@ export interface Channel { localConstraints: ChannelConstraints | undefined; /** List constraints for the remote node. */ remoteConstraints: ChannelConstraints | undefined; + /** + * This lists out the set of alias short channel ids that exist for a channel. + * This may be empty. + */ + aliasScids: string[]; + /** Whether or not this is a zero-conf channel. */ + zeroConf: boolean; + /** This is the confirmed / on-chain zero-conf SCID. */ + zeroConfConfirmedScid: string; } export interface ListChannelsRequest { @@ -917,6 +992,22 @@ export interface ListChannelsResponse { channels: Channel[]; } +export interface AliasMap { + /** + * For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is + * the first assigned "base" alias. + */ + baseScid: string; + /** The set of all aliases stored for the base SCID. */ + aliases: string[]; +} + +export interface ListAliasesRequest {} + +export interface ListAliasesResponse { + aliasMaps: AliasMap[]; +} + export interface ChannelCloseSummary { /** The outpoint (txid:index) of the funding transaction. */ channelPoint: string; @@ -953,6 +1044,13 @@ export interface ChannelCloseSummary { */ closeInitiator: Initiator; resolutions: Resolution[]; + /** + * This lists out the set of alias short channel ids that existed for the + * closed channel. This may be empty. + */ + aliasScids: string[]; + /** The confirmed SCID for a zero-conf channel. */ + zeroConfConfirmedScid: string; } export enum ChannelCloseSummary_ClosureType { @@ -1138,6 +1236,8 @@ export interface GetInfoResponse { * announcements and invoices. */ features: { [key: number]: Feature }; + /** Indicates whether the HTLC interceptor API is in always-on mode. */ + requireHtlcInterceptor: boolean; } export interface GetInfoResponse_FeaturesEntry { @@ -1215,6 +1315,12 @@ export interface CloseChannelRequest { * closure transaction. */ satPerVbyte: string; + /** + * The maximum fee rate the closer is willing to pay. + * + * NOTE: This field is only respected if we're the initiator of the channel. + */ + maxFeePerVbyte: string; } export interface CloseStatusUpdate { @@ -1432,6 +1538,13 @@ export interface OpenChannelRequest { * the remote peer supports explicit channel negotiation. */ commitmentType: CommitmentType; + /** If this is true, then a zero-conf channel open will be attempted. */ + zeroConf: boolean; + /** + * If this is true, then an option-scid-alias channel-type open will be + * attempted. + */ + scidAlias: boolean; } export interface OpenStatusUpdate { @@ -1672,13 +1785,13 @@ export interface PendingChannelsResponse_PendingChannel { numForwardingPackages: string; /** A set of flags showing the current state of the channel. */ chanStatusFlags: string; + /** Whether this channel is advertised to the network or not. */ + private: boolean; } export interface PendingChannelsResponse_PendingOpenChannel { /** The pending channel */ channel: PendingChannelsResponse_PendingChannel | undefined; - /** The height at which this channel will be confirmed */ - confirmationHeight: number; /** * The amount calculated to be paid in fees for the current set of * commitment transactions. The fee amount is persisted with the channel @@ -1813,6 +1926,8 @@ export interface WalletBalanceResponse { * other usage. */ lockedBalance: string; + /** The amount of reserve required. */ + reservedBalanceAnchorChan: string; /** A mapping of each wallet account's name to its balance. */ accountBalance: { [key: string]: WalletAccountBalance }; } @@ -1944,6 +2059,11 @@ export interface QueryRoutesRequest { * fallback. */ destFeatures: FeatureBit[]; + /** + * The time preference for this payment. Set to -1 to optimize for fees + * only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + timePref: number; } export interface QueryRoutesRequest_DestCustomRecordsEntry { @@ -2040,6 +2160,8 @@ export interface Hop { * to drop off at each hop within the onion. */ customRecords: { [key: string]: Uint8Array | string }; + /** The payment metadata to send along with the payment to the payee. */ + metadata: Uint8Array | string; } export interface Hop_CustomRecordsEntry { @@ -2387,6 +2509,7 @@ export interface Invoice { /** * The hash of the preimage. When using REST, this field must be encoded as * base64. + * Note: Output only, don't specify for creating an invoice. */ rHash: Uint8Array | string; /** @@ -2404,17 +2527,26 @@ export interface Invoice { /** * Whether this invoice has been fulfilled * + * The field is deprecated. Use the state field instead (compare to SETTLED). + * * @deprecated */ settled: boolean; - /** When this invoice was created */ + /** + * When this invoice was created. + * Note: Output only, don't specify for creating an invoice. + */ creationDate: string; - /** When this invoice was settled */ + /** + * When this invoice was settled. + * Note: Output only, don't specify for creating an invoice. + */ settleDate: string; /** * A bare-bones invoice for a payment within the Lightning Network. With the * details of the invoice, the sender has all the data necessary to send a * payment to the recipient. + * Note: Output only, don't specify for creating an invoice. */ paymentRequest: string; /** @@ -2442,6 +2574,7 @@ export interface Invoice { * this index making it monotonically increasing. Callers to the * SubscribeInvoices call can use this to instantly get notified of all added * invoices with an add_index greater than this one. + * Note: Output only, don't specify for creating an invoice. */ addIndex: string; /** @@ -2449,6 +2582,7 @@ export interface Invoice { * increment this index making it monotonically increasing. Callers to the * SubscribeInvoices call can use this to instantly get notified of all * settled invoices with an settle_index greater than this one. + * Note: Output only, don't specify for creating an invoice. */ settleIndex: string; /** @@ -2464,6 +2598,7 @@ export interface Invoice { * was ultimately accepted. Additionally, it's possible that the sender paid * MORE that was specified in the original invoice. So we'll record that here * as well. + * Note: Output only, don't specify for creating an invoice. */ amtPaidSat: string; /** @@ -2473,23 +2608,35 @@ export interface Invoice { * amount was ultimately accepted. Additionally, it's possible that the sender * paid MORE that was specified in the original invoice. So we'll record that * here as well. + * Note: Output only, don't specify for creating an invoice. */ amtPaidMsat: string; - /** The state the invoice is in. */ + /** + * The state the invoice is in. + * Note: Output only, don't specify for creating an invoice. + */ state: Invoice_InvoiceState; - /** List of HTLCs paying to this invoice [EXPERIMENTAL]. */ + /** + * List of HTLCs paying to this invoice [EXPERIMENTAL]. + * Note: Output only, don't specify for creating an invoice. + */ htlcs: InvoiceHTLC[]; - /** List of features advertised on the invoice. */ + /** + * List of features advertised on the invoice. + * Note: Output only, don't specify for creating an invoice. + */ features: { [key: number]: Feature }; /** * Indicates if this invoice was a spontaneous payment that arrived via keysend * [EXPERIMENTAL]. + * Note: Output only, don't specify for creating an invoice. */ isKeysend: boolean; /** * The payment address of this invoice. This value will be used in MPP * payments, and also for newer invoices that always require the MPP payload * for added end-to-end security. + * Note: Output only, don't specify for creating an invoice. */ paymentAddr: Uint8Array | string; /** Signals whether or not this is an AMP invoice. */ @@ -2501,6 +2648,7 @@ export interface Invoice { * given set ID. This field is always populated for AMP invoices, and can be * used along side LookupInvoice to obtain the HTLC information related to a * given sub-invoice. + * Note: Output only, don't specify for creating an invoice. */ ampInvoiceState: { [key: string]: AMPInvoiceState }; } @@ -2780,6 +2928,13 @@ export interface ListPaymentsRequest { * of the returned payments is always oldest first (ascending index order). */ reversed: boolean; + /** + * If set, all payments (complete and incomplete, independent of the + * max_payments parameter) will be counted. Note that setting this to true will + * increase the run time of the call significantly on systems that have a lot + * of payments, as all of them have to be iterated through to be counted. + */ + countTotalPayments: boolean; } export interface ListPaymentsResponse { @@ -2795,6 +2950,13 @@ export interface ListPaymentsResponse { * as the index_offset to continue seeking forwards in the next request. */ lastIndexOffset: string; + /** + * Will only be set if count_total_payments in the request was set. Represents + * the total number of payments (complete and incomplete, independent of the + * number of payments requested in the query) currently present in the payments + * database. + */ + totalNumPayments: string; } export interface DeletePaymentRequest { @@ -3361,6 +3523,13 @@ export interface RPCMiddlewareRequest { * the same type, or replaced by an error message. */ response: RPCMessage | undefined; + /** + * This is used to indicate to the client that the server has successfully + * registered the interceptor. This is only used in the very first message + * that the server sends to the client after the client sends the server + * the middleware registration message. + */ + regComplete: boolean | undefined; /** * The unique message ID of this middleware intercept message. There can be * multiple middleware intercept messages per single gRPC request (one for the @@ -3392,7 +3561,8 @@ export interface RPCMessage { streamRpc: boolean; /** * The full canonical gRPC name of the message type (in the format - * .TypeName, for example lnrpc.GetInfoRequest). + * .TypeName, for example lnrpc.GetInfoRequest). In case of an + * error being returned from lnd, this simply contains the string "error". */ typeName: string; /** @@ -3400,6 +3570,12 @@ export interface RPCMessage { * format. */ serialized: Uint8Array | string; + /** + * Indicates that the response from lnd was an error, not a gRPC response. If + * this is set to true then the type_name contains the string "error" and + * serialized contains the error string. + */ + isError: boolean; } export interface RPCMiddlewareResponse { @@ -3464,17 +3640,15 @@ export interface InterceptFeedback { */ error: string; /** - * A boolean indicating that the gRPC response should be replaced/overwritten. - * As its name suggests, this can only be used as a feedback to an intercepted - * response RPC message and is ignored for feedback on any other message. This - * boolean is needed because in protobuf an empty message is serialized as a - * 0-length or nil byte slice and we wouldn't be able to distinguish between + * A boolean indicating that the gRPC message should be replaced/overwritten. + * This boolean is needed because in protobuf an empty message is serialized as + * a 0-length or nil byte slice and we wouldn't be able to distinguish between * an empty replacement message and the "don't replace anything" case. */ replaceResponse: boolean; /** * If the replace_response field is set to true, this field must contain the - * binary serialized gRPC response message in the protobuf format. + * binary serialized gRPC message in the protobuf format. */ replacementSerialized: Uint8Array | string; } @@ -4052,6 +4226,13 @@ export interface Lightning { subscribeCustomMessages( request?: DeepPartial , onMessage?: (msg: CustomMessage) => void, onError?: (err: Error) => void): void; + /** + * lncli: `listaliases` + * ListAliases returns the set of all aliases that have ever existed with + * their confirmed SCID (if it exists) and/or the base SCID (in the case of + * zero conf). + */ + listAliases(request?: DeepPartial): Promise; } type Builtin = diff --git a/lib/types/proto/lnd/routerrpc/router.ts b/lib/types/proto/lnd/routerrpc/router.ts index e845469..c425b97 100644 --- a/lib/types/proto/lnd/routerrpc/router.ts +++ b/lib/types/proto/lnd/routerrpc/router.ts @@ -49,7 +49,7 @@ export enum PaymentState { * routes to the destination at all. */ FAILED_NO_ROUTE = 'FAILED_NO_ROUTE', - /** FAILED_ERROR - A non-recoverable error has occured. */ + /** FAILED_ERROR - A non-recoverable error has occurred. */ FAILED_ERROR = 'FAILED_ERROR', /** * FAILED_INCORRECT_PAYMENT_DETAILS - Payment details incorrect (unknown hash, invalid amt or @@ -193,6 +193,11 @@ export interface SendPaymentRequest { maxShardSizeMsat: string; /** If set, an AMP-payment will be attempted. */ amp: boolean; + /** + * The time preference for this payment. Set to -1 to optimize for fees + * only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + timePref: number; } export interface SendPaymentRequest_DestCustomRecordsEntry { @@ -236,6 +241,13 @@ export interface SendToRouteRequest { paymentHash: Uint8Array | string; /** Route that should be used to attempt to complete the payment. */ route: Route | undefined; + /** + * Whether the payment should be marked as failed when a temporary error is + * returned from the given route. Set it to true so the payment won't be + * failed unless a terminal error is occurred, such as payment timeout, no + * routes, incorrect payment details, or insufficient funds. + */ + skipTempErr: boolean; } export interface SendToRouteResponse { @@ -557,6 +569,23 @@ export interface ForwardHtlcInterceptResponse { action: ResolveHoldForwardAction; /** The preimage in case the resolve action is Settle. */ preimage: Uint8Array | string; + /** + * Encrypted failure message in case the resolve action is Fail. + * + * If failure_message is specified, the failure_code field must be set + * to zero. + */ + failureMessage: Uint8Array | string; + /** + * Return the specified failure code in case the resolve action is Fail. The + * message data fields are populated automatically. + * + * If a non-zero failure_code is specified, failure_message must not be set. + * + * For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the + * default value for this field. + */ + failureCode: Failure_FailureCode; } export interface UpdateChanStatusRequest { diff --git a/lib/types/proto/lnd/signrpc/signer.ts b/lib/types/proto/lnd/signrpc/signer.ts index f01e6af..ffdd218 100644 --- a/lib/types/proto/lnd/signrpc/signer.ts +++ b/lib/types/proto/lnd/signrpc/signer.ts @@ -1,4 +1,28 @@ /* eslint-disable */ +export enum SignMethod { + /** + * SIGN_METHOD_WITNESS_V0 - Specifies that a SegWit v0 (p2wkh, np2wkh, p2wsh) input script should be + * signed. + */ + SIGN_METHOD_WITNESS_V0 = 'SIGN_METHOD_WITNESS_V0', + /** + * SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086 - Specifies that a SegWit v1 (p2tr) input should be signed by using the + * BIP0086 method (commit to internal key only). + */ + SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086 = 'SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086', + /** + * SIGN_METHOD_TAPROOT_KEY_SPEND - Specifies that a SegWit v1 (p2tr) input should be signed by using a given + * taproot hash to commit to in addition to the internal key. + */ + SIGN_METHOD_TAPROOT_KEY_SPEND = 'SIGN_METHOD_TAPROOT_KEY_SPEND', + /** + * SIGN_METHOD_TAPROOT_SCRIPT_SPEND - Specifies that a SegWit v1 (p2tr) input should be spent using the script + * path and that a specific leaf script should be signed for. + */ + SIGN_METHOD_TAPROOT_SCRIPT_SPEND = 'SIGN_METHOD_TAPROOT_SCRIPT_SPEND', + UNRECOGNIZED = 'UNRECOGNIZED' +} + export interface KeyLocator { /** The family of key being identified. */ keyFamily: number; @@ -58,8 +82,21 @@ export interface SignDescriptor { */ doubleTweak: Uint8Array | string; /** - * The full script required to properly redeem the output. This field will - * only be populated if a p2wsh or a p2sh output is being signed. + * The 32 byte input to the taproot tweak derivation that is used to derive + * the output key from an internal key: outputKey = internalKey + + * tagged_hash("tapTweak", internalKey || tapTweak). + * + * When doing a BIP 86 spend, this field can be an empty byte slice. + * + * When doing a normal key path spend, with the output key committing to an + * actual script root, then this field should be: the tapscript root hash. + */ + tapTweak: Uint8Array | string; + /** + * The full script required to properly redeem the output. This field will + * only be populated if a p2tr, p2wsh or a p2sh output is being signed. If a + * taproot script path spend is being attempted, then this should be the raw + * leaf script. */ witnessScript: Uint8Array | string; /** @@ -74,6 +111,13 @@ export interface SignDescriptor { sighash: number; /** The target input within the transaction that should be signed. */ inputIndex: number; + /** + * The sign method specifies how the input should be signed. Depending on the + * method, either the tap_tweak, witness_script or both need to be specified. + * Defaults to SegWit v0 signing to be backward compatible with older RPC + * clients. + */ + signMethod: SignMethod; } export interface SignReq { @@ -81,6 +125,11 @@ export interface SignReq { rawTxBytes: Uint8Array | string; /** A set of sign descriptors, for each input to be signed. */ signDescs: SignDescriptor[]; + /** + * The full list of UTXO information for each of the inputs being spent. This + * is required when spending one or more taproot (SegWit v1) outputs. + */ + prevOutputs: TxOut[]; } export interface SignResp { @@ -107,7 +156,10 @@ export interface InputScriptResp { } export interface SignMessageReq { - /** The message to be signed. */ + /** + * The message to be signed. When using REST, this field must be encoded as + * base64. + */ msg: Uint8Array | string; /** The key locator that identifies which key to use for signing. */ keyLoc: KeyLocator | undefined; @@ -115,9 +167,17 @@ export interface SignMessageReq { doubleHash: boolean; /** * Use the compact (pubkey recoverable) format instead of the raw lnwire - * format. + * format. This option cannot be used with Schnorr signatures. */ compactSig: boolean; + /** Use Schnorr signature. This option cannot be used with compact format. */ + schnorrSig: boolean; + /** + * The optional Taproot tweak bytes to apply to the private key before creating + * a Schnorr signature. The private key is tweaked as described in BIP-341: + * privKey + h_tapTweak(internalKey || tapTweak) + */ + schnorrSigTapTweak: Uint8Array | string; } export interface SignMessageResp { @@ -126,15 +186,25 @@ export interface SignMessageResp { } export interface VerifyMessageReq { - /** The message over which the signature is to be verified. */ + /** + * The message over which the signature is to be verified. When using + * REST, this field must be encoded as base64. + */ msg: Uint8Array | string; /** * The fixed-size LN wire encoded signature to be verified over the given - * message. + * message. When using REST, this field must be encoded as base64. */ signature: Uint8Array | string; - /** The public key the signature has to be valid for. */ + /** + * The public key the signature has to be valid for. When using REST, this + * field must be encoded as base64. If the is_schnorr_sig option is true, then + * the public key is expected to be in the 32-byte x-only serialization + * according to BIP-340. + */ pubkey: Uint8Array | string; + /** Specifies if the signature is a Schnorr signature. */ + isSchnorrSig: boolean; } export interface VerifyMessageResp { @@ -166,6 +236,197 @@ export interface SharedKeyResponse { sharedKey: Uint8Array | string; } +export interface TweakDesc { + /** Tweak is the 32-byte value that will modify the public key. */ + tweak: Uint8Array | string; + /** + * Specifies if the target key should be converted to an x-only public key + * before tweaking. If true, then the public key will be mapped to an x-only + * key before the tweaking operation is applied. + */ + isXOnly: boolean; +} + +export interface TaprootTweakDesc { + /** + * The root hash of the tapscript tree if a script path is committed to. If + * the MuSig2 key put on chain doesn't also commit to a script path (BIP-0086 + * key spend only), then this needs to be empty and the key_spend_only field + * below must be set to true. This is required because gRPC cannot + * differentiate between a zero-size byte slice and a nil byte slice (both + * would be serialized the same way). So the extra boolean is required. + */ + scriptRoot: Uint8Array | string; + /** + * Indicates that the above script_root is expected to be empty because this + * is a BIP-0086 key spend only commitment where only the internal key is + * committed to instead of also including a script root hash. + */ + keySpendOnly: boolean; +} + +export interface MuSig2CombineKeysRequest { + /** + * A list of all public keys (serialized in 32-byte x-only format!) + * participating in the signing session. The list will always be sorted + * lexicographically internally. This must include the local key which is + * described by the above key_loc. + */ + allSignerPubkeys: Uint8Array | string[]; + /** + * A series of optional generic tweaks to be applied to the the aggregated + * public key. + */ + tweaks: TweakDesc[]; + /** + * An optional taproot specific tweak that must be specified if the MuSig2 + * combined key will be used as the main taproot key of a taproot output + * on-chain. + */ + taprootTweak: TaprootTweakDesc | undefined; +} + +export interface MuSig2CombineKeysResponse { + /** + * The combined public key (in the 32-byte x-only format) with all tweaks + * applied to it. If a taproot tweak is specified, this corresponds to the + * taproot key that can be put into the on-chain output. + */ + combinedKey: Uint8Array | string; + /** + * The raw combined public key (in the 32-byte x-only format) before any tweaks + * are applied to it. If a taproot tweak is specified, this corresponds to the + * internal key that needs to be put into the witness if the script spend path + * is used. + */ + taprootInternalKey: Uint8Array | string; +} + +export interface MuSig2SessionRequest { + /** The key locator that identifies which key to use for signing. */ + keyLoc: KeyLocator | undefined; + /** + * A list of all public keys (serialized in 32-byte x-only format!) + * participating in the signing session. The list will always be sorted + * lexicographically internally. This must include the local key which is + * described by the above key_loc. + */ + allSignerPubkeys: Uint8Array | string[]; + /** + * An optional list of all public nonces of other signing participants that + * might already be known. + */ + otherSignerPublicNonces: Uint8Array | string[]; + /** + * A series of optional generic tweaks to be applied to the the aggregated + * public key. + */ + tweaks: TweakDesc[]; + /** + * An optional taproot specific tweak that must be specified if the MuSig2 + * combined key will be used as the main taproot key of a taproot output + * on-chain. + */ + taprootTweak: TaprootTweakDesc | undefined; +} + +export interface MuSig2SessionResponse { + /** + * The unique ID that represents this signing session. A session can be used + * for producing a signature a single time. If the signing fails for any + * reason, a new session with the same participants needs to be created. + */ + sessionId: Uint8Array | string; + /** + * The combined public key (in the 32-byte x-only format) with all tweaks + * applied to it. If a taproot tweak is specified, this corresponds to the + * taproot key that can be put into the on-chain output. + */ + combinedKey: Uint8Array | string; + /** + * The raw combined public key (in the 32-byte x-only format) before any tweaks + * are applied to it. If a taproot tweak is specified, this corresponds to the + * internal key that needs to be put into the witness if the script spend path + * is used. + */ + taprootInternalKey: Uint8Array | string; + /** + * The two public nonces the local signer uses, combined into a single value + * of 66 bytes. Can be split into the two 33-byte points to get the individual + * nonces. + */ + localPublicNonces: Uint8Array | string; + /** + * Indicates whether all nonces required to start the signing process are known + * now. + */ + haveAllNonces: boolean; +} + +export interface MuSig2RegisterNoncesRequest { + /** The unique ID of the signing session those nonces should be registered with. */ + sessionId: Uint8Array | string; + /** + * A list of all public nonces of other signing participants that should be + * registered. + */ + otherSignerPublicNonces: Uint8Array | string[]; +} + +export interface MuSig2RegisterNoncesResponse { + /** + * Indicates whether all nonces required to start the signing process are known + * now. + */ + haveAllNonces: boolean; +} + +export interface MuSig2SignRequest { + /** The unique ID of the signing session to use for signing. */ + sessionId: Uint8Array | string; + /** The 32-byte SHA256 digest of the message to sign. */ + messageDigest: Uint8Array | string; + /** + * Cleanup indicates that after signing, the session state can be cleaned up, + * since another participant is going to be responsible for combining the + * partial signatures. + */ + cleanup: boolean; +} + +export interface MuSig2SignResponse { + /** The partial signature created by the local signer. */ + localPartialSignature: Uint8Array | string; +} + +export interface MuSig2CombineSigRequest { + /** The unique ID of the signing session to combine the signatures for. */ + sessionId: Uint8Array | string; + /** + * The list of all other participants' partial signatures to add to the current + * session. + */ + otherPartialSignatures: Uint8Array | string[]; +} + +export interface MuSig2CombineSigResponse { + /** + * Indicates whether all partial signatures required to create a final, full + * signature are known yet. If this is true, then the final_signature field is + * set, otherwise it is empty. + */ + haveAllSignatures: boolean; + /** The final, full signature that is valid for the combined public key. */ + finalSignature: Uint8Array | string; +} + +export interface MuSig2CleanupRequest { + /** The unique ID of the signing session that should be removed/cleaned up. */ + sessionId: Uint8Array | string; +} + +export interface MuSig2CleanupResponse {} + /** * Signer is a service that gives access to the signing functionality of the * daemon's wallet. @@ -185,8 +446,8 @@ export interface Signer { /** * ComputeInputScript generates a complete InputIndex for the passed * transaction with the signature as defined within the passed SignDescriptor. - * This method should be capable of generating the proper input script for - * both regular p2wkh output and p2wkh outputs nested within a regular p2sh + * This method should be capable of generating the proper input script for both + * regular p2wkh/p2tr outputs and p2wkh outputs nested within a regular p2sh * output. * * Note that when using this method to sign inputs belonging to the wallet, @@ -222,6 +483,87 @@ export interface Signer { * hashed with sha256, resulting in the final key length of 256bit. */ deriveSharedKey(request?: DeepPartial): Promise; + /** + * MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used + * to calculate the combined MuSig2 public key from a list of all participating + * signers' public keys. This RPC is completely stateless and deterministic and + * does not create any signing session. It can be used to determine the Taproot + * public key that should be put in an on-chain output once all public keys are + * known. A signing session is only needed later when that output should be + * _spent_ again. + * + * NOTE: The MuSig2 BIP is not final yet and therefore this API must be + * considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + * releases. Backward compatibility is not guaranteed! + */ + muSig2CombineKeys( + request?: DeepPartial + ): Promise; + /** + * MuSig2CreateSession (experimental!) creates a new MuSig2 signing session + * using the local key identified by the key locator. The complete list of all + * public keys of all signing parties must be provided, including the public + * key of the local signing key. If nonces of other parties are already known, + * they can be submitted as well to reduce the number of RPC calls necessary + * later on. + * + * NOTE: The MuSig2 BIP is not final yet and therefore this API must be + * considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + * releases. Backward compatibility is not guaranteed! + */ + muSig2CreateSession( + request?: DeepPartial + ): Promise; + /** + * MuSig2RegisterNonces (experimental!) registers one or more public nonces of + * other signing participants for a session identified by its ID. This RPC can + * be called multiple times until all nonces are registered. + * + * NOTE: The MuSig2 BIP is not final yet and therefore this API must be + * considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + * releases. Backward compatibility is not guaranteed! + */ + muSig2RegisterNonces( + request?: DeepPartial + ): Promise; + /** + * MuSig2Sign (experimental!) creates a partial signature using the local + * signing key that was specified when the session was created. This can only + * be called when all public nonces of all participants are known and have been + * registered with the session. If this node isn't responsible for combining + * all the partial signatures, then the cleanup flag should be set, indicating + * that the session can be removed from memory once the signature was produced. + * + * NOTE: The MuSig2 BIP is not final yet and therefore this API must be + * considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + * releases. Backward compatibility is not guaranteed! + */ + muSig2Sign(request?: DeepPartial): Promise; + /** + * MuSig2CombineSig (experimental!) combines the given partial signature(s) + * with the local one, if it already exists. Once a partial signature of all + * participants is registered, the final signature will be combined and + * returned. + * + * NOTE: The MuSig2 BIP is not final yet and therefore this API must be + * considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + * releases. Backward compatibility is not guaranteed! + */ + muSig2CombineSig( + request?: DeepPartial + ): Promise; + /** + * MuSig2Cleanup (experimental!) allows a caller to clean up a session early in + * cases where it's obvious that the signing session won't succeed and the + * resources can be released. + * + * NOTE: The MuSig2 BIP is not final yet and therefore this API must be + * considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + * releases. Backward compatibility is not guaranteed! + */ + muSig2Cleanup( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/lib/types/proto/lnd/walletrpc/walletkit.ts b/lib/types/proto/lnd/walletrpc/walletkit.ts index 4c874e0..333328b 100644 --- a/lib/types/proto/lnd/walletrpc/walletkit.ts +++ b/lib/types/proto/lnd/walletrpc/walletkit.ts @@ -7,6 +7,7 @@ export enum AddressType { WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH', NESTED_WITNESS_PUBKEY_HASH = 'NESTED_WITNESS_PUBKEY_HASH', HYBRID_NESTED_WITNESS_PUBKEY_HASH = 'HYBRID_NESTED_WITNESS_PUBKEY_HASH', + TAPROOT_PUBKEY = 'TAPROOT_PUBKEY', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -95,6 +96,13 @@ export interface ListUnspentRequest { maxConfs: number; /** An optional filter to only include outputs belonging to an account. */ account: string; + /** + * When min_confs and max_confs are zero, setting false implicitly + * overrides max_confs to be MaxInt32, otherwise max_confs remains + * zero. An error is returned if the value is true and both min_confs + * and max_confs are non-zero. (default: false) + */ + unconfirmedOnly: boolean; } export interface ListUnspentResponse { @@ -220,6 +228,16 @@ export interface ListAccountsResponse { accounts: Account[]; } +export interface RequiredReserveRequest { + /** The number of additional channels the user would like to open. */ + additionalPublicChannels: number; +} + +export interface RequiredReserveResponse { + /** The amount of reserve required. */ + requiredReserve: string; +} + export interface ImportAccountRequest { /** A name to identify the account with. */ name: string; @@ -522,6 +540,10 @@ export interface UtxoLease { outpoint: OutPoint | undefined; /** The absolute expiration of the output lease represented as a unix timestamp. */ expiration: string; + /** The public key script of the leased output. */ + pkScript: Uint8Array | string; + /** The value of the leased output in satoshis. */ + value: string; } export interface SignPsbtRequest { @@ -572,7 +594,9 @@ export interface ListLeasesResponse { export interface WalletKit { /** * ListUnspent returns a list of all utxos spendable by the wallet with a - * number of confirmations between the specified minimum and maximum. + * number of confirmations between the specified minimum and maximum. By + * default, all utxos are listed. To list only the unconfirmed utxos, set + * the unconfirmed_only to true. */ listUnspent(request?: DeepPartial): Promise; /** @@ -612,6 +636,14 @@ export interface WalletKit { * wallet accounts and return only those matching. */ listAccounts(request?: DeepPartial): Promise; + /** + * RequiredReserve returns the minimum amount of satoshis that should be kept + * in the wallet in order to fee bump anchor channels if necessary. The value + * scales with the number of public anchor channels but is capped at a maximum. + */ + requiredReserve( + request?: DeepPartial + ): Promise; /** * ImportAccount imports an account backed by an account extended public key. * The master key fingerprint denotes the fingerprint of the root key diff --git a/lib/types/proto/loop/client.ts b/lib/types/proto/loop/client.ts index 2cf36fd..2de6d98 100644 --- a/lib/types/proto/loop/client.ts +++ b/lib/types/proto/loop/client.ts @@ -343,6 +343,8 @@ export interface SwapResponse { * Used for both loop-in and loop-out. */ htlcAddressP2wsh: string; + /** The address of the v3 (taproot) htlc. Used for both loop-in and loop-out. */ + htlcAddressP2tr: string; /** A human-readable message received from the loop server. */ serverMessage: string; } @@ -395,6 +397,8 @@ export interface SwapStatus { htlcAddressP2wsh: string; /** HTLC address (nested segwit), used in loop-in swaps only. */ htlcAddressNp2wsh: string; + /** The address of the v3 (taproot) htlc. Used for both loop-in and loop-out. */ + htlcAddressP2tr: string; /** Swap server cost */ costServer: string; /** On-chain transaction cost */ diff --git a/lib/types/proto/pool/auctioneerrpc/auctioneer.ts b/lib/types/proto/pool/auctioneerrpc/auctioneer.ts index 21eb923..5ccdfc9 100644 --- a/lib/types/proto/pool/auctioneerrpc/auctioneer.ts +++ b/lib/types/proto/pool/auctioneerrpc/auctioneer.ts @@ -37,6 +37,12 @@ export enum AuctionAccountState { STATE_CLOSED = 'STATE_CLOSED', /** STATE_PENDING_BATCH - The account has recently participated in a batch and is not yet confirmed. */ STATE_PENDING_BATCH = 'STATE_PENDING_BATCH', + /** + * STATE_EXPIRED_PENDING_UPDATE - The account has reached the expiration height while it had a pending update + * that hasn't yet confirmed. This allows accounts to be renewed once + * confirmed and expired. + */ + STATE_EXPIRED_PENDING_UPDATE = 'STATE_EXPIRED_PENDING_UPDATE', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -726,6 +732,16 @@ export interface ServerOrder { * expressed in satoshis per 1000 weight units (sat/kW). */ maxBatchFeeRateSatPerKw: string; + /** + * List of nodes that will be allowed to match with our order. Incompatible + * with the `not_allowed_node_ids` field. + */ + allowedNodeIds: Uint8Array | string[]; + /** + * List of nodes that won't be allowed to match with our order. Incompatible + * with the `allowed_node_ids` field. + */ + notAllowedNodeIds: Uint8Array | string[]; } export interface ServerBid { diff --git a/lib/types/proto/pool/trader.ts b/lib/types/proto/pool/trader.ts index da9c938..a8a4541 100644 --- a/lib/types/proto/pool/trader.ts +++ b/lib/types/proto/pool/trader.ts @@ -387,6 +387,16 @@ export interface Order { minUnitsMatch: number; /** The channel type to use for the resulting matched channels. */ channelType: OrderChannelType; + /** + * List of nodes that will be allowed to match with our order. Incompatible + * with the `not_allowed_node_ids` field. + */ + allowedNodeIds: Uint8Array | string[]; + /** + * List of nodes that won't be allowed to match with our order. Incompatible + * with the `allowed_node_ids` field. + */ + notAllowedNodeIds: Uint8Array | string[]; } export interface Bid { diff --git a/package-lock.json b/package-lock.json index 8b4db2a..500f911 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lightninglabs/lnc-core", - "version": "0.1.11-alpha.1", + "version": "0.1.12-alpha", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lightninglabs/lnc-core", - "version": "0.1.11-alpha.1", + "version": "0.1.12-alpha", "license": "MIT", "dependencies": { "node-polyfill-webpack-plugin": "1.1.4" @@ -164,6 +164,58 @@ "node": ">=10.0.0" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -2993,13 +3045,13 @@ } }, "node_modules/terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", + "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", "dependencies": { + "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "bin": { @@ -3014,14 +3066,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "engines": { - "node": ">= 8" - } - }, "node_modules/timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -3805,6 +3849,49 @@ "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==" + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==" + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + }, + "@jridgewell/trace-mapping": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -6004,13 +6091,13 @@ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" }, "terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", + "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", "requires": { + "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -6018,11 +6105,6 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" } } }, diff --git a/package.json b/package.json index a1bfea0..6f405ca 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "@lightninglabs/lnc-core", - "version": "0.1.11-alpha.1", + "version": "0.1.12-alpha", "description": "Type definitions and utilities for Lightning Node Connect", "main": "./dist/index.js", "types": "./dist/index.d.ts", "config": { - "lnd_release_tag": "v0.14.3-beta", - "loop_release_tag": "v0.19.1-beta", - "pool_release_tag": "v0.5.6-alpha", - "faraday_release_tag": "v0.2.5-alpha", + "lnd_release_tag": "v0.15.1-beta", + "loop_release_tag": "v0.20.1-beta", + "pool_release_tag": "v0.5.8-alpha", + "faraday_release_tag": "v0.2.8-alpha", "protoc_version": "3.15.8" }, "scripts": { diff --git a/protos/faraday/v0.2.5-alpha/faraday.proto b/protos/faraday/v0.2.8-alpha/faraday.proto similarity index 95% rename from protos/faraday/v0.2.5-alpha/faraday.proto rename to protos/faraday/v0.2.8-alpha/faraday.proto index bec204d..4cf9ef3 100644 --- a/protos/faraday/v0.2.5-alpha/faraday.proto +++ b/protos/faraday/v0.2.8-alpha/faraday.proto @@ -335,6 +335,14 @@ enum FiatBackend { // This API is reached through the following URL: // https://api.coindesk.com/v1/bpi/historical/close.json COINDESK = 2; + + // Use custom price data provided in a CSV file for fiat price information. + CUSTOM = 3; + + // Use the CoinGecko API for fiat price information. + // This API is reached through the following URL: + // https://api.coingecko.com/api/v3/coins/bitcoin/market_chart + COINGECKO = 4; } message ExchangeRateRequest { @@ -350,6 +358,9 @@ message ExchangeRateRequest { // The api to be used for fiat related queries. FiatBackend fiat_backend = 5; + + // Custom price points to use if the CUSTOM FiatBackend option is set. + repeated BitcoinPrice custom_prices = 8; } message ExchangeRateResponse { @@ -365,6 +376,9 @@ message BitcoinPrice { // The timestamp for this price price provided. uint64 price_timestamp = 2; + + // The currency that the price is denoted in. + string currency = 3; } message ExchangeRate { @@ -407,6 +421,9 @@ message NodeAuditRequest { // The api to be used for fiat related queries. FiatBackend fiat_backend = 7; + + // Custom price points to use if the CUSTOM FiatBackend option is set. + repeated BitcoinPrice custom_prices = 8; } message CustomCategory { @@ -522,7 +539,8 @@ message ReportEntry { // The transaction id of the entry. string txid = 7; - // The fiat amount of the entry's amount in USD. + // The fiat amount of the entry's amount in the currency specified in the + // btc_price field. string fiat = 8; // A unique identifier for the entry, if available. @@ -531,7 +549,7 @@ message ReportEntry { // An additional note for the entry, providing additional context. string note = 10; - // The bitcoin price and timestamp used to calcualte our fiat value. + // The bitcoin price and timestamp used to calculate our fiat value. BitcoinPrice btc_price = 11; } diff --git a/protos/lnd/v0.14.3-beta/signrpc/signer.proto b/protos/lnd/v0.14.3-beta/signrpc/signer.proto deleted file mode 100644 index 608c71a..0000000 --- a/protos/lnd/v0.14.3-beta/signrpc/signer.proto +++ /dev/null @@ -1,250 +0,0 @@ -syntax = "proto3"; - -package signrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc/signrpc"; - -// Signer is a service that gives access to the signing functionality of the -// daemon's wallet. -service Signer { - /* - SignOutputRaw is a method that can be used to generated a signature for a - set of inputs/outputs to a transaction. Each request specifies details - concerning how the outputs should be signed, which keys they should be - signed with, and also any optional tweaks. The return value is a fixed - 64-byte signature (the same format as we use on the wire in Lightning). - - If we are unable to sign using the specified keys, then an error will be - returned. - */ - rpc SignOutputRaw (SignReq) returns (SignResp); - - /* - ComputeInputScript generates a complete InputIndex for the passed - transaction with the signature as defined within the passed SignDescriptor. - This method should be capable of generating the proper input script for - both regular p2wkh output and p2wkh outputs nested within a regular p2sh - output. - - Note that when using this method to sign inputs belonging to the wallet, - the only items of the SignDescriptor that need to be populated are pkScript - in the TxOut field, the value in that same field, and finally the input - index. - */ - rpc ComputeInputScript (SignReq) returns (InputScriptResp); - - /* - SignMessage signs a message with the key specified in the key locator. The - returned signature is fixed-size LN wire format encoded. - - The main difference to SignMessage in the main RPC is that a specific key is - used to sign the message instead of the node identity private key. - */ - rpc SignMessage (SignMessageReq) returns (SignMessageResp); - - /* - VerifyMessage verifies a signature over a message using the public key - provided. The signature must be fixed-size LN wire format encoded. - - The main difference to VerifyMessage in the main RPC is that the public key - used to sign the message does not have to be a node known to the network. - */ - rpc VerifyMessage (VerifyMessageReq) returns (VerifyMessageResp); - - /* - DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key - derivation between the ephemeral public key in the request and the node's - key specified in the key_desc parameter. Either a key locator or a raw - public key is expected in the key_desc, if neither is supplied, defaults to - the node's identity private key: - P_shared = privKeyNode * ephemeralPubkey - The resulting shared public key is serialized in the compressed format and - hashed with sha256, resulting in the final key length of 256bit. - */ - rpc DeriveSharedKey (SharedKeyRequest) returns (SharedKeyResponse); -} - -message KeyLocator { - // The family of key being identified. - int32 key_family = 1; - - // The precise index of the key being identified. - int32 key_index = 2; -} - -message KeyDescriptor { - /* - The raw bytes of the public key in the key pair being identified. Either - this or the KeyLocator must be specified. - */ - bytes raw_key_bytes = 1; - - /* - The key locator that identifies which private key to use for signing. - Either this or the raw bytes of the target public key must be specified. - */ - KeyLocator key_loc = 2; -} - -message TxOut { - // The value of the output being spent. - int64 value = 1; - - // The script of the output being spent. - bytes pk_script = 2; -} - -message SignDescriptor { - /* - A descriptor that precisely describes *which* key to use for signing. This - may provide the raw public key directly, or require the Signer to re-derive - the key according to the populated derivation path. - - Note that if the key descriptor was obtained through walletrpc.DeriveKey, - then the key locator MUST always be provided, since the derived keys are not - persisted unlike with DeriveNextKey. - */ - KeyDescriptor key_desc = 1; - - /* - A scalar value that will be added to the private key corresponding to the - above public key to obtain the private key to be used to sign this input. - This value is typically derived via the following computation: - - * derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N - */ - bytes single_tweak = 2; - - /* - A private key that will be used in combination with its corresponding - private key to derive the private key that is to be used to sign the target - input. Within the Lightning protocol, this value is typically the - commitment secret from a previously revoked commitment transaction. This - value is in combination with two hash values, and the original private key - to derive the private key to be used when signing. - - * k = (privKey*sha256(pubKey || tweakPub) + - tweakPriv*sha256(tweakPub || pubKey)) mod N - */ - bytes double_tweak = 3; - - /* - The full script required to properly redeem the output. This field will - only be populated if a p2wsh or a p2sh output is being signed. - */ - bytes witness_script = 4; - - /* - A description of the output being spent. The value and script MUST be - provided. - */ - TxOut output = 5; - - /* - The target sighash type that should be used when generating the final - sighash, and signature. - */ - uint32 sighash = 7; - - /* - The target input within the transaction that should be signed. - */ - int32 input_index = 8; -} - -message SignReq { - // The raw bytes of the transaction to be signed. - bytes raw_tx_bytes = 1; - - // A set of sign descriptors, for each input to be signed. - repeated SignDescriptor sign_descs = 2; -} - -message SignResp { - /* - A set of signatures realized in a fixed 64-byte format ordered in ascending - input order. - */ - repeated bytes raw_sigs = 1; -} - -message InputScript { - // The serializes witness stack for the specified input. - repeated bytes witness = 1; - - /* - The optional sig script for the specified witness that will only be set if - the input specified is a nested p2sh witness program. - */ - bytes sig_script = 2; -} - -message InputScriptResp { - // The set of fully valid input scripts requested. - repeated InputScript input_scripts = 1; -} - -message SignMessageReq { - // The message to be signed. - bytes msg = 1; - - // The key locator that identifies which key to use for signing. - KeyLocator key_loc = 2; - - // Double-SHA256 hash instead of just the default single round. - bool double_hash = 3; - - /* - Use the compact (pubkey recoverable) format instead of the raw lnwire - format. - */ - bool compact_sig = 4; -} -message SignMessageResp { - /* - The signature for the given message in the fixed-size LN wire format. - */ - bytes signature = 1; -} - -message VerifyMessageReq { - // The message over which the signature is to be verified. - bytes msg = 1; - - /* - The fixed-size LN wire encoded signature to be verified over the given - message. - */ - bytes signature = 2; - - // The public key the signature has to be valid for. - bytes pubkey = 3; -} -message VerifyMessageResp { - // Whether the signature was valid over the given message. - bool valid = 1; -} - -message SharedKeyRequest { - // The ephemeral public key to use for the DH key derivation. - bytes ephemeral_pubkey = 1; - - /* - Deprecated. The optional key locator of the local key that should be used. - If this parameter is not set then the node's identity private key will be - used. - */ - KeyLocator key_loc = 2 [deprecated = true]; - - /* - A key descriptor describes the key used for performing ECDH. Either a key - locator or a raw public key is expected, if neither is supplied, defaults to - the node's identity private key. - */ - KeyDescriptor key_desc = 3; -} - -message SharedKeyResponse { - // The shared public key, hashed with sha256. - bytes shared_key = 1; -} diff --git a/protos/lnd/v0.14.3-beta/autopilotrpc/autopilot.proto b/protos/lnd/v0.15.1-beta/autopilotrpc/autopilot.proto similarity index 100% rename from protos/lnd/v0.14.3-beta/autopilotrpc/autopilot.proto rename to protos/lnd/v0.15.1-beta/autopilotrpc/autopilot.proto diff --git a/protos/lnd/v0.14.3-beta/chainrpc/chainnotifier.proto b/protos/lnd/v0.15.1-beta/chainrpc/chainnotifier.proto similarity index 89% rename from protos/lnd/v0.14.3-beta/chainrpc/chainnotifier.proto rename to protos/lnd/v0.15.1-beta/chainrpc/chainnotifier.proto index 5c9202b..4045d81 100644 --- a/protos/lnd/v0.14.3-beta/chainrpc/chainnotifier.proto +++ b/protos/lnd/v0.15.1-beta/chainrpc/chainnotifier.proto @@ -12,9 +12,11 @@ service ChainNotifier { registers an intent for a client to be notified once a confirmation request has reached its required number of confirmations on-chain. - A client can specify whether the confirmation request should be for a - particular transaction by its hash or for an output script by specifying a - zero hash. + A confirmation request must have a valid output script. It is also possible + to give a transaction ID. If the transaction ID is not set, a notification + is sent once the output script confirms. If the transaction ID is also set, + a notification is sent once the output script confirms in the given + transaction. */ rpc RegisterConfirmationsNtfn (ConfRequest) returns (stream ConfEvent); @@ -119,7 +121,11 @@ message SpendRequest { /* The outpoint for which we should request a spend notification for. If set to a zero outpoint, then the spend notification will be requested for the - script instead. + script instead. A zero or nil outpoint is not supported for Taproot spends + because the output script cannot reliably be computed from the witness alone + and the spent output script is not always available in the rescan context. + So an outpoint must _always_ be specified when registering a spend + notification for a Taproot output. */ Outpoint outpoint = 1; diff --git a/protos/lnd/v0.14.3-beta/invoicesrpc/invoices.proto b/protos/lnd/v0.15.1-beta/invoicesrpc/invoices.proto similarity index 95% rename from protos/lnd/v0.14.3-beta/invoicesrpc/invoices.proto rename to protos/lnd/v0.15.1-beta/invoicesrpc/invoices.proto index 810e663..f98c64a 100644 --- a/protos/lnd/v0.14.3-beta/invoicesrpc/invoices.proto +++ b/protos/lnd/v0.15.1-beta/invoicesrpc/invoices.proto @@ -44,7 +44,8 @@ service Invoices { } message CancelInvoiceMsg { - // Hash corresponding to the (hold) invoice to cancel. + // Hash corresponding to the (hold) invoice to cancel. When using + // REST, this field must be encoded as base64. bytes payment_hash = 1; } message CancelInvoiceResp { @@ -138,7 +139,8 @@ message SettleInvoiceResp { message SubscribeSingleInvoiceRequest { reserved 1; - // Hash corresponding to the (hold) invoice to subscribe to. + // Hash corresponding to the (hold) invoice to subscribe to. When using + // REST, this field must be encoded as base64url. bytes r_hash = 2; } @@ -163,6 +165,7 @@ enum LookupModifier { message LookupInvoiceMsg { oneof invoice_ref { + // When using REST, this field must be encoded as base64. bytes payment_hash = 1; bytes payment_addr = 2; bytes set_id = 3; diff --git a/protos/lnd/v0.14.3-beta/lightning.proto b/protos/lnd/v0.15.1-beta/lightning.proto similarity index 94% rename from protos/lnd/v0.14.3-beta/lightning.proto rename to protos/lnd/v0.15.1-beta/lightning.proto index 5bfe570..b1716e3 100644 --- a/protos/lnd/v0.14.3-beta/lightning.proto +++ b/protos/lnd/v0.15.1-beta/lightning.proto @@ -570,6 +570,13 @@ service Lightning { */ rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest) returns (stream CustomMessage); + + /* lncli: `listaliases` + ListAliases returns the set of all aliases that have ever existed with + their confirmed SCID (if it exists) and/or the base SCID (in the case of + zero conf). + */ + rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse); } message SubscribeCustomMessagesRequest { @@ -620,6 +627,38 @@ message Utxo { int64 confirmations = 6; } +enum OutputScriptType { + SCRIPT_TYPE_PUBKEY_HASH = 0; + SCRIPT_TYPE_SCRIPT_HASH = 1; + SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; + SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; + SCRIPT_TYPE_PUBKEY = 4; + SCRIPT_TYPE_MULTISIG = 5; + SCRIPT_TYPE_NULLDATA = 6; + SCRIPT_TYPE_NON_STANDARD = 7; + SCRIPT_TYPE_WITNESS_UNKNOWN = 8; +} + +message OutputDetail { + // The type of the output + OutputScriptType output_type = 1; + + // The address + string address = 2; + + // The pkscript in hex + string pk_script = 3; + + // The output index used in the raw transaction + int64 output_index = 4; + + // The value of the output coin in satoshis + int64 amount = 5; + + // Denotes if the output is controlled by the internal wallet + bool is_our_address = 6; +} + message Transaction { // The transaction hash string tx_hash = 1; @@ -642,15 +681,23 @@ message Transaction { // Fees paid for this transaction int64 total_fees = 7; - // Addresses that received funds for this transaction - repeated string dest_addresses = 8; + // Addresses that received funds for this transaction. Deprecated as it is + // now incorporated in the output_details field. + repeated string dest_addresses = 8 [deprecated = true]; + + // Outputs that received funds for this transaction + repeated OutputDetail output_details = 11; // The raw transaction hex. string raw_tx_hex = 9; // A label that was optionally set on transaction broadcast. string label = 10; + + // PreviousOutpoints/Inputs of this transaction. + repeated PreviousOutPoint previous_outpoints = 12; } + message GetTransactionsRequest { /* The height from which to list transactions, inclusive. If this value is @@ -879,6 +926,14 @@ message ChannelAcceptRequest { // The commitment type the initiator wishes to use for the proposed channel. CommitmentType commitment_type = 14; + + // Whether the initiator wants to open a zero-conf channel via the channel + // type. + bool wants_zero_conf = 15; + + // Whether the initiator wants to use the scid-alias channel type. This is + // separate from the feature bit. + bool wants_scid_alias = 16; } message ChannelAcceptResponse { @@ -939,6 +994,13 @@ message ChannelAcceptResponse { The number of confirmations we require before we consider the channel open. */ uint32 min_accept_depth = 10; + + /* + Whether the responder wants this to be a zero-conf channel. This will fail + if either side does not have the scid-alias feature bit set. The minimum + depth field must be zero if this is true. + */ + bool zero_conf = 11; } message ChannelPoint { @@ -971,12 +1033,21 @@ message OutPoint { uint32 output_index = 3; } +message PreviousOutPoint { + // The outpoint in format txid:n. + string outpoint = 1; + + // Denotes if the outpoint is controlled by the internal wallet. + // The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. + bool is_our_output = 2; +} + message LightningAddress { - // The identity pubkey of the Lightning node + // The identity pubkey of the Lightning node. string pubkey = 1; // The network location of the lightning node, e.g. `69.69.69.69:1337` or - // `localhost:10011` + // `localhost:10011`. string host = 2; } @@ -1102,12 +1173,15 @@ message ListUnspentResponse { - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) +- `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) */ enum AddressType { WITNESS_PUBKEY_HASH = 0; NESTED_PUBKEY_HASH = 1; UNUSED_WITNESS_PUBKEY_HASH = 2; UNUSED_NESTED_PUBKEY_HASH = 3; + TAPROOT_PUBKEY = 4; + UNUSED_TAPROOT_PUBKEY = 5; } message NewAddressRequest { @@ -1162,11 +1236,15 @@ message VerifyMessageResponse { } message ConnectPeerRequest { - // Lightning address of the peer, in the format `@host` + /* + Lightning address of the peer to connect to. + */ LightningAddress addr = 1; - /* If set, the daemon will attempt to persistently connect to the target - * peer. Otherwise, the call will be synchronous. */ + /* + If set, the daemon will attempt to persistently connect to the target + peer. Otherwise, the call will be synchronous. + */ bool perm = 2; /* @@ -1419,6 +1497,18 @@ message Channel { // List constraints for the remote node. ChannelConstraints remote_constraints = 30; + + /* + This lists out the set of alias short channel ids that exist for a channel. + This may be empty. + */ + repeated uint64 alias_scids = 31; + + // Whether or not this is a zero-conf channel. + bool zero_conf = 32; + + // This is the confirmed / on-chain zero-conf SCID. + uint64 zero_conf_confirmed_scid = 33; } message ListChannelsRequest { @@ -1438,6 +1528,22 @@ message ListChannelsResponse { repeated Channel channels = 11; } +message AliasMap { + /* + For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is + the first assigned "base" alias. + */ + uint64 base_scid = 1; + + // The set of all aliases stored for the base SCID. + repeated uint64 aliases = 2; +} +message ListAliasesRequest { +} +message ListAliasesResponse { + repeated AliasMap alias_maps = 1; +} + enum Initiator { INITIATOR_UNKNOWN = 0; INITIATOR_LOCAL = 1; @@ -1502,6 +1608,15 @@ message ChannelCloseSummary { Initiator close_initiator = 12; repeated Resolution resolutions = 13; + + /* + This lists out the set of alias short channel ids that existed for the + closed channel. This may be empty. + */ + repeated uint64 alias_scids = 14; + + // The confirmed SCID for a zero-conf channel. + uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; } enum ResolutionType { @@ -1770,6 +1885,11 @@ message GetInfoResponse { announcements and invoices. */ map features = 19; + + /* + Indicates whether the HTLC interceptor API is in always-on mode. + */ + bool require_htlc_interceptor = 21; } message GetRecoveryInfoRequest { @@ -1842,6 +1962,11 @@ message CloseChannelRequest { // A manual fee rate set in sat/vbyte that should be used when crafting the // closure transaction. uint64 sat_per_vbyte = 6; + + // The maximum fee rate the closer is willing to pay. + // + // NOTE: This field is only respected if we're the initiator of the channel. + uint64 max_fee_per_vbyte = 7; } message CloseStatusUpdate { @@ -2053,6 +2178,17 @@ message OpenChannelRequest { the remote peer supports explicit channel negotiation. */ CommitmentType commitment_type = 18; + + /* + If this is true, then a zero-conf channel open will be attempted. + */ + bool zero_conf = 19; + + /* + If this is true, then an option-scid-alias channel-type open will be + attempted. + */ + bool scid_alias = 20; } message OpenStatusUpdate { oneof update { @@ -2316,15 +2452,15 @@ message PendingChannelsResponse { // A set of flags showing the current state of the channel. string chan_status_flags = 11; + + // Whether this channel is advertised to the network or not. + bool private = 12; } message PendingOpenChannel { // The pending channel PendingChannel channel = 1; - // The height at which this channel will be confirmed - uint32 confirmation_height = 2; - /* The amount calculated to be paid in fees for the current set of commitment transactions. The fee amount is persisted with the channel @@ -2343,6 +2479,9 @@ message PendingChannelsResponse { transaction. This value can later be updated once the channel is open. */ int64 fee_per_kw = 6; + + // Previously used for confirmation_height. Do not reuse. + reserved 2; } message WaitingCloseChannel { @@ -2503,6 +2642,9 @@ message WalletBalanceResponse { // other usage. int64 locked_balance = 5; + // The amount of reserve required. + int64 reserved_balance_anchor_chan = 6; + // A mapping of each wallet account's name to its balance. map account_balance = 4; } @@ -2650,6 +2792,12 @@ message QueryRoutesRequest { fallback. */ repeated lnrpc.FeatureBit dest_features = 17; + + /* + The time preference for this payment. Set to -1 to optimize for fees + only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + double time_pref = 18; } message NodePair { @@ -2744,6 +2892,9 @@ message Hop { to drop off at each hop within the onion. */ map custom_records = 11; + + // The payment metadata to send along with the payment to the payee. + bytes metadata = 13; } message MPPRecord { @@ -3115,6 +3266,7 @@ message Invoice { /* The hash of the preimage. When using REST, this field must be encoded as base64. + Note: Output only, don't specify for creating an invoice. */ bytes r_hash = 4; @@ -3132,19 +3284,30 @@ message Invoice { */ int64 value_msat = 23; - // Whether this invoice has been fulfilled + /* + Whether this invoice has been fulfilled + + The field is deprecated. Use the state field instead (compare to SETTLED). + */ bool settled = 6 [deprecated = true]; - // When this invoice was created + /* + When this invoice was created. + Note: Output only, don't specify for creating an invoice. + */ int64 creation_date = 7; - // When this invoice was settled + /* + When this invoice was settled. + Note: Output only, don't specify for creating an invoice. + */ int64 settle_date = 8; /* A bare-bones invoice for a payment within the Lightning Network. With the details of the invoice, the sender has all the data necessary to send a payment to the recipient. + Note: Output only, don't specify for creating an invoice. */ string payment_request = 9; @@ -3179,6 +3342,7 @@ message Invoice { this index making it monotonically increasing. Callers to the SubscribeInvoices call can use this to instantly get notified of all added invoices with an add_index greater than this one. + Note: Output only, don't specify for creating an invoice. */ uint64 add_index = 16; @@ -3187,6 +3351,7 @@ message Invoice { increment this index making it monotonically increasing. Callers to the SubscribeInvoices call can use this to instantly get notified of all settled invoices with an settle_index greater than this one. + Note: Output only, don't specify for creating an invoice. */ uint64 settle_index = 17; @@ -3200,6 +3365,7 @@ message Invoice { was ultimately accepted. Additionally, it's possible that the sender paid MORE that was specified in the original invoice. So we'll record that here as well. + Note: Output only, don't specify for creating an invoice. */ int64 amt_paid_sat = 19; @@ -3210,6 +3376,7 @@ message Invoice { amount was ultimately accepted. Additionally, it's possible that the sender paid MORE that was specified in the original invoice. So we'll record that here as well. + Note: Output only, don't specify for creating an invoice. */ int64 amt_paid_msat = 20; @@ -3222,18 +3389,26 @@ message Invoice { /* The state the invoice is in. + Note: Output only, don't specify for creating an invoice. */ InvoiceState state = 21; - // List of HTLCs paying to this invoice [EXPERIMENTAL]. + /* + List of HTLCs paying to this invoice [EXPERIMENTAL]. + Note: Output only, don't specify for creating an invoice. + */ repeated InvoiceHTLC htlcs = 22; - // List of features advertised on the invoice. + /* + List of features advertised on the invoice. + Note: Output only, don't specify for creating an invoice. + */ map features = 24; /* Indicates if this invoice was a spontaneous payment that arrived via keysend [EXPERIMENTAL]. + Note: Output only, don't specify for creating an invoice. */ bool is_keysend = 25; @@ -3241,6 +3416,7 @@ message Invoice { The payment address of this invoice. This value will be used in MPP payments, and also for newer invoices that always require the MPP payload for added end-to-end security. + Note: Output only, don't specify for creating an invoice. */ bytes payment_addr = 26; @@ -3256,6 +3432,7 @@ message Invoice { given set ID. This field is always populated for AMP invoices, and can be used along side LookupInvoice to obtain the HTLC information related to a given sub-invoice. + Note: Output only, don't specify for creating an invoice. */ map amp_invoice_state = 28; } @@ -3577,6 +3754,14 @@ message ListPaymentsRequest { of the returned payments is always oldest first (ascending index order). */ bool reversed = 4; + + /* + If set, all payments (complete and incomplete, independent of the + max_payments parameter) will be counted. Note that setting this to true will + increase the run time of the call significantly on systems that have a lot + of payments, as all of them have to be iterated through to be counted. + */ + bool count_total_payments = 5; } message ListPaymentsResponse { @@ -3594,6 +3779,14 @@ message ListPaymentsResponse { as the index_offset to continue seeking forwards in the next request. */ uint64 last_index_offset = 3; + + /* + Will only be set if count_total_payments in the request was set. Represents + the total number of payments (complete and incomplete, independent of the + number of payments requested in the query) currently present in the payments + database. + */ + uint64 total_num_payments = 4; } message DeletePaymentRequest { @@ -4247,6 +4440,14 @@ message RPCMiddlewareRequest { the same type, or replaced by an error message. */ RPCMessage response = 6; + + /* + This is used to indicate to the client that the server has successfully + registered the interceptor. This is only used in the very first message + that the server sends to the client after the client sends the server + the middleware registration message. + */ + bool reg_complete = 8; } /* @@ -4284,7 +4485,8 @@ message RPCMessage { /* The full canonical gRPC name of the message type (in the format - .TypeName, for example lnrpc.GetInfoRequest). + .TypeName, for example lnrpc.GetInfoRequest). In case of an + error being returned from lnd, this simply contains the string "error". */ string type_name = 3; @@ -4293,6 +4495,13 @@ message RPCMessage { format. */ bytes serialized = 4; + + /* + Indicates that the response from lnd was an error, not a gRPC response. If + this is set to true then the type_name contains the string "error" and + serialized contains the error string. + */ + bool is_error = 5; } message RPCMiddlewareResponse { @@ -4369,18 +4578,16 @@ message InterceptFeedback { string error = 1; /* - A boolean indicating that the gRPC response should be replaced/overwritten. - As its name suggests, this can only be used as a feedback to an intercepted - response RPC message and is ignored for feedback on any other message. This - boolean is needed because in protobuf an empty message is serialized as a - 0-length or nil byte slice and we wouldn't be able to distinguish between + A boolean indicating that the gRPC message should be replaced/overwritten. + This boolean is needed because in protobuf an empty message is serialized as + a 0-length or nil byte slice and we wouldn't be able to distinguish between an empty replacement message and the "don't replace anything" case. */ bool replace_response = 2; /* If the replace_response field is set to true, this field must contain the - binary serialized gRPC response message in the protobuf format. + binary serialized gRPC message in the protobuf format. */ bytes replacement_serialized = 3; } diff --git a/protos/lnd/v0.14.3-beta/routerrpc/router.proto b/protos/lnd/v0.15.1-beta/routerrpc/router.proto similarity index 95% rename from protos/lnd/v0.14.3-beta/routerrpc/router.proto rename to protos/lnd/v0.15.1-beta/routerrpc/router.proto index 1eb0c6b..04812b4 100644 --- a/protos/lnd/v0.14.3-beta/routerrpc/router.proto +++ b/protos/lnd/v0.15.1-beta/routerrpc/router.proto @@ -284,6 +284,12 @@ message SendPaymentRequest { If set, an AMP-payment will be attempted. */ bool amp = 22; + + /* + The time preference for this payment. Set to -1 to optimize for fees + only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + double time_pref = 23; } message TrackPaymentRequest { @@ -330,6 +336,14 @@ message SendToRouteRequest { // Route that should be used to attempt to complete the payment. lnrpc.Route route = 2; + + /* + Whether the payment should be marked as failed when a temporary error is + returned from the given route. Set it to true so the payment won't be + failed unless a terminal error is occurred, such as payment timeout, no + routes, incorrect payment details, or insufficient funds. + */ + bool skip_temp_err = 3; } message SendToRouteResponse { @@ -683,7 +697,7 @@ enum PaymentState { FAILED_NO_ROUTE = 3; /* - A non-recoverable error has occured. + A non-recoverable error has occurred. */ FAILED_ERROR = 4; @@ -781,6 +795,21 @@ message ForwardHtlcInterceptResponse { // The preimage in case the resolve action is Settle. bytes preimage = 3; + + // Encrypted failure message in case the resolve action is Fail. + // + // If failure_message is specified, the failure_code field must be set + // to zero. + bytes failure_message = 4; + + // Return the specified failure code in case the resolve action is Fail. The + // message data fields are populated automatically. + // + // If a non-zero failure_code is specified, failure_message must not be set. + // + // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the + // default value for this field. + lnrpc.Failure.FailureCode failure_code = 5; } enum ResolveHoldForwardAction { diff --git a/protos/lnd/v0.15.1-beta/signrpc/signer.proto b/protos/lnd/v0.15.1-beta/signrpc/signer.proto new file mode 100644 index 0000000..5ea85dd --- /dev/null +++ b/protos/lnd/v0.15.1-beta/signrpc/signer.proto @@ -0,0 +1,640 @@ +syntax = "proto3"; + +package signrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc/signrpc"; + +// Signer is a service that gives access to the signing functionality of the +// daemon's wallet. +service Signer { + /* + SignOutputRaw is a method that can be used to generated a signature for a + set of inputs/outputs to a transaction. Each request specifies details + concerning how the outputs should be signed, which keys they should be + signed with, and also any optional tweaks. The return value is a fixed + 64-byte signature (the same format as we use on the wire in Lightning). + + If we are unable to sign using the specified keys, then an error will be + returned. + */ + rpc SignOutputRaw (SignReq) returns (SignResp); + + /* + ComputeInputScript generates a complete InputIndex for the passed + transaction with the signature as defined within the passed SignDescriptor. + This method should be capable of generating the proper input script for both + regular p2wkh/p2tr outputs and p2wkh outputs nested within a regular p2sh + output. + + Note that when using this method to sign inputs belonging to the wallet, + the only items of the SignDescriptor that need to be populated are pkScript + in the TxOut field, the value in that same field, and finally the input + index. + */ + rpc ComputeInputScript (SignReq) returns (InputScriptResp); + + /* + SignMessage signs a message with the key specified in the key locator. The + returned signature is fixed-size LN wire format encoded. + + The main difference to SignMessage in the main RPC is that a specific key is + used to sign the message instead of the node identity private key. + */ + rpc SignMessage (SignMessageReq) returns (SignMessageResp); + + /* + VerifyMessage verifies a signature over a message using the public key + provided. The signature must be fixed-size LN wire format encoded. + + The main difference to VerifyMessage in the main RPC is that the public key + used to sign the message does not have to be a node known to the network. + */ + rpc VerifyMessage (VerifyMessageReq) returns (VerifyMessageResp); + + /* + DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key + derivation between the ephemeral public key in the request and the node's + key specified in the key_desc parameter. Either a key locator or a raw + public key is expected in the key_desc, if neither is supplied, defaults to + the node's identity private key: + P_shared = privKeyNode * ephemeralPubkey + The resulting shared public key is serialized in the compressed format and + hashed with sha256, resulting in the final key length of 256bit. + */ + rpc DeriveSharedKey (SharedKeyRequest) returns (SharedKeyResponse); + + /* + MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used + to calculate the combined MuSig2 public key from a list of all participating + signers' public keys. This RPC is completely stateless and deterministic and + does not create any signing session. It can be used to determine the Taproot + public key that should be put in an on-chain output once all public keys are + known. A signing session is only needed later when that output should be + _spent_ again. + + NOTE: The MuSig2 BIP is not final yet and therefore this API must be + considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + releases. Backward compatibility is not guaranteed! + */ + rpc MuSig2CombineKeys (MuSig2CombineKeysRequest) + returns (MuSig2CombineKeysResponse); + + /* + MuSig2CreateSession (experimental!) creates a new MuSig2 signing session + using the local key identified by the key locator. The complete list of all + public keys of all signing parties must be provided, including the public + key of the local signing key. If nonces of other parties are already known, + they can be submitted as well to reduce the number of RPC calls necessary + later on. + + NOTE: The MuSig2 BIP is not final yet and therefore this API must be + considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + releases. Backward compatibility is not guaranteed! + */ + rpc MuSig2CreateSession (MuSig2SessionRequest) + returns (MuSig2SessionResponse); + + /* + MuSig2RegisterNonces (experimental!) registers one or more public nonces of + other signing participants for a session identified by its ID. This RPC can + be called multiple times until all nonces are registered. + + NOTE: The MuSig2 BIP is not final yet and therefore this API must be + considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + releases. Backward compatibility is not guaranteed! + */ + rpc MuSig2RegisterNonces (MuSig2RegisterNoncesRequest) + returns (MuSig2RegisterNoncesResponse); + + /* + MuSig2Sign (experimental!) creates a partial signature using the local + signing key that was specified when the session was created. This can only + be called when all public nonces of all participants are known and have been + registered with the session. If this node isn't responsible for combining + all the partial signatures, then the cleanup flag should be set, indicating + that the session can be removed from memory once the signature was produced. + + NOTE: The MuSig2 BIP is not final yet and therefore this API must be + considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + releases. Backward compatibility is not guaranteed! + */ + rpc MuSig2Sign (MuSig2SignRequest) returns (MuSig2SignResponse); + + /* + MuSig2CombineSig (experimental!) combines the given partial signature(s) + with the local one, if it already exists. Once a partial signature of all + participants is registered, the final signature will be combined and + returned. + + NOTE: The MuSig2 BIP is not final yet and therefore this API must be + considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + releases. Backward compatibility is not guaranteed! + */ + rpc MuSig2CombineSig (MuSig2CombineSigRequest) + returns (MuSig2CombineSigResponse); + + /* + MuSig2Cleanup (experimental!) allows a caller to clean up a session early in + cases where it's obvious that the signing session won't succeed and the + resources can be released. + + NOTE: The MuSig2 BIP is not final yet and therefore this API must be + considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming + releases. Backward compatibility is not guaranteed! + */ + rpc MuSig2Cleanup (MuSig2CleanupRequest) returns (MuSig2CleanupResponse); +} + +message KeyLocator { + // The family of key being identified. + int32 key_family = 1; + + // The precise index of the key being identified. + int32 key_index = 2; +} + +message KeyDescriptor { + /* + The raw bytes of the public key in the key pair being identified. Either + this or the KeyLocator must be specified. + */ + bytes raw_key_bytes = 1; + + /* + The key locator that identifies which private key to use for signing. + Either this or the raw bytes of the target public key must be specified. + */ + KeyLocator key_loc = 2; +} + +message TxOut { + // The value of the output being spent. + int64 value = 1; + + // The script of the output being spent. + bytes pk_script = 2; +} + +enum SignMethod { + /* + Specifies that a SegWit v0 (p2wkh, np2wkh, p2wsh) input script should be + signed. + */ + SIGN_METHOD_WITNESS_V0 = 0; + + /* + Specifies that a SegWit v1 (p2tr) input should be signed by using the + BIP0086 method (commit to internal key only). + */ + SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086 = 1; + + /* + Specifies that a SegWit v1 (p2tr) input should be signed by using a given + taproot hash to commit to in addition to the internal key. + */ + SIGN_METHOD_TAPROOT_KEY_SPEND = 2; + + /* + Specifies that a SegWit v1 (p2tr) input should be spent using the script + path and that a specific leaf script should be signed for. + */ + SIGN_METHOD_TAPROOT_SCRIPT_SPEND = 3; +} + +message SignDescriptor { + /* + A descriptor that precisely describes *which* key to use for signing. This + may provide the raw public key directly, or require the Signer to re-derive + the key according to the populated derivation path. + + Note that if the key descriptor was obtained through walletrpc.DeriveKey, + then the key locator MUST always be provided, since the derived keys are not + persisted unlike with DeriveNextKey. + */ + KeyDescriptor key_desc = 1; + + /* + A scalar value that will be added to the private key corresponding to the + above public key to obtain the private key to be used to sign this input. + This value is typically derived via the following computation: + + * derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N + */ + bytes single_tweak = 2; + + /* + A private key that will be used in combination with its corresponding + private key to derive the private key that is to be used to sign the target + input. Within the Lightning protocol, this value is typically the + commitment secret from a previously revoked commitment transaction. This + value is in combination with two hash values, and the original private key + to derive the private key to be used when signing. + + * k = (privKey*sha256(pubKey || tweakPub) + + tweakPriv*sha256(tweakPub || pubKey)) mod N + */ + bytes double_tweak = 3; + + /* + The 32 byte input to the taproot tweak derivation that is used to derive + the output key from an internal key: outputKey = internalKey + + tagged_hash("tapTweak", internalKey || tapTweak). + + When doing a BIP 86 spend, this field can be an empty byte slice. + + When doing a normal key path spend, with the output key committing to an + actual script root, then this field should be: the tapscript root hash. + */ + bytes tap_tweak = 10; + + /* + The full script required to properly redeem the output. This field will + only be populated if a p2tr, p2wsh or a p2sh output is being signed. If a + taproot script path spend is being attempted, then this should be the raw + leaf script. + */ + bytes witness_script = 4; + + /* + A description of the output being spent. The value and script MUST be + provided. + */ + TxOut output = 5; + + /* + The target sighash type that should be used when generating the final + sighash, and signature. + */ + uint32 sighash = 7; + + /* + The target input within the transaction that should be signed. + */ + int32 input_index = 8; + + /* + The sign method specifies how the input should be signed. Depending on the + method, either the tap_tweak, witness_script or both need to be specified. + Defaults to SegWit v0 signing to be backward compatible with older RPC + clients. + */ + SignMethod sign_method = 9; +} + +message SignReq { + // The raw bytes of the transaction to be signed. + bytes raw_tx_bytes = 1; + + // A set of sign descriptors, for each input to be signed. + repeated SignDescriptor sign_descs = 2; + + /* + The full list of UTXO information for each of the inputs being spent. This + is required when spending one or more taproot (SegWit v1) outputs. + */ + repeated TxOut prev_outputs = 3; +} + +message SignResp { + /* + A set of signatures realized in a fixed 64-byte format ordered in ascending + input order. + */ + repeated bytes raw_sigs = 1; +} + +message InputScript { + // The serializes witness stack for the specified input. + repeated bytes witness = 1; + + /* + The optional sig script for the specified witness that will only be set if + the input specified is a nested p2sh witness program. + */ + bytes sig_script = 2; +} + +message InputScriptResp { + // The set of fully valid input scripts requested. + repeated InputScript input_scripts = 1; +} + +message SignMessageReq { + /* + The message to be signed. When using REST, this field must be encoded as + base64. + */ + bytes msg = 1; + + // The key locator that identifies which key to use for signing. + KeyLocator key_loc = 2; + + // Double-SHA256 hash instead of just the default single round. + bool double_hash = 3; + + /* + Use the compact (pubkey recoverable) format instead of the raw lnwire + format. This option cannot be used with Schnorr signatures. + */ + bool compact_sig = 4; + + /* + Use Schnorr signature. This option cannot be used with compact format. + */ + bool schnorr_sig = 5; + + /* + The optional Taproot tweak bytes to apply to the private key before creating + a Schnorr signature. The private key is tweaked as described in BIP-341: + privKey + h_tapTweak(internalKey || tapTweak) + */ + bytes schnorr_sig_tap_tweak = 6; +} +message SignMessageResp { + /* + The signature for the given message in the fixed-size LN wire format. + */ + bytes signature = 1; +} + +message VerifyMessageReq { + // The message over which the signature is to be verified. When using + // REST, this field must be encoded as base64. + bytes msg = 1; + + /* + The fixed-size LN wire encoded signature to be verified over the given + message. When using REST, this field must be encoded as base64. + */ + bytes signature = 2; + + /* + The public key the signature has to be valid for. When using REST, this + field must be encoded as base64. If the is_schnorr_sig option is true, then + the public key is expected to be in the 32-byte x-only serialization + according to BIP-340. + */ + bytes pubkey = 3; + + /* + Specifies if the signature is a Schnorr signature. + */ + bool is_schnorr_sig = 4; +} + +message VerifyMessageResp { + // Whether the signature was valid over the given message. + bool valid = 1; +} + +message SharedKeyRequest { + // The ephemeral public key to use for the DH key derivation. + bytes ephemeral_pubkey = 1; + + /* + Deprecated. The optional key locator of the local key that should be used. + If this parameter is not set then the node's identity private key will be + used. + */ + KeyLocator key_loc = 2 [deprecated = true]; + + /* + A key descriptor describes the key used for performing ECDH. Either a key + locator or a raw public key is expected, if neither is supplied, defaults to + the node's identity private key. + */ + KeyDescriptor key_desc = 3; +} + +message SharedKeyResponse { + // The shared public key, hashed with sha256. + bytes shared_key = 1; +} + +message TweakDesc { + /* + Tweak is the 32-byte value that will modify the public key. + */ + bytes tweak = 1; + + /* + Specifies if the target key should be converted to an x-only public key + before tweaking. If true, then the public key will be mapped to an x-only + key before the tweaking operation is applied. + */ + bool is_x_only = 2; +} + +message TaprootTweakDesc { + /* + The root hash of the tapscript tree if a script path is committed to. If + the MuSig2 key put on chain doesn't also commit to a script path (BIP-0086 + key spend only), then this needs to be empty and the key_spend_only field + below must be set to true. This is required because gRPC cannot + differentiate between a zero-size byte slice and a nil byte slice (both + would be serialized the same way). So the extra boolean is required. + */ + bytes script_root = 1; + + /* + Indicates that the above script_root is expected to be empty because this + is a BIP-0086 key spend only commitment where only the internal key is + committed to instead of also including a script root hash. + */ + bool key_spend_only = 2; +} + +message MuSig2CombineKeysRequest { + /* + A list of all public keys (serialized in 32-byte x-only format!) + participating in the signing session. The list will always be sorted + lexicographically internally. This must include the local key which is + described by the above key_loc. + */ + repeated bytes all_signer_pubkeys = 1; + + /* + A series of optional generic tweaks to be applied to the the aggregated + public key. + */ + repeated TweakDesc tweaks = 2; + + /* + An optional taproot specific tweak that must be specified if the MuSig2 + combined key will be used as the main taproot key of a taproot output + on-chain. + */ + TaprootTweakDesc taproot_tweak = 3; +} + +message MuSig2CombineKeysResponse { + /* + The combined public key (in the 32-byte x-only format) with all tweaks + applied to it. If a taproot tweak is specified, this corresponds to the + taproot key that can be put into the on-chain output. + */ + bytes combined_key = 1; + + /* + The raw combined public key (in the 32-byte x-only format) before any tweaks + are applied to it. If a taproot tweak is specified, this corresponds to the + internal key that needs to be put into the witness if the script spend path + is used. + */ + bytes taproot_internal_key = 2; +} + +message MuSig2SessionRequest { + /* + The key locator that identifies which key to use for signing. + */ + KeyLocator key_loc = 1; + + /* + A list of all public keys (serialized in 32-byte x-only format!) + participating in the signing session. The list will always be sorted + lexicographically internally. This must include the local key which is + described by the above key_loc. + */ + repeated bytes all_signer_pubkeys = 2; + + /* + An optional list of all public nonces of other signing participants that + might already be known. + */ + repeated bytes other_signer_public_nonces = 3; + + /* + A series of optional generic tweaks to be applied to the the aggregated + public key. + */ + repeated TweakDesc tweaks = 4; + + /* + An optional taproot specific tweak that must be specified if the MuSig2 + combined key will be used as the main taproot key of a taproot output + on-chain. + */ + TaprootTweakDesc taproot_tweak = 5; +} + +message MuSig2SessionResponse { + /* + The unique ID that represents this signing session. A session can be used + for producing a signature a single time. If the signing fails for any + reason, a new session with the same participants needs to be created. + */ + bytes session_id = 1; + + /* + The combined public key (in the 32-byte x-only format) with all tweaks + applied to it. If a taproot tweak is specified, this corresponds to the + taproot key that can be put into the on-chain output. + */ + bytes combined_key = 2; + + /* + The raw combined public key (in the 32-byte x-only format) before any tweaks + are applied to it. If a taproot tweak is specified, this corresponds to the + internal key that needs to be put into the witness if the script spend path + is used. + */ + bytes taproot_internal_key = 3; + + /* + The two public nonces the local signer uses, combined into a single value + of 66 bytes. Can be split into the two 33-byte points to get the individual + nonces. + */ + bytes local_public_nonces = 4; + + /* + Indicates whether all nonces required to start the signing process are known + now. + */ + bool have_all_nonces = 5; +} + +message MuSig2RegisterNoncesRequest { + /* + The unique ID of the signing session those nonces should be registered with. + */ + bytes session_id = 1; + + /* + A list of all public nonces of other signing participants that should be + registered. + */ + repeated bytes other_signer_public_nonces = 3; +} + +message MuSig2RegisterNoncesResponse { + /* + Indicates whether all nonces required to start the signing process are known + now. + */ + bool have_all_nonces = 1; +} + +message MuSig2SignRequest { + /* + The unique ID of the signing session to use for signing. + */ + bytes session_id = 1; + + /* + The 32-byte SHA256 digest of the message to sign. + */ + bytes message_digest = 2; + + /* + Cleanup indicates that after signing, the session state can be cleaned up, + since another participant is going to be responsible for combining the + partial signatures. + */ + bool cleanup = 3; +} + +message MuSig2SignResponse { + /* + The partial signature created by the local signer. + */ + bytes local_partial_signature = 1; +} + +message MuSig2CombineSigRequest { + /* + The unique ID of the signing session to combine the signatures for. + */ + bytes session_id = 1; + + /* + The list of all other participants' partial signatures to add to the current + session. + */ + repeated bytes other_partial_signatures = 2; +} + +message MuSig2CombineSigResponse { + /* + Indicates whether all partial signatures required to create a final, full + signature are known yet. If this is true, then the final_signature field is + set, otherwise it is empty. + */ + bool have_all_signatures = 1; + + /* + The final, full signature that is valid for the combined public key. + */ + bytes final_signature = 2; +} + +message MuSig2CleanupRequest { + /* + The unique ID of the signing session that should be removed/cleaned up. + */ + bytes session_id = 1; +} + +message MuSig2CleanupResponse { +} \ No newline at end of file diff --git a/protos/lnd/v0.14.3-beta/walletrpc/walletkit.proto b/protos/lnd/v0.15.1-beta/walletrpc/walletkit.proto similarity index 95% rename from protos/lnd/v0.14.3-beta/walletrpc/walletkit.proto rename to protos/lnd/v0.15.1-beta/walletrpc/walletkit.proto index 84ff7a6..2e5f453 100644 --- a/protos/lnd/v0.14.3-beta/walletrpc/walletkit.proto +++ b/protos/lnd/v0.15.1-beta/walletrpc/walletkit.proto @@ -12,7 +12,9 @@ option go_package = "github.com/lightningnetwork/lnd/lnrpc/walletrpc"; service WalletKit { /* ListUnspent returns a list of all utxos spendable by the wallet with a - number of confirmations between the specified minimum and maximum. + number of confirmations between the specified minimum and maximum. By + default, all utxos are listed. To list only the unconfirmed utxos, set + the unconfirmed_only to true. */ rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse); @@ -62,6 +64,14 @@ service WalletKit { */ rpc ListAccounts (ListAccountsRequest) returns (ListAccountsResponse); + /* + RequiredReserve returns the minimum amount of satoshis that should be kept + in the wallet in order to fee bump anchor channels if necessary. The value + scales with the number of public anchor channels but is capped at a maximum. + */ + rpc RequiredReserve (RequiredReserveRequest) + returns (RequiredReserveResponse); + /* ImportAccount imports an account backed by an account extended public key. The master key fingerprint denotes the fingerprint of the root key @@ -240,6 +250,14 @@ message ListUnspentRequest { // An optional filter to only include outputs belonging to an account. string account = 3; + + /* + When min_confs and max_confs are zero, setting false implicitly + overrides max_confs to be MaxInt32, otherwise max_confs remains + zero. An error is returned if the value is true and both min_confs + and max_confs are non-zero. (default: false) + */ + bool unconfirmed_only = 4; } message ListUnspentResponse { @@ -324,6 +342,7 @@ enum AddressType { WITNESS_PUBKEY_HASH = 1; NESTED_WITNESS_PUBKEY_HASH = 2; HYBRID_NESTED_WITNESS_PUBKEY_HASH = 3; + TAPROOT_PUBKEY = 4; } message Account { // The name used to identify the account. @@ -389,6 +408,16 @@ message ListAccountsResponse { repeated Account accounts = 1; } +message RequiredReserveRequest { + // The number of additional channels the user would like to open. + uint32 additional_public_channels = 1; +} + +message RequiredReserveResponse { + // The amount of reserve required. + int64 required_reserve = 1; +} + message ImportAccountRequest { // A name to identify the account with. string name = 1; @@ -833,6 +862,16 @@ message UtxoLease { The absolute expiration of the output lease represented as a unix timestamp. */ uint64 expiration = 3; + + /* + The public key script of the leased output. + */ + bytes pk_script = 4; + + /* + The value of the leased output in satoshis. + */ + uint64 value = 5; } message SignPsbtRequest { diff --git a/protos/lnd/v0.14.3-beta/walletunlocker.proto b/protos/lnd/v0.15.1-beta/walletunlocker.proto similarity index 100% rename from protos/lnd/v0.14.3-beta/walletunlocker.proto rename to protos/lnd/v0.15.1-beta/walletunlocker.proto diff --git a/protos/lnd/v0.14.3-beta/watchtowerrpc/watchtower.proto b/protos/lnd/v0.15.1-beta/watchtowerrpc/watchtower.proto similarity index 100% rename from protos/lnd/v0.14.3-beta/watchtowerrpc/watchtower.proto rename to protos/lnd/v0.15.1-beta/watchtowerrpc/watchtower.proto diff --git a/protos/lnd/v0.14.3-beta/wtclientrpc/wtclient.proto b/protos/lnd/v0.15.1-beta/wtclientrpc/wtclient.proto similarity index 100% rename from protos/lnd/v0.14.3-beta/wtclientrpc/wtclient.proto rename to protos/lnd/v0.15.1-beta/wtclientrpc/wtclient.proto diff --git a/protos/loop/v0.19.1-beta/client.proto b/protos/loop/v0.20.1-beta/client.proto similarity index 99% rename from protos/loop/v0.19.1-beta/client.proto rename to protos/loop/v0.20.1-beta/client.proto index 7856c0d..26d41a2 100644 --- a/protos/loop/v0.19.1-beta/client.proto +++ b/protos/loop/v0.20.1-beta/client.proto @@ -317,6 +317,9 @@ message SwapResponse { */ string htlc_address_p2wsh = 5; + // The address of the v3 (taproot) htlc. Used for both loop-in and loop-out. + string htlc_address_p2tr = 7; + // A human-readable message received from the loop server. string server_message = 6; } @@ -387,6 +390,9 @@ message SwapStatus { // HTLC address (nested segwit), used in loop-in swaps only. string htlc_address_np2wsh = 13; + // The address of the v3 (taproot) htlc. Used for both loop-in and loop-out. + string htlc_address_p2tr = 18; + // Swap server cost int64 cost_server = 8; diff --git a/protos/loop/v0.19.1-beta/debug.proto b/protos/loop/v0.20.1-beta/debug.proto similarity index 100% rename from protos/loop/v0.19.1-beta/debug.proto rename to protos/loop/v0.20.1-beta/debug.proto diff --git a/protos/loop/v0.19.1-beta/swapserverrpc/common.proto b/protos/loop/v0.20.1-beta/swapserverrpc/common.proto similarity index 100% rename from protos/loop/v0.19.1-beta/swapserverrpc/common.proto rename to protos/loop/v0.20.1-beta/swapserverrpc/common.proto diff --git a/protos/loop/v0.19.1-beta/swapserverrpc/server.proto b/protos/loop/v0.20.1-beta/swapserverrpc/server.proto similarity index 95% rename from protos/loop/v0.19.1-beta/swapserverrpc/server.proto rename to protos/loop/v0.20.1-beta/swapserverrpc/server.proto index a8e3799..3b5676a 100644 --- a/protos/loop/v0.19.1-beta/swapserverrpc/server.proto +++ b/protos/loop/v0.20.1-beta/swapserverrpc/server.proto @@ -43,6 +43,8 @@ service SwapServer { rpc ReportRoutingResult (ReportRoutingResultReq) returns (ReportRoutingResultRes); + + rpc MuSig2SignSweep (MuSig2SignSweepReq) returns (MuSig2SignSweepRes); } /** @@ -92,6 +94,9 @@ enum ProtocolVersion { // The client may ask the server to use a custom routing helper plugin in // order to enhance off-chain payments corresponding to a swap. ROUTING_PLUGIN = 9; + + // The client will use the new v3 (taproot) HTLC scripts. + HTLC_V3 = 10; } message ServerLoopOutRequest { @@ -523,3 +528,30 @@ message ReportRoutingResultReq { message ReportRoutingResultRes { } + +message MuSig2SignSweepReq { + reserved 5; + + ProtocolVersion protocol_version = 1; + + // The swap hash. + bytes swap_hash = 2; + + // The payment address for the swap invoice, used to ensure that only the + // swap owner can obtain the partial signature. + bytes payment_address = 3; + + // The local public nonce. + bytes nonce = 4; + + // The psbt of the sweep txn. + bytes sweep_tx_psbt = 6; +} + +message MuSig2SignSweepRes { + // The server side public nonce. + bytes nonce = 1; + + // The partial signature of the server for the requested sighash. + bytes partial_signature = 2; +} diff --git a/protos/pool/v0.5.6-alpha/auctioneerrpc/auctioneer.proto b/protos/pool/v0.5.8-alpha/auctioneerrpc/auctioneer.proto similarity index 98% rename from protos/pool/v0.5.6-alpha/auctioneerrpc/auctioneer.proto rename to protos/pool/v0.5.8-alpha/auctioneerrpc/auctioneer.proto index 0030f0b..cd3b9a9 100644 --- a/protos/pool/v0.5.6-alpha/auctioneerrpc/auctioneer.proto +++ b/protos/pool/v0.5.8-alpha/auctioneerrpc/auctioneer.proto @@ -670,6 +670,13 @@ enum AuctionAccountState { The account has recently participated in a batch and is not yet confirmed. */ STATE_PENDING_BATCH = 5; + + /* + The account has reached the expiration height while it had a pending update + that hasn't yet confirmed. This allows accounts to be renewed once + confirmed and expired. + */ + STATE_EXPIRED_PENDING_UPDATE = 6; } message AuctionAccount { @@ -886,6 +893,14 @@ message ServerOrder { expressed in satoshis per 1000 weight units (sat/kW). */ uint64 max_batch_fee_rate_sat_per_kw = 13; + + // List of nodes that will be allowed to match with our order. Incompatible + // with the `not_allowed_node_ids` field. + repeated bytes allowed_node_ids = 14; + + // List of nodes that won't be allowed to match with our order. Incompatible + // with the `allowed_node_ids` field. + repeated bytes not_allowed_node_ids = 15; } enum NodeTier { diff --git a/protos/pool/v0.5.6-alpha/auctioneerrpc/hashmail.proto b/protos/pool/v0.5.8-alpha/auctioneerrpc/hashmail.proto similarity index 100% rename from protos/pool/v0.5.6-alpha/auctioneerrpc/hashmail.proto rename to protos/pool/v0.5.8-alpha/auctioneerrpc/hashmail.proto diff --git a/protos/pool/v0.5.6-alpha/trader.proto b/protos/pool/v0.5.8-alpha/trader.proto similarity index 99% rename from protos/pool/v0.5.6-alpha/trader.proto rename to protos/pool/v0.5.8-alpha/trader.proto index 755684f..34dd35a 100644 --- a/protos/pool/v0.5.6-alpha/trader.proto +++ b/protos/pool/v0.5.8-alpha/trader.proto @@ -620,6 +620,14 @@ message Order { // The channel type to use for the resulting matched channels. OrderChannelType channel_type = 13; + + // List of nodes that will be allowed to match with our order. Incompatible + // with the `not_allowed_node_ids` field. + repeated bytes allowed_node_ids = 14; + + // List of nodes that won't be allowed to match with our order. Incompatible + // with the `allowed_node_ids` field. + repeated bytes not_allowed_node_ids = 15; } message Bid {