Skip to content

Instantly share code, notes, and snippets.

@mrfelton
Created April 19, 2020 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrfelton/2d8d7f17948cf4b9af6d1de2420e5fa4 to your computer and use it in GitHub Desktop.
Save mrfelton/2d8d7f17948cf4b9af6d1de2420e5fa4 to your computer and use it in GitHub Desktop.
diff -Naur proto/0.9.0-beta/autopilotrpc/autopilot.proto proto/0.10.0-beta/autopilotrpc/autopilot.proto
--- proto/0.9.0-beta/autopilotrpc/autopilot.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/autopilotrpc/autopilot.proto 2020-04-19 10:30:30.000000000 +0200
@@ -11,68 +11,70 @@
/**
Status returns whether the daemon's autopilot agent is active.
*/
- rpc Status(StatusRequest) returns (StatusResponse);
+ rpc Status (StatusRequest) returns (StatusResponse);
/**
ModifyStatus is used to modify the status of the autopilot agent, like
enabling or disabling it.
*/
- rpc ModifyStatus(ModifyStatusRequest) returns (ModifyStatusResponse);
+ rpc ModifyStatus (ModifyStatusRequest) returns (ModifyStatusResponse);
/**
QueryScores queries all available autopilot heuristics, in addition to any
active combination of these heruristics, for the scores they would give to
the given nodes.
*/
- rpc QueryScores(QueryScoresRequest) returns (QueryScoresResponse);
+ rpc QueryScores (QueryScoresRequest) returns (QueryScoresResponse);
/**
SetScores attempts to set the scores used by the running autopilot agent,
if the external scoring heuristic is enabled.
*/
- rpc SetScores(SetScoresRequest) returns (SetScoresResponse);
+ rpc SetScores (SetScoresRequest) returns (SetScoresResponse);
}
-message StatusRequest{
+message StatusRequest {
}
-message StatusResponse{
+message StatusResponse {
/// Indicates whether the autopilot is active or not.
- bool active = 1 [json_name = "active"];
+ bool active = 1;
}
-message ModifyStatusRequest{
+message ModifyStatusRequest {
/// Whether the autopilot agent should be enabled or not.
- bool enable = 1 [json_name = "enable"];
+ bool enable = 1;
}
-message ModifyStatusResponse {}
+message ModifyStatusResponse {
+}
-message QueryScoresRequest{
- repeated string pubkeys = 1 [json_name = "pubkeys"];
+message QueryScoresRequest {
+ repeated string pubkeys = 1;
/// If set, we will ignore the local channel state when calculating scores.
- bool ignore_local_state = 2 [json_name = "no_state"];
+ bool ignore_local_state = 2;
}
message QueryScoresResponse {
message HeuristicResult {
- string heuristic = 1 [json_name = "heuristic"];
- map<string, double> scores= 2 [json_name = "scores"];
+ string heuristic = 1;
+ map<string, double> scores = 2;
}
- repeated HeuristicResult results = 1 [json_name = "results"];
+ repeated HeuristicResult results = 1;
}
-message SetScoresRequest{
+message SetScoresRequest {
/// The name of the heuristic to provide scores to.
- string heuristic = 1 [json_name = "heuristic"];
+ string heuristic = 1;
/**
A map from hex-encoded public keys to scores. Scores must be in the range
[0.0, 1.0].
*/
- map<string, double> scores = 2 [json_name = "scores"];
+ map<string, double> scores = 2;
}
-message SetScoresResponse {}
+message SetScoresResponse {
+}
diff -Naur proto/0.9.0-beta/chainrpc/chainnotifier.proto proto/0.10.0-beta/chainrpc/chainnotifier.proto
--- proto/0.9.0-beta/chainrpc/chainnotifier.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/chainrpc/chainnotifier.proto 2020-04-19 10:30:44.000000000 +0200
@@ -39,7 +39,8 @@
// The hash of the block in which the confirmed transaction was included in.
bytes block_hash = 2;
- // The height of the block in which the confirmed transaction was included in.
+ // The height of the block in which the confirmed transaction was included
+ // in.
uint32 block_height = 3;
// The index of the confirmed transaction within the transaction.
@@ -150,7 +151,7 @@
particular transaction by its hash or for an output script by specifying a
zero hash.
*/
- rpc RegisterConfirmationsNtfn(ConfRequest) returns (stream ConfEvent);
+ rpc RegisterConfirmationsNtfn (ConfRequest) returns (stream ConfEvent);
/*
RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
@@ -160,7 +161,7 @@
A client can specify whether the spend request should be for a particular
outpoint or for an output script by specifying a zero outpoint.
*/
- rpc RegisterSpendNtfn(SpendRequest) returns (stream SpendEvent);
+ rpc RegisterSpendNtfn (SpendRequest) returns (stream SpendEvent);
/*
RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
@@ -173,5 +174,5 @@
point. This allows clients to be idempotent by ensuring that they do not
missing processing a single block within the chain.
*/
- rpc RegisterBlockEpochNtfn(BlockEpoch) returns (stream BlockEpoch);
+ rpc RegisterBlockEpochNtfn (BlockEpoch) returns (stream BlockEpoch);
}
diff -Naur proto/0.9.0-beta/invoicesrpc/invoices.proto proto/0.10.0-beta/invoicesrpc/invoices.proto
--- proto/0.9.0-beta/invoicesrpc/invoices.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/invoicesrpc/invoices.proto 2020-04-19 10:31:19.000000000 +0200
@@ -15,33 +15,35 @@
to notify the client of state transitions of the specified invoice.
Initially the current invoice state is always sent out.
*/
- rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
+ rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest)
+ returns (stream lnrpc.Invoice);
/**
CancelInvoice cancels a currently open invoice. If the invoice is already
canceled, this call will succeed. If the invoice is already settled, it will
fail.
*/
- rpc CancelInvoice(CancelInvoiceMsg) returns (CancelInvoiceResp);
+ rpc CancelInvoice (CancelInvoiceMsg) returns (CancelInvoiceResp);
/**
AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
supplied in the request.
*/
- rpc AddHoldInvoice(AddHoldInvoiceRequest) returns (AddHoldInvoiceResp);
+ rpc AddHoldInvoice (AddHoldInvoiceRequest) returns (AddHoldInvoiceResp);
/**
SettleInvoice settles an accepted invoice. If the invoice is already
settled, this call will succeed.
*/
- rpc SettleInvoice(SettleInvoiceMsg) returns (SettleInvoiceResp);
+ rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp);
}
message CancelInvoiceMsg {
/// Hash corresponding to the (hold) invoice to cancel.
bytes payment_hash = 1;
}
-message CancelInvoiceResp {}
+message CancelInvoiceResp {
+}
message AddHoldInvoiceRequest {
/**
@@ -50,49 +52,49 @@
field of the encoded payment request if the description_hash field is not
being used.
*/
- string memo = 1 [json_name = "memo"];
+ string memo = 1;
/// The hash of the preimage
- bytes hash = 2 [json_name = "hash"];
+ bytes hash = 2;
/**
The value of this invoice in satoshis
The fields value and value_msat are mutually exclusive.
*/
- int64 value = 3 [json_name = "value"];
+ int64 value = 3;
/**
The value of this invoice in millisatoshis
The fields value and value_msat are mutually exclusive.
*/
- int64 value_msat = 10 [json_name = "value_msat"];
+ int64 value_msat = 10;
/**
Hash (SHA-256) of a description of the payment. Used if the description of
payment (memo) is too long to naturally fit within the description field
of an encoded payment request.
*/
- bytes description_hash = 4 [json_name = "description_hash"];
+ bytes description_hash = 4;
/// Payment request expiry time in seconds. Default is 3600 (1 hour).
- int64 expiry = 5 [json_name = "expiry"];
+ int64 expiry = 5;
/// Fallback on-chain address.
- string fallback_addr = 6 [json_name = "fallback_addr"];
+ string fallback_addr = 6;
/// Delta to use for the time-lock of the CLTV extended to the final hop.
- uint64 cltv_expiry = 7 [json_name = "cltv_expiry"];
+ uint64 cltv_expiry = 7;
/**
Route hints that can each be individually used to assist in reaching the
invoice's destination.
*/
- repeated lnrpc.RouteHint route_hints = 8 [json_name = "route_hints"];
+ repeated lnrpc.RouteHint route_hints = 8;
/// Whether this invoice should include routing hints for private channels.
- bool private = 9 [json_name = "private"];
+ bool private = 9;
}
message AddHoldInvoiceResp {
@@ -101,19 +103,21 @@
details of the invoice, the sender has all the data necessary to send a
payment to the recipient.
*/
- string payment_request = 1 [json_name = "payment_request"];
+ string payment_request = 1;
}
message SettleInvoiceMsg {
- /// Externally discovered pre-image that should be used to settle the hold invoice.
+ /// Externally discovered pre-image that should be used to settle the hold
+ /// invoice.
bytes preimage = 1;
}
-message SettleInvoiceResp {}
+message SettleInvoiceResp {
+}
message SubscribeSingleInvoiceRequest {
reserved 1;
/// Hash corresponding to the (hold) invoice to subscribe to.
- bytes r_hash = 2 [json_name = "r_hash"];
+ bytes r_hash = 2;
}
diff -Naur proto/0.9.0-beta/lnclipb/lncli.proto proto/0.10.0-beta/lnclipb/lncli.proto
--- proto/0.9.0-beta/lnclipb/lncli.proto 1970-01-01 01:00:00.000000000 +0100
+++ proto/0.10.0-beta/lnclipb/lncli.proto 2020-04-19 10:33:46.000000000 +0200
@@ -0,0 +1,15 @@
+syntax = "proto3";
+
+import "../verrpc/verrpc.proto";
+
+package lnclipb;
+
+option go_package = "github.com/lightningnetwork/lnd/lnrpc/lnclipb";
+
+message VersionResponse {
+ /// The version information for lncli.
+ verrpc.Version lncli = 1;
+
+ /// The version information for lnd.
+ verrpc.Version lnd = 2;
+};
diff -Naur proto/0.9.0-beta/lnrpc/rpc.proto proto/0.10.0-beta/lnrpc/rpc.proto
--- proto/0.9.0-beta/lnrpc/rpc.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/lnrpc/rpc.proto 2020-04-19 10:31:43.000000000 +0200
@@ -19,7 +19,7 @@
* An RPC method can be matched to an lncli command by placing a line in the
* beginning of the description in exactly the following format:
* lncli: `methodname`
- *
+ *
* Failure to specify the exact name of the command will cause documentation
* generation to fail.
*
@@ -41,7 +41,7 @@
method should be used to commit the newly generated seed, and create the
wallet.
*/
- rpc GenSeed(GenSeedRequest) returns (GenSeedResponse) {
+ rpc GenSeed (GenSeedRequest) returns (GenSeedResponse) {
option (google.api.http) = {
get: "/v1/genseed"
};
@@ -61,7 +61,7 @@
seed, then present it to the user. Once it has been verified by the user,
the seed can be fed into this RPC in order to commit the new wallet.
*/
- rpc InitWallet(InitWalletRequest) returns (InitWalletResponse) {
+ rpc InitWallet (InitWalletRequest) returns (InitWalletResponse) {
option (google.api.http) = {
post: "/v1/initwallet"
body: "*"
@@ -72,7 +72,7 @@
UnlockWallet is used at startup of lnd to provide a password to unlock
the wallet database.
*/
- rpc UnlockWallet(UnlockWalletRequest) returns (UnlockWalletResponse) {
+ rpc UnlockWallet (UnlockWalletRequest) returns (UnlockWalletResponse) {
option (google.api.http) = {
post: "/v1/unlockwallet"
body: "*"
@@ -83,7 +83,8 @@
ChangePassword changes the password of the encrypted wallet. This will
automatically unlock the wallet database if successful.
*/
- rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {
+ rpc ChangePassword (ChangePasswordRequest)
+ returns (ChangePasswordResponse) {
option (google.api.http) = {
post: "/v1/changepassword"
body: "*"
@@ -195,7 +196,8 @@
*/
ChanBackupSnapshot channel_backups = 3;
}
-message UnlockWalletResponse {}
+message UnlockWalletResponse {
+}
message ChangePasswordRequest {
/**
@@ -210,7 +212,8 @@
*/
bytes new_password = 2;
}
-message ChangePasswordResponse {}
+message ChangePasswordResponse {
+}
service Lightning {
/** lncli: `walletbalance`
@@ -228,7 +231,8 @@
ChannelBalance returns the total funds available across all open channels
in satoshis.
*/
- rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse) {
+ rpc ChannelBalance (ChannelBalanceRequest)
+ returns (ChannelBalanceResponse) {
option (google.api.http) = {
get: "/v1/balance/channels"
};
@@ -270,7 +274,7 @@
/** lncli: `listunspent`
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.
*/
rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) {
option (google.api.http) = {
@@ -283,7 +287,8 @@
the client in which any newly discovered transactions relevant to the
wallet are sent over.
*/
- rpc SubscribeTransactions (GetTransactionsRequest) returns (stream Transaction);
+ rpc SubscribeTransactions (GetTransactionsRequest)
+ returns (stream Transaction);
/** lncli: `sendmany`
SendMany handles a request for a transaction that creates multiple specified
@@ -344,7 +349,8 @@
given pubKey. In the case that we currently have a pending or active channel
with the target peer, then this action will be not be allowed.
*/
- rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse) {
+ rpc DisconnectPeer (DisconnectPeerRequest)
+ returns (DisconnectPeerResponse) {
option (google.api.http) = {
delete: "/v1/peers/{pub_key}"
};
@@ -384,9 +390,10 @@
workflow and is waiting for confirmations for the funding txn, or is in the
process of closure, either initiated cooperatively or non-cooperatively.
*/
- rpc PendingChannels (PendingChannelsRequest) returns (PendingChannelsResponse) {
+ rpc PendingChannels (PendingChannelsRequest)
+ returns (PendingChannelsResponse) {
option (google.api.http) = {
- get: "/v1/channels/pending"
+ get: "/v1/channels/pending"
};
}
@@ -406,19 +413,20 @@
sent over. Events include new active channels, inactive channels, and closed
channels.
*/
- rpc SubscribeChannelEvents (ChannelEventSubscription) returns (stream ChannelEventUpdate);
+ rpc SubscribeChannelEvents (ChannelEventSubscription)
+ returns (stream ChannelEventUpdate);
/** lncli: `closedchannels`
ClosedChannels returns a description of all the closed channels that
this node was a participant in.
*/
- rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse) {
+ rpc ClosedChannels (ClosedChannelsRequest)
+ returns (ClosedChannelsResponse) {
option (google.api.http) = {
get: "/v1/channels/closed"
};
}
-
/**
OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
call is meant to be consumed by clients to the REST proxy. As with all
@@ -454,7 +462,7 @@
Alternatively, this can be used to interactively drive PSBT signing for
funding for partially complete funding transactions.
*/
- rpc FundingStateStep(FundingTransitionMsg) returns (FundingStateStepResp);
+ rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp);
/**
ChannelAcceptor dispatches a bi-directional streaming RPC in which
@@ -463,7 +471,8 @@
node operators to specify their own criteria for accepting inbound channels
through a single persistent connection.
*/
- rpc ChannelAcceptor (stream ChannelAcceptResponse) returns (stream ChannelAcceptRequest);
+ rpc ChannelAcceptor (stream ChannelAcceptResponse)
+ returns (stream ChannelAcceptRequest);
/** lncli: `closechannel`
CloseChannel attempts to close an active channel identified by its channel
@@ -486,20 +495,23 @@
channels due to bugs fixed in newer versions of lnd. Only available
when in debug builds of lnd.
*/
- rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse) {
+ rpc AbandonChannel (AbandonChannelRequest)
+ returns (AbandonChannelResponse) {
option (google.api.http) = {
delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}"
};
}
-
/** lncli: `sendpayment`
- SendPayment dispatches a bi-directional streaming RPC for sending payments
- through the Lightning Network. A single RPC invocation creates a persistent
- bi-directional stream allowing clients to rapidly send payments through the
- Lightning Network with a single persistent connection.
+ Deprecated, use routerrpc.SendPayment. SendPayment dispatches a
+ bi-directional streaming RPC for sending payments through the Lightning
+ Network. A single RPC invocation creates a persistent bi-directional
+ stream allowing clients to rapidly send payments through the Lightning
+ Network with a single persistent connection.
*/
- rpc SendPayment (stream SendRequest) returns (stream SendResponse);
+ rpc SendPayment (stream SendRequest) returns (stream SendResponse) {
+ option deprecated = true;
+ }
/**
SendPaymentSync is the synchronous non-streaming version of SendPayment.
@@ -520,7 +532,7 @@
allows users to specify a full route manually. This can be used for things
like rebalancing, and atomic swaps.
*/
- rpc SendToRoute(stream SendToRouteRequest) returns (stream SendResponse);
+ rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse);
/**
SendToRouteSync is a synchronous version of SendToRoute. It Will block
@@ -611,7 +623,8 @@
/**
DeleteAllPayments deletes all outgoing payments from DB.
*/
- rpc DeleteAllPayments (DeleteAllPaymentsRequest) returns (DeleteAllPaymentsResponse) {
+ rpc DeleteAllPayments (DeleteAllPaymentsRequest)
+ returns (DeleteAllPaymentsResponse) {
option (google.api.http) = {
delete: "/v1/payments"
};
@@ -631,6 +644,16 @@
};
}
+ /** lncli: `getnodemetrics`
+ GetNodeMetrics returns node metrics calculated from the graph. Currently
+ the only supported metric is betweenness centrality of individual nodes.
+ */
+ rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse) {
+ option (google.api.http) = {
+ get: "/v1/graph/nodemetrics"
+ };
+ }
+
/** lncli: `getchaninfo`
GetChanInfo returns the latest authenticated network announcement for the
given channel identified by its channel ID: an 8-byte integer which
@@ -660,7 +683,7 @@
send an HTLC, also including the necessary information that should be
present within the Sphinx packet encapsulated within the HTLC.
*/
- rpc QueryRoutes(QueryRoutesRequest) returns (QueryRoutesResponse) {
+ rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse) {
option (google.api.http) = {
get: "/v1/graph/routes/{pub_key}/{amt}"
};
@@ -680,7 +703,7 @@
StopDaemon will send a shutdown request to the interrupt handler, triggering
a graceful shutdown of the daemon.
*/
- rpc StopDaemon(StopRequest) returns (StopResponse);
+ rpc StopDaemon (StopRequest) returns (StopResponse);
/**
SubscribeChannelGraph launches a streaming RPC that allows the caller to
@@ -690,7 +713,8 @@
channels being advertised, updates in the routing policy for a directional
channel edge, and when channels are closed on-chain.
*/
- rpc SubscribeChannelGraph(GraphTopologySubscription) returns (stream GraphTopologyUpdate);
+ rpc SubscribeChannelGraph (GraphTopologySubscription)
+ returns (stream GraphTopologyUpdate);
/** lncli: `debuglevel`
DebugLevel allows a caller to programmatically set the logging verbosity of
@@ -704,7 +728,7 @@
FeeReport allows the caller to obtain a report detailing the current fee
schedule enforced by the node globally for each channel.
*/
- rpc FeeReport(FeeReportRequest) returns (FeeReportResponse) {
+ rpc FeeReport (FeeReportRequest) returns (FeeReportResponse) {
option (google.api.http) = {
get: "/v1/fees"
};
@@ -714,7 +738,8 @@
UpdateChannelPolicy allows the caller to update the fee schedule and
channel policies for all channels globally, or a particular channel.
*/
- rpc UpdateChannelPolicy(PolicyUpdateRequest) returns (PolicyUpdateResponse) {
+ rpc UpdateChannelPolicy (PolicyUpdateRequest)
+ returns (PolicyUpdateResponse) {
option (google.api.http) = {
post: "/v1/chanpolicy"
body: "*"
@@ -733,7 +758,8 @@
the index offset of the last entry. The index offset can be provided to the
request to allow the caller to skip a series of records.
*/
- rpc ForwardingHistory(ForwardingHistoryRequest) returns (ForwardingHistoryResponse) {
+ rpc ForwardingHistory (ForwardingHistoryRequest)
+ returns (ForwardingHistoryResponse) {
option (google.api.http) = {
post: "/v1/switch"
body: "*"
@@ -748,7 +774,8 @@
method once lnd is running, or via the InitWallet and UnlockWallet methods
from the WalletUnlocker service.
*/
- rpc ExportChannelBackup(ExportChannelBackupRequest) returns (ChannelBackup) {
+ rpc ExportChannelBackup (ExportChannelBackupRequest)
+ returns (ChannelBackup) {
option (google.api.http) = {
get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}"
};
@@ -761,7 +788,8 @@
as well, which contains a single encrypted blob containing the backups of
each channel.
*/
- rpc ExportAllChannelBackups(ChanBackupExportRequest) returns (ChanBackupSnapshot) {
+ rpc ExportAllChannelBackups (ChanBackupExportRequest)
+ returns (ChanBackupSnapshot) {
option (google.api.http) = {
get: "/v1/channels/backup"
};
@@ -772,7 +800,8 @@
snapshot. This method will accept either a packed Single or a packed Multi.
Specifying both will result in an error.
*/
- rpc VerifyChanBackup(ChanBackupSnapshot) returns (VerifyChanBackupResponse) {
+ rpc VerifyChanBackup (ChanBackupSnapshot)
+ returns (VerifyChanBackupResponse) {
option (google.api.http) = {
post: "/v1/channels/backup/verify"
body: "*"
@@ -785,7 +814,8 @@
remaining within the channel. If we are able to unpack the backup, then the
new channel will be shown under listchannels, as well as pending channels.
*/
- rpc RestoreChannelBackups(RestoreChanBackupRequest) returns (RestoreBackupResponse) {
+ rpc RestoreChannelBackups (RestoreChanBackupRequest)
+ returns (RestoreBackupResponse) {
option (google.api.http) = {
post: "/v1/channels/backup/restore"
body: "*"
@@ -801,7 +831,8 @@
ups, but the updated set of encrypted multi-chan backups with the closed
channel(s) removed.
*/
- rpc SubscribeChannelBackups(ChannelBackupSubscription) returns (stream ChanBackupSnapshot) {
+ rpc SubscribeChannelBackups (ChannelBackupSubscription)
+ returns (stream ChanBackupSnapshot) {
};
/** lncli: `bakemacaroon`
@@ -809,7 +840,7 @@
write permissions. No first-party caveats are added since this can be done
offline.
*/
- rpc BakeMacaroon(BakeMacaroonRequest) returns (BakeMacaroonResponse) {
+ rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse) {
option (google.api.http) = {
post: "/v1/macaroon"
body: "*"
@@ -819,57 +850,57 @@
message Utxo {
/// The type of address
- AddressType type = 1 [json_name = "address_type"];
+ AddressType address_type = 1;
/// The address
- string address = 2 [json_name = "address"];
+ string address = 2;
/// The value of the unspent coin in satoshis
- int64 amount_sat = 3 [json_name = "amount_sat"];
+ int64 amount_sat = 3;
/// The pkscript in hex
- string pk_script = 4 [json_name = "pk_script"];
+ string pk_script = 4;
/// The outpoint in format txid:n
- OutPoint outpoint = 5 [json_name = "outpoint"];
+ OutPoint outpoint = 5;
/// The number of confirmations for the Utxo
- int64 confirmations = 6 [json_name = "confirmations"];
+ int64 confirmations = 6;
}
message Transaction {
/// The transaction hash
- string tx_hash = 1 [ json_name = "tx_hash" ];
+ string tx_hash = 1;
/// The transaction amount, denominated in satoshis
- int64 amount = 2 [ json_name = "amount" ];
+ int64 amount = 2;
/// The number of confirmations
- int32 num_confirmations = 3 [ json_name = "num_confirmations" ];
+ int32 num_confirmations = 3;
/// The hash of the block this transaction was included in
- string block_hash = 4 [ json_name = "block_hash" ];
+ string block_hash = 4;
/// The height of the block this transaction was included in
- int32 block_height = 5 [ json_name = "block_height" ];
+ int32 block_height = 5;
/// Timestamp of this transaction
- int64 time_stamp = 6 [ json_name = "time_stamp" ];
+ int64 time_stamp = 6;
/// Fees paid for this transaction
- int64 total_fees = 7 [ json_name = "total_fees" ];
+ int64 total_fees = 7;
/// Addresses that received funds for this transaction
- repeated string dest_addresses = 8 [ json_name = "dest_addresses" ];
+ repeated string dest_addresses = 8;
/// The raw transaction hex.
- string raw_tx_hex = 9 [ json_name = "raw_tx_hex" ];
+ string raw_tx_hex = 9;
}
message GetTransactionsRequest {
}
message TransactionDetails {
/// The list of transactions relevant to the wallet.
- repeated Transaction transactions = 1 [json_name = "transactions"];
+ repeated Transaction transactions = 1;
}
message FeeLimit {
@@ -985,7 +1016,7 @@
/**
Features assumed to be supported by the final node. All transitive feature
- depdencies must also be set properly. For a given feature bit pair, either
+ dependencies must also be set properly. For a given feature bit pair, either
optional or remote may be set, but not both. If this field is nil or empty,
the router will try to load destination features from the graph as a
fallback.
@@ -994,10 +1025,10 @@
}
message SendResponse {
- string payment_error = 1 [json_name = "payment_error"];
- bytes payment_preimage = 2 [json_name = "payment_preimage"];
- Route payment_route = 3 [json_name = "payment_route"];
- bytes payment_hash = 4 [json_name = "payment_hash"];
+ string payment_error = 1;
+ bytes payment_preimage = 2;
+ Route payment_route = 3;
+ bytes payment_hash = 4;
}
message SendToRouteRequest {
@@ -1029,7 +1060,8 @@
/// The pending channel id.
bytes pending_chan_id = 3;
- /// The funding amount in satoshis that initiator wishes to use in the channel.
+ /// The funding amount in satoshis that initiator wishes to use in the
+ /// channel.
uint64 funding_amt = 4;
/// The push amount of the proposed channel in millisatoshis.
@@ -1038,28 +1070,32 @@
/// The dust limit of the initiator's commitment tx.
uint64 dust_limit = 6;
- /// The maximum amount of coins in millisatoshis that can be pending in this channel.
+ /// The maximum amount of coins in millisatoshis that can be pending in this
+ /// channel.
uint64 max_value_in_flight = 7;
- /// The minimum amount of satoshis the initiator requires us to have at all times.
+ /// The minimum amount of satoshis the initiator requires us to have at all
+ /// times.
uint64 channel_reserve = 8;
/// The smallest HTLC in millisatoshis that the initiator will accept.
uint64 min_htlc = 9;
- /// The initial fee rate that the initiator suggests for both commitment transactions.
+ /// The initial fee rate that the initiator suggests for both commitment
+ /// transactions.
uint64 fee_per_kw = 10;
/**
- The number of blocks to use for the relative time lock in the pay-to-self output
- of both commitment transactions.
+ The number of blocks to use for the relative time lock in the pay-to-self
+ output of both commitment transactions.
*/
uint32 csv_delay = 11;
/// The total number of incoming HTLC's that the initiator will accept.
uint32 max_accepted_htlcs = 12;
- /// A bit-field which the initiator uses to specify proposed channel behavior.
+ /// A bit-field which the initiator uses to specify proposed channel
+ /// behavior.
uint32 channel_flags = 13;
}
@@ -1077,67 +1113,71 @@
Txid of the funding transaction. When using REST, this field must be
encoded as base64.
*/
- bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"];
+ bytes funding_txid_bytes = 1;
/**
Hex-encoded string representing the byte-reversed hash of the funding
transaction.
*/
- string funding_txid_str = 2 [json_name = "funding_txid_str"];
+ string funding_txid_str = 2;
}
/// The index of the output of the funding transaction
- uint32 output_index = 3 [json_name = "output_index"];
+ uint32 output_index = 3;
}
message OutPoint {
/// Raw bytes representing the transaction id.
- bytes txid_bytes = 1 [json_name = "txid_bytes"];
+ bytes txid_bytes = 1;
/// Reversed, hex-encoded string representing the transaction id.
- string txid_str = 2 [json_name = "txid_str"];
+ string txid_str = 2;
/// The index of the output on the transaction.
- uint32 output_index = 3 [json_name = "output_index"];
+ uint32 output_index = 3;
}
message LightningAddress {
/// The identity pubkey of the Lightning node
- string pubkey = 1 [json_name = "pubkey"];
+ string pubkey = 1;
- /// The network location of the lightning node, e.g. `69.69.69.69:1337` or `localhost:10011`
- string host = 2 [json_name = "host"];
+ /// The network location of the lightning node, e.g. `69.69.69.69:1337` or
+ /// `localhost:10011`
+ string host = 2;
}
message EstimateFeeRequest {
/// The map from addresses to amounts for the transaction.
map<string, int64> AddrToAmount = 1;
- /// The target number of blocks that this transaction should be confirmed by.
+ /// The target number of blocks that this transaction should be confirmed
+ /// by.
int32 target_conf = 2;
}
message EstimateFeeResponse {
/// The total fee in satoshis.
- int64 fee_sat = 1 [json_name = "fee_sat"];
+ int64 fee_sat = 1;
/// The fee rate in satoshi/byte.
- int64 feerate_sat_per_byte = 2 [json_name = "feerate_sat_per_byte"];
+ int64 feerate_sat_per_byte = 2;
}
message SendManyRequest {
/// The map from addresses to amounts
map<string, int64> AddrToAmount = 1;
- /// The target number of blocks that this transaction should be confirmed by.
+ /// The target number of blocks that this transaction should be confirmed
+ /// by.
int32 target_conf = 3;
- /// A manual fee rate set in sat/byte that should be used when crafting the transaction.
+ /// A manual fee rate set in sat/byte that should be used when crafting the
+ /// transaction.
int64 sat_per_byte = 5;
}
message SendManyResponse {
/// The id of the transaction
- string txid = 1 [json_name = "txid"];
+ string txid = 1;
}
message SendCoinsRequest {
@@ -1147,10 +1187,12 @@
/// The amount in satoshis to send
int64 amount = 2;
- /// The target number of blocks that this transaction should be confirmed by.
+ /// The target number of blocks that this transaction should be confirmed
+ /// by.
int32 target_conf = 3;
- /// A manual fee rate set in sat/byte that should be used when crafting the transaction.
+ /// A manual fee rate set in sat/byte that should be used when crafting the
+ /// transaction.
int64 sat_per_byte = 5;
/**
@@ -1162,7 +1204,7 @@
}
message SendCoinsResponse {
/// The transaction ID of the transaction
- string txid = 1 [json_name = "txid"];
+ string txid = 1;
}
message ListUnspentRequest {
@@ -1174,7 +1216,7 @@
}
message ListUnspentResponse {
/// A list of utxos
- repeated Utxo utxos = 1 [json_name = "utxos"];
+ repeated Utxo utxos = 1;
}
/**
@@ -1184,10 +1226,10 @@
- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1)
*/
enum AddressType {
- WITNESS_PUBKEY_HASH = 0;
- NESTED_PUBKEY_HASH = 1;
- UNUSED_WITNESS_PUBKEY_HASH = 2;
- UNUSED_NESTED_PUBKEY_HASH = 3;
+ WITNESS_PUBKEY_HASH = 0;
+ NESTED_PUBKEY_HASH = 1;
+ UNUSED_WITNESS_PUBKEY_HASH = 2;
+ UNUSED_NESTED_PUBKEY_HASH = 3;
}
message NewAddressRequest {
@@ -1196,7 +1238,7 @@
}
message NewAddressResponse {
/// The newly generated wallet address
- string address = 1 [json_name = "address"];
+ string address = 1;
}
message SignMessageRequest {
@@ -1204,11 +1246,11 @@
The message to be signed. When using REST, this field must be encoded as
base64.
*/
- bytes msg = 1 [ json_name = "msg" ];
+ bytes msg = 1;
}
message SignMessageResponse {
/// The signature for the given message
- string signature = 1 [ json_name = "signature" ];
+ string signature = 1;
}
message VerifyMessageRequest {
@@ -1216,17 +1258,17 @@
The message over which the signature is to be verified. When using REST,
this field must be encoded as base64.
*/
- bytes msg = 1 [ json_name = "msg" ];
+ bytes msg = 1;
/// The signature to be verified over the given message
- string signature = 2 [ json_name = "signature" ];
+ string signature = 2;
}
message VerifyMessageResponse {
/// Whether the signature was valid over the given message
- bool valid = 1 [ json_name = "valid" ];
+ bool valid = 1;
/// The pubkey recovered from the signature
- string pubkey = 2 [ json_name = "pubkey" ];
+ string pubkey = 2;
}
message ConnectPeerRequest {
@@ -1242,47 +1284,75 @@
message DisconnectPeerRequest {
/// The pubkey of the node to disconnect from
- string pub_key = 1 [json_name = "pub_key"];
+ string pub_key = 1;
}
message DisconnectPeerResponse {
}
message HTLC {
- bool incoming = 1 [json_name = "incoming"];
- int64 amount = 2 [json_name = "amount"];
- bytes hash_lock = 3 [json_name = "hash_lock"];
- uint32 expiration_height = 4 [json_name = "expiration_height"];
+ bool incoming = 1;
+ int64 amount = 2;
+ bytes hash_lock = 3;
+ uint32 expiration_height = 4;
+}
+
+enum CommitmentType {
+ /**
+ A channel using the legacy commitment format having tweaked to_remote
+ keys.
+ */
+ LEGACY = 0;
+
+ /**
+ A channel that uses the modern commitment format where the key in the
+ output of the remote party does not change each state. This makes back
+ up and recovery easier as when the channel is closed, the funds go
+ directly to that key.
+ */
+ STATIC_REMOTE_KEY = 1;
+
+ /**
+ A channel that uses a commitment format that has anchor outputs on the
+ commitments, allowing fee bumping after a force close transaction has
+ been broadcast.
+ */
+ ANCHORS = 2;
+
+ /**
+ Returned when the commitment type isn't known or unavailable.
+ */
+ UNKNOWN_COMMITMENT_TYPE = 999;
}
message Channel {
/// Whether this channel is active or not
- bool active = 1 [json_name = "active"];
+ bool active = 1;
/// The identity pubkey of the remote node
- string remote_pubkey = 2 [json_name = "remote_pubkey"];
+ string remote_pubkey = 2;
/**
The outpoint (txid:index) of the funding transaction. With this value, Bob
will be able to generate a signature for Alice's version of the commitment
transaction.
*/
- string channel_point = 3 [json_name = "channel_point"];
+ string channel_point = 3;
/**
The unique channel ID for the channel. The first 3 bytes are the block
height, the next 3 the index within the block, and the last 2 bytes are the
output index for the channel.
*/
- uint64 chan_id = 4 [json_name = "chan_id", jstype = JS_STRING];
+ uint64 chan_id = 4 [jstype = JS_STRING];
/// The total amount of funds held in this channel
- int64 capacity = 5 [json_name = "capacity"];
+ int64 capacity = 5;
/// This node's current balance in this channel
- int64 local_balance = 6 [json_name = "local_balance"];
+ int64 local_balance = 6;
/// The counterparty's current balance in this channel
- int64 remote_balance = 7 [json_name = "remote_balance"];
+ int64 remote_balance = 7;
/**
The amount calculated to be paid in fees for the current set of commitment
@@ -1290,84 +1360,83 @@
allow the fee amount to be removed and recalculated with each channel state
update, including updates that happen after a system restart.
*/
- int64 commit_fee = 8 [json_name = "commit_fee"];
+ int64 commit_fee = 8;
/// The weight of the commitment transaction
- int64 commit_weight = 9 [json_name = "commit_weight"];
+ int64 commit_weight = 9;
/**
The required number of satoshis per kilo-weight that the requester will pay
at all times, for both the funding transaction and commitment transaction.
This value can later be updated once the channel is open.
*/
- int64 fee_per_kw = 10 [json_name = "fee_per_kw"];
+ int64 fee_per_kw = 10;
/// The unsettled balance in this channel
- int64 unsettled_balance = 11 [json_name = "unsettled_balance"];
+ int64 unsettled_balance = 11;
/**
The total number of satoshis we've sent within this channel.
*/
- int64 total_satoshis_sent = 12 [json_name = "total_satoshis_sent"];
+ int64 total_satoshis_sent = 12;
/**
The total number of satoshis we've received within this channel.
*/
- int64 total_satoshis_received = 13 [json_name = "total_satoshis_received"];
+ int64 total_satoshis_received = 13;
/**
The total number of updates conducted within this channel.
*/
- uint64 num_updates = 14 [json_name = "num_updates"];
+ uint64 num_updates = 14;
/**
The list of active, uncleared HTLCs currently pending within the channel.
*/
- repeated HTLC pending_htlcs = 15 [json_name = "pending_htlcs"];
+ repeated HTLC pending_htlcs = 15;
/**
The CSV delay expressed in relative blocks. If the channel is force closed,
we will need to wait for this many blocks before we can regain our funds.
*/
- uint32 csv_delay = 16 [json_name = "csv_delay"];
+ uint32 csv_delay = 16;
/// Whether this channel is advertised to the network or not.
- bool private = 17 [json_name = "private"];
+ bool private = 17;
/// True if we were the ones that created the channel.
- bool initiator = 18 [json_name = "initiator"];
+ bool initiator = 18;
/// A set of flags showing the current state of the channel.
- string chan_status_flags = 19 [json_name = "chan_status_flags"];
+ string chan_status_flags = 19;
/// The minimum satoshis this node is required to reserve in its balance.
- int64 local_chan_reserve_sat = 20 [json_name = "local_chan_reserve_sat"];
+ int64 local_chan_reserve_sat = 20;
/**
The minimum satoshis the other node is required to reserve in its balance.
*/
- int64 remote_chan_reserve_sat = 21 [json_name = "remote_chan_reserve_sat"];
+ int64 remote_chan_reserve_sat = 21;
- /**
- If true, then this channel uses the modern commitment format where the key
- in the output of the remote party does not change each state. This makes
- back up and recovery easier as when the channel is closed, the funds go
- directly to that key.
- */
- bool static_remote_key = 22 [json_name = "static_remote_key"];
+ /// Deprecated. Use commitment_type.
+ bool static_remote_key = 22 [deprecated = true];
+
+ /// The commitment type used by this channel.
+ CommitmentType commitment_type = 26;
/**
The number of seconds that the channel has been monitored by the channel
scoring system. Scores are currently not persisted, so this value may be
less than the lifetime of the channel [EXPERIMENTAL].
*/
- int64 lifetime = 23 [json_name = "lifetime"];
+ int64 lifetime = 23;
/**
The number of seconds that the remote peer has been observed as being online
- by the channel scoring system over the lifetime of the channel [EXPERIMENTAL].
+ by the channel scoring system over the lifetime of the channel
+ [EXPERIMENTAL].
*/
- int64 uptime = 24 [json_name = "uptime"];
+ int64 uptime = 24;
/**
Close address is the address that we will enforce payout to on cooperative
@@ -1376,48 +1445,78 @@
request. If this value is not set, you can still choose a payout address by
cooperatively closing with the delivery_address field set.
*/
- string close_address = 25 [json_name ="close_address"];
-}
+ string close_address = 25;
+ /*
+ The amount that the initiator of the channel optionally pushed to the remote
+ party on channel open. This amount will be zero if the channel initiator did
+ not push any funds to the remote peer. If the initiator field is true, we
+ pushed this amount to our peer, if it is false, the remote peer pushed this
+ amount to us.
+ */
+ uint64 push_amount_sat = 27;
+
+ /**
+ This uint32 indicates if this channel is to be considered 'frozen'. A
+ frozen channel doest not allow a cooperative channel close by the
+ initiator. The thaw_height is the height that this restriction stops
+ applying to the channel. This field is optional, not setting it or using a
+ value of zero will mean the channel has no additional restrictions.
+ */
+ uint32 thaw_height = 28;
+}
message ListChannelsRequest {
bool active_only = 1;
bool inactive_only = 2;
bool public_only = 3;
bool private_only = 4;
+
+ /**
+ Filters the response for channels with a target peer's pubkey. If peer is
+ empty, all channels will be returned.
+ */
+ bytes peer = 5;
}
message ListChannelsResponse {
/// The list of active channels
- repeated Channel channels = 11 [json_name = "channels"];
+ repeated Channel channels = 11;
+}
+
+enum Initiator {
+ INITIATOR_UNKNOWN = 0;
+ INITIATOR_LOCAL = 1;
+ INITIATOR_REMOTE = 2;
+ INITIATOR_BOTH = 3;
}
message ChannelCloseSummary {
/// The outpoint (txid:index) of the funding transaction.
- string channel_point = 1 [json_name = "channel_point"];
+ string channel_point = 1;
/// The unique channel ID for the channel.
- uint64 chan_id = 2 [json_name = "chan_id", jstype = JS_STRING];
+ uint64 chan_id = 2 [jstype = JS_STRING];
/// The hash of the genesis block that this channel resides within.
- string chain_hash = 3 [json_name = "chain_hash"];
+ string chain_hash = 3;
/// The txid of the transaction which ultimately closed this channel.
- string closing_tx_hash = 4 [json_name = "closing_tx_hash"];
+ string closing_tx_hash = 4;
/// Public key of the remote peer that we formerly had a channel with.
- string remote_pubkey = 5 [json_name = "remote_pubkey"];
+ string remote_pubkey = 5;
/// Total capacity of the channel.
- int64 capacity = 6 [json_name = "capacity"];
+ int64 capacity = 6;
/// Height at which the funding transaction was spent.
- uint32 close_height = 7 [json_name = "close_height"];
+ uint32 close_height = 7;
/// Settled balance at the time of channel closure
- int64 settled_balance = 8 [json_name = "settled_balance"];
+ int64 settled_balance = 8;
/// The sum of all the time-locked outputs at the time of channel closure
- int64 time_locked_balance = 9 [json_name = "time_locked_balance"];
+ int64 time_locked_balance = 9;
enum ClosureType {
COOPERATIVE_CLOSE = 0;
@@ -1429,7 +1528,23 @@
}
/// Details on how the channel was closed.
- ClosureType close_type = 10 [json_name = "close_type"];
+ ClosureType close_type = 10;
+
+ /**
+ Open initiator is the party that initiated opening the channel. Note that
+ this value may be unknown if the channel was closed before we migrated to
+ store open channel information after close.
+ */
+ Initiator open_initiator = 11;
+
+ /**
+ Close initiator indicates which party initiated the close. This value will
+ be unknown for channels that were cooperatively closed before we started
+ tracking cooperative close initiators. Note that this indicates which party
+ initiated a close, and it is possible for both to initiate cooperative or
+ force closes, although only one party's close will be confirmed on chain.
+ */
+ Initiator close_initiator = 12;
}
message ClosedChannelsRequest {
@@ -1442,33 +1557,33 @@
}
message ClosedChannelsResponse {
- repeated ChannelCloseSummary channels = 1 [json_name = "channels"];
+ repeated ChannelCloseSummary channels = 1;
}
message Peer {
/// The identity pubkey of the peer
- string pub_key = 1 [json_name = "pub_key"];
+ string pub_key = 1;
/// Network address of the peer; eg `127.0.0.1:10011`
- string address = 3 [json_name = "address"];
+ string address = 3;
/// Bytes of data transmitted to this peer
- uint64 bytes_sent = 4 [json_name = "bytes_sent"];
+ uint64 bytes_sent = 4;
/// Bytes of data transmitted from this peer
- uint64 bytes_recv = 5 [json_name = "bytes_recv"];
+ uint64 bytes_recv = 5;
/// Satoshis sent to this peer
- int64 sat_sent = 6 [json_name = "sat_sent"];
+ int64 sat_sent = 6;
/// Satoshis received from this peer
- int64 sat_recv = 7 [json_name = "sat_recv"];
+ int64 sat_recv = 7;
/// A channel is inbound if the counterparty initiated the channel
- bool inbound = 8 [json_name = "inbound"];
+ bool inbound = 8;
/// Ping time to this peer
- int64 ping_time = 9 [json_name = "ping_time"];
+ int64 ping_time = 9;
enum SyncType {
/**
@@ -1488,17 +1603,40 @@
}
// The type of sync we are currently performing with this peer.
- SyncType sync_type = 10 [json_name = "sync_type"];
+ SyncType sync_type = 10;
/// Features advertised by the remote peer in their init message.
- map<uint32, Feature> features = 11 [json_name = "features"];
+ map<uint32, Feature> features = 11;
+
+ /*
+ The latest errors received from our peer with timestamps, limited to the 10
+ most recent errors. These errors are tracked across peer connections, but
+ are not persisted across lnd restarts. Note that these errors are only
+ stored for peers that we have channels open with, to prevent peers from
+ spamming us with errors at no cost.
+ */
+ repeated TimestampedError errors = 12;
+}
+
+message TimestampedError {
+ // The unix timestamp in seconds when the error occurred.
+ uint64 timestamp = 1;
+
+ // The string representation of the error sent by our peer.
+ string error = 2;
}
message ListPeersRequest {
+ /*
+ If true, only the last error that our peer sent us will be returned with
+ the peer's information, rather than the full set of historic errors we have
+ stored.
+ */
+ bool latest_error = 1;
}
message ListPeersResponse {
/// The list of currently connected peers
- repeated Peer peers = 1 [json_name = "peers"];
+ repeated Peer peers = 1;
}
message PeerEventSubscription {
@@ -1506,86 +1644,88 @@
message PeerEvent {
/// The identity pubkey of the peer.
- string pub_key = 1 [json_name = "pub_key"];
+ string pub_key = 1;
enum EventType {
PEER_ONLINE = 0;
PEER_OFFLINE = 1;
}
- EventType type = 2 [ json_name = "type" ];
+ EventType type = 2;
}
message GetInfoRequest {
}
message GetInfoResponse {
-
/// The version of the LND software that the node is running.
- string version = 14 [ json_name = "version" ];
+ string version = 14;
+
+ /// The SHA1 commit hash that the daemon is compiled with.
+ string commit_hash = 20;
/// The identity pubkey of the current node.
- string identity_pubkey = 1 [json_name = "identity_pubkey"];
+ string identity_pubkey = 1;
/// If applicable, the alias of the current node, e.g. "bob"
- string alias = 2 [json_name = "alias"];
+ string alias = 2;
/// The color of the current node in hex code format
- string color = 17 [json_name = "color"];
+ string color = 17;
/// Number of pending channels
- uint32 num_pending_channels = 3 [json_name = "num_pending_channels"];
+ uint32 num_pending_channels = 3;
/// Number of active channels
- uint32 num_active_channels = 4 [json_name = "num_active_channels"];
+ uint32 num_active_channels = 4;
/// Number of inactive channels
- uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"];
+ uint32 num_inactive_channels = 15;
/// Number of peers
- uint32 num_peers = 5 [json_name = "num_peers"];
+ uint32 num_peers = 5;
/// The node's current view of the height of the best block
- uint32 block_height = 6 [json_name = "block_height"];
+ uint32 block_height = 6;
/// The node's current view of the hash of the best block
- string block_hash = 8 [json_name = "block_hash"];
+ string block_hash = 8;
/// Timestamp of the block best known to the wallet
- int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ];
+ int64 best_header_timestamp = 13;
/// Whether the wallet's view is synced to the main chain
- bool synced_to_chain = 9 [json_name = "synced_to_chain"];
+ bool synced_to_chain = 9;
// Whether we consider ourselves synced with the public channel graph.
- bool synced_to_graph = 18 [json_name = "synced_to_graph"];
+ bool synced_to_graph = 18;
/**
Whether the current node is connected to testnet. This field is
deprecated and the network field should be used instead
**/
- bool testnet = 10 [json_name = "testnet", deprecated = true];
+ bool testnet = 10 [deprecated = true];
reserved 11;
/// A list of active chains the node is connected to
- repeated Chain chains = 16 [json_name = "chains"];
+ repeated Chain chains = 16;
/// The URIs of the current node.
- repeated string uris = 12 [json_name = "uris"];
+ repeated string uris = 12;
/*
Features that our node has advertised in our init message, node
announcements and invoices.
*/
- map<uint32, Feature> features = 19 [json_name = "features"];
+ map<uint32, Feature> features = 19;
}
message Chain {
/// The blockchain the node is on (eg bitcoin, litecoin)
- string chain = 1 [json_name = "chain"];
+ string chain = 1;
/// The network the node is on (eg regtest, testnet, mainnet)
- string network = 2 [json_name = "network"];
+ string network = 2;
}
message ConfirmationUpdate {
@@ -1596,13 +1736,13 @@
}
message ChannelOpenUpdate {
- ChannelPoint channel_point = 1 [json_name = "channel_point"];
+ ChannelPoint channel_point = 1;
}
message ChannelCloseUpdate {
- bytes closing_txid = 1 [json_name = "closing_txid"];
+ bytes closing_txid = 1;
- bool success = 2 [json_name = "success"];
+ bool success = 2;
}
message CloseChannelRequest {
@@ -1613,13 +1753,16 @@
*/
ChannelPoint channel_point = 1;
- /// If true, then the channel will be closed forcibly. This means the current commitment transaction will be signed and broadcast.
+ /// If true, then the channel will be closed forcibly. This means the
+ /// current commitment transaction will be signed and broadcast.
bool force = 2;
- /// The target number of blocks that the closure transaction should be confirmed by.
+ /// The target number of blocks that the closure transaction should be
+ /// confirmed by.
int32 target_conf = 3;
- /// A manual fee rate set in sat/byte that should be used when crafting the closure transaction.
+ /// A manual fee rate set in sat/byte that should be used when crafting the
+ /// closure transaction.
int64 sat_per_byte = 4;
/*
@@ -1628,19 +1771,41 @@
is set, the request to close will fail because the channel must pay out
to the upfront shutdown addresss.
*/
- string delivery_address = 5 [json_name = "delivery_address"];
+ string delivery_address = 5;
}
message CloseStatusUpdate {
oneof update {
- PendingUpdate close_pending = 1 [json_name = "close_pending"];
- ChannelCloseUpdate chan_close = 3 [json_name = "chan_close"];
+ PendingUpdate close_pending = 1;
+ ChannelCloseUpdate chan_close = 3;
}
}
message PendingUpdate {
- bytes txid = 1 [json_name = "txid"];
- uint32 output_index = 2 [json_name = "output_index"];
+ bytes txid = 1;
+ uint32 output_index = 2;
+}
+
+message ReadyForPsbtFunding {
+ /**
+ The P2WSH address of the channel funding multisig address that the below
+ specified amount in satoshis needs to be sent to.
+ */
+ string funding_address = 1;
+
+ /**
+ The exact amount in satoshis that needs to be sent to the above address to
+ fund the pending channel.
+ */
+ int64 funding_amount = 2;
+
+ /**
+ A raw PSBT that contains the pending channel output. If a base PSBT was
+ provided in the PsbtShim, this is the base PSBT with one additional output.
+ If no base PSBT was specified, this is an otherwise empty PSBT with exactly
+ one output.
+ */
+ bytes psbt = 3;
}
message OpenChannelRequest {
@@ -1648,40 +1813,48 @@
The pubkey of the node to open a channel with. When using REST, this field
must be encoded as base64.
*/
- bytes node_pubkey = 2 [json_name = "node_pubkey"];
+ bytes node_pubkey = 2;
/**
The hex encoded pubkey of the node to open a channel with. Deprecated now
that the REST gateway supports base64 encoding of bytes fields.
*/
- string node_pubkey_string = 3 [json_name = "node_pubkey_string", deprecated = true];
+ string node_pubkey_string = 3 [deprecated = true];
/// The number of satoshis the wallet should commit to the channel
- int64 local_funding_amount = 4 [json_name = "local_funding_amount"];
+ int64 local_funding_amount = 4;
- /// The number of satoshis to push to the remote side as part of the initial commitment state
- int64 push_sat = 5 [json_name = "push_sat"];
+ /// The number of satoshis to push to the remote side as part of the initial
+ /// commitment state
+ int64 push_sat = 5;
- /// The target number of blocks that the funding transaction should be confirmed by.
+ /// The target number of blocks that the funding transaction should be
+ /// confirmed by.
int32 target_conf = 6;
- /// A manual fee rate set in sat/byte that should be used when crafting the funding transaction.
+ /// A manual fee rate set in sat/byte that should be used when crafting the
+ /// funding transaction.
int64 sat_per_byte = 7;
- /// Whether this channel should be private, not announced to the greater network.
- bool private = 8 [json_name = "private"];
-
- /// The minimum value in millisatoshi we will require for incoming HTLCs on the channel.
- int64 min_htlc_msat = 9 [json_name = "min_htlc_msat"];
-
- /// The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size.
- uint32 remote_csv_delay = 10 [json_name = "remote_csv_delay"];
-
- /// The minimum number of confirmations each one of your outputs used for the funding transaction must satisfy.
- int32 min_confs = 11 [json_name = "min_confs"];
-
- /// Whether unconfirmed outputs should be used as inputs for the funding transaction.
- bool spend_unconfirmed = 12 [json_name = "spend_unconfirmed"];
+ /// Whether this channel should be private, not announced to the greater
+ /// network.
+ bool private = 8;
+
+ /// The minimum value in millisatoshi we will require for incoming HTLCs on
+ /// the channel.
+ int64 min_htlc_msat = 9;
+
+ /// The delay we require on the remote's commitment transaction. If this is
+ /// not set, it will be scaled automatically with the channel size.
+ uint32 remote_csv_delay = 10;
+
+ /// The minimum number of confirmations each one of your outputs used for
+ /// the funding transaction must satisfy.
+ int32 min_confs = 11;
+
+ /// Whether unconfirmed outputs should be used as inputs for the funding
+ /// transaction.
+ bool spend_unconfirmed = 12;
/*
Close address is an optional address which specifies the address to which
@@ -1693,7 +1866,7 @@
Note: If this value is set on channel creation, you will *not* be able to
cooperatively close out to a different address.
*/
- string close_address = 13 [json_name = "close_address"];
+ string close_address = 13;
/**
Funding shims are an optional argument that allow the caller to intercept
@@ -1702,19 +1875,34 @@
that is generated by the wallet as normal, or signal that signing will be
carried out in an interactive manner (PSBT based).
*/
- FundingShim funding_shim = 14 [json_name = "funding_shim"];
+ FundingShim funding_shim = 14;
}
message OpenStatusUpdate {
oneof update {
- PendingUpdate chan_pending = 1 [json_name = "chan_pending"];
- ChannelOpenUpdate chan_open = 3 [json_name = "chan_open"];
- }
+ /**
+ Signals that the channel is now fully negotiated and the funding
+ transaction published.
+ */
+ PendingUpdate chan_pending = 1;
+
+ /**
+ Signals that the channel's funding transaction has now reached the
+ required number of confirmations on chain and can be used.
+ */
+ ChannelOpenUpdate chan_open = 3;
+
+ /**
+ Signals that the funding process has been suspended and the construction
+ of a PSBT that funds the channel PK script is now required.
+ */
+ ReadyForPsbtFunding psbt_fund = 5;
+ }
/**
The pending channel ID of the created channel. This value may be used to
further the funding flow manually via the FundingStateStep method.
*/
- bytes pending_chan_id = 4 [json_name = "pending_chan_id"];
+ bytes pending_chan_id = 4;
}
message KeyLocator {
@@ -1726,15 +1914,15 @@
}
message KeyDescriptor {
- /**
- The raw bytes of the key being identified.
- */
- bytes raw_key_bytes = 1;
-
- /**
- The key locator that identifies which key to use for signing.
- */
- KeyLocator key_loc = 2;
+ /**
+ The raw bytes of the key being identified.
+ */
+ bytes raw_key_bytes = 1;
+
+ /**
+ The key locator that identifies which key to use for signing.
+ */
+ KeyLocator key_loc = 2;
}
message ChanPointShim {
@@ -1760,11 +1948,44 @@
channel ID.
*/
bytes pending_chan_id = 5;
+
+ /**
+ This uint32 indicates if this channel is to be considered 'frozen'. A
+ frozen channel does not allow a cooperative channel close by the
+ initiator. The thaw_height is the height that this restriction stops
+ applying to the channel.
+ */
+ uint32 thaw_height = 6;
+}
+
+message PsbtShim {
+ /**
+ A unique identifier of 32 random bytes that will be used as the pending
+ channel ID to identify the PSBT state machine when interacting with it and
+ on the wire protocol to initiate the funding request.
+ */
+ bytes pending_chan_id = 1;
+
+ /**
+ An optional base PSBT the new channel output will be added to. If this is
+ non-empty, it must be a binary serialized PSBT.
+ */
+ bytes base_psbt = 2;
}
message FundingShim {
oneof shim {
+ /**
+ A channel shim where the channel point was fully constructed outside
+ of lnd's wallet and the transaction might already be published.
+ */
ChanPointShim chan_point_shim = 1;
+
+ /**
+ A channel shim that uses a PSBT to fund and sign the channel funding
+ transaction.
+ */
+ PsbtShim psbt_shim = 2;
}
}
@@ -1773,17 +1994,56 @@
bytes pending_chan_id = 1;
}
+message FundingPsbtVerify {
+ /**
+ The funded but not yet signed PSBT that sends the exact channel capacity
+ amount to the PK script returned in the open channel message in a previous
+ step.
+ */
+ bytes funded_psbt = 1;
+
+ /// The pending channel ID of the channel to get the PSBT for.
+ bytes pending_chan_id = 2;
+}
+
+message FundingPsbtFinalize {
+ /**
+ The funded PSBT that contains all witness data to send the exact channel
+ capacity amount to the PK script returned in the open channel message in a
+ previous step.
+ */
+ bytes signed_psbt = 1;
+
+ /// The pending channel ID of the channel to get the PSBT for.
+ bytes pending_chan_id = 2;
+}
+
message FundingTransitionMsg {
oneof trigger {
/**
- The funding shim to regsiter. This should be used before any
+ The funding shim to register. This should be used before any
channel funding has began by the remote party, as it is intended as a
- prepatory step for the full channel funding.
+ preparatory step for the full channel funding.
*/
FundingShim shim_register = 1;
/// Used to cancel an existing registered funding shim.
FundingShimCancel shim_cancel = 2;
+
+ /**
+ Used to continue a funding flow that was initiated to be executed
+ through a PSBT. This step verifies that the PSBT contains the correct
+ outputs to fund the channel.
+ */
+ FundingPsbtVerify psbt_verify = 3;
+
+ /**
+ Used to continue a funding flow that was initiated to be executed
+ through a PSBT. This step finalizes the funded and signed PSBT, finishes
+ negotiation with the peer and finally publishes the resulting funding
+ transaction.
+ */
+ FundingPsbtFinalize psbt_finalize = 4;
}
}
@@ -1791,57 +2051,64 @@
}
message PendingHTLC {
-
/// The direction within the channel that the htlc was sent
- bool incoming = 1 [ json_name = "incoming" ];
+ bool incoming = 1;
/// The total value of the htlc
- int64 amount = 2 [ json_name = "amount" ];
+ int64 amount = 2;
/// The final output to be swept back to the user's wallet
- string outpoint = 3 [ json_name = "outpoint" ];
+ string outpoint = 3;
/// The next block height at which we can spend the current stage
- uint32 maturity_height = 4 [ json_name = "maturity_height" ];
+ uint32 maturity_height = 4;
/**
The number of blocks remaining until the current stage can be swept.
Negative values indicate how many blocks have passed since becoming
mature.
*/
- int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
+ int32 blocks_til_maturity = 5;
/// Indicates whether the htlc is in its first or second stage of recovery
- uint32 stage = 6 [ json_name = "stage" ];
+ uint32 stage = 6;
}
-message PendingChannelsRequest {}
+message PendingChannelsRequest {
+}
message PendingChannelsResponse {
message PendingChannel {
- string remote_node_pub = 1 [ json_name = "remote_node_pub" ];
- string channel_point = 2 [ json_name = "channel_point" ];
+ string remote_node_pub = 1;
+ string channel_point = 2;
- int64 capacity = 3 [ json_name = "capacity" ];
+ int64 capacity = 3;
- int64 local_balance = 4 [ json_name = "local_balance" ];
- int64 remote_balance = 5 [ json_name = "remote_balance" ];
+ int64 local_balance = 4;
+ int64 remote_balance = 5;
- /// The minimum satoshis this node is required to reserve in its balance.
- int64 local_chan_reserve_sat = 6 [json_name = "local_chan_reserve_sat"];
+ /// The minimum satoshis this node is required to reserve in its
+ /// balance.
+ int64 local_chan_reserve_sat = 6;
/**
The minimum satoshis the other node is required to reserve in its
balance.
*/
- int64 remote_chan_reserve_sat = 7 [json_name = "remote_chan_reserve_sat"];
+ int64 remote_chan_reserve_sat = 7;
+
+ // The party that initiated opening the channel.
+ Initiator initiator = 8;
+
+ /// The commitment type used by this channel.
+ CommitmentType commitment_type = 9;
}
message PendingOpenChannel {
/// The pending channel
- PendingChannel channel = 1 [ json_name = "channel" ];
+ PendingChannel channel = 1;
/// The height at which this channel will be confirmed
- uint32 confirmation_height = 2 [ json_name = "confirmation_height" ];
+ uint32 confirmation_height = 2;
/**
The amount calculated to be paid in fees for the current set of
@@ -1850,17 +2117,17 @@
each channel state update, including updates that happen after a system
restart.
*/
- int64 commit_fee = 4 [json_name = "commit_fee" ];
+ int64 commit_fee = 4;
/// The weight of the commitment transaction
- int64 commit_weight = 5 [ json_name = "commit_weight" ];
+ int64 commit_weight = 5;
/**
The required number of satoshis per kilo-weight that the requester will
pay at all times, for both the funding transaction and commitment
transaction. This value can later be updated once the channel is open.
*/
- int64 fee_per_kw = 6 [ json_name = "fee_per_kw" ];
+ int64 fee_per_kw = 6;
}
message WaitingCloseChannel {
@@ -1868,7 +2135,42 @@
PendingChannel channel = 1;
/// The balance in satoshis encumbered in this channel
- int64 limbo_balance = 2 [ json_name = "limbo_balance" ];
+ int64 limbo_balance = 2;
+
+ /**
+ A list of valid commitment transactions. Any of these can confirm at
+ this point.
+ */
+ Commitments commitments = 3;
+ }
+
+ message Commitments {
+ /// Hash of the local version of the commitment tx.
+ string local_txid = 1;
+
+ /// Hash of the remote version of the commitment tx.
+ string remote_txid = 2;
+
+ /// Hash of the remote pending version of the commitment tx.
+ string remote_pending_txid = 3;
+
+ /*
+ The amount in satoshis calculated to be paid in fees for the local
+ commitment.
+ */
+ uint64 local_commit_fee_sat = 4;
+
+ /*
+ The amount in satoshis calculated to be paid in fees for the remote
+ commitment.
+ */
+ uint64 remote_commit_fee_sat = 5;
+
+ /*
+ The amount in satoshis calculated to be paid in fees for the remote
+ pending commitment.
+ */
+ uint64 remote_pending_commit_fee_sat = 6;
}
message ClosedChannel {
@@ -1876,49 +2178,61 @@
PendingChannel channel = 1;
/// The transaction id of the closing transaction
- string closing_txid = 2 [ json_name = "closing_txid" ];
+ string closing_txid = 2;
}
message ForceClosedChannel {
/// The pending channel to be force closed
- PendingChannel channel = 1 [ json_name = "channel" ];
+ PendingChannel channel = 1;
/// The transaction id of the closing transaction
- string closing_txid = 2 [ json_name = "closing_txid" ];
+ string closing_txid = 2;
/// The balance in satoshis encumbered in this pending channel
- int64 limbo_balance = 3 [ json_name = "limbo_balance" ];
+ int64 limbo_balance = 3;
/// The height at which funds can be swept into the wallet
- uint32 maturity_height = 4 [ json_name = "maturity_height" ];
+ uint32 maturity_height = 4;
/*
Remaining # of blocks until the commitment output can be swept.
Negative values indicate how many blocks have passed since becoming
mature.
*/
- int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
+ int32 blocks_til_maturity = 5;
/// The total value of funds successfully recovered from this channel
- int64 recovered_balance = 6 [ json_name = "recovered_balance" ];
+ int64 recovered_balance = 6;
+
+ repeated PendingHTLC pending_htlcs = 8;
+
+ enum AnchorState {
+ LIMBO = 0;
+ RECOVERED = 1;
+ LOST = 2;
+ }
- repeated PendingHTLC pending_htlcs = 8 [ json_name = "pending_htlcs" ];
+ AnchorState anchor = 9;
}
/// The balance in satoshis encumbered in pending channels
- int64 total_limbo_balance = 1 [ json_name = "total_limbo_balance" ];
+ int64 total_limbo_balance = 1;
/// Channels pending opening
- repeated PendingOpenChannel pending_open_channels = 2 [ json_name = "pending_open_channels" ];
+ repeated PendingOpenChannel pending_open_channels = 2;
- /// Channels pending closing
- repeated ClosedChannel pending_closing_channels = 3 [ json_name = "pending_closing_channels" ];
+ /*
+ Deprecated: Channels pending closing previously contained cooperatively
+ closed channels with a single confirmation. These channels are now
+ considered closed from the time we see them on chain.
+ */
+ repeated ClosedChannel pending_closing_channels = 3 [deprecated = true];
/// Channels pending force closing
- repeated ForceClosedChannel pending_force_closing_channels = 4 [ json_name = "pending_force_closing_channels" ];
+ repeated ForceClosedChannel pending_force_closing_channels = 4;
/// Channels waiting for closing tx to confirm
- repeated WaitingCloseChannel waiting_close_channels = 5 [ json_name = "waiting_close_channels" ];
+ repeated WaitingCloseChannel waiting_close_channels = 5;
}
message ChannelEventSubscription {
@@ -1926,43 +2240,45 @@
message ChannelEventUpdate {
oneof channel {
- Channel open_channel = 1 [ json_name = "open_channel" ];
- ChannelCloseSummary closed_channel = 2 [ json_name = "closed_channel" ];
- ChannelPoint active_channel = 3 [ json_name = "active_channel" ];
- ChannelPoint inactive_channel = 4 [ json_name = "inactive_channel" ];
+ Channel open_channel = 1;
+ ChannelCloseSummary closed_channel = 2;
+ ChannelPoint active_channel = 3;
+ ChannelPoint inactive_channel = 4;
+ PendingUpdate pending_open_channel = 6;
}
enum UpdateType {
- OPEN_CHANNEL = 0;
- CLOSED_CHANNEL = 1;
- ACTIVE_CHANNEL = 2;
- INACTIVE_CHANNEL = 3;
+ OPEN_CHANNEL = 0;
+ CLOSED_CHANNEL = 1;
+ ACTIVE_CHANNEL = 2;
+ INACTIVE_CHANNEL = 3;
+ PENDING_OPEN_CHANNEL = 4;
}
- UpdateType type = 5 [ json_name = "type" ];
+ UpdateType type = 5;
}
message WalletBalanceRequest {
}
message WalletBalanceResponse {
/// The balance of the wallet
- int64 total_balance = 1 [json_name = "total_balance"];
+ int64 total_balance = 1;
/// The confirmed balance of a wallet(with >= 1 confirmations)
- int64 confirmed_balance = 2 [json_name = "confirmed_balance"];
+ int64 confirmed_balance = 2;
/// The unconfirmed balance of a wallet(with 0 confirmations)
- int64 unconfirmed_balance = 3 [json_name = "unconfirmed_balance"];
+ int64 unconfirmed_balance = 3;
}
message ChannelBalanceRequest {
}
message ChannelBalanceResponse {
/// Sum of channels balances denominated in satoshis
- int64 balance = 1 [json_name = "balance"];
+ int64 balance = 1;
/// Sum of channels pending balances denominated in satoshis
- int64 pending_open_balance = 2 [json_name = "pending_open_balance"];
+ int64 pending_open_balance = 2;
}
message QueryRoutesRequest {
@@ -2065,7 +2381,7 @@
/**
Features assumed to be supported by the final node. All transitive feature
- depdencies must also be set properly. For a given feature bit pair, either
+ dependencies must also be set properly. For a given feature bit pair, either
optional or remote may be set, but not both. If this field is nil or empty,
the router will try to load destination features from the graph as a
fallback.
@@ -2105,13 +2421,13 @@
The route that results from the path finding operation. This is still a
repeated field to retain backwards compatibility.
*/
- repeated Route routes = 1 [json_name = "routes"];
+ repeated Route routes = 1;
/**
The success probability of the returned route based on the current mission
control state. [EXPERIMENTAL]
*/
- double success_prob = 2 [json_name = "success_prob"];
+ double success_prob = 2;
}
message Hop {
@@ -2120,26 +2436,26 @@
height, the next 3 the index within the block, and the last 2 bytes are the
output index for the channel.
*/
- uint64 chan_id = 1 [json_name = "chan_id", jstype = JS_STRING];
- int64 chan_capacity = 2 [json_name = "chan_capacity"];
- int64 amt_to_forward = 3 [json_name = "amt_to_forward", deprecated = true];
- int64 fee = 4 [json_name = "fee", deprecated = true];
- uint32 expiry = 5 [json_name = "expiry"];
- int64 amt_to_forward_msat = 6 [json_name = "amt_to_forward_msat"];
- int64 fee_msat = 7 [json_name = "fee_msat"];
+ uint64 chan_id = 1 [jstype = JS_STRING];
+ int64 chan_capacity = 2;
+ int64 amt_to_forward = 3 [deprecated = true];
+ int64 fee = 4 [deprecated = true];
+ uint32 expiry = 5;
+ int64 amt_to_forward_msat = 6;
+ int64 fee_msat = 7;
/**
An optional public key of the hop. If the public key is given, the payment
can be executed without relying on a copy of the channel graph.
*/
- string pub_key = 8 [json_name = "pub_key"];
+ string pub_key = 8;
/**
If set to true, then this hop will be encoded using the new variable length
TLV format. Note that if any custom tlv_records below are specified, then
this field MUST be set to true for them to be encoded properly.
*/
- bool tlv_payload = 9 [json_name = "tlv_payload"];
+ bool tlv_payload = 9;
/**
An optional TLV record tha singals the use of an MPP payment. If present,
@@ -2147,14 +2463,14 @@
final hop payload of all non-zero payments in the HTLC set. If empty, a
regular single-shot payment is or was attempted.
*/
- MPPRecord mpp_record = 10 [json_name = "mpp_record"];
+ MPPRecord mpp_record = 10;
/**
An optional set of key-value TLV records. This is useful within the context
of the SendToRoute call as it allows callers to specify arbitrary K-V pairs
to drop off at each hop within the onion.
*/
- map<uint64, bytes> custom_records = 11 [json_name = "custom_records"];
+ map<uint64, bytes> custom_records = 11;
}
message MPPRecord {
@@ -2164,7 +2480,7 @@
subpayments, and match the payment_addr provided in the receiver's invoice.
The same payment_addr must be used on all subpayments.
*/
- bytes payment_addr = 11 [json_name = "payment_addr"];
+ bytes payment_addr = 11;
/**
The total amount in milli-satoshis being sent as part of a larger multi-path
@@ -2172,7 +2488,7 @@
and payment_hash sum exactly to total_amt_msat. The same
total_amt_msat must be used on all subpayments.
*/
- int64 total_amt_msat = 10 [json_name = "total_amt_msat"];
+ int64 total_amt_msat = 10;
}
/**
@@ -2183,21 +2499,20 @@
carry the initial payment amount after fees are accounted for.
*/
message Route {
-
/**
The cumulative (final) time lock across the entire route. This is the CLTV
value that should be extended to the first hop in the route. All other hops
will decrement the time-lock as advertised, leaving enough time for all
hops to wait for or present the payment preimage to complete the payment.
*/
- uint32 total_time_lock = 1 [json_name = "total_time_lock"];
+ uint32 total_time_lock = 1;
/**
The sum of the fees paid at each hop within the final route. In the case
of a one-hop payment, this value will be zero as we don't need to pay a fee
to ourselves.
*/
- int64 total_fees = 2 [json_name = "total_fees", deprecated = true];
+ int64 total_fees = 2 [deprecated = true];
/**
The total amount of funds required to complete a payment over this route.
@@ -2206,22 +2521,22 @@
satoshis, otherwise the route will fail at an intermediate node due to an
insufficient amount of fees.
*/
- int64 total_amt = 3 [json_name = "total_amt", deprecated = true];
+ int64 total_amt = 3 [deprecated = true];
/**
Contains details concerning the specific forwarding details at each hop.
*/
- repeated Hop hops = 4 [json_name = "hops"];
+ repeated Hop hops = 4;
/**
The total fees in millisatoshis.
*/
- int64 total_fees_msat = 5 [json_name = "total_fees_msat"];
+ int64 total_fees_msat = 5;
/**
The total amount in millisatoshis.
*/
- int64 total_amt_msat = 6 [json_name = "total_amt_msat"];
+ int64 total_amt_msat = 6;
}
message NodeInfoRequest {
@@ -2233,23 +2548,22 @@
}
message NodeInfo {
-
/**
An individual vertex/node within the channel graph. A node is
connected to other nodes by one or more channel edges emanating from it. As
the graph is directed, a node will also have an incoming edge attached to
it for each outgoing edge.
*/
- LightningNode node = 1 [json_name = "node"];
+ LightningNode node = 1;
/// The total number of channels for the node.
- uint32 num_channels = 2 [json_name = "num_channels"];
+ uint32 num_channels = 2;
/// The sum of all channels capacity for the node, denominated in satoshis.
- int64 total_capacity = 3 [json_name = "total_capacity"];
+ int64 total_capacity = 3;
/// A list of all public channels for the node.
- repeated ChannelEdge channels = 4 [json_name = "channels"];
+ repeated ChannelEdge channels = 4;
}
/**
@@ -2259,27 +2573,27 @@
each outgoing edge.
*/
message LightningNode {
- uint32 last_update = 1 [ json_name = "last_update" ];
- string pub_key = 2 [ json_name = "pub_key" ];
- string alias = 3 [ json_name = "alias" ];
- repeated NodeAddress addresses = 4 [ json_name = "addresses" ];
- string color = 5 [ json_name = "color" ];
- map<uint32, Feature> features = 6 [ json_name = "features" ];
+ uint32 last_update = 1;
+ string pub_key = 2;
+ string alias = 3;
+ repeated NodeAddress addresses = 4;
+ string color = 5;
+ map<uint32, Feature> features = 6;
}
message NodeAddress {
- string network = 1 [ json_name = "network" ];
- string addr = 2 [ json_name = "addr" ];
+ string network = 1;
+ string addr = 2;
}
message RoutingPolicy {
- uint32 time_lock_delta = 1 [json_name = "time_lock_delta"];
- int64 min_htlc = 2 [json_name = "min_htlc"];
- int64 fee_base_msat = 3 [json_name = "fee_base_msat"];
- int64 fee_rate_milli_msat = 4 [json_name = "fee_rate_milli_msat"];
- bool disabled = 5 [json_name = "disabled"];
- uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"];
- uint32 last_update = 7 [json_name = "last_update"];
+ uint32 time_lock_delta = 1;
+ int64 min_htlc = 2;
+ int64 fee_base_msat = 3;
+ int64 fee_rate_milli_msat = 4;
+ bool disabled = 5;
+ uint64 max_htlc_msat = 6;
+ uint32 last_update = 7;
}
/**
@@ -2290,42 +2604,70 @@
within a ChannelEdgePolicy for each direction of the channel.
*/
message ChannelEdge {
-
/**
The unique channel ID for the channel. The first 3 bytes are the block
height, the next 3 the index within the block, and the last 2 bytes are the
output index for the channel.
*/
- uint64 channel_id = 1 [json_name = "channel_id", jstype = JS_STRING];
- string chan_point = 2 [json_name = "chan_point"];
+ uint64 channel_id = 1 [jstype = JS_STRING];
+ string chan_point = 2;
- uint32 last_update = 3 [json_name = "last_update", deprecated = true];
+ uint32 last_update = 3 [deprecated = true];
- string node1_pub = 4 [json_name = "node1_pub"];
- string node2_pub = 5 [json_name = "node2_pub"];
+ string node1_pub = 4;
+ string node2_pub = 5;
- int64 capacity = 6 [json_name = "capacity"];
+ int64 capacity = 6;
- RoutingPolicy node1_policy = 7 [json_name = "node1_policy"];
- RoutingPolicy node2_policy = 8 [json_name = "node2_policy"];
+ RoutingPolicy node1_policy = 7;
+ RoutingPolicy node2_policy = 8;
}
message ChannelGraphRequest {
- /**
- Whether unannounced channels are included in the response or not. If set,
- unannounced channels are included. Unannounced channels are both private
- channels, and public channels that are not yet announced to the network.
- */
- bool include_unannounced = 1 [json_name = "include_unannounced"];
+ /**
+ Whether unannounced channels are included in the response or not. If set,
+ unannounced channels are included. Unannounced channels are both private
+ channels, and public channels that are not yet announced to the network.
+ */
+ bool include_unannounced = 1;
}
/// Returns a new instance of the directed channel graph.
message ChannelGraph {
/// The list of `LightningNode`s in this channel graph
- repeated LightningNode nodes = 1 [json_name = "nodes"];
+ repeated LightningNode nodes = 1;
/// The list of `ChannelEdge`s in this channel graph
- repeated ChannelEdge edges = 2 [json_name = "edges"];
+ repeated ChannelEdge edges = 2;
+}
+
+enum NodeMetricType {
+ UNKNOWN = 0;
+ BETWEENNESS_CENTRALITY = 1;
+}
+
+message NodeMetricsRequest {
+ /// The requested node metrics.
+ repeated NodeMetricType types = 1;
+}
+
+message NodeMetricsResponse {
+ /**
+ Betweenness centrality is the sum of the ratio of shortest paths that pass
+ through the node for each pair of nodes in the graph (not counting paths
+ starting or ending at this node).
+ Map of node pubkey to betweenness centrality of the node. Normalized
+ values are in the [0,1] closed interval.
+ */
+ map<string, FloatMetric> betweenness_centrality = 1;
+}
+
+message FloatMetric {
+ /// Arbitrary float value.
+ double value = 1;
+
+ /// The value normalized to [0,1] or [-1,1].
+ double normalized_value = 2;
}
message ChanInfoRequest {
@@ -2340,31 +2682,34 @@
message NetworkInfoRequest {
}
message NetworkInfo {
- uint32 graph_diameter = 1 [json_name = "graph_diameter"];
- double avg_out_degree = 2 [json_name = "avg_out_degree"];
- uint32 max_out_degree = 3 [json_name = "max_out_degree"];
-
- uint32 num_nodes = 4 [json_name = "num_nodes"];
- uint32 num_channels = 5 [json_name = "num_channels"];
-
- int64 total_network_capacity = 6 [json_name = "total_network_capacity"];
-
- double avg_channel_size = 7 [json_name = "avg_channel_size"];
- int64 min_channel_size = 8 [json_name = "min_channel_size"];
- int64 max_channel_size = 9 [json_name = "max_channel_size"];
- int64 median_channel_size_sat = 10 [json_name = "median_channel_size_sat"];
+ uint32 graph_diameter = 1;
+ double avg_out_degree = 2;
+ uint32 max_out_degree = 3;
+
+ uint32 num_nodes = 4;
+ uint32 num_channels = 5;
+
+ int64 total_network_capacity = 6;
+
+ double avg_channel_size = 7;
+ int64 min_channel_size = 8;
+ int64 max_channel_size = 9;
+ int64 median_channel_size_sat = 10;
// The number of edges marked as zombies.
- uint64 num_zombie_chans = 11 [json_name = "num_zombie_chans"];
+ uint64 num_zombie_chans = 11;
// TODO(roasbeef): fee rate info, expiry
// * also additional RPC for tracking fee info once in
}
-message StopRequest{}
-message StopResponse{}
+message StopRequest {
+}
+message StopResponse {
+}
-message GraphTopologySubscription {}
+message GraphTopologySubscription {
+}
message GraphTopologyUpdate {
repeated NodeUpdate node_updates = 1;
repeated ChannelEdgeUpdate channel_updates = 2;
@@ -2389,9 +2734,9 @@
int64 capacity = 3;
- RoutingPolicy routing_policy = 4;
+ RoutingPolicy routing_policy = 4;
- string advertising_node = 5;
+ string advertising_node = 5;
string connecting_node = 6;
}
message ClosedChannelUpdate {
@@ -2408,22 +2753,22 @@
message HopHint {
/// The public key of the node at the start of the channel.
- string node_id = 1 [json_name = "node_id"];
+ string node_id = 1;
/// The unique identifier of the channel.
- uint64 chan_id = 2 [json_name = "chan_id", jstype = JS_STRING];
+ uint64 chan_id = 2 [jstype = JS_STRING];
/// The base fee of the channel denominated in millisatoshis.
- uint32 fee_base_msat = 3 [json_name = "fee_base_msat"];
+ uint32 fee_base_msat = 3;
/**
The fee rate of the channel for sending one satoshi across it denominated in
millionths of a satoshi.
*/
- uint32 fee_proportional_millionths = 4 [json_name = "fee_proportional_millionths"];
+ uint32 fee_proportional_millionths = 4;
/// The time-lock delta of the channel.
- uint32 cltv_expiry_delta = 5 [json_name = "cltv_expiry_delta"];
+ uint32 cltv_expiry_delta = 5;
}
message RouteHint {
@@ -2431,7 +2776,7 @@
A list of hop hints that when chained together can assist in reaching a
specific destination.
*/
- repeated HopHint hop_hints = 1 [json_name = "hop_hints"];
+ repeated HopHint hop_hints = 1;
}
message Invoice {
@@ -2441,7 +2786,7 @@
field of the encoded payment request if the description_hash field is not
being used.
*/
- string memo = 1 [json_name = "memo"];
+ string memo = 1;
reserved 2;
@@ -2450,43 +2795,43 @@
HTLC payable to this preimage. When using REST, this field must be encoded
as base64.
*/
- bytes r_preimage = 3 [json_name = "r_preimage"];
+ bytes r_preimage = 3;
/**
The hash of the preimage. When using REST, this field must be encoded as
base64.
*/
- bytes r_hash = 4 [json_name = "r_hash"];
+ bytes r_hash = 4;
/**
The value of this invoice in satoshis
The fields value and value_msat are mutually exclusive.
*/
- int64 value = 5 [json_name = "value"];
+ int64 value = 5;
/**
The value of this invoice in millisatoshis
The fields value and value_msat are mutually exclusive.
*/
- int64 value_msat = 23 [json_name = "value_msat"];
+ int64 value_msat = 23;
/// Whether this invoice has been fulfilled
- bool settled = 6 [json_name = "settled", deprecated = true];
+ bool settled = 6 [deprecated = true];
/// When this invoice was created
- int64 creation_date = 7 [json_name = "creation_date"];
+ int64 creation_date = 7;
/// When this invoice was settled
- int64 settle_date = 8 [json_name = "settle_date"];
+ 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.
*/
- string payment_request = 9 [json_name = "payment_request"];
+ string payment_request = 9;
/**
Hash (SHA-256) of a description of the payment. Used if the description of
@@ -2494,25 +2839,25 @@
of an encoded payment request. When using REST, this field must be encoded
as base64.
*/
- bytes description_hash = 10 [json_name = "description_hash"];
+ bytes description_hash = 10;
/// Payment request expiry time in seconds. Default is 3600 (1 hour).
- int64 expiry = 11 [json_name = "expiry"];
+ int64 expiry = 11;
/// Fallback on-chain address.
- string fallback_addr = 12 [json_name = "fallback_addr"];
+ string fallback_addr = 12;
/// Delta to use for the time-lock of the CLTV extended to the final hop.
- uint64 cltv_expiry = 13 [json_name = "cltv_expiry"];
+ uint64 cltv_expiry = 13;
/**
Route hints that can each be individually used to assist in reaching the
invoice's destination.
*/
- repeated RouteHint route_hints = 14 [json_name = "route_hints"];
+ repeated RouteHint route_hints = 14;
/// Whether this invoice should include routing hints for private channels.
- bool private = 15 [json_name = "private"];
+ bool private = 15;
/**
The "add" index of this invoice. Each newly created invoice will increment
@@ -2520,7 +2865,7 @@
SubscribeInvoices call can use this to instantly get notified of all added
invoices with an add_index greater than this one.
*/
- uint64 add_index = 16 [json_name = "add_index"];
+ uint64 add_index = 16;
/**
The "settle" index of this invoice. Each newly settled invoice will
@@ -2528,10 +2873,10 @@
SubscribeInvoices call can use this to instantly get notified of all
settled invoices with an settle_index greater than this one.
*/
- uint64 settle_index = 17 [json_name = "settle_index"];
+ uint64 settle_index = 17;
/// Deprecated, use amt_paid_sat or amt_paid_msat.
- int64 amt_paid = 18 [json_name = "amt_paid", deprecated = true];
+ int64 amt_paid = 18 [deprecated = true];
/**
The amount that was accepted for this invoice, in satoshis. This will ONLY
@@ -2541,7 +2886,7 @@
MORE that was specified in the original invoice. So we'll record that here
as well.
*/
- int64 amt_paid_sat = 19 [json_name = "amt_paid_sat"];
+ int64 amt_paid_sat = 19;
/**
The amount that was accepted for this invoice, in millisatoshis. This will
@@ -2551,7 +2896,7 @@
paid MORE that was specified in the original invoice. So we'll record that
here as well.
*/
- int64 amt_paid_msat = 20 [json_name = "amt_paid_msat"];
+ int64 amt_paid_msat = 20;
enum InvoiceState {
OPEN = 0;
@@ -2563,19 +2908,19 @@
/**
The state the invoice is in.
*/
- InvoiceState state = 21 [json_name = "state"];
+ InvoiceState state = 21;
/// List of HTLCs paying to this invoice [EXPERIMENTAL].
- repeated InvoiceHTLC htlcs = 22 [json_name = "htlcs"];
+ repeated InvoiceHTLC htlcs = 22;
/// List of features advertised on the invoice.
- map<uint32, Feature> features = 24 [json_name = "features"];
+ map<uint32, Feature> features = 24;
/**
Indicates if this invoice was a spontaneous payment that arrived via keysend
[EXPERIMENTAL].
*/
- bool is_keysend = 25 [json_name = "is_keysend"];
+ bool is_keysend = 25;
}
enum InvoiceHTLCState {
@@ -2587,45 +2932,45 @@
/// Details of an HTLC that paid to an invoice
message InvoiceHTLC {
/// Short channel id over which the htlc was received.
- uint64 chan_id = 1 [json_name = "chan_id", jstype = JS_STRING];
+ uint64 chan_id = 1 [jstype = JS_STRING];
/// Index identifying the htlc on the channel.
- uint64 htlc_index = 2 [json_name = "htlc_index"];
+ uint64 htlc_index = 2;
/// The amount of the htlc in msat.
- uint64 amt_msat = 3 [json_name = "amt_msat"];
+ uint64 amt_msat = 3;
/// Block height at which this htlc was accepted.
- int32 accept_height = 4 [json_name = "accept_height"];
+ int32 accept_height = 4;
/// Time at which this htlc was accepted.
- int64 accept_time = 5 [json_name = "accept_time"];
+ int64 accept_time = 5;
/// Time at which this htlc was settled or canceled.
- int64 resolve_time = 6 [json_name = "resolve_time"];
+ int64 resolve_time = 6;
/// Block height at which this htlc expires.
- int32 expiry_height = 7 [json_name = "expiry_height"];
+ int32 expiry_height = 7;
/// Current state the htlc is in.
- InvoiceHTLCState state = 8 [json_name = "state"];
+ InvoiceHTLCState state = 8;
/// Custom tlv records.
- map<uint64, bytes> custom_records = 9 [json_name = "custom_records"];
+ map<uint64, bytes> custom_records = 9;
/// The total amount of the mpp payment in msat.
- uint64 mpp_total_amt_msat = 10 [json_name = "mpp_total_amt_msat"];
+ uint64 mpp_total_amt_msat = 10;
}
message AddInvoiceResponse {
- bytes r_hash = 1 [json_name = "r_hash"];
+ bytes r_hash = 1;
/**
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.
*/
- string payment_request = 2 [json_name = "payment_request"];
+ string payment_request = 2;
/**
The "add" index of this invoice. Each newly created invoice will increment
@@ -2633,7 +2978,7 @@
SubscribeInvoices call can use this to instantly get notified of all added
invoices with an add_index greater than this one.
*/
- uint64 add_index = 16 [json_name = "add_index"];
+ uint64 add_index = 16;
}
message PaymentHash {
/**
@@ -2642,13 +2987,13 @@
Deprecated now that the REST gateway supports base64 encoding of bytes
fields.
*/
- string r_hash_str = 1 [json_name = "r_hash_str", deprecated = true];
+ string r_hash_str = 1 [deprecated = true];
/**
The payment hash of the invoice to be looked up. When using REST, this field
must be encoded as base64.
*/
- bytes r_hash = 2 [json_name = "r_hash"];
+ bytes r_hash = 2;
}
message ListInvoiceRequest {
@@ -2656,41 +3001,41 @@
If set, only invoices that are not settled and not canceled will be returned
in the response.
*/
- bool pending_only = 1 [json_name = "pending_only"];
+ bool pending_only = 1;
/**
The index of an invoice that will be used as either the start or end of a
query to determine which invoices should be returned in the response.
*/
- uint64 index_offset = 4 [json_name = "index_offset"];
+ uint64 index_offset = 4;
/// The max number of invoices to return in the response to this query.
- uint64 num_max_invoices = 5 [json_name = "num_max_invoices"];
+ uint64 num_max_invoices = 5;
/**
If set, the invoices returned will result from seeking backwards from the
specified index offset. This can be used to paginate backwards.
*/
- bool reversed = 6 [json_name = "reversed"];
+ bool reversed = 6;
}
message ListInvoiceResponse {
/**
A list of invoices from the time slice of the time series specified in the
request.
*/
- repeated Invoice invoices = 1 [json_name = "invoices"];
+ repeated Invoice invoices = 1;
/**
The index of the last item in the set of returned invoices. This can be used
to seek further, pagination style.
*/
- uint64 last_index_offset = 2 [json_name = "last_index_offset"];
+ uint64 last_index_offset = 2;
/**
The index of the last item in the set of returned invoices. This can be used
to seek backwards, pagination style.
*/
- uint64 first_index_offset = 3 [json_name = "first_index_offset"];
+ uint64 first_index_offset = 3;
}
message InvoiceSubscription {
@@ -2700,7 +3045,7 @@
value. This allows callers to catch up on any events they missed while they
weren't connected to the streaming RPC.
*/
- uint64 add_index = 1 [json_name = "add_index"];
+ uint64 add_index = 1;
/**
If specified (non-zero), then we'll first start by sending out
@@ -2708,37 +3053,69 @@
this value. This allows callers to catch up on any events they missed while
they weren't connected to the streaming RPC.
*/
- uint64 settle_index = 2 [json_name = "settle_index"];
+ uint64 settle_index = 2;
}
+enum PaymentFailureReason {
+ /**
+ Payment isn't failed (yet).
+ */
+ FAILURE_REASON_NONE = 0;
+
+ /**
+ There are more routes to try, but the payment timeout was exceeded.
+ */
+ FAILURE_REASON_TIMEOUT = 1;
+
+ /**
+ All possible routes were tried and failed permanently. Or were no
+ routes to the destination at all.
+ */
+ FAILURE_REASON_NO_ROUTE = 2;
+
+ /**
+ A non-recoverable error has occured.
+ */
+ FAILURE_REASON_ERROR = 3;
+
+ /**
+ Payment details incorrect (unknown hash, invalid amt or
+ invalid final cltv delta)
+ */
+ FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4;
+
+ /**
+ Insufficient local balance.
+ */
+ FAILURE_REASON_INSUFFICIENT_BALANCE = 5;
+}
message Payment {
/// The payment hash
- string payment_hash = 1 [json_name = "payment_hash"];
+ string payment_hash = 1;
/// Deprecated, use value_sat or value_msat.
- int64 value = 2 [json_name = "value", deprecated = true];
+ int64 value = 2 [deprecated = true];
/// Deprecated, use creation_time_ns
- int64 creation_date = 3 [json_name = "creation_date", deprecated = true];
+ int64 creation_date = 3 [deprecated = true];
- /// The path this payment took.
- repeated string path = 4 [json_name = "path", deprecated = true];
+ reserved 4;
/// Deprecated, use fee_sat or fee_msat.
- int64 fee = 5 [json_name = "fee", deprecated = true];
+ int64 fee = 5 [deprecated = true];
/// The payment preimage
- string payment_preimage = 6 [json_name = "payment_preimage"];
+ string payment_preimage = 6;
/// The value of the payment in satoshis
- int64 value_sat = 7 [json_name = "value_sat"];
+ int64 value_sat = 7;
/// The value of the payment in milli-satoshis
- int64 value_msat = 8 [json_name = "value_msat"];
+ int64 value_msat = 8;
/// The optional payment request being fulfilled.
- string payment_request = 9 [json_name = "payment_request"];
+ string payment_request = 9;
enum PaymentStatus {
UNKNOWN = 0;
@@ -2748,56 +3125,100 @@
}
// The status of the payment.
- PaymentStatus status = 10 [json_name = "status"];
+ PaymentStatus status = 10;
/// The fee paid for this payment in satoshis
- int64 fee_sat = 11 [json_name = "fee_sat"];
+ int64 fee_sat = 11;
/// The fee paid for this payment in milli-satoshis
- int64 fee_msat = 12 [json_name = "fee_msat"];
+ int64 fee_msat = 12;
/// The time in UNIX nanoseconds at which the payment was created.
- int64 creation_time_ns = 13 [json_name = "creation_time_ns"];
+ int64 creation_time_ns = 13;
/// The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
- repeated HTLCAttempt htlcs = 14 [json_name = "htlcs"];
+ repeated HTLCAttempt htlcs = 14;
+
+ /**
+ The creation index of this payment. Each payment can be uniquely identified
+ by this index, which may not strictly increment by 1 for payments made in
+ older versions of lnd.
+ */
+ uint64 payment_index = 15;
+
+ PaymentFailureReason failure_reason = 16;
}
message HTLCAttempt {
- enum HTLCStatus {
- IN_FLIGHT = 0;
- SUCCEEDED = 1;
- FAILED = 2;
- }
+ enum HTLCStatus {
+ IN_FLIGHT = 0;
+ SUCCEEDED = 1;
+ FAILED = 2;
+ }
- /// The status of the HTLC.
- HTLCStatus status = 1 [json_name = "status"];
+ /// The status of the HTLC.
+ HTLCStatus status = 1;
- /// The route taken by this HTLC.
- Route route = 2 [json_name = "route"];
+ /// The route taken by this HTLC.
+ Route route = 2;
- /// The time in UNIX nanoseconds at which this HTLC was sent.
- int64 attempt_time_ns = 3 [json_name = "attempt_time_ns"];
+ /// The time in UNIX nanoseconds at which this HTLC was sent.
+ int64 attempt_time_ns = 3;
- /**
- The time in UNIX nanoseconds at which this HTLC was settled or failed.
- This value will not be set if the HTLC is still IN_FLIGHT.
- */
- int64 resolve_time_ns = 4 [json_name = "resolve_time_ns"];
+ /**
+ The time in UNIX nanoseconds at which this HTLC was settled or failed.
+ This value will not be set if the HTLC is still IN_FLIGHT.
+ */
+ int64 resolve_time_ns = 4;
+
+ // Detailed htlc failure info.
+ Failure failure = 5;
}
message ListPaymentsRequest {
/**
If true, then return payments that have not yet fully completed. This means
that pending payments, as well as failed payments will show up if this
- field is set to True.
+ field is set to true. This flag doesn't change the meaning of the indices,
+ which are tied to individual payments.
*/
bool include_incomplete = 1;
+
+ /**
+ The index of a payment that will be used as either the start or end of a
+ query to determine which payments should be returned in the response. The
+ index_offset is exclusive. In the case of a zero index_offset, the query
+ will start with the oldest payment when paginating forwards, or will end
+ with the most recent payment when paginating backwards.
+ */
+ uint64 index_offset = 2;
+
+ /// The maximal number of payments returned in the response to this query.
+ uint64 max_payments = 3;
+
+ /**
+ If set, the payments returned will result from seeking backwards from the
+ specified index offset. This can be used to paginate backwards. The order
+ of the returned payments is always oldest first (ascending index order).
+ */
+ bool reversed = 4;
}
message ListPaymentsResponse {
/// The list of payments
- repeated Payment payments = 1 [json_name = "payments"];
+ repeated Payment payments = 1;
+
+ /**
+ The index of the first item in the set of returned payments. This can be
+ used as the index_offset to continue seeking backwards in the next request.
+ */
+ uint64 first_index_offset = 2;
+
+ /**
+ The index of the last item in the set of returned payments. This can be used
+ as the index_offset to continue seeking forwards in the next request.
+ */
+ uint64 last_index_offset = 3;
}
message DeleteAllPaymentsRequest {
@@ -2813,13 +3234,12 @@
message AbandonChannelResponse {
}
-
message DebugLevelRequest {
bool show = 1;
string level_spec = 2;
}
message DebugLevelResponse {
- string sub_systems = 1 [json_name = "sub_systems"];
+ string sub_systems = 1;
}
message PayReqString {
@@ -2827,157 +3247,183 @@
string pay_req = 1;
}
message PayReq {
- string destination = 1 [json_name = "destination"];
- string payment_hash = 2 [json_name = "payment_hash"];
- int64 num_satoshis = 3 [json_name = "num_satoshis"];
- int64 timestamp = 4 [json_name = "timestamp"];
- int64 expiry = 5 [json_name = "expiry"];
- string description = 6 [json_name = "description"];
- string description_hash = 7 [json_name = "description_hash"];
- string fallback_addr = 8 [json_name = "fallback_addr"];
- int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
- repeated RouteHint route_hints = 10 [json_name = "route_hints"];
- bytes payment_addr = 11 [json_name = "payment_addr"];
- int64 num_msat = 12 [json_name = "num_msat"];
- map<uint32, Feature> features = 13 [json_name = "features"];
+ string destination = 1;
+ string payment_hash = 2;
+ int64 num_satoshis = 3;
+ int64 timestamp = 4;
+ int64 expiry = 5;
+ string description = 6;
+ string description_hash = 7;
+ string fallback_addr = 8;
+ int64 cltv_expiry = 9;
+ repeated RouteHint route_hints = 10;
+ bytes payment_addr = 11;
+ int64 num_msat = 12;
+ map<uint32, Feature> features = 13;
}
enum FeatureBit {
- DATALOSS_PROTECT_REQ = 0;
- DATALOSS_PROTECT_OPT = 1;
- INITIAL_ROUING_SYNC = 3;
- UPFRONT_SHUTDOWN_SCRIPT_REQ = 4;
- UPFRONT_SHUTDOWN_SCRIPT_OPT = 5;
- GOSSIP_QUERIES_REQ = 6;
- GOSSIP_QUERIES_OPT = 7;
- TLV_ONION_REQ = 8;
- TLV_ONION_OPT = 9;
- EXT_GOSSIP_QUERIES_REQ = 10;
- EXT_GOSSIP_QUERIES_OPT = 11;
- STATIC_REMOTE_KEY_REQ = 12;
- STATIC_REMOTE_KEY_OPT = 13;
- PAYMENT_ADDR_REQ = 14;
- PAYMENT_ADDR_OPT = 15;
- MPP_REQ = 16;
- MPP_OPT = 17;
+ DATALOSS_PROTECT_REQ = 0;
+ DATALOSS_PROTECT_OPT = 1;
+ INITIAL_ROUING_SYNC = 3;
+ UPFRONT_SHUTDOWN_SCRIPT_REQ = 4;
+ UPFRONT_SHUTDOWN_SCRIPT_OPT = 5;
+ GOSSIP_QUERIES_REQ = 6;
+ GOSSIP_QUERIES_OPT = 7;
+ TLV_ONION_REQ = 8;
+ TLV_ONION_OPT = 9;
+ EXT_GOSSIP_QUERIES_REQ = 10;
+ EXT_GOSSIP_QUERIES_OPT = 11;
+ STATIC_REMOTE_KEY_REQ = 12;
+ STATIC_REMOTE_KEY_OPT = 13;
+ PAYMENT_ADDR_REQ = 14;
+ PAYMENT_ADDR_OPT = 15;
+ MPP_REQ = 16;
+ MPP_OPT = 17;
}
message Feature {
- string name = 2 [json_name = "name"];
- bool is_required = 3 [json_name = "is_required"];
- bool is_known = 4 [json_name = "is_known"];
+ string name = 2;
+ bool is_required = 3;
+ bool is_known = 4;
}
-message FeeReportRequest {}
+message FeeReportRequest {
+}
message ChannelFeeReport {
+ /// The short channel id that this fee report belongs to.
+ uint64 chan_id = 5 [jstype = JS_STRING];
+
/// The channel that this fee report belongs to.
- string chan_point = 1 [json_name = "channel_point"];
+ string channel_point = 1;
/// The base fee charged regardless of the number of milli-satoshis sent.
- int64 base_fee_msat = 2 [json_name = "base_fee_msat"];
+ int64 base_fee_msat = 2;
- /// The amount charged per milli-satoshis transferred expressed in millionths of a satoshi.
- int64 fee_per_mil = 3 [json_name = "fee_per_mil"];
-
- /// The effective fee rate in milli-satoshis. Computed by dividing the fee_per_mil value by 1 million.
- double fee_rate = 4 [json_name = "fee_rate"];
+ /// The amount charged per milli-satoshis transferred expressed in
+ /// millionths of a satoshi.
+ int64 fee_per_mil = 3;
+
+ /// The effective fee rate in milli-satoshis. Computed by dividing the
+ /// fee_per_mil value by 1 million.
+ double fee_rate = 4;
}
message FeeReportResponse {
- /// An array of channel fee reports which describes the current fee schedule for each channel.
- repeated ChannelFeeReport channel_fees = 1 [json_name = "channel_fees"];
-
- /// The total amount of fee revenue (in satoshis) the switch has collected over the past 24 hrs.
- uint64 day_fee_sum = 2 [json_name = "day_fee_sum"];
-
- /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 week.
- uint64 week_fee_sum = 3 [json_name = "week_fee_sum"];
-
- /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 month.
- uint64 month_fee_sum = 4 [json_name = "month_fee_sum"];
+ /// An array of channel fee reports which describes the current fee schedule
+ /// for each channel.
+ repeated ChannelFeeReport channel_fees = 1;
+
+ /// The total amount of fee revenue (in satoshis) the switch has collected
+ /// over the past 24 hrs.
+ uint64 day_fee_sum = 2;
+
+ /// The total amount of fee revenue (in satoshis) the switch has collected
+ /// over the past 1 week.
+ uint64 week_fee_sum = 3;
+
+ /// The total amount of fee revenue (in satoshis) the switch has collected
+ /// over the past 1 month.
+ uint64 month_fee_sum = 4;
}
message PolicyUpdateRequest {
oneof scope {
/// If set, then this update applies to all currently active channels.
- bool global = 1 [json_name = "global"] ;
+ bool global = 1;
/// If set, this update will target a specific channel.
- ChannelPoint chan_point = 2 [json_name = "chan_point"];
+ ChannelPoint chan_point = 2;
}
/// The base fee charged regardless of the number of milli-satoshis sent.
- int64 base_fee_msat = 3 [json_name = "base_fee_msat"];
+ int64 base_fee_msat = 3;
- /// The effective fee rate in milli-satoshis. The precision of this value goes up to 6 decimal places, so 1e-6.
- double fee_rate = 4 [json_name = "fee_rate"];
+ /// The effective fee rate in milli-satoshis. The precision of this value
+ /// goes up to 6 decimal places, so 1e-6.
+ double fee_rate = 4;
/// The required timelock delta for HTLCs forwarded over the channel.
- uint32 time_lock_delta = 5 [json_name = "time_lock_delta"];
+ uint32 time_lock_delta = 5;
- /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum HTLC will be unchanged.
- uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"];
-
- /// The minimum HTLC size in milli-satoshis. Only applied if min_htlc_msat_specified is true.
- uint64 min_htlc_msat = 7 [json_name = "min_htlc_msat"];
+ /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum
+ /// HTLC will be unchanged.
+ uint64 max_htlc_msat = 6;
+
+ /// The minimum HTLC size in milli-satoshis. Only applied if
+ /// min_htlc_msat_specified is true.
+ uint64 min_htlc_msat = 7;
/// If true, min_htlc_msat is applied.
- bool min_htlc_msat_specified = 8 [json_name = "set_min_htlc_msat"];
+ bool min_htlc_msat_specified = 8;
}
message PolicyUpdateResponse {
}
message ForwardingHistoryRequest {
- /// Start time is the starting point of the forwarding history request. All records beyond this point will be included, respecting the end time, and the index offset.
- uint64 start_time = 1 [json_name = "start_time"];
-
- /// End time is the end point of the forwarding history request. The response will carry at most 50k records between the start time and the end time. The index offset can be used to implement pagination.
- uint64 end_time = 2 [json_name = "end_time"];
-
- /// Index offset is the offset in the time series to start at. As each response can only contain 50k records, callers can use this to skip around within a packed time series.
- uint32 index_offset = 3 [json_name = "index_offset"];
+ /// Start time is the starting point of the forwarding history request. All
+ /// records beyond this point will be included, respecting the end time, and
+ /// the index offset.
+ uint64 start_time = 1;
+
+ /// End time is the end point of the forwarding history request. The
+ /// response will carry at most 50k records between the start time and the
+ /// end time. The index offset can be used to implement pagination.
+ uint64 end_time = 2;
+
+ /// Index offset is the offset in the time series to start at. As each
+ /// response can only contain 50k records, callers can use this to skip
+ /// around within a packed time series.
+ uint32 index_offset = 3;
/// The max number of events to return in the response to this query.
- uint32 num_max_events = 4 [json_name = "num_max_events"];
+ uint32 num_max_events = 4;
}
message ForwardingEvent {
- /// Timestamp is the time (unix epoch offset) that this circuit was completed.
- uint64 timestamp = 1 [json_name = "timestamp"];
+ /// Timestamp is the time (unix epoch offset) that this circuit was
+ /// completed.
+ uint64 timestamp = 1;
/// The incoming channel ID that carried the HTLC that created the circuit.
- uint64 chan_id_in = 2 [json_name = "chan_id_in", jstype = JS_STRING];
-
- /// The outgoing channel ID that carried the preimage that completed the circuit.
- uint64 chan_id_out = 4 [json_name = "chan_id_out", jstype = JS_STRING];
-
- /// The total amount (in satoshis) of the incoming HTLC that created half the circuit.
- uint64 amt_in = 5 [json_name = "amt_in"];
+ uint64 chan_id_in = 2 [jstype = JS_STRING];
- /// The total amount (in satoshis) of the outgoing HTLC that created the second half of the circuit.
- uint64 amt_out = 6 [json_name = "amt_out"];
+ /// The outgoing channel ID that carried the preimage that completed the
+ /// circuit.
+ uint64 chan_id_out = 4 [jstype = JS_STRING];
+
+ /// The total amount (in satoshis) of the incoming HTLC that created half
+ /// the circuit.
+ uint64 amt_in = 5;
+
+ /// The total amount (in satoshis) of the outgoing HTLC that created the
+ /// second half of the circuit.
+ uint64 amt_out = 6;
/// The total fee (in satoshis) that this payment circuit carried.
- uint64 fee = 7 [json_name = "fee"];
+ uint64 fee = 7;
/// The total fee (in milli-satoshis) that this payment circuit carried.
- uint64 fee_msat = 8 [json_name = "fee_msat"];
-
- /// The total amount (in milli-satoshis) of the incoming HTLC that created half the circuit.
- uint64 amt_in_msat = 9 [json_name = "amt_in_msat"];
-
- /// The total amount (in milli-satoshis) of the outgoing HTLC that created the second half of the circuit.
- uint64 amt_out_msat = 10 [json_name = "amt_out_msat"];
+ uint64 fee_msat = 8;
+ /// The total amount (in milli-satoshis) of the incoming HTLC that created
+ /// half the circuit.
+ uint64 amt_in_msat = 9;
+
+ /// The total amount (in milli-satoshis) of the outgoing HTLC that created
+ /// the second half of the circuit.
+ uint64 amt_out_msat = 10;
// TODO(roasbeef): add settlement latency?
// * use FPE on the chan id?
// * also list failures?
}
message ForwardingHistoryResponse {
- /// A list of forwarding events from the time slice of the time series specified in the request.
- repeated ForwardingEvent forwarding_events = 1 [json_name = "forwarding_events"];
-
- /// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style.
- uint32 last_offset_index = 2 [json_name = "last_offset_index"];
+ /// A list of forwarding events from the time slice of the time series
+ /// specified in the request.
+ repeated ForwardingEvent forwarding_events = 1;
+
+ /// The index of the last time in the set of returned forwarding events. Can
+ /// be used to seek further, pagination style.
+ uint32 last_offset_index = 2;
}
message ExportChannelBackupRequest {
@@ -2989,7 +3435,7 @@
/**
Identifies the channel that this backup belongs to.
*/
- ChannelPoint chan_point = 1 [ json_name = "chan_point" ];
+ ChannelPoint chan_point = 1;
/**
Is an encrypted single-chan backup. this can be passed to
@@ -2997,14 +3443,14 @@
order to trigger the recovery protocol. When using REST, this field must be
encoded as base64.
*/
- bytes chan_backup = 2 [ json_name = "chan_backup" ];
+ bytes chan_backup = 2;
}
message MultiChanBackup {
/**
Is the set of all channels that are included in this multi-channel backup.
*/
- repeated ChannelPoint chan_points = 1 [ json_name = "chan_points" ];
+ repeated ChannelPoint chan_points = 1;
/**
A single encrypted blob containing all the static channel backups of the
@@ -3012,29 +3458,30 @@
safely be replaced with any prior/future versions. When using REST, this
field must be encoded as base64.
*/
- bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
+ bytes multi_chan_backup = 2;
}
-message ChanBackupExportRequest {}
-message ChanBackupSnapshot {
+message ChanBackupExportRequest {
+}
+message ChanBackupSnapshot {
/**
The set of new channels that have been added since the last channel backup
snapshot was requested.
*/
- ChannelBackups single_chan_backups = 1 [ json_name = "single_chan_backups" ];
+ ChannelBackups single_chan_backups = 1;
/**
A multi-channel backup that covers all open channels currently known to
lnd.
*/
- MultiChanBackup multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
+ MultiChanBackup multi_chan_backup = 2;
}
message ChannelBackups {
/**
A set of single-chan static channel backups.
*/
- repeated ChannelBackup chan_backups = 1 [ json_name = "chan_backups" ];
+ repeated ChannelBackup chan_backups = 1;
}
message RestoreChanBackupRequest {
@@ -3042,34 +3489,199 @@
/**
The channels to restore as a list of channel/backup pairs.
*/
- ChannelBackups chan_backups = 1 [ json_name = "chan_backups" ];
+ ChannelBackups chan_backups = 1;
/**
The channels to restore in the packed multi backup format. When using
REST, this field must be encoded as base64.
*/
- bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
+ bytes multi_chan_backup = 2;
}
}
-message RestoreBackupResponse {}
+message RestoreBackupResponse {
+}
-message ChannelBackupSubscription {}
+message ChannelBackupSubscription {
+}
message VerifyChanBackupResponse {
}
message MacaroonPermission {
/// The entity a permission grants access to.
- string entity = 1 [json_name = "entity"];
+ string entity = 1;
/// The action that is granted.
- string action = 2 [json_name = "action"];
+ string action = 2;
}
message BakeMacaroonRequest {
/// The list of permissions the new macaroon should grant.
- repeated MacaroonPermission permissions = 1 [json_name = "permissions"];
+ repeated MacaroonPermission permissions = 1;
}
message BakeMacaroonResponse {
/// The hex encoded macaroon, serialized in binary format.
- string macaroon = 1 [json_name = "macaroon"];
+ string macaroon = 1;
+}
+
+message Failure {
+ enum FailureCode {
+ /**
+ The numbers assigned in this enumeration match the failure codes as
+ defined in BOLT #4. Because protobuf 3 requires enums to start with 0,
+ a RESERVED value is added.
+ */
+ RESERVED = 0;
+
+ INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1;
+ INCORRECT_PAYMENT_AMOUNT = 2;
+ FINAL_INCORRECT_CLTV_EXPIRY = 3;
+ FINAL_INCORRECT_HTLC_AMOUNT = 4;
+ FINAL_EXPIRY_TOO_SOON = 5;
+ INVALID_REALM = 6;
+ EXPIRY_TOO_SOON = 7;
+ INVALID_ONION_VERSION = 8;
+ INVALID_ONION_HMAC = 9;
+ INVALID_ONION_KEY = 10;
+ AMOUNT_BELOW_MINIMUM = 11;
+ FEE_INSUFFICIENT = 12;
+ INCORRECT_CLTV_EXPIRY = 13;
+ CHANNEL_DISABLED = 14;
+ TEMPORARY_CHANNEL_FAILURE = 15;
+ REQUIRED_NODE_FEATURE_MISSING = 16;
+ REQUIRED_CHANNEL_FEATURE_MISSING = 17;
+ UNKNOWN_NEXT_PEER = 18;
+ TEMPORARY_NODE_FAILURE = 19;
+ PERMANENT_NODE_FAILURE = 20;
+ PERMANENT_CHANNEL_FAILURE = 21;
+ EXPIRY_TOO_FAR = 22;
+ MPP_TIMEOUT = 23;
+
+ /**
+ An internal error occurred.
+ */
+ INTERNAL_FAILURE = 997;
+
+ /**
+ The error source is known, but the failure itself couldn't be decoded.
+ */
+ UNKNOWN_FAILURE = 998;
+
+ /**
+ An unreadable failure result is returned if the received failure message
+ cannot be decrypted. In that case the error source is unknown.
+ */
+ UNREADABLE_FAILURE = 999;
+ }
+
+ /// Failure code as defined in the Lightning spec
+ FailureCode code = 1;
+
+ reserved 2;
+
+ /// An optional channel update message.
+ ChannelUpdate channel_update = 3;
+
+ /// A failure type-dependent htlc value.
+ uint64 htlc_msat = 4;
+
+ /// The sha256 sum of the onion payload.
+ bytes onion_sha_256 = 5;
+
+ /// A failure type-dependent cltv expiry value.
+ uint32 cltv_expiry = 6;
+
+ /// A failure type-dependent flags value.
+ uint32 flags = 7;
+
+ /**
+ The position in the path of the intermediate or final node that generated
+ the failure message. Position zero is the sender node.
+ **/
+ uint32 failure_source_index = 8;
+
+ /// A failure type-dependent block height.
+ uint32 height = 9;
+}
+
+message ChannelUpdate {
+ /**
+ The signature that validates the announced data and proves the ownership
+ of node id.
+ */
+ bytes signature = 1;
+
+ /**
+ The target chain that this channel was opened within. This value
+ should be the genesis hash of the target chain. Along with the short
+ channel ID, this uniquely identifies the channel globally in a
+ blockchain.
+ */
+ bytes chain_hash = 2;
+
+ /**
+ The unique description of the funding transaction.
+ */
+ uint64 chan_id = 3 [jstype = JS_STRING];
+
+ /**
+ A timestamp that allows ordering in the case of multiple announcements.
+ We should ignore the message if timestamp is not greater than the
+ last-received.
+ */
+ uint32 timestamp = 4;
+
+ /**
+ The bitfield that describes whether optional fields are present in this
+ update. Currently, the least-significant bit must be set to 1 if the
+ optional field MaxHtlc is present.
+ */
+ uint32 message_flags = 10;
+
+ /**
+ The bitfield that describes additional meta-data concerning how the
+ update is to be interpreted. Currently, the least-significant bit must be
+ set to 0 if the creating node corresponds to the first node in the
+ previously sent channel announcement and 1 otherwise. If the second bit
+ is set, then the channel is set to be disabled.
+ */
+ uint32 channel_flags = 5;
+
+ /**
+ The minimum number of blocks this node requires to be added to the expiry
+ of HTLCs. This is a security parameter determined by the node operator.
+ This value represents the required gap between the time locks of the
+ incoming and outgoing HTLC's set to this node.
+ */
+ uint32 time_lock_delta = 6;
+
+ /**
+ The minimum HTLC value which will be accepted.
+ */
+ uint64 htlc_minimum_msat = 7;
+
+ /**
+ The base fee that must be used for incoming HTLC's to this particular
+ channel. This value will be tacked onto the required for a payment
+ independent of the size of the payment.
+ */
+ uint32 base_fee = 8;
+
+ /**
+ The fee rate that will be charged per millionth of a satoshi.
+ */
+ uint32 fee_rate = 9;
+
+ /**
+ The maximum HTLC value which will be accepted.
+ */
+ uint64 htlc_maximum_msat = 11;
+
+ /**
+ The set of data that was appended to this message, some of which we may
+ not actually know how to iterate or parse. By holding onto this data, we
+ ensure that we're able to properly validate the set of signatures that
+ cover these new fields, and ensure we're able to make upgrades to the
+ network in a forwards compatible manner.
+ */
+ bytes extra_opaque_data = 12;
}
diff -Naur proto/0.9.0-beta/routerrpc/router.proto proto/0.10.0-beta/routerrpc/router.proto
--- proto/0.9.0-beta/routerrpc/router.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/routerrpc/router.proto 2020-04-19 10:32:04.000000000 +0200
@@ -60,7 +60,7 @@
*/
int64 fee_limit_sat = 7;
- /**
+ /**
The maximum number of millisatoshis that will be paid as a fee of the
payment. If this field is left to the default value of 0, only zero-fee
routes will be considered. This usually means single hop routes connecting
@@ -92,7 +92,7 @@
/**
Optional route hints to reach the destination through private channels.
*/
- repeated lnrpc.RouteHint route_hints = 10 [json_name = "route_hints"];
+ repeated lnrpc.RouteHint route_hints = 10;
/**
An optional field that can be used to pass an arbitrary set of TLV records
@@ -108,80 +108,25 @@
/**
Features assumed to be supported by the final node. All transitive feature
- depdencies must also be set properly. For a given feature bit pair, either
+ dependencies must also be set properly. For a given feature bit pair, either
optional or remote may be set, but not both. If this field is nil or empty,
the router will try to load destination features from the graph as a
fallback.
*/
repeated lnrpc.FeatureBit dest_features = 16;
-}
-
-message TrackPaymentRequest {
- /// The hash of the payment to look up.
- bytes payment_hash = 1;
-}
-
-enum PaymentState {
- /**
- Payment is still in flight.
- */
- IN_FLIGHT = 0;
/**
- Payment completed successfully.
+ The maximum number of partial payments that may be use to complete the full
+ amount.
*/
- SUCCEEDED = 1;
-
- /**
- There are more routes to try, but the payment timeout was exceeded.
- */
- FAILED_TIMEOUT = 2;
-
- /**
- All possible routes were tried and failed permanently. Or were no
- routes to the destination at all.
- */
- FAILED_NO_ROUTE = 3;
-
- /**
- A non-recoverable error has occured.
- */
- FAILED_ERROR = 4;
-
- /**
- Payment details incorrect (unknown hash, invalid amt or
- invalid final cltv delta)
- */
- FAILED_INCORRECT_PAYMENT_DETAILS = 5;
-
- /**
- Insufficient local balance.
- */
- FAILED_INSUFFICIENT_BALANCE = 6;
+ uint32 max_shards = 17;
}
-
-message PaymentStatus {
- /// Current state the payment is in.
- PaymentState state = 1;
-
- /**
- The pre-image of the payment when state is SUCCEEDED.
- */
- bytes preimage = 2;
-
- /**
- The taken route when state is SUCCEEDED.
- */
- lnrpc.Route route = 3;
-
- /**
- The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
- */
- repeated lnrpc.HTLCAttempt htlcs = 4;
+message TrackPaymentRequest {
+ /// The hash of the payment to look up.
+ bytes payment_hash = 1;
}
-
message RouteFeeRequest {
/**
The destination once wishes to obtain a routing fee quote to.
@@ -222,239 +167,84 @@
bytes preimage = 1;
/// The failure message in case the payment failed.
- Failure failure = 2;
+ lnrpc.Failure failure = 2;
}
-message Failure {
- enum FailureCode {
- /**
- The numbers assigned in this enumeration match the failure codes as
- defined in BOLT #4. Because protobuf 3 requires enums to start with 0,
- a RESERVED value is added.
- */
- RESERVED = 0;
-
- INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1;
- INCORRECT_PAYMENT_AMOUNT = 2;
- FINAL_INCORRECT_CLTV_EXPIRY = 3;
- FINAL_INCORRECT_HTLC_AMOUNT = 4;
- FINAL_EXPIRY_TOO_SOON = 5;
- INVALID_REALM = 6;
- EXPIRY_TOO_SOON = 7;
- INVALID_ONION_VERSION = 8;
- INVALID_ONION_HMAC = 9;
- INVALID_ONION_KEY = 10;
- AMOUNT_BELOW_MINIMUM = 11;
- FEE_INSUFFICIENT = 12;
- INCORRECT_CLTV_EXPIRY = 13;
- CHANNEL_DISABLED = 14;
- TEMPORARY_CHANNEL_FAILURE = 15;
- REQUIRED_NODE_FEATURE_MISSING = 16;
- REQUIRED_CHANNEL_FEATURE_MISSING = 17;
- UNKNOWN_NEXT_PEER = 18;
- TEMPORARY_NODE_FAILURE = 19;
- PERMANENT_NODE_FAILURE = 20;
- PERMANENT_CHANNEL_FAILURE = 21;
- EXPIRY_TOO_FAR = 22;
- MPP_TIMEOUT = 23;
-
- /**
- The error source is known, but the failure itself couldn't be decoded.
- */
- UNKNOWN_FAILURE = 998;
-
- /**
- An unreadable failure result is returned if the received failure message
- cannot be decrypted. In that case the error source is unknown.
- */
- UNREADABLE_FAILURE = 999;
- }
-
- /// Failure code as defined in the Lightning spec
- FailureCode code = 1;
-
- reserved 2;
-
- /// An optional channel update message.
- ChannelUpdate channel_update = 3;
-
- /// A failure type-dependent htlc value.
- uint64 htlc_msat = 4;
-
- /// The sha256 sum of the onion payload.
- bytes onion_sha_256 = 5;
-
- /// A failure type-dependent cltv expiry value.
- uint32 cltv_expiry = 6;
-
- /// A failure type-dependent flags value.
- uint32 flags = 7;
-
- /**
- The position in the path of the intermediate or final node that generated
- the failure message. Position zero is the sender node.
- **/
- uint32 failure_source_index = 8;
-
- /// A failure type-dependent block height.
- uint32 height = 9;
+message ResetMissionControlRequest {
}
-
-message ChannelUpdate {
- /**
- The signature that validates the announced data and proves the ownership
- of node id.
- */
- bytes signature = 1;
-
- /**
- The target chain that this channel was opened within. This value
- should be the genesis hash of the target chain. Along with the short
- channel ID, this uniquely identifies the channel globally in a
- blockchain.
- */
- bytes chain_hash = 2;
-
- /**
- The unique description of the funding transaction.
- */
- uint64 chan_id = 3 [jstype = JS_STRING];
-
- /**
- A timestamp that allows ordering in the case of multiple announcements.
- We should ignore the message if timestamp is not greater than the
- last-received.
- */
- uint32 timestamp = 4;
-
- /**
- The bitfield that describes whether optional fields are present in this
- update. Currently, the least-significant bit must be set to 1 if the
- optional field MaxHtlc is present.
- */
- uint32 message_flags = 10;
-
- /**
- The bitfield that describes additional meta-data concerning how the
- update is to be interpreted. Currently, the least-significant bit must be
- set to 0 if the creating node corresponds to the first node in the
- previously sent channel announcement and 1 otherwise. If the second bit
- is set, then the channel is set to be disabled.
- */
- uint32 channel_flags = 5;
-
- /**
- The minimum number of blocks this node requires to be added to the expiry
- of HTLCs. This is a security parameter determined by the node operator.
- This value represents the required gap between the time locks of the
- incoming and outgoing HTLC's set to this node.
- */
- uint32 time_lock_delta = 6;
-
- /**
- The minimum HTLC value which will be accepted.
- */
- uint64 htlc_minimum_msat = 7;
-
- /**
- The base fee that must be used for incoming HTLC's to this particular
- channel. This value will be tacked onto the required for a payment
- independent of the size of the payment.
- */
- uint32 base_fee = 8;
-
- /**
- The fee rate that will be charged per millionth of a satoshi.
- */
- uint32 fee_rate = 9;
-
- /**
- The maximum HTLC value which will be accepted.
- */
- uint64 htlc_maximum_msat = 11;
-
- /**
- The set of data that was appended to this message, some of which we may
- not actually know how to iterate or parse. By holding onto this data, we
- ensure that we're able to properly validate the set of signatures that
- cover these new fields, and ensure we're able to make upgrades to the
- network in a forwards compatible manner.
- */
- bytes extra_opaque_data = 12;
+message ResetMissionControlResponse {
}
-message ResetMissionControlRequest{}
-message ResetMissionControlResponse{}
-
-message QueryMissionControlRequest {}
+message QueryMissionControlRequest {
+}
/// QueryMissionControlResponse contains mission control state.
message QueryMissionControlResponse {
reserved 1;
/// Node pair-level mission control state.
- repeated PairHistory pairs = 2 [json_name = "pairs"];
+ repeated PairHistory pairs = 2;
}
/// PairHistory contains the mission control state for a particular node pair.
message PairHistory {
/// The source node pubkey of the pair.
- bytes node_from = 1 [json_name ="node_from"];
+ bytes node_from = 1;
/// The destination node pubkey of the pair.
- bytes node_to = 2 [json_name="node_to"];
+ bytes node_to = 2;
reserved 3, 4, 5, 6;
- PairData history = 7 [json_name="history"];
+ PairData history = 7;
}
message PairData {
/// Time of last failure.
- int64 fail_time = 1 [json_name = "fail_time"];
+ int64 fail_time = 1;
/**
Lowest amount that failed to forward rounded to whole sats. This may be
set to zero if the failure is independent of amount.
*/
- int64 fail_amt_sat = 2 [json_name = "fail_amt_sat"];
+ int64 fail_amt_sat = 2;
/**
Lowest amount that failed to forward in millisats. This may be
set to zero if the failure is independent of amount.
*/
- int64 fail_amt_msat = 4 [json_name = "fail_amt_msat"];
+ int64 fail_amt_msat = 4;
reserved 3;
/// Time of last success.
- int64 success_time = 5 [json_name = "success_time"];
+ int64 success_time = 5;
/// Highest amount that we could successfully forward rounded to whole sats.
- int64 success_amt_sat = 6 [json_name = "success_amt_sat"];
+ int64 success_amt_sat = 6;
/// Highest amount that we could successfully forward in millisats.
- int64 success_amt_msat = 7 [json_name = "success_amt_msat"];
+ int64 success_amt_msat = 7;
}
-message QueryProbabilityRequest{
+message QueryProbabilityRequest {
/// The source node pubkey of the pair.
- bytes from_node = 1 [json_name = "from_node"];
+ bytes from_node = 1;
/// The destination node pubkey of the pair.
- bytes to_node = 2 [json_name = "to_node"];
+ bytes to_node = 2;
/// The amount for which to calculate a probability.
- int64 amt_msat = 3 [json_name = "amt_msat"];
+ int64 amt_msat = 3;
}
-message QueryProbabilityResponse{
+message QueryProbabilityResponse {
/// The success probability for the requested pair.
- double probability = 1 [json_name = "probability"];
+ double probability = 1;
/// The historical data for the requested pair.
- PairData history = 2 [json_name = "history"];
+ PairData history = 2;
}
message BuildRouteRequest {
@@ -490,56 +280,196 @@
lnrpc.Route route = 1;
}
+message SubscribeHtlcEventsRequest {
+}
+
+/**
+HtlcEvent contains the htlc event that was processed. These are served on a
+best-effort basis; events are not persisted, delivery is not guaranteed
+(in the event of a crash in the switch, forward events may be lost) and
+some events may be replayed upon restart. Events consumed from this package
+should be de-duplicated by the htlc's unique combination of incoming and
+outgoing channel id and htlc id. [EXPERIMENTAL]
+*/
+message HtlcEvent {
+ /**
+ The short channel id that the incoming htlc arrived at our node on. This
+ value is zero for sends.
+ */
+ uint64 incoming_channel_id = 1;
+
+ /**
+ The short channel id that the outgoing htlc left our node on. This value
+ is zero for receives.
+ */
+ uint64 outgoing_channel_id = 2;
+
+ /**
+ Incoming id is the index of the incoming htlc in the incoming channel.
+ This value is zero for sends.
+ */
+ uint64 incoming_htlc_id = 3;
+
+ /**
+ Outgoing id is the index of the outgoing htlc in the outgoing channel.
+ This value is zero for receives.
+ */
+ uint64 outgoing_htlc_id = 4;
+
+ /**
+ The time in unix nanoseconds that the event occurred.
+ */
+ uint64 timestamp_ns = 5;
+
+ enum EventType {
+ UNKNOWN = 0;
+ SEND = 1;
+ RECEIVE = 2;
+ FORWARD = 3;
+ }
+
+ /**
+ The event type indicates whether the htlc was part of a send, receive or
+ forward.
+ */
+ EventType event_type = 6;
+
+ oneof event {
+ ForwardEvent forward_event = 7;
+ ForwardFailEvent forward_fail_event = 8;
+ SettleEvent settle_event = 9;
+ LinkFailEvent link_fail_event = 10;
+ }
+}
+
+message HtlcInfo {
+ // The timelock on the incoming htlc.
+ uint32 incoming_timelock = 1;
+
+ // The timelock on the outgoing htlc.
+ uint32 outgoing_timelock = 2;
+
+ // The amount of the incoming htlc.
+ uint64 incoming_amt_msat = 3;
+
+ // The amount of the outgoing htlc.
+ uint64 outgoing_amt_msat = 4;
+}
+
+message ForwardEvent {
+ // Info contains details about the htlc that was forwarded.
+ HtlcInfo info = 1;
+}
+
+message ForwardFailEvent {
+}
+
+message SettleEvent {
+}
+
+message LinkFailEvent {
+ // Info contains details about the htlc that we failed.
+ HtlcInfo info = 1;
+
+ // FailureCode is the BOLT error code for the failure.
+ lnrpc.Failure.FailureCode wire_failure = 2;
+
+ /**
+ FailureDetail provides additional information about the reason for the
+ failure. This detail enriches the information provided by the wire message
+ and may be 'no detail' if the wire message requires no additional metadata.
+ */
+ FailureDetail failure_detail = 3;
+
+ // A string representation of the link failure.
+ string failure_string = 4;
+}
+
+enum FailureDetail {
+ UNKNOWN = 0;
+ NO_DETAIL = 1;
+ ONION_DECODE = 2;
+ LINK_NOT_ELIGIBLE = 3;
+ ON_CHAIN_TIMEOUT = 4;
+ HTLC_EXCEEDS_MAX = 5;
+ INSUFFICIENT_BALANCE = 6;
+ INCOMPLETE_FORWARD = 7;
+ HTLC_ADD_FAILED = 8;
+ FORWARDS_DISABLED = 9;
+ INVOICE_CANCELED = 10;
+ INVOICE_UNDERPAID = 11;
+ INVOICE_EXPIRY_TOO_SOON = 12;
+ INVOICE_NOT_OPEN = 13;
+ MPP_INVOICE_TIMEOUT = 14;
+ ADDRESS_MISMATCH = 15;
+ SET_TOTAL_MISMATCH = 16;
+ SET_TOTAL_TOO_LOW = 17;
+ SET_OVERPAID = 18;
+ UNKNOWN_INVOICE = 19;
+ INVALID_KEYSEND = 20;
+ MPP_IN_PROGRESS = 21;
+ CIRCULAR_ROUTE = 22;
+}
+
service Router {
/**
SendPayment attempts to route a payment described by the passed
PaymentRequest to the final destination. The call returns a stream of
- payment status updates.
+ payment updates.
*/
- rpc SendPayment(SendPaymentRequest) returns (stream PaymentStatus);
+ rpc SendPayment (SendPaymentRequest) returns (stream lnrpc.Payment);
/**
TrackPayment returns an update stream for the payment identified by the
payment hash.
*/
- rpc TrackPayment(TrackPaymentRequest) returns (stream PaymentStatus);
-
+ rpc TrackPayment (TrackPaymentRequest) returns (stream lnrpc.Payment);
/**
EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
may cost to send an HTLC to the target end destination.
*/
- rpc EstimateRouteFee(RouteFeeRequest) returns (RouteFeeResponse);
+ rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse);
/**
SendToRoute attempts to make a payment via the specified route. This method
differs from SendPayment in that it allows users to specify a full route
manually. This can be used for things like rebalancing, and atomic swaps.
*/
- rpc SendToRoute(SendToRouteRequest) returns (SendToRouteResponse);
+ rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse);
/**
ResetMissionControl clears all mission control state and starts with a clean
slate.
*/
- rpc ResetMissionControl(ResetMissionControlRequest) returns (ResetMissionControlResponse);
+ rpc ResetMissionControl (ResetMissionControlRequest)
+ returns (ResetMissionControlResponse);
/**
QueryMissionControl exposes the internal mission control state to callers.
It is a development feature.
*/
- rpc QueryMissionControl(QueryMissionControlRequest) returns (QueryMissionControlResponse);
+ rpc QueryMissionControl (QueryMissionControlRequest)
+ returns (QueryMissionControlResponse);
/**
QueryProbability returns the current success probability estimate for a
given node pair and amount.
*/
- rpc QueryProbability(QueryProbabilityRequest) returns (QueryProbabilityResponse);
+ rpc QueryProbability (QueryProbabilityRequest)
+ returns (QueryProbabilityResponse);
/**
BuildRoute builds a fully specified route based on a list of hop public
keys. It retrieves the relevant channel policies from the graph in order to
calculate the correct fees and time locks.
*/
- rpc BuildRoute(BuildRouteRequest) returns (BuildRouteResponse);
+ rpc BuildRoute (BuildRouteRequest) returns (BuildRouteResponse);
+
+ /**
+ SubscribeHtlcEvents creates a uni-directional stream from the server to
+ the client which delivers a stream of htlc events.
+ */
+ rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest)
+ returns (stream HtlcEvent);
}
diff -Naur proto/0.9.0-beta/signrpc/signer.proto proto/0.10.0-beta/signrpc/signer.proto
--- proto/0.9.0-beta/signrpc/signer.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/signrpc/signer.proto 2020-04-19 10:32:22.000000000 +0200
@@ -71,7 +71,8 @@
bytes witness_script = 4;
/**
- A description of the output being spent. The value and script MUST be provided.
+ A description of the output being spent. The value and script MUST be
+ provided.
*/
TxOut output = 5;
diff -Naur proto/0.9.0-beta/verrpc/verrpc.proto proto/0.10.0-beta/verrpc/verrpc.proto
--- proto/0.9.0-beta/verrpc/verrpc.proto 1970-01-01 01:00:00.000000000 +0100
+++ proto/0.10.0-beta/verrpc/verrpc.proto 2020-04-19 10:34:20.000000000 +0200
@@ -0,0 +1,41 @@
+syntax = "proto3";
+
+package verrpc;
+
+option go_package = "github.com/lightningnetwork/lnd/lnrpc/verrpc";
+
+service Versioner {
+ rpc GetVersion (VersionRequest) returns (Version);
+};
+
+message VersionRequest {
+};
+
+message Version {
+ /// A verbose description of the daemon's commit.
+ string commit = 1;
+
+ /// The SHA1 commit hash that the daemon is compiled with.
+ string commit_hash = 2;
+
+ /// The semantic version.
+ string version = 3;
+
+ /// The major application version.
+ uint32 app_major = 4;
+
+ /// The minor application version.
+ uint32 app_minor = 5;
+
+ /// The application patch number.
+ uint32 app_patch = 6;
+
+ /// The application pre-release modifier, possibly empty.
+ string app_pre_release = 7;
+
+ /// The list of build tags that were supplied during compilation.
+ repeated string build_tags = 8;
+
+ /// The version of go that compiled the executable.
+ string go_version = 9;
+};
diff -Naur proto/0.9.0-beta/walletrpc/walletkit.proto proto/0.10.0-beta/walletrpc/walletkit.proto
--- proto/0.9.0-beta/walletrpc/walletkit.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/walletrpc/walletkit.proto 2020-04-19 10:32:41.000000000 +0200
@@ -22,7 +22,7 @@
int32 key_family = 2;
}
-message AddrRequest{
+message AddrRequest {
// No fields, as we always give out a p2wkh address.
}
message AddrResponse {
@@ -164,33 +164,51 @@
script that pays to a key solely under our control.
*/
NESTED_WITNESS_KEY_HASH = 12;
+
+ /*
+ A witness type that allows us to spend our anchor on the commitment
+ transaction.
+ */
+ COMMITMENT_ANCHOR = 13;
}
message PendingSweep {
// The outpoint of the output we're attempting to sweep.
- lnrpc.OutPoint outpoint = 1 [json_name = "outpoint"];
+ lnrpc.OutPoint outpoint = 1;
// The witness type of the output we're attempting to sweep.
- WitnessType witness_type = 2 [json_name = "witness_type"];
+ WitnessType witness_type = 2;
// The value of the output we're attempting to sweep.
- uint32 amount_sat = 3 [json_name = "amount_sat"];
+ uint32 amount_sat = 3;
/*
The fee rate we'll use to sweep the output. The fee rate is only determined
once a sweeping transaction for the output is created, so it's possible for
this to be 0 before this.
*/
- uint32 sat_per_byte = 4 [json_name = "sat_per_byte"];
+ uint32 sat_per_byte = 4;
// The number of broadcast attempts we've made to sweep the output.
- uint32 broadcast_attempts = 5 [json_name = "broadcast_attempts"];
+ uint32 broadcast_attempts = 5;
/*
The next height of the chain at which we'll attempt to broadcast the
sweep transaction of the output.
*/
- uint32 next_broadcast_height = 6 [json_name = "next_broadcast_height"];
+ uint32 next_broadcast_height = 6;
+
+ // The requested confirmation target for this output.
+ uint32 requested_conf_target = 8;
+
+ // The requested fee rate, expressed in sat/byte, for this output.
+ uint32 requested_sat_per_byte = 9;
+
+ /**
+ Whether this input must be force-swept. This means that it is swept even
+ if it has a negative yield.
+ */
+ bool force = 7;
}
message PendingSweepsRequest {
@@ -200,21 +218,27 @@
/*
The set of outputs currently being swept by lnd's central batching engine.
*/
- repeated PendingSweep pending_sweeps = 1 [json_name = "pending_sweeps"];
+ repeated PendingSweep pending_sweeps = 1;
}
message BumpFeeRequest {
// The input we're attempting to bump the fee of.
- lnrpc.OutPoint outpoint = 1 [json_name = "outpoint"];
+ lnrpc.OutPoint outpoint = 1;
// The target number of blocks that the input should be spent within.
- uint32 target_conf = 2 [json_name = "target_conf"];
+ uint32 target_conf = 2;
/*
The fee rate, expressed in sat/byte, that should be used to spend the input
with.
*/
- uint32 sat_per_byte = 3 [json_name = "sat_per_byte"];
+ uint32 sat_per_byte = 3;
+
+ /**
+ Whether this input must be force-swept. This means that it is swept even
+ if it has a negative yield.
+ */
+ bool force = 4;
}
message BumpFeeResponse {
@@ -226,18 +250,18 @@
(account in BIP43) specified. This method should return the next external
child within this branch.
*/
- rpc DeriveNextKey(KeyReq) returns (signrpc.KeyDescriptor);
+ rpc DeriveNextKey (KeyReq) returns (signrpc.KeyDescriptor);
/**
DeriveKey attempts to derive an arbitrary key specified by the passed
KeyLocator.
*/
- rpc DeriveKey(signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
+ rpc DeriveKey (signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
/**
NextAddr returns the next unused address within the wallet.
*/
- rpc NextAddr(AddrRequest) returns (AddrResponse);
+ rpc NextAddr (AddrRequest) returns (AddrResponse);
/**
PublishTransaction attempts to publish the passed transaction to the
@@ -245,21 +269,21 @@
attempt to re-broadcast the transaction on start up, until it enters the
chain.
*/
- rpc PublishTransaction(Transaction) returns (PublishResponse);
+ rpc PublishTransaction (Transaction) returns (PublishResponse);
/**
SendOutputs is similar to the existing sendmany call in Bitcoind, and
allows the caller to create a transaction that sends to several outputs at
once. This is ideal when wanting to batch create a set of transactions.
*/
- rpc SendOutputs(SendOutputsRequest) returns (SendOutputsResponse);
+ rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse);
/**
EstimateFee attempts to query the internal fee estimator of the wallet to
determine the fee (in sat/kw) to attach to a transaction in order to
achieve the confirmation target.
*/
- rpc EstimateFee(EstimateFeeRequest) returns (EstimateFeeResponse);
+ rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);
/*
PendingSweeps returns lists of on-chain outputs that lnd is currently
@@ -271,7 +295,7 @@
remain supported. This is an advanced API that depends on the internals of
the UtxoSweeper, so things may change.
*/
- rpc PendingSweeps(PendingSweepsRequest) returns (PendingSweepsResponse);
+ rpc PendingSweeps (PendingSweepsRequest) returns (PendingSweepsResponse);
/*
BumpFee bumps the fee of an arbitrary input within a transaction. This RPC
@@ -300,5 +324,5 @@
fee preference being provided. For now, the responsibility of ensuring that
the new fee preference is sufficient is delegated to the user.
*/
- rpc BumpFee(BumpFeeRequest) returns (BumpFeeResponse);
+ rpc BumpFee (BumpFeeRequest) returns (BumpFeeResponse);
}
diff -Naur proto/0.9.0-beta/watchtowerrpc/watchtower.proto proto/0.10.0-beta/watchtowerrpc/watchtower.proto
--- proto/0.9.0-beta/watchtowerrpc/watchtower.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/watchtowerrpc/watchtower.proto 2020-04-19 10:32:56.000000000 +0200
@@ -5,24 +5,24 @@
option go_package = "github.com/lightningnetwork/lnd/lnrpc/watchtowerrpc";
service Watchtower {
- /** lncli: tower info
- GetInfo returns general information concerning the companion watchtower
- including it's public key and URIs where the server is currently
- listening for clients.
- */
- rpc GetInfo(GetInfoRequest) returns (GetInfoResponse);
+ /** lncli: tower info
+ GetInfo returns general information concerning the companion watchtower
+ including its public key and URIs where the server is currently
+ listening for clients.
+ */
+ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
}
-message GetInfoRequest{
+message GetInfoRequest {
}
message GetInfoResponse {
- /// The public key of the watchtower.
- bytes pubkey = 1 [json_name = "pubkey"];
+ /// The public key of the watchtower.
+ bytes pubkey = 1;
- /// The listening addresses of the watchtower.
- repeated string listeners = 2 [json_name = "listeners"];
+ /// The listening addresses of the watchtower.
+ repeated string listeners = 2;
- /// The URIs of the watchtower.
- repeated string uris = 3 [json_name = "uris" ];
+ /// The URIs of the watchtower.
+ repeated string uris = 3;
}
diff -Naur proto/0.9.0-beta/wtclientrpc/wtclient.proto proto/0.10.0-beta/wtclientrpc/wtclient.proto
--- proto/0.9.0-beta/wtclientrpc/wtclient.proto 2020-04-13 00:01:23.000000000 +0200
+++ proto/0.10.0-beta/wtclientrpc/wtclient.proto 2020-04-19 10:33:05.000000000 +0200
@@ -6,10 +6,10 @@
message AddTowerRequest {
// The identifying public key of the watchtower to add.
- bytes pubkey = 1 [json_name = "pubkey"];
+ bytes pubkey = 1;
// A network address the watchtower is reachable over.
- string address = 2 [json_name = "address"];
+ string address = 2;
}
message AddTowerResponse {
@@ -17,14 +17,14 @@
message RemoveTowerRequest {
// The identifying public key of the watchtower to remove.
- bytes pubkey = 1 [json_name = "pubkey"];
+ bytes pubkey = 1;
/*
If set, then the record for this address will be removed, indicating that is
is stale. Otherwise, the watchtower will no longer be used for future
session negotiations and backups.
*/
- string address = 2 [json_name = "address"];
+ string address = 2;
}
message RemoveTowerResponse {
@@ -32,10 +32,10 @@
message GetTowerInfoRequest {
// The identifying public key of the watchtower to retrieve information for.
- bytes pubkey = 1 [json_name = "pubkey"];
+ bytes pubkey = 1;
// Whether we should include sessions with the watchtower in the response.
- bool include_sessions = 2 [json_name = "include_sessions"];
+ bool include_sessions = 2;
}
message TowerSession {
@@ -43,49 +43,49 @@
The total number of successful backups that have been made to the
watchtower session.
*/
- uint32 num_backups = 1 [json_name = "num_backups"];
+ uint32 num_backups = 1;
/*
The total number of backups in the session that are currently pending to be
acknowledged by the watchtower.
*/
- uint32 num_pending_backups = 2 [json_name = "num_pending_backups"];
+ uint32 num_pending_backups = 2;
// The maximum number of backups allowed by the watchtower session.
- uint32 max_backups = 3 [json_name = "max_backups"];
+ uint32 max_backups = 3;
/*
The fee rate, in satoshis per vbyte, that will be used by the watchtower for
the justice transaction in the event of a channel breach.
*/
- uint32 sweep_sat_per_byte = 4 [json_name = "sweep_sat_per_byte"];
+ uint32 sweep_sat_per_byte = 4;
}
message Tower {
// The identifying public key of the watchtower.
- bytes pubkey = 1 [json_name = "pubkey"];
+ bytes pubkey = 1;
// The list of addresses the watchtower is reachable over.
- repeated string addresses = 2 [json_name = "addresses"];
+ repeated string addresses = 2;
// Whether the watchtower is currently a candidate for new sessions.
- bool active_session_candidate = 3 [json_name = "active_session_candidate"];
+ bool active_session_candidate = 3;
// The number of sessions that have been negotiated with the watchtower.
- uint32 num_sessions = 4 [json_name = "num_sessions"];
+ uint32 num_sessions = 4;
// The list of sessions that have been negotiated with the watchtower.
- repeated TowerSession sessions = 5 [json_name = "sessions"];
+ repeated TowerSession sessions = 5;
}
message ListTowersRequest {
// Whether we should include sessions with the watchtower in the response.
- bool include_sessions = 1 [json_name = "include_sessions"];
+ bool include_sessions = 1;
}
message ListTowersResponse {
// The list of watchtowers available for new backups.
- repeated Tower towers = 1 [json_name = "towers"];
+ repeated Tower towers = 1;
}
message StatsRequest {
@@ -96,25 +96,25 @@
The total number of backups made to all active and exhausted watchtower
sessions.
*/
- uint32 num_backups = 1 [json_name = "num_backups"];
+ uint32 num_backups = 1;
/*
The total number of backups that are pending to be acknowledged by all
active and exhausted watchtower sessions.
*/
- uint32 num_pending_backups = 2 [json_name = "num_pending_backups"];
+ uint32 num_pending_backups = 2;
/*
The total number of backups that all active and exhausted watchtower
sessions have failed to acknowledge.
*/
- uint32 num_failed_backups = 3 [json_name = "num_failed_backups"];
+ uint32 num_failed_backups = 3;
// The total number of new sessions made to watchtowers.
- uint32 num_sessions_acquired = 4 [json_name = "num_sessions_acquired"];
+ uint32 num_sessions_acquired = 4;
// The total number of watchtower sessions that have been exhausted.
- uint32 num_sessions_exhausted = 5 [json_name = "num_sessions_exhausted"];
+ uint32 num_sessions_exhausted = 5;
}
message PolicyRequest {
@@ -125,13 +125,13 @@
The maximum number of updates each session we negotiate with watchtowers
should allow.
*/
- uint32 max_updates = 1 [json_name = "max_updates"];
+ uint32 max_updates = 1;
/*
The fee rate, in satoshis per vbyte, that will be used by watchtowers for
justice transactions in response to channel breaches.
*/
- uint32 sweep_sat_per_byte = 2 [json_name = "sweep_sat_per_byte"];
+ uint32 sweep_sat_per_byte = 2;
}
service WatchtowerClient {
@@ -141,7 +141,7 @@
any new addresses included will be considered when dialing it for
session negotiations and backups.
*/
- rpc AddTower(AddTowerRequest) returns (AddTowerResponse);
+ rpc AddTower (AddTowerRequest) returns (AddTowerResponse);
/*
RemoveTower removes a watchtower from being considered for future session
@@ -149,17 +149,17 @@
again. If an address is provided, then this RPC only serves as a way of
removing the address from the watchtower instead.
*/
- rpc RemoveTower(RemoveTowerRequest) returns (RemoveTowerResponse);
+ rpc RemoveTower (RemoveTowerRequest) returns (RemoveTowerResponse);
// ListTowers returns the list of watchtowers registered with the client.
- rpc ListTowers(ListTowersRequest) returns (ListTowersResponse);
+ rpc ListTowers (ListTowersRequest) returns (ListTowersResponse);
// GetTowerInfo retrieves information for a registered watchtower.
- rpc GetTowerInfo(GetTowerInfoRequest) returns (Tower);
+ rpc GetTowerInfo (GetTowerInfoRequest) returns (Tower);
// Stats returns the in-memory statistics of the client since startup.
- rpc Stats(StatsRequest) returns (StatsResponse);
+ rpc Stats (StatsRequest) returns (StatsResponse);
// Policy returns the active watchtower client policy configuration.
- rpc Policy(PolicyRequest) returns (PolicyResponse);
+ rpc Policy (PolicyRequest) returns (PolicyResponse);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment