Skip to content

Commit 7d3ef5a

Browse files
authored
Allow unset onion_hash in invalid_onion_blinding (#1093)
In most cases the `onion_hash` isn't actionable in the case of blinded payments and it's wasteful to keep track of the incoming onion, so we allow setting it to an all zero value.
1 parent 7f53a3e commit 7d3ef5a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

02-peer-protocol.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,14 +1144,16 @@ A node:
11441144
- When failing an incoming HTLC:
11451145
- If `current_blinding_point` is set in the onion payload and it is not the
11461146
final node:
1147-
- MUST send an `update_fail_htlc` error using the
1148-
`invalid_onion_blinding` failure code with the `sha256_of_onion`
1149-
of the onion it received, for any local or downstream errors.
1147+
- MUST send an `update_fail_htlc` error using the `invalid_onion_blinding`
1148+
failure code for any local or downstream errors.
1149+
- SHOULD use the `sha256_of_onion` of the onion it received.
1150+
- MAY use an all zero `sha256_of_onion`.
11501151
- SHOULD add a random delay before sending `update_fail_htlc`.
11511152
- If `blinding_point` is set in the incoming `update_add_htlc`:
11521153
- MUST send an `update_fail_malformed_htlc` error using the
1153-
`invalid_onion_blinding` failure code with the `sha256_of_onion`
1154-
of the onion it received, for any local or downstream errors.
1154+
`invalid_onion_blinding` failure code for any local or downstream errors.
1155+
- SHOULD use the `sha256_of_onion` of the onion it received.
1156+
- MAY use an all zero `sha256_of_onion`.
11551157

11561158
A receiving node:
11571159
- if the `id` does not correspond to an HTLC in its current commitment transaction:
@@ -1166,7 +1168,7 @@ A receiving node:
11661168
- MUST send a `warning` and close the connection, or send an
11671169
`error` and fail the channel.
11681170
- if the `sha256_of_onion` in `update_fail_malformed_htlc` doesn't match the
1169-
onion it sent:
1171+
onion it sent and is not all zero:
11701172
- MAY retry or choose an alternate error response.
11711173
- otherwise, a receiving node which has an outgoing HTLC canceled by `update_fail_malformed_htlc`:
11721174
- MUST return an error in the `update_fail_htlc` sent to the link which

0 commit comments

Comments
 (0)