Skip to content

Commit 3344779

Browse files
committed
Drop the required channel_update in failure onions
As noted previously, `channel_update`s in the onion failure packets are massive gaping fingerprintign vulnerabilities - if a node applies them in a publicly-visible way the err'ing node can easily identify the sender of an HTLC. While the updates are still arguably marginally useful for nodes to use in their pathfinding local to retires of the same payment, this too will eventually become an issue with PTLCs. Further, we shouldn't be letting nodes get away with delaying payments by failing to announce the latest channel parameters or enforcing new parameters too soon, so treating the node as having indicated insufficient liquidity (or other general failure) is appropriate in the general case. Thus, here, we begin phasing out the `channel_update` field, requiring nodes ignore it outside of the current payment and making it formally optional (though nodes have been doing this for some time due to various bugs). Because some nodes may want to use update data on mobile when they have stale gossip data, it is left optional.
1 parent db278ab commit 3344779

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

04-onion-routing.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,12 +1080,7 @@ The top byte of `failure_code` can be read as a set of flags:
10801080
* 0x8000 (BADONION): unparsable onion encrypted by sending peer
10811081
* 0x4000 (PERM): permanent failure (otherwise transient)
10821082
* 0x2000 (NODE): node failure (otherwise channel)
1083-
* 0x1000 (UPDATE): new channel update enclosed
1084-
1085-
Please note that the `channel_update` field is mandatory in messages whose
1086-
`failure_code` includes the `UPDATE` flag. It is encoded *with* the message
1087-
type prefix, i.e. it should always start with `0x0102`. Note that historical
1088-
lightning implementations serialized this without the `0x0102` message type.
1083+
* 0x1000 (UPDATE): channel forwarding parameter was violated
10891084

10901085
The following `failure_code`s are defined:
10911086

@@ -1378,6 +1373,16 @@ In the case of multiple short_channel_id aliases, the `channel_update`
13781373
expecting, to both avoid confusion and to avoid leaking information
13791374
about other aliases (or the real location of the channel UTXO).
13801375

1376+
The `channel_update` field used to be mandatory in messages whose `failure_code`
1377+
includes the `UPDATE` flag. However, because nodes applying an update contained
1378+
in the onion to their gossip data is a massive fingerprinting vulnerability,
1379+
the `channel_update` field is no longer mandatory and nodes are expected to
1380+
transition away from including it. Nodes which do not provide a
1381+
`channel_update` are expected to set the `channel_update` `len` field to zero.
1382+
1383+
Some nodes may still use the `channel_update` for retries of the same payment,
1384+
however.
1385+
13811386
## Receiving Failure Codes
13821387

13831388
### Requirements
@@ -1397,20 +1402,16 @@ The _origin node_:
13971402
- SHOULD remove all channels connected with the erring node from
13981403
consideration.
13991404
- if the PERM bit is NOT set:
1400-
- SHOULD restore the channels as it receives new `channel_update`s.
1405+
- SHOULD restore the channels as it receives new `channel_update`s from
1406+
its peers.
14011407
- otherwise:
14021408
- if UPDATE is set, AND the `channel_update` is valid and more recent
1403-
than the `channel_update` used to send the payment:
1404-
- if `channel_update` should NOT have caused the failure:
1405-
- MAY treat the `channel_update` as invalid.
1406-
- otherwise:
1407-
- SHOULD apply the `channel_update`.
1408-
- MAY queue the `channel_update` for broadcast.
1409-
- otherwise:
1410-
- SHOULD eliminate the channel outgoing from the erring node from
1411-
consideration.
1412-
- if the PERM bit is NOT set:
1413-
- SHOULD restore the channel as it receives new `channel_update`s.
1409+
than the `channel_update` used to send the payment:
1410+
- MAY consider the `channel_update` when calculating routes to retry
1411+
the payment which failed,
1412+
- MUST NOT expose the `channel_update` to third-parties in any other
1413+
context, including applying the `channel_update` to the local network
1414+
graph, send the `channel_update` to peers as gossip, etc.
14141415
- SHOULD then retry routing and sending the payment.
14151416
- MAY use the data specified in the various failure types for debugging
14161417
purposes.

0 commit comments

Comments
 (0)