1
0
Fork 0
mirror of https://github.com/lightning/bolts.git synced 2025-02-22 06:21:48 +01:00

bolt04: Introduce the destination_signal to the tlv_payload

As discussed during the spec meeting this allows us not to use the 32 byte
HMAC to identify the last hop, and use a 2-byte signal instead.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2019-06-24 23:13:16 +02:00
parent 6120510dd3
commit 0616c29bed

View file

@ -245,6 +245,7 @@ This is a more flexible format, which avoids the redundant `short_channel_id` fi
1. tlvs: `tlv_payload` 1. tlvs: `tlv_payload`
2. types: 2. types:
1. type: 0 (`destination_signal`)
1. type: 2 (`amt_to_forward`) 1. type: 2 (`amt_to_forward`)
2. data: 2. data:
* [`tu64`:`amt_to_forward`] * [`tu64`:`amt_to_forward`]
@ -261,10 +262,10 @@ The writer:
- MUST include `amt_to_forward` and `outgoing_cltv_value` for every node. - MUST include `amt_to_forward` and `outgoing_cltv_value` for every node.
- MUST include `short_channel_id` for every non-final node. - MUST include `short_channel_id` for every non-final node.
- MUST NOT include `short_channel_id` for the final node. - MUST NOT include `short_channel_id` for the final node.
- MUST include the `destination_signal` for the final node.
The reader: The reader:
- MUST return an error if `amt_to_forward` or `outgoing_cltv_value` are not present. - MUST return an error if `amt_to_forward` or `outgoing_cltv_value` are not present.
- MUST return an error if it is not the final node and `short_channel_id` is not present.
The requirements for the contents of these fields are specified [above](#legacy-hop_data-payload-format). The requirements for the contents of these fields are specified [above](#legacy-hop_data-payload-format).