mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-18 00:31:32 +01:00
routing: update Sphinx API to include r-hash and per-hop-payload
This commit modifies both the Sphinx packet generation and processing for recent updates to the API. With the version 1 Sphinx specification, the payment hash is now included in the MACs in order to thwart any potential replay attacks. As a result, any attempts to replay previous HTLC packets MUST re-use the same payment hash, meaning that the first-hop node can simply settle the HTLC immediately, thwarting the attacker. Additionally, within the Sphinx packet, each hop now gets a per-hop payload which contains the necessary details (CTLV value, fee, etc) for the node to successfully forward the payment. This per-hop payload is protected by a packet-wide MAC.
This commit is contained in:
@@ -57,6 +57,7 @@ type HTLCAddRequest struct {
|
||||
// and the shared secret is fresh, then the node should stip off a layer
|
||||
// of encryption, exposing the next hop to be used in the subsequent
|
||||
// HTLCAddRequest message.
|
||||
// TODO(roasbeef): can be fixed sized now that v1 Sphinx is "done".
|
||||
OnionBlob []byte
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user