1
0
Fork 0
mirror of https://github.com/lightning/bolts.git synced 2025-03-10 09:10:07 +01:00

onion: Specifying payment-key commitment in onion (#47)

Specifying that the `onion-routing-packet` commits to the
`payment-key` by setting the associated data. This avoids replay
attacks and specifying it here keeps the onion-routing spec clean.
This commit is contained in:
Christian Decker 2016-12-10 02:15:44 +01:00 committed by Olaoluwa Osuntokun
parent d076039df2
commit a868d1381d

View file

@ -539,6 +539,9 @@ reconnection if it has the sender did not previously acknowledge the
commitment of that HTLC. A receiving node MAY fail the channel if commitment of that HTLC. A receiving node MAY fail the channel if
other `id` violations occur. other `id` violations occur.
The `onion-routing-packet` contains an obfuscated list of hops and instructions for each hop along the path.
It commits to the HTLC by setting the `payment-key` as associated data, i.e., including the `payment-key` in the computation of HMACs.
This prevents replay attacks that'd reuse a previous `onion-routing-packet` with a different `payment-key`.
#### Rationale #### Rationale