Skip to content

Commit

Permalink
BOLT 7: allow variable length onion messages.
Browse files Browse the repository at this point in the history
But suggest constraining them to "small" or "large" sizings.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Dec 16, 2020
1 parent dea3613 commit 781004a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 07-routing-gossip.md
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,8 @@ parameter which allows decryption of the `enctlv` field inside the

1. type: 385 (`onion_message`) (`option_onion_messages`)
2. data:
* [`1366*byte`:`onionmsg`]
* [`u16`:`len`]
* [`len*byte`:`onionmsg`]
* [`onion_message_tlvs`:`onion_message_tlvs`]

1. tlvs: `onion_message_tlvs`
Expand All @@ -1152,6 +1153,7 @@ The writer:
- MUST populate the per-hop payloads as described in [BOLT 4](04-onion-routing.md#onion-messages).
- SHOULD retry via a different route if it expects a response and
doesn't receive one after a reasonable period.
- SHOULD set `len` to 1366 or 32834.

The reader:
- MUST ignore any message which contains a `blinding` which it did not expect, or does not contain
Expand All @@ -1162,6 +1164,11 @@ The reader:

## Rationale

`len` allows larger messages to be sent than the standard 1300 bytes
allowed for an HTLC onion, but this should be used sparingly as it is
reduces anonymity set, hence the recommendation that it either look
like an HTLC onion, or if larger, be a fixed size.

`blinding` is critical to the use of blinded paths: there are various
means by which a blinded path is passed to a node. The receipt of an
expected `blinding` indicates that blinded path has been used: it is
Expand Down

0 comments on commit 781004a

Please sign in to comment.