From 99b6c3cc1f18f98fa893d8aa9cb74a923c1168b8 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 19 Mar 2026 00:01:38 +0100 Subject: [PATCH 1/3] bolt04: Fix requirements of failure message for final node --- 04-onion-routing.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/04-onion-routing.md b/04-onion-routing.md index 63fbdf34f..3ac829165 100644 --- a/04-onion-routing.md +++ b/04-onion-routing.md @@ -1464,12 +1464,6 @@ A _forwarding node_ MUST: - select one of the above error codes when creating an error message. A _forwarding node_ MAY, but a _final node_ MUST NOT: - - if the onion `version` byte is unknown: - - return an `invalid_onion_version` error. - - if the onion HMAC is incorrect: - - return an `invalid_onion_hmac` error. - - if the ephemeral key in the onion is unparsable: - - return an `invalid_onion_key` error. - if during forwarding to its receiving peer, an otherwise unspecified, transient error occurs in the outgoing channel (e.g. channel capacity reached, too many in-flight HTLCs, etc.): @@ -1504,6 +1498,14 @@ A _forwarding node_ MAY, but a _final node_ MUST NOT: - report the current channel setting for the outgoing channel. - return a `channel_disabled` error. +A _forwarding node_ and a _final node_ MAY: + - if the onion `version` byte is unknown: + - return an `invalid_onion_version` error. + - if the onion HMAC is incorrect: + - return an `invalid_onion_hmac` error. + - if the ephemeral key in the onion is unparsable: + - return an `invalid_onion_key` error. + An _intermediate hop_ MUST NOT, but the _final node_: - if the payment hash has already been paid: - MAY treat the payment hash as unknown. From fd6d0e50e7fa156c4199905cab8d9e69404615c9 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 19 Mar 2026 00:09:11 +0100 Subject: [PATCH 2/3] bolt04: Always use 'forwarding node' in requirements of failure messages --- 04-onion-routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-onion-routing.md b/04-onion-routing.md index 3ac829165..810451014 100644 --- a/04-onion-routing.md +++ b/04-onion-routing.md @@ -1506,7 +1506,7 @@ A _forwarding node_ and a _final node_ MAY: - if the ephemeral key in the onion is unparsable: - return an `invalid_onion_key` error. -An _intermediate hop_ MUST NOT, but the _final node_: +An _forwarding node_ MUST NOT, but a _final node_ MUST: - if the payment hash has already been paid: - MAY treat the payment hash as unknown. - MAY succeed in accepting the HTLC. From bc69e726f14965d7edc8a0e4e37f67a62c120d85 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 19 Mar 2026 00:10:26 +0100 Subject: [PATCH 3/3] bolt04: Remove confusing duplicate mention of requirement --- 04-onion-routing.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/04-onion-routing.md b/04-onion-routing.md index 810451014..54bfb7fe8 100644 --- a/04-onion-routing.md +++ b/04-onion-routing.md @@ -1457,8 +1457,7 @@ An _erring node_ MAY: A _forwarding node_ MUST: - if `path_key` is set in the incoming `update_add_htlc`: - return an `invalid_onion_blinding` error. - - if `current_path_key` is set in the onion payload and it is not the - final node: + - if `current_path_key` is set in the onion payload: - return an `invalid_onion_blinding` error. - otherwise: - select one of the above error codes when creating an error message.