bolts icon indicating copy to clipboard operation
bolts copied to clipboard

bolt04: add explicit requirement for final nodes to reject short_channel_id

Open erickcestari opened this issue 1 month ago • 0 comments

Final nodes should reject payments that include short_channel_id in their payload, as this field is only meaningful for forwarding nodes. While BOLT 4 specifies that writers MUST NOT include short_channel_id for the final node, it doesn't explicitly require final nodes to return an error when this field is present.

Current spec (writer requirements):

For the final node:
  - MUST NOT include `short_channel_id`

Current spec (reader requirements):

If it is the final node:
  - MUST treat `total_msat` as if it were equal to `amt_to_forward` if it is not present.
  - MUST return an error if:
    - incoming `amount_msat` < `amt_to_forward`.
    - incoming `cltv_expiry` < `outgoing_cltv_value`.
    - incoming `cltv_expiry` < `current_block_height` + `min_final_cltv_expiry_delta`

This ambiguity has led to implementation inconsistencies:

This inconsistency was discovered through differential fuzzing (bitcoinfuzz), where the same onion was rejected by LND and rust-lightning but accepted by Core Lightning.

This PR adds an explicit requirement for final nodes to return an error if short_channel_id is present in the payload, making the validation requirements consistent with the writer requirements.

erickcestari avatar Nov 26 '25 14:11 erickcestari