Skip to content

Commit a3209a5

Browse files
authored
Merge pull request #9950 from starius/describegraph-authproofs2
lnrpc: add auth_proof to graph APIs
2 parents 40efefe + 409bf3c commit a3209a5

File tree

7 files changed

+2689
-2357
lines changed

7 files changed

+2689
-2357
lines changed

cmd/commands/commands.go

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,11 @@ var describeGraphCommand = cli.Command{
19871987
"graph. Unannounced channels are both private channels, and " +
19881988
"public channels that are not yet announced to the network.",
19891989
},
1990+
cli.BoolFlag{
1991+
Name: "include_auth_proof",
1992+
Usage: "If set, will include announcements' " +
1993+
"signatures into ChannelEdge.",
1994+
},
19901995
},
19911996
Action: actionDecorator(describeGraph),
19921997
}
@@ -1998,6 +2003,7 @@ func describeGraph(ctx *cli.Context) error {
19982003

19992004
req := &lnrpc.ChannelGraphRequest{
20002005
IncludeUnannounced: ctx.Bool("include_unannounced"),
2006+
IncludeAuthProof: ctx.Bool("include_auth_proof"),
20012007
}
20022008

20032009
graph, err := client.DescribeGraph(ctxc, req)
@@ -2055,6 +2061,11 @@ var getChanInfoCommand = cli.Command{
20552061
"the chan_id param is set this param is " +
20562062
"ignored.",
20572063
},
2064+
cli.BoolFlag{
2065+
Name: "include_auth_proof",
2066+
Usage: "If set, will include announcements' " +
2067+
"signatures into ChannelEdge.",
2068+
},
20582069
},
20592070
Action: actionDecorator(getChanInfo),
20602071
}
@@ -2088,8 +2099,9 @@ func getChanInfo(ctx *cli.Context) error {
20882099
}
20892100

20902101
req := &lnrpc.ChanInfoRequest{
2091-
ChanId: chanID,
2092-
ChanPoint: chanPoint,
2102+
ChanId: chanID,
2103+
ChanPoint: chanPoint,
2104+
IncludeAuthProof: ctx.Bool("include_auth_proof"),
20932105
}
20942106

20952107
chanInfo, err := client.GetChanInfo(ctxc, req)
@@ -2118,6 +2130,12 @@ var getNodeInfoCommand = cli.Command{
21182130
Usage: "if true, will return all known channels " +
21192131
"associated with the node",
21202132
},
2133+
cli.BoolFlag{
2134+
Name: "include_auth_proof",
2135+
Usage: "If set, will include announcements' " +
2136+
"signatures into ChannelEdge. Depends on " +
2137+
"include_channels",
2138+
},
21212139
},
21222140
Action: actionDecorator(getNodeInfo),
21232141
}
@@ -2140,8 +2158,9 @@ func getNodeInfo(ctx *cli.Context) error {
21402158
}
21412159

21422160
req := &lnrpc.NodeInfoRequest{
2143-
PubKey: pubKey,
2144-
IncludeChannels: ctx.Bool("include_channels"),
2161+
PubKey: pubKey,
2162+
IncludeChannels: ctx.Bool("include_channels"),
2163+
IncludeAuthProof: ctx.Bool("include_auth_proof"),
21452164
}
21462165

21472166
nodeInfo, err := client.GetNodeInfo(ctxc, req)

docs/release-notes/release-notes-0.20.0.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ circuit. The indices are only available for forwarding events saved after v0.20.
4848
[`incoming_chan_ids` and `outgoing_chan_ids`](https://github.com/lightningnetwork/lnd/pull/9356).
4949
This allows to retrieve forwarding events for specific channels.
5050

51+
52+
* `DescribeGraph`, `GetNodeInfo`, `GetChanInfo` and the corresponding lncli
53+
commands [now have flag](https://github.com/lightningnetwork/lnd/pull/9950)
54+
`include_auth_proof`. With the flag, these APIs add AuthProof (signatures from
55+
the channel announcement) to the returned ChannelEdge.
56+
57+
5158
## lncli Additions
5259

5360
* [`lncli sendpayment` and `lncli queryroutes` now support the
@@ -127,6 +134,7 @@ circuit. The indices are only available for forwarding events saved after v0.20.
127134
# Contributors (Alphabetical Order)
128135

129136
* Abdulkbk
137+
* Boris Nagaev
130138
* Elle Mouton
131139
* Funyug
132140
* Mohamed Awnallah

lnrpc/devrpc/dev.swagger.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,32 @@
106106
}
107107
}
108108
},
109+
"lnrpcChannelAuthProof": {
110+
"type": "object",
111+
"properties": {
112+
"node_sig1": {
113+
"type": "string",
114+
"format": "byte",
115+
"description": "node_sig1 are the raw bytes of the first node signature encoded\nin DER format."
116+
},
117+
"bitcoin_sig1": {
118+
"type": "string",
119+
"format": "byte",
120+
"description": "bitcoin_sig1 are the raw bytes of the first bitcoin signature of the\nMultiSigKey key of the channel encoded in DER format."
121+
},
122+
"node_sig2": {
123+
"type": "string",
124+
"format": "byte",
125+
"description": "node_sig2 are the raw bytes of the second node signature encoded\nin DER format."
126+
},
127+
"bitcoin_sig2": {
128+
"type": "string",
129+
"format": "byte",
130+
"description": "bitcoin_sig2 are the raw bytes of the second bitcoin signature of the\nMultiSigKey key of the channel encoded in DER format."
131+
}
132+
},
133+
"description": "ChannelAuthProof is the authentication proof (the signature portion) for a\nchannel. Using the four signatures contained in the struct, and some\nauxiliary knowledge (the funding script, node identities, and outpoint) nodes\non the network are able to validate the authenticity and existence of a\nchannel."
134+
},
109135
"lnrpcChannelEdge": {
110136
"type": "object",
111137
"properties": {
@@ -144,6 +170,10 @@
144170
"format": "byte"
145171
},
146172
"description": "Custom channel announcement tlv records."
173+
},
174+
"auth_proof": {
175+
"$ref": "#/definitions/lnrpcChannelAuthProof",
176+
"description": "Authentication proof for this channel. This proof contains a set of\nsignatures binding four identities, which attests to the legitimacy of\nthe advertised channel. This only is available for advertised channels.\nThis field is not filled by default. Pass include_auth_proof flag to\nDescribeGraph, GetNodeInfo or GetChanInfo to get this data."
147177
}
148178
},
149179
"description": "A fully authenticated channel along with all its unique attributes.\nOnce an authenticated channel announcement has been processed on the network,\nthen an instance of ChannelEdgeInfo encapsulating the channels attributes is\nstored. The other portions relevant to routing policy of a channel are stored\nwithin a ChannelEdgePolicy for each direction of the channel."

0 commit comments

Comments
 (0)