-
Notifications
You must be signed in to change notification settings - Fork 2
/
rpc.proto
1828 lines (1504 loc) · 62.6 KB
/
rpc.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
//import "google/api/annotations.proto";
package lnrpc;
/**
* Comments in this file will be directly parsed into the API
* Documentation as descriptions of the associated method, message, or field.
* These descriptions should go right above the definition of the object, and
* can be in either block or /// comment format.
*
* One edge case exists where a // comment followed by a /// comment in the
* next line will cause the description not to show up in the documentation. In
* that instance, simply separate the two comments with a blank line.
*
* 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.
*
* More information on how exactly the gRPC documentation is generated from
* this proto file can be found here:
* https://github.com/MaxFangX/lightning-api
*/
// The WalletUnlocker service is used to set up a wallet password for
// lnd at first startup, and unlock a previously set up wallet.
service WalletUnlocker {
/**
GenSeed is the first method that should be used to instantiate a new lnd
instance. This method allows a caller to generate a new aezeed cipher seed
given an optional passphrase. If provided, the passphrase will be necessary
to decrypt the cipherseed to expose the internal wallet seed.
Once the cipherseed is obtained and verified by the user, the InitWallet
method should be used to commit the newly generated seed, and create the
wallet.
*/
rpc GenSeed(GenSeedRequest) returns (GenSeedResponse) {
option (google.api.http) = {
get: "/v1/genseed"
};
}
/**
InitWallet is used when lnd is starting up for the first time to fully
initialize the daemon and its internal wallet. At the very least a wallet
password must be provided. This will be used to encrypt sensitive material
on disk.
In the case of a recovery scenario, the user can also specify their aezeed
mnemonic and passphrase. If set, then the daemon will use this prior state
to initialize its internal wallet.
Alternatively, this can be used along with the GenSeed RPC to obtain a
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) {
option (google.api.http) = {
post: "/v1/initwallet"
body: "*"
};
}
/** lncli: `unlock`
UnlockWallet is used at startup of lnd to provide a password to unlock
the wallet database.
*/
rpc UnlockWallet(UnlockWalletRequest) returns (UnlockWalletResponse) {
option (google.api.http) = {
post: "/v1/unlockwallet"
body: "*"
};
}
/** lncli: `changepassword`
ChangePassword changes the password of the encrypted wallet. This will
automatically unlock the wallet database if successful.
*/
rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {
option (google.api.http) = {
post: "/v1/changepassword"
body: "*"
};
}
}
message GenSeedRequest {
/**
aezeed_passphrase is an optional user provided passphrase that will be used
to encrypt the generated aezeed cipher seed.
*/
bytes aezeed_passphrase = 1;
/**
seed_entropy is an optional 16-bytes generated via CSPRNG. If not
specified, then a fresh set of randomness will be used to create the seed.
*/
bytes seed_entropy = 2;
}
message GenSeedResponse {
/**
cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
cipher seed obtained by the user. This field is optional, as if not
provided, then the daemon will generate a new cipher seed for the user.
Otherwise, then the daemon will attempt to recover the wallet state linked
to this cipher seed.
*/
repeated string cipher_seed_mnemonic = 1;
/**
enciphered_seed are the raw aezeed cipher seed bytes. This is the raw
cipher text before run through our mnemonic encoding scheme.
*/
bytes enciphered_seed = 2;
}
message InitWalletRequest {
/**
wallet_password is the passphrase that should be used to encrypt the
wallet. This MUST be at least 8 chars in length. After creation, this
password is required to unlock the daemon.
*/
bytes wallet_password = 1;
/**
cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
cipher seed obtained by the user. This may have been generated by the
GenSeed method, or be an existing seed.
*/
repeated string cipher_seed_mnemonic = 2;
/**
aezeed_passphrase is an optional user provided passphrase that will be used
to encrypt the generated aezeed cipher seed.
*/
bytes aezeed_passphrase = 3;
/**
recovery_window is an optional argument specifying the address lookahead
when restoring a wallet seed. The recovery window applies to each
invdividual branch of the BIP44 derivation paths. Supplying a recovery
window of zero indicates that no addresses should be recovered, such after
the first initialization of the wallet.
*/
int32 recovery_window = 4;
}
message InitWalletResponse {
}
message UnlockWalletRequest {
/**
wallet_password should be the current valid passphrase for the daemon. This
will be required to decrypt on-disk material that the daemon requires to
function properly.
*/
bytes wallet_password = 1;
/**
recovery_window is an optional argument specifying the address lookahead
when restoring a wallet seed. The recovery window applies to each
invdividual branch of the BIP44 derivation paths. Supplying a recovery
window of zero indicates that no addresses should be recovered, such after
the first initialization of the wallet.
*/
int32 recovery_window = 2;
}
message UnlockWalletResponse {}
message ChangePasswordRequest {
/**
current_password should be the current valid passphrase used to unlock the
daemon.
*/
bytes current_password = 1;
/**
new_password should be the new passphrase that will be needed to unlock the
daemon.
*/
bytes new_password = 2;
}
message ChangePasswordResponse {}
service Lightning {
/** lncli: `walletbalance`
WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
confirmed unspent outputs and all unconfirmed unspent outputs under control
of the wallet.
*/
rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) {
option (google.api.http) = {
get: "/v1/balance/blockchain"
};
}
/** lncli: `channelbalance`
ChannelBalance returns the total funds available across all open channels
in satoshis.
*/
rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse) {
option (google.api.http) = {
get: "/v1/balance/channels"
};
}
/** lncli: `listchaintxns`
GetTransactions returns a list describing all the known transactions
relevant to the wallet.
*/
rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) {
option (google.api.http) = {
get: "/v1/transactions"
};
}
/** lncli: `sendcoins`
SendCoins executes a request to send coins to a particular address. Unlike
SendMany, this RPC call only allows creating a single output at a time. If
neither target_conf, or sat_per_byte are set, then the internal wallet will
consult its fee model to determine a fee for the default confirmation
target.
*/
rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) {
option (google.api.http) = {
post: "/v1/transactions"
body: "*"
};
}
/**
SubscribeTransactions creates a uni-directional stream from the server to
the client in which any newly discovered transactions relevant to the
wallet are sent over.
*/
rpc SubscribeTransactions (GetTransactionsRequest) returns (stream Transaction);
/** lncli: `sendmany`
SendMany handles a request for a transaction that creates multiple specified
outputs in parallel. If neither target_conf, or sat_per_byte are set, then
the internal wallet will consult its fee model to determine a fee for the
default confirmation target.
*/
rpc SendMany (SendManyRequest) returns (SendManyResponse);
/** lncli: `newaddress`
NewAddress creates a new address under control of the local wallet.
*/
rpc NewAddress (NewAddressRequest) returns (NewAddressResponse);
/**
NewWitnessAddress creates a new witness address under control of the local wallet.
*/
rpc NewWitnessAddress (NewWitnessAddressRequest) returns (NewAddressResponse) {
option (google.api.http) = {
get: "/v1/newaddress"
};
}
/** lncli: `signmessage`
SignMessage signs a message with this node's private key. The returned
signature string is `zbase32` encoded and pubkey recoverable, meaning that
only the message digest and signature are needed for verification.
*/
rpc SignMessage (SignMessageRequest) returns (SignMessageResponse);
/** lncli: `verifymessage`
VerifyMessage verifies a signature over a msg. The signature must be
zbase32 encoded and signed by an active node in the resident node's
channel database. In addition to returning the validity of the signature,
VerifyMessage also returns the recovered pubkey from the signature.
*/
rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse);
/** lncli: `connect`
ConnectPeer attempts to establish a connection to a remote peer. This is at
the networking level, and is used for communication between nodes. This is
distinct from establishing a channel with a peer.
*/
rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) {
option (google.api.http) = {
post: "/v1/peers"
body: "*"
};
}
/** lncli: `disconnect`
DisconnectPeer attempts to disconnect one peer from another identified by a
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) {
option (google.api.http) = {
delete: "/v1/peers/{pub_key}"
};
}
/** lncli: `listpeers`
ListPeers returns a verbose listing of all currently active peers.
*/
rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) {
option (google.api.http) = {
get: "/v1/peers"
};
}
/** lncli: `getinfo`
GetInfo returns general information concerning the lightning node including
it's identity pubkey, alias, the chains it is connected to, and information
concerning the number of open+pending channels.
*/
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) {
option (google.api.http) = {
get: "/v1/getinfo"
};
}
// TODO(roasbeef): merge with below with bool?
/** lncli: `pendingchannels`
PendingChannels returns a list of all the channels that are currently
considered "pending". A channel is pending if it has finished the funding
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) {
option (google.api.http) = {
get: "/v1/channels/pending"
};
}
/** lncli: `listchannels`
ListChannels returns a description of all the open channels that this node
is a participant in.
*/
rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) {
option (google.api.http) = {
get: "/v1/channels"
};
}
/** lncli: `closedchannels`
ClosedChannels returns a description of all the closed channels that
this node was a participant in.
*/
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
other sync calls, all byte slices are intended to be populated as hex
encoded strings.
*/
rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) {
option (google.api.http) = {
post: "/v1/channels"
body: "*"
};
}
/** lncli: `openchannel`
OpenChannel attempts to open a singly funded channel specified in the
request to a remote peer. Users are able to specify a target number of
blocks that the funding transaction should be confirmed in, or a manual fee
rate to us for the funding transaction. If neither are specified, then a
lax block confirmation target is used.
*/
rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate);
/** lncli: `closechannel`
CloseChannel attempts to close an active channel identified by its channel
outpoint (ChannelPoint). The actions of this method can additionally be
augmented to attempt a force close after a timeout period in the case of an
inactive peer. If a non-force close (cooperative closure) is requested,
then the user can specify either a target number of blocks until the
closure transaction is confirmed, or a manual fee rate. If neither are
specified, then a default lax, block confirmation target is used.
*/
rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) {
option (google.api.http) = {
delete: "/v1/channels/{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.
*/
rpc SendPayment (stream SendRequest) returns (stream SendResponse);
/**
SendPaymentSync is the synchronous non-streaming version of SendPayment.
This RPC is intended to be consumed by clients of the REST proxy.
Additionally, this RPC expects the destination's public key and the payment
hash (if any) to be encoded as hex strings.
*/
rpc SendPaymentSync (SendRequest) returns (SendResponse) {
option (google.api.http) = {
post: "/v1/channels/transactions"
body: "*"
};
}
/** lncli: `sendtoroute`
SendToRoute is a bi-directional streaming RPC for sending payment through
the Lightning Network. 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(stream SendToRouteRequest) returns (stream SendResponse);
/**
SendToRouteSync is a synchronous version of SendToRoute. It Will block
until the payment either fails or succeeds.
*/
rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) {
option (google.api.http) = {
post: "/v1/channels/transactions/route"
body: "*"
};
}
/** lncli: `addinvoice`
AddInvoice attempts to add a new invoice to the invoice database. Any
duplicated invoices are rejected, therefore all invoices *must* have a
unique payment preimage.
*/
rpc AddInvoice (Invoice) returns (AddInvoiceResponse) {
option (google.api.http) = {
post: "/v1/invoices"
body: "*"
};
}
/** lncli: `listinvoices`
ListInvoices returns a list of all the invoices currently stored within the
database. Any active debug invoices are ignored.
*/
rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) {
option (google.api.http) = {
get: "/v1/invoices"
};
}
/** lncli: `lookupinvoice`
LookupInvoice attempts to look up an invoice according to its payment hash.
The passed payment hash *must* be exactly 32 bytes, if not, an error is
returned.
*/
rpc LookupInvoice (PaymentHash) returns (Invoice) {
option (google.api.http) = {
get: "/v1/invoice/{r_hash_str}"
};
}
/**
SubscribeInvoices returns a uni-directional stream (sever -> client) for
notifying the client of newly added/settled invoices.
*/
rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) {
option (google.api.http) = {
get: "/v1/invoices/subscribe"
};
}
/** lncli: `decodepayreq`
DecodePayReq takes an encoded payment request string and attempts to decode
it, returning a full description of the conditions encoded within the
payment request.
*/
rpc DecodePayReq (PayReqString) returns (PayReq) {
option (google.api.http) = {
get: "/v1/payreq/{pay_req}"
};
}
/** lncli: `listpayments`
ListPayments returns a list of all outgoing payments.
*/
rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) {
option (google.api.http) = {
get: "/v1/payments"
};
};
/**
DeleteAllPayments deletes all outgoing payments from DB.
*/
rpc DeleteAllPayments (DeleteAllPaymentsRequest) returns (DeleteAllPaymentsResponse) {
option (google.api.http) = {
delete: "/v1/payments"
};
};
/** lncli: `describegraph`
DescribeGraph returns a description of the latest graph state from the
point of view of the node. The graph information is partitioned into two
components: all the nodes/vertexes, and all the edges that connect the
vertexes themselves. As this is a directed graph, the edges also contain
the node directional specific routing policy which includes: the time lock
delta, fee information, etc.
*/
rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) {
option (google.api.http) = {
get: "/v1/graph"
};
}
/** lncli: `getchaninfo`
GetChanInfo returns the latest authenticated network announcement for the
given channel identified by its channel ID: an 8-byte integer which
uniquely identifies the location of transaction's funding output within the
blockchain.
*/
rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) {
option (google.api.http) = {
get: "/v1/graph/edge/{chan_id}"
};
}
/** lncli: `getnodeinfo`
GetNodeInfo returns the latest advertised, aggregated, and authenticated
channel information for the specified node identified by its public key.
*/
rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) {
option (google.api.http) = {
get: "/v1/graph/node/{pub_key}"
};
}
/** lncli: `queryroutes`
QueryRoutes attempts to query the daemon's Channel Router for a possible
route to a target destination capable of carrying a specific amount of
satoshis. The retuned route contains the full details required to craft and
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) {
option (google.api.http) = {
get: "/v1/graph/routes/{pub_key}/{amt}"
};
}
/** lncli: `getnetworkinfo`
GetNetworkInfo returns some basic stats about the known channel graph from
the point of view of the node.
*/
rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) {
option (google.api.http) = {
get: "/v1/graph/info"
};
}
/** lncli: `stop`
StopDaemon will send a shutdown request to the interrupt handler, triggering
a graceful shutdown of the daemon.
*/
rpc StopDaemon(StopRequest) returns (StopResponse);
/**
SubscribeChannelGraph launches a streaming RPC that allows the caller to
receive notifications upon any changes to the channel graph topology from
the point of view of the responding node. Events notified include: new
nodes coming online, nodes updating their authenticated attributes, new
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);
/** lncli: `debuglevel`
DebugLevel allows a caller to programmatically set the logging verbosity of
lnd. The logging can be targeted according to a coarse daemon-wide logging
level, or in a granular fashion to specify the logging for a target
sub-system.
*/
rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse);
/** lncli: `feereport`
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) {
option (google.api.http) = {
get: "/v1/fees"
};
}
/** lncli: `updatechanpolicy`
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) {
option (google.api.http) = {
post: "/v1/chanpolicy"
body: "*"
};
}
/** lncli: `fwdinghistory`
ForwardingHistory allows the caller to query the htlcswitch for a record of
all HTLC's forwarded within the target time range, and integer offset
within that time range. If no time-range is specified, then the first chunk
of the past 24 hrs of forwarding history are returned.
A list of forwarding events are returned. The size of each forwarding event
is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
As a result each message can only contain 50k entries. Each response has
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) {
option (google.api.http) = {
post: "/v1/switch"
body: "*"
};
};
}
message Transaction {
/// The transaction hash
string tx_hash = 1 [ json_name = "tx_hash" ];
/// The transaction ammount, denominated in satoshis
int64 amount = 2 [ json_name = "amount" ];
/// The number of confirmations
int32 num_confirmations = 3 [ json_name = "num_confirmations" ];
/// The hash of the block this transaction was included in
string block_hash = 4 [ json_name = "block_hash" ];
/// The height of the block this transaction was included in
int32 block_height = 5 [ json_name = "block_height" ];
/// Timestamp of this transaction
int64 time_stamp = 6 [ json_name = "time_stamp" ];
/// Fees paid for this transaction
int64 total_fees = 7 [ json_name = "total_fees" ];
/// Addresses that received funds for this transaction
repeated string dest_addresses = 8 [ json_name = "dest_addresses" ];
}
message GetTransactionsRequest {
}
message TransactionDetails {
/// The list of transactions relevant to the wallet.
repeated Transaction transactions = 1 [json_name = "transactions"];
}
message FeeLimit {
oneof limit {
/// The fee limit expressed as a fixed amount of satoshis.
int64 fixed = 1;
/// The fee limit expressed as a percentage of the payment amount.
int64 percent = 2;
}
}
message SendRequest {
/// The identity pubkey of the payment recipient
bytes dest = 1;
/// The hex-encoded identity pubkey of the payment recipient
string dest_string = 2;
/// Number of satoshis to send.
int64 amt = 3;
/// The hash to use within the payment's HTLC
bytes payment_hash = 4;
/// The hex-encoded hash to use within the payment's HTLC
string payment_hash_string = 5;
/**
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 = 6;
/**
The CLTV delta from the current height that should be used to set the
timelock for the final hop.
*/
int32 final_cltv_delta = 7;
/**
The maximum number of satoshis that will be paid as a fee of the payment.
This value can be represented either as a percentage of the amount being
sent, or as a fixed amount of the maximum fee the user is willing the pay to
send the payment.
*/
FeeLimit fee_limit = 8;
}
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"];
}
message SendToRouteRequest {
/// The payment hash to use for the HTLC.
bytes payment_hash = 1;
/// An optional hex-encoded payment hash to be used for the HTLC.
string payment_hash_string = 2;
/// The set of routes that should be used to attempt to complete the payment.
repeated Route routes = 3;
}
message ChannelPoint {
oneof funding_txid {
/// Txid of the funding transaction
bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"];
/// Hex-encoded string representing the funding transaction
string funding_txid_str = 2 [json_name = "funding_txid_str"];
}
/// The index of the output of the funding transaction
uint32 output_index = 3 [json_name = "output_index"];
}
message LightningAddress {
/// The identity pubkey of the Lightning node
string pubkey = 1 [json_name = "pubkey"];
/// The network location of the lightning node, e.g. `69.69.69.69:1337` or `localhost:10011`
string host = 2 [json_name = "host"];
}
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.
int32 target_conf = 3;
/// 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"];
}
message SendCoinsRequest {
/// The address to send coins to
string addr = 1;
/// The amount in satoshis to send
int64 amount = 2;
/// 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.
int64 sat_per_byte = 5;
}
message SendCoinsResponse {
/// The transaction ID of the transaction
string txid = 1 [json_name = "txid"];
}
/**
`AddressType` has to be one of:
- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0)
- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1)
- `p2pkh`: Pay to public key hash (`PUBKEY_HASH` = 2)
*/
message NewAddressRequest {
enum AddressType {
WITNESS_PUBKEY_HASH = 0;
NESTED_PUBKEY_HASH = 1;
}
/// The address type
AddressType type = 1;
}
message NewWitnessAddressRequest {
}
message NewAddressResponse {
/// The newly generated wallet address
string address = 1 [json_name = "address"];
}
message SignMessageRequest {
/// The message to be signed
bytes msg = 1 [ json_name = "msg" ];
}
message SignMessageResponse {
/// The signature for the given message
string signature = 1 [ json_name = "signature" ];
}
message VerifyMessageRequest {
/// The message over which the signature is to be verified
bytes msg = 1 [ json_name = "msg" ];
/// The signature to be verified over the given message
string signature = 2 [ json_name = "signature" ];
}
message VerifyMessageResponse {
/// Whether the signature was valid over the given message
bool valid = 1 [ json_name = "valid" ];
/// The pubkey recovered from the signature
string pubkey = 2 [ json_name = "pubkey" ];
}
message ConnectPeerRequest {
/// Lightning address of the peer, in the format `<pubkey>@host`
LightningAddress addr = 1;
/** If set, the daemon will attempt to persistently connect to the target
* peer. Otherwise, the call will be synchronous. */
bool perm = 2;
}
message ConnectPeerResponse {
}
message DisconnectPeerRequest {
/// The pubkey of the node to disconnect from
string pub_key = 1 [json_name = "pub_key"];
}
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"];
}
message Channel {
/// Whether this channel is active or not
bool active = 1 [json_name = "active"];
/// The identity pubkey of the remote node
string remote_pubkey = 2 [json_name = "remote_pubkey"];
/**
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"];
/**
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"];
/// The total amount of funds held in this channel
int64 capacity = 5 [json_name = "capacity"];
/// This node's current balance in this channel
int64 local_balance = 6 [json_name = "local_balance"];
/// The counterparty's current balance in this channel
int64 remote_balance = 7 [json_name = "remote_balance"];
/**
The amount calculated to be paid in fees for the current set of commitment
transactions. The fee amount is persisted with the channel in order to
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"];
/// The weight of the commitment transaction
int64 commit_weight = 9 [json_name = "commit_weight"];
/**
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"];
/// The unsettled balance in this channel
int64 unsettled_balance = 11 [json_name = "unsettled_balance"];
/**
The total number of satoshis we've sent within this channel.
*/
int64 total_satoshis_sent = 12 [json_name = "total_satoshis_sent"];
/**
The total number of satoshis we've received within this channel.
*/
int64 total_satoshis_received = 13 [json_name = "total_satoshis_received"];
/**
The total number of updates conducted within this channel.
*/
uint64 num_updates = 14 [json_name = "num_updates"];
/**
The list of active, uncleared HTLCs currently pending within the channel.
*/
repeated HTLC pending_htlcs = 15 [json_name = "pending_htlcs"];
/**
The CSV delay expressed in relative blocks. If the channel is force
closed, we'll need to wait for this many blocks before we can regain our
funds.
*/
uint32 csv_delay = 16 [json_name = "csv_delay"];
/// Whether this channel is advertised to the network or not
bool private = 17 [json_name = "private"];
}
message ListChannelsRequest {
bool active_only = 1;
bool inactive_only = 2;
bool public_only = 3;
bool private_only = 4;
}
message ListChannelsResponse {
/// The list of active channels
repeated Channel channels = 11 [json_name = "channels"];
}
message ChannelCloseSummary {
/// The outpoint (txid:index) of the funding transaction.
string channel_point = 1 [json_name = "channel_point"];
/// The unique channel ID for the channel.
uint64 chan_id = 2 [json_name = "chan_id"];
/// The hash of the genesis block that this channel resides within.
string chain_hash = 3 [json_name = "chain_hash"];
/// The txid of the transaction which ultimately closed this channel.
string closing_tx_hash = 4 [json_name = "closing_tx_hash"];
/// Public key of the remote peer that we formerly had a channel with.
string remote_pubkey = 5 [json_name = "remote_pubkey"];
/// Total capacity of the channel.
int64 capacity = 6 [json_name = "capacity"];
/// Height at which the funding transaction was spent.
uint32 close_height = 7 [json_name = "close_height"];
/// Settled balance at the time of channel closure
int64 settled_balance = 8 [json_name = "settled_balance"];
/// The sum of all the time-locked outputs at the time of channel closure
int64 time_locked_balance = 9 [json_name = "time_locked_balance"];
enum ClosureType {
COOPERATIVE_CLOSE = 0;
LOCAL_FORCE_CLOSE = 1;
REMOTE_FORCE_CLOSE = 2;
BREACH_CLOSE = 3;
FUNDING_CANCELED = 4;
}
/// Details on how the channel was closed.
ClosureType close_type = 10 [json_name = "close_type"];
}
message ClosedChannelsRequest {
bool cooperative = 1;
bool local_force = 2;
bool remote_force = 3;
bool breach = 4;
bool funding_canceled = 5;
}
message ClosedChannelsResponse {
repeated ChannelCloseSummary channels = 1 [json_name = "channels"];
}
message Peer {
/// The identity pubkey of the peer
string pub_key = 1 [json_name = "pub_key"];