Skip to content

Commit 5edf3ce

Browse files
committed
BOLT 7: allow variable length onion messages.
But suggest constraining them to "small" or "large" sizings. Signed-off-by: Rusty Russell <[email protected]>
1 parent 4677034 commit 5edf3ce

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

07-routing-gossip.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,8 @@ parameter which allows decryption of the `enctlv` field inside the
11401140

11411141
1. type: 385 (`onion_message`) (`option_onion_messages`)
11421142
2. data:
1143-
* [`1366*byte`:`onionmsg`]
1143+
* [`u16`:`len`]
1144+
* [`len*byte`:`onionmsg`]
11441145
* [`onion_message_tlvs`:`onion_message_tlvs`]
11451146

11461147
1. tlvs: `onion_message_tlvs`
@@ -1155,13 +1156,22 @@ The writer:
11551156
- MUST populate the per-hop payloads as described in [BOLT 4](04-onion-routing.md#onion-messages).
11561157
- SHOULD retry via a different route if it expects a response and
11571158
doesn't receive one after a reasonable period.
1159+
- SHOULD set `len` to 1366 or 32834.
11581160

11591161
The reader:
11601162
- MUST handle the per-hop payloads as described in [BOLT 4](04-onion-routing.md#onion-messages).
11611163
- SHOULD accept onion messages from peers without an established channel.
11621164
- MAY rate-limit messages by dropping them.
11631165

1164-
## References
1166+
## Rationale
1167+
1168+
`len` allows larger messages to be sent than the standard 1300 bytes
1169+
allowed for an HTLC onion, but this should be used sparingly as it is
1170+
reduces anonymity set, hence the recommendation that it either look
1171+
like an HTLC onion, or if larger, be a fixed size.
1172+
1173+
1174+
# References
11651175

11661176
1. <a id="reference-1">[RFC 1950 "ZLIB Compressed Data Format Specification version 3.3](https://www.ietf.org/rfc/rfc1950.txt)</a>
11671177
2. <a id="reference-2">[Maximum Compression Factor](https://zlib.net/zlib_tech.html)</a>

0 commit comments

Comments
 (0)