Skip to content

Commit

Permalink
bolt04: Add the TLV types for the new payload format
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Decker <decker.christian@gmail.com>
  • Loading branch information
cdecker committed Jun 6, 2019
1 parent beddc1f commit 5dad251
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion 04-onion-routing.md
Expand Up @@ -240,7 +240,36 @@ parameters may lead to extraneous routing failure.

### `tlv_payload` payload format

TBD
This is a more flexible format, which avoids the redundant `short_channel_id` field for the final node.

1. tlv: `tlv_payload`
2. types:
1. type: 2 (`amt_to_forward`)
2. data:
* [`integer`:`amt_to_forward`]
1. type: 4 (`outgoing_cltv_value`)
2. data:
* [`integer`:`outgoing_cltv_value`]
1. type: 6 (`short_channel_id`)
2. data:
* [`8`:`short_channel_id`]

### Requirements

The writer:
- MUST include `amt_to_forward` and `outgoing_cltv_value` for every node.
- MUST include `short_channel_id` for every non-final node.
- MUST NOT include `short_channel_id` for the final node.

The reader:
- 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).

# Accepting and Forwarding a Payment

Once a node has decoded the payload it either accepts the payment locally, or forwards it to the peer indicated as the next hop in the payload.

## Non-strict Forwarding

Expand Down

0 comments on commit 5dad251

Please sign in to comment.