Skip to content

Commit

Permalink
Update proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Sep 1, 2022
1 parent e8df5ad commit d234057
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 10 deletions.
64 changes: 63 additions & 1 deletion proto/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ service Lightning {
*/
rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest)
returns (stream CustomMessage);

/* lncli: `listaliases`
ListAliases returns the set of all aliases that have ever existed with
their confirmed SCID (if it exists) and/or the base SCID (in the case of
zero conf).
*/
rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse);
}

message SubscribeCustomMessagesRequest {
Expand Down Expand Up @@ -630,6 +637,7 @@ enum OutputScriptType {
SCRIPT_TYPE_NULLDATA = 6;
SCRIPT_TYPE_NON_STANDARD = 7;
SCRIPT_TYPE_WITNESS_UNKNOWN = 8;
SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9;
}

message OutputDetail {
Expand Down Expand Up @@ -919,6 +927,14 @@ message ChannelAcceptRequest {

// The commitment type the initiator wishes to use for the proposed channel.
CommitmentType commitment_type = 14;

// Whether the initiator wants to open a zero-conf channel via the channel
// type.
bool wants_zero_conf = 15;

// Whether the initiator wants to use the scid-alias channel type. This is
// separate from the feature bit.
bool wants_scid_alias = 16;
}

message ChannelAcceptResponse {
Expand Down Expand Up @@ -1482,6 +1498,18 @@ message Channel {

// List constraints for the remote node.
ChannelConstraints remote_constraints = 30;

/*
This lists out the set of alias short channel ids that exist for a channel.
This may be empty.
*/
repeated uint64 alias_scids = 31;

// Whether or not this is a zero-conf channel.
bool zero_conf = 32;

// This is the confirmed / on-chain zero-conf SCID.
uint64 zero_conf_confirmed_scid = 33;
}

message ListChannelsRequest {
Expand All @@ -1501,6 +1529,22 @@ message ListChannelsResponse {
repeated Channel channels = 11;
}

message AliasMap {
/*
For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is
the first assigned "base" alias.
*/
uint64 base_scid = 1;

// The set of all aliases stored for the base SCID.
repeated uint64 aliases = 2;
}
message ListAliasesRequest {
}
message ListAliasesResponse {
repeated AliasMap alias_maps = 1;
}

enum Initiator {
INITIATOR_UNKNOWN = 0;
INITIATOR_LOCAL = 1;
Expand Down Expand Up @@ -1565,6 +1609,15 @@ message ChannelCloseSummary {
Initiator close_initiator = 12;

repeated Resolution resolutions = 13;

/*
This lists out the set of alias short channel ids that existed for the
closed channel. This may be empty.
*/
repeated uint64 alias_scids = 14;

// The confirmed SCID for a zero-conf channel.
uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING];
}

enum ResolutionType {
Expand Down Expand Up @@ -1910,6 +1963,11 @@ message CloseChannelRequest {
// A manual fee rate set in sat/vbyte that should be used when crafting the
// closure transaction.
uint64 sat_per_vbyte = 6;

// The maximum fee rate the closer is willing to pay.
//
// NOTE: This field is only respected if we're the initiator of the channel.
uint64 max_fee_per_vbyte = 7;
}

message CloseStatusUpdate {
Expand Down Expand Up @@ -3227,7 +3285,11 @@ message Invoice {
*/
int64 value_msat = 23;

// Whether this invoice has been fulfilled
/*
Whether this invoice has been fulfilled
The field is deprecated. Use the state field instead (compare to SETTLED).
*/
bool settled = 6 [deprecated = true];

/*
Expand Down
171 changes: 162 additions & 9 deletions proto/walletkit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ service WalletKit {
rpc RequiredReserve (RequiredReserveRequest)
returns (RequiredReserveResponse);

/*
ListAddresses retrieves all the addresses along with their balance. An
account name filter can be provided to filter through all of the
wallet accounts and return the addresses of only those matching.
*/
rpc ListAddresses (ListAddressesRequest) returns (ListAddressesResponse);

/*
ImportAccount imports an account backed by an account extended public key.
The master key fingerprint denotes the fingerprint of the root key
Expand Down Expand Up @@ -100,7 +107,11 @@ service WalletKit {
rpc ImportAccount (ImportAccountRequest) returns (ImportAccountResponse);

/*
ImportPublicKey imports a public key as watch-only into the wallet.
ImportPublicKey imports a public key as watch-only into the wallet. The
public key is converted into a simple address of the given type and that
address script is watched on chain. For Taproot keys, this will only watch
the BIP-0086 style output script. Use ImportTapscript for more advanced key
spend or script spend outputs.
NOTE: Events (deposits/spends) for a key will only be detected by lnd if
they happen after the import. Rescans to detect past events will be
Expand All @@ -109,6 +120,22 @@ service WalletKit {
rpc ImportPublicKey (ImportPublicKeyRequest)
returns (ImportPublicKeyResponse);

/*
ImportTapscript imports a Taproot script and internal key and adds the
resulting Taproot output key as a watch-only output script into the wallet.
For BIP-0086 style Taproot keys (no root hash commitment and no script spend
path) use ImportPublicKey.
NOTE: Events (deposits/spends) for a key will only be detected by lnd if
they happen after the import. Rescans to detect past events will be
supported later on.
NOTE: Taproot keys imported through this RPC currently _cannot_ be used for
funding PSBTs. Only tracking the balance and UTXOs is currently supported.
*/
rpc ImportTapscript (ImportTapscriptRequest)
returns (ImportTapscriptResponse);

/*
PublishTransaction attempts to publish the passed transaction to the
network. Once this returns without an error, the wallet will continually
Expand Down Expand Up @@ -348,14 +375,7 @@ message Account {
// The name used to identify the account.
string name = 1;

/*
The type of addresses the account supports.
AddressType | External Branch | Internal Branch
---------------------------------------------------------------------
WITNESS_PUBKEY_HASH | P2WPKH | P2WPKH
NESTED_WITNESS_PUBKEY_HASH | NP2WPKH | NP2WPKH
HYBRID_NESTED_WITNESS_PUBKEY_HASH | NP2WPKH | P2WPKH
*/
// The type of addresses the account supports.
AddressType address_type = 2;

/*
Expand Down Expand Up @@ -397,13 +417,58 @@ message Account {
// Whether the wallet stores private keys for the account.
bool watch_only = 8;
}

message AddressProperty {
/*
The address encoded using the appropriate format depending on the
address type (base58, bech32, bech32m).
Note that lnd's internal/custom keys for channels and other
functionality are derived from the same scope. Since they
aren't really used as addresses and will never have an
on-chain balance, we'll show the public key instead (only if
the show_custom_accounts flag is provided).
*/
string address = 1;

// Denotes if the address is a change address.
bool is_internal = 2;

// The balance of the address.
int64 balance = 3;
}

message AccountWithAddresses {
// The name used to identify the account.
string name = 1;

// The type of addresses the account supports.
AddressType address_type = 2;

/*
The derivation path corresponding to the account public key. This will
always be empty for the default imported account in which single public keys
are imported into.
*/
string derivation_path = 3;

/*
List of address, its type internal/external & balance.
Note that the order of addresses will be random and not according to the
derivation index, since that information is not stored by the underlying
wallet.
*/
repeated AddressProperty addresses = 4;
}

message ListAccountsRequest {
// An optional filter to only return accounts matching this name.
string name = 1;

// An optional filter to only return accounts matching this address type.
AddressType address_type = 2;
}

message ListAccountsResponse {
repeated Account accounts = 1;
}
Expand All @@ -418,6 +483,20 @@ message RequiredReserveResponse {
int64 required_reserve = 1;
}

message ListAddressesRequest {
// An optional filter to only return addresses matching this account.
string account_name = 1;

// An optional flag to return LND's custom accounts (Purpose=1017)
// public key along with other addresses.
bool show_custom_accounts = 2;
}

message ListAddressesResponse {
// A list of all the accounts and their addresses.
repeated AccountWithAddresses account_with_addresses = 1;
}

message ImportAccountRequest {
// A name to identify the account with.
string name = 1;
Expand Down Expand Up @@ -482,6 +561,77 @@ message ImportPublicKeyRequest {
message ImportPublicKeyResponse {
}

message ImportTapscriptRequest {
/*
The internal public key, serialized as 32-byte x-only public key.
*/
bytes internal_public_key = 1;

oneof script {
/*
The full script tree with all individual leaves is known and the root
hash can be constructed from the full tree directly.
*/
TapscriptFullTree full_tree = 2;

/*
Only a single script leaf is known. To construct the root hash, the full
inclusion proof must also be provided.
*/
TapscriptPartialReveal partial_reveal = 3;

/*
Only the root hash of the Taproot script tree (or other form of Taproot
commitment) is known.
*/
bytes root_hash_only = 4;

/*
Only the final, tweaked Taproot key is known and no additional
information about the internal key or type of tweak that was used to
derive it. When this is set, the wallet treats the key in
internal_public_key as the Taproot key directly. This can be useful for
tracking arbitrary Taproot outputs without the goal of ever being able
to spend from them through the internal wallet.
*/
bool full_key_only = 5;
}
}

message TapscriptFullTree {
/*
The complete, ordered list of all tap leaves of the tree.
*/
repeated TapLeaf all_leaves = 1;
}

message TapLeaf {
// The leaf version. Should be 0xc0 (192) in case of a SegWit v1 script.
uint32 leaf_version = 1;

// The script of the tap leaf.
bytes script = 2;
}

message TapscriptPartialReveal {
// The tap leaf that is known and will be revealed.
TapLeaf revealed_leaf = 1;

// The BIP-0341 serialized inclusion proof that is required to prove that
// the revealed leaf is part of the tree. This contains 0..n blocks of 32
// bytes. If the tree only contained a single leaf (which is the revealed
// leaf), this can be empty.
bytes full_inclusion_proof = 2;
}

message ImportTapscriptResponse {
/*
The resulting pay-to-Taproot address that represents the imported internal
key with the script committed to it.
*/
string p2tr_address = 1;
}

message Transaction {
/*
The raw serialized transaction.
Expand Down Expand Up @@ -885,6 +1035,9 @@ message SignPsbtRequest {
message SignPsbtResponse {
// The signed transaction in PSBT format.
bytes signed_psbt = 1;

// The indices of signed inputs.
repeated uint32 signed_inputs = 2;
}

message FinalizePsbtRequest {
Expand Down
7 changes: 7 additions & 0 deletions proto/walletunlocker.proto
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ message InitWalletRequest {
corresponding private keys and can serve signing RPC requests.
*/
WatchOnly watch_only = 9;

/*
macaroon_root_key is an optional 32 byte macaroon root key that can be
provided when initializing the wallet rather than letting lnd generate one
on its own.
*/
bytes macaroon_root_key = 10;
}
message InitWalletResponse {
/*
Expand Down

0 comments on commit d234057

Please sign in to comment.