2
0
mirror of https://github.com/lnbook/lnbook synced 2024-11-04 18:00:26 +00:00

ch-10: explcitily call out all zero for scid as final hop indicator

In practice, the HMAC for the _next_ hop is also zero, but most
implementations will check the `scid` value instead.
This commit is contained in:
Olaoluwa Osuntokun 2021-07-22 20:11:44 -07:00 committed by Andreas M. Antonopoulos
parent 4c6f23835d
commit fe4a1870d2

View File

@ -138,7 +138,7 @@ Alice will start building the hop data from the end of the path backwards: Dina,
===== Final node payload for Dina
Alice first builds the payload that will be delivered to Dina. Dina will not be constructing an "outgoing HTLC", because Dina is the final node and payment recipient. For this reason, the payload for Dina is different that all the others, but only Dina will know this since it will be encrypted in the innermost layer of the onion. Essentially, this is the "secret letter to Dina" we saw in our physical envelope example.
Alice first builds the payload that will be delivered to Dina. Dina will not be constructing an "outgoing HTLC", because Dina is the final node and payment recipient. For this reason, the payload for Dina is different that all the others (uses all zeros for the `short_channel_id`), but only Dina will know this since it will be encrypted in the innermost layer of the onion. Essentially, this is the "secret letter to Dina" we saw in our physical envelope example.
The hop payload for Dina must match the information in the invoice generated by Dina for Alice and will contain (at least) the following fields in Type-Lenght-Value (TLV) format: