lnrpc: add auth_proof to graph APIs

Added flag include_auth_proof to DescribeGraph, GetNodeInfo, GetChanInfo
and the corresponding lncli commands. With the flag, these APIs add AuthProof
(signatures from the channel announcement) to the returned ChannelEdge.

This is useful to extract this data from the DB.
This commit is contained in:
Boris Nagaev
2025-06-13 19:01:21 -03:00
parent 40efefeb6a
commit 7a70dcb36e
6 changed files with 2689 additions and 2365 deletions

View File

@@ -3421,6 +3421,10 @@ message NodeInfoRequest {
// If true, will include all known channels associated with the node.
bool include_channels = 2;
// If true, will include announcements' signatures into ChannelEdge.
// Depends on include_channels.
bool include_auth_proof = 3;
}
message NodeInfo {
@@ -3481,6 +3485,31 @@ message RoutingPolicy {
int32 inbound_fee_rate_milli_msat = 10;
}
/*
ChannelAuthProof is the authentication proof (the signature portion) for a
channel. Using the four signatures contained in the struct, and some
auxiliary knowledge (the funding script, node identities, and outpoint) nodes
on the network are able to validate the authenticity and existence of a
channel.
*/
message ChannelAuthProof {
// node_sig1 are the raw bytes of the first node signature encoded
// in DER format.
bytes node_sig1 = 1;
// bitcoin_sig1 are the raw bytes of the first bitcoin signature of the
// MultiSigKey key of the channel encoded in DER format.
bytes bitcoin_sig1 = 2;
// node_sig2 are the raw bytes of the second node signature encoded
// in DER format.
bytes node_sig2 = 3;
// bitcoin_sig2 are the raw bytes of the second bitcoin signature of the
// MultiSigKey key of the channel encoded in DER format.
bytes bitcoin_sig2 = 4;
}
/*
A fully authenticated channel along with all its unique attributes.
Once an authenticated channel announcement has been processed on the network,
@@ -3509,6 +3538,13 @@ message ChannelEdge {
// Custom channel announcement tlv records.
map<uint64, bytes> custom_records = 9;
// Authentication proof for this channel. This proof contains a set of
// signatures binding four identities, which attests to the legitimacy of
// the advertised channel. This only is available for advertised channels.
// This field is not filled by default. Pass include_auth_proof flag to
// DescribeGraph, GetNodeInfo or GetChanInfo to get this data.
ChannelAuthProof auth_proof = 10;
}
message ChannelGraphRequest {
@@ -3518,6 +3554,9 @@ message ChannelGraphRequest {
channels, and public channels that are not yet announced to the network.
*/
bool include_unannounced = 1;
// If true, will include announcements' signatures into ChannelEdge.
bool include_auth_proof = 2;
}
// Returns a new instance of the directed channel graph.
@@ -3569,6 +3608,9 @@ message ChanInfoRequest {
// The channel point of the channel in format funding_txid:output_index. If
// chan_id is specified, this field is ignored.
string chan_point = 2;
// If true, will include announcements' signatures into ChannelEdge.
bool include_auth_proof = 3;
}
message NetworkInfoRequest {