Skip to content

Commit 6ab13fe

Browse files
committed
fixup: use return packet instead of reason field
1 parent 85da1c2 commit 6ab13fe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

04-onion-routing.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,8 @@ route, so it knows where to return-forward any eventual return packets.
10371037

10381038
## Erring node
10391039

1040-
The node generating the error message (_erring node_) builds a return packet (the `reason` field in `update_fail_htlc`) consisting of the following fields:
1040+
The node generating the error message builds a _return packet_
1041+
consisting of the following fields:
10411042

10421043
1. data:
10431044
* [`32*byte`:`hmac`]
@@ -1066,7 +1067,7 @@ The erring node puts its hold time at the start of this array and zeroes out the
10661067
field is based on the maximum supported number of hops in a route (20).
10671068

10681069
The field `truncated_hmacs` contains truncated authentication codes series for each hop, with the
1069-
same `um` key that is used for `hmac` in the `reason` field. Regular 32 byte HMACs are
1070+
same `um` key that is used for `hmac` in the return packet. Regular 32 byte HMACs are
10701071
truncated to the first 4 bytes to save space.
10711072

10721073
In theory this truncation makes it possible for malicious nodes to guess the
@@ -1092,7 +1093,7 @@ away from the erring node.
10921093

10931094
Each HMAC covers the following data:
10941095

1095-
* The `reason` field.
1096+
* The return packet.
10961097

10971098
* The first `y+1` hold times in `htlc_hold_times`. For example, `hmac_0_2` would cover
10981099
all three hold times.
@@ -1158,7 +1159,7 @@ result to obfuscate the `attribution_data` field.
11581159
Furthermore every hop, also the ones that do no support attributable failures, performs these steps:
11591160

11601161
* Generate its `ammag` key, generate the pseudo-random byte streams, and apply the
1161-
result to obfuscate the `reason` field
1162+
result to obfuscate the return packet. This is then stored as the `reason` field of the `update_htlc_fail` message.
11621163

11631164
These obfuscation steps are identical to the obfuscation steps that the erring node carries out.
11641165

@@ -1185,9 +1186,9 @@ For nodes supporting attributable failures:
11851186

11861187
For all nodes:
11871188

1188-
* Compute the HMAC for the `reason` field, using the hop's `um` key.
1189+
* Compute the HMAC for the return packet, using the hop's `um` key.
11891190

1190-
* When the computed HMAC matches `hmac` in the `reason` field, the sender will know that the current hop is the sender of the failure. They can then parse `failuremsg`.
1191+
* When the computed HMAC matches `hmac` in the return packet, the sender will know that the current hop is the sender of the failure. They can then parse `failuremsg`.
11911192

11921193
The association between the forward and return packets is handled outside of
11931194
this onion routing protocol, e.g. via association with an HTLC in a payment

0 commit comments

Comments
 (0)