@ -1,6 +1,6 @@
syntax = "proto3" ;
import "google/api/annotations.proto" ;
/ / import "google/api/annotations.proto" ;
package lnrpc ;
/ * *
@ -28,13 +28,39 @@ package lnrpc;
/ / 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 {
/ * * lncli : ` create `
CreateWallet is used at lnd startup to set the encryption password for
the wallet database.
/ * *
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 CreateWallet ( CreateWalletRequest ) returns ( CreateWalletResponse ) {
rpc GenSeed ( GenSeed Request) returns ( GenSeed Response) {
option ( google.api.http ) = {
post : "/v1/createwallet"
get : "/v1/genseed"
} ;
}
/ * * lncli : ` init `
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 : "*"
} ;
}
@ -51,20 +77,74 @@ service WalletUnlocker {
}
}
message CreateWalletRequest {
bytes password = 1 ;
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 CreateWalletResponse { }
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 ;
}
message InitWalletResponse {
}
message UnlockWalletRequest {
bytes password = 1 ;
/ * *
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 ;
}
message UnlockWalletResponse { }
service Lightning {
/ * * lncli : ` walletbalance `
WalletBalance returns total unspent outputs ( confirmed and unconfirmed ) , all confirmed unspent outputs and all unconfirmed unspent outputs under control
WalletBalance returns total unspent outputs ( confirmed and unconfirmed ) , all
confirmed unspent outputs and all unconfirmed unspent outputs under control
by the wallet. This method can be modified by having the request specify
only witness outputs should be factored into the final output sum.
* /
@ -251,7 +331,7 @@ service Lightning {
* /
rpc CloseChannel ( CloseChannelRequest ) returns ( stream CloseStatusUpdate ) {
option ( google.api.http ) = {
delete : "/v1/channels/{channel_point.funding_txid}/{channel_point.output_index}"
delete : "/v1/channels/{channel_point.funding_txid_str }/{channel_point.output_index}"
} ;
}
@ -294,18 +374,18 @@ service Lightning {
* /
rpc ListInvoices ( ListInvoiceRequest ) returns ( ListInvoiceResponse ) {
option ( google.api.http ) = {
get : "/v1/invoices/{pending_only} "
get : "/v1/invoices"
} ;
}
/ * * lncli : ` lookupinvoice `
LookupInvoice attemps to look up an invoice according to its payment hash.
LookupInvoice attempt s 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/invoices /{r_hash_str}"
get : "/v1/invoice/{r_hash_str}"
} ;
}
@ -389,7 +469,7 @@ service Lightning {
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 encapsua lted within the HTLC.
present within the Sphinx packet encapsula ted within the HTLC.
* /
rpc QueryRoutes ( QueryRoutesRequest ) returns ( QueryRoutesResponse ) {
option ( google.api.http ) = {
@ -447,7 +527,7 @@ service Lightning {
* /
rpc UpdateChannelPolicy ( PolicyUpdateRequest ) returns ( PolicyUpdateResponse ) {
option ( google.api.http ) = {
post : "/v1/fees "
post : "/v1/chanpolicy "
body : "*"
} ;
}
@ -518,16 +598,16 @@ message SendResponse {
}
message ChannelPoint {
/ / TODO ( roasbeef ) : make str vs bytes into a oneof
oneof funding_txid {
/ / / Txid of the funding transaction
bytes funding_txid_bytes = 1 [ json_name = "funding_txid_bytes" ] ;
/ / / Txid of the funding transaction
bytes funding_txid = 1 [ json_name = "funding_txid" ] ;
/ / / Hex - encoded string representing the funding transaction
string funding_txid_str = 2 [ json_name = "funding_txid_str" ] ;
/ / / 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" ] ;
uint32 output_index = 3 [ json_name = "output_index" ] ;
}
message LightningAddress {
@ -610,7 +690,7 @@ message VerifyMessageRequest {
/ / / The message over which the signature is to be verified
bytes msg = 1 [ json_name = "msg" ] ;
/ / / The signature to be verifed over the given message
/ / / The signature to be verifi ed over the given message
string signature = 2 [ json_name = "signature" ] ;
}
message VerifyMessageResponse {
@ -630,8 +710,6 @@ message ConnectPeerRequest {
bool perm = 2 ;
}
message ConnectPeerResponse {
/ / / The id of the newly connected peer
int32 peer_id = 1 [ json_name = "peer_id" ] ;
}
message DisconnectPeerRequest {
@ -738,9 +816,6 @@ message Peer {
/ / / The identity pubkey of the peer
string pub_key = 1 [ json_name = "pub_key" ] ;
/ / / The peer ' s id from the local point of view
int32 peer_id = 2 [ json_name = "peer_id" ] ;
/ / / Network address of the peer ; eg ` 127.0 .0 .1 : 10011 `
string address = 3 [ json_name = "address" ] ;
@ -806,6 +881,9 @@ message GetInfoResponse {
/ / / The URIs of the current node.
repeated string uris = 12 [ json_name = "uris" ] ;
/ / / Timestamp of the block best known to the wallet
int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ] ;
}
message ConfirmationUpdate {
@ -840,8 +918,9 @@ message CloseChannelRequest {
int32 target_conf = 3 ;
/ / / A manual fee rate set in sat / byte that should be used when crafting the closure transaction.
int64 sat_per_byte = 5 ;
int64 sat_per_byte = 4 ;
}
message CloseStatusUpdate {
oneof update {
PendingUpdate close_pending = 1 [ json_name = "close_pending" ] ;
@ -857,13 +936,10 @@ message PendingUpdate {
message OpenChannelRequest {
/ / / The peer_id of the node to open a channel with
int32 target_peer_id = 1 [ json_name = "target_peer_id" ] ;
/ / / The pubkey of the node to open a channel with
bytes node_pubkey = 2 [ json_name = "node_pubkey" ] ;
/ / / The hex encor ded pubkey of the node to open a channel with
/ / / The hex encoded pubkey of the node to open a channel with
string node_pubkey_string = 3 [ json_name = "node_pubkey_string" ] ;
/ / / The number of satoshis the wallet should commit to the channel
@ -1031,6 +1107,9 @@ message QueryRoutesRequest {
/ / / The amount to send expressed in satoshis
int64 amt = 2 ;
/ / / The max number of routes to return.
int32 num_routes = 3 ;
}
message QueryRoutesResponse {
repeated Route routes = 1 [ json_name = "routes" ] ;
@ -1337,6 +1416,7 @@ message InvoiceSubscription {
message Payment {
/ / / The payment hash
string payment_hash = 1 [ json_name = "payment_hash" ] ;
/ / / The value of the payment in satoshis
int64 value = 2 [ json_name = "value" ] ;
@ -1348,6 +1428,9 @@ message Payment {
/ / / The fee paid for this payment in satoshis
int64 fee = 5 [ json_name = "fee" ] ;
/ / / The payment preimage
string payment_preimage = 6 [ json_name = "payment_preimage" ] ;
}
message ListPaymentsRequest {