<p>The specifications of BOLT04 mention that onion message packets can be either 1366 or 32834 bytes in size to keep all messages the same size for privacy. Here I want to calculate what the maximum travel distance for the larger size is.</p>
<p>I've found that headers are 66 bytes (version 1, public_key 33, HMAC 32) so the payload is 32834 - 66 = 32768 bytes.
OM intermediary hops payloads are at least 70 bytes (length 1, HMAC 32, type 1, subtype 1, blinded_node_id 33, enclen 2).
Hence the maximum travel distance is 32768 / 70 = 468 hops.
Are these calculations correct?</p>

CC BY-SA 4.0
2024-04-16T04:00:09.063Z
2024-09-29T18:22:11.370Z
2024-09-29T18:22:11.370Z
Amin Bashiri
<p>According to the specifications: <a href="https://github.com/lightning/bolts/blob/master/04-onion-routing.md#onion-messages" rel="nofollow noreferrer">https://github.com/lightning/bolts/blob/master/04-onion-routing.md#onion-messages</a></p>
<p>What's the maximum number of hops an onion message can travel?</p>

<lightning-network><lightning-routing><message><onion-message>
Maximum Number of Hops an Onion Message Can Travel?
Amin Bashiri
# Maximum Number of Hops an Onion Message Can Travel?

(Asked by: username_0 on 2024-04-16)

According to the specifications: <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#onion-messages>

What's the maximum number of hops an onion message can travel?

**Tags:** lightning-network, lightning-routing, message, onion-message


---

## 1 answers

### Answer by username_0 on 2024-04-16. Score: 1 | Accepted answer

The specifications of BOLT04 mention that onion message packets can be either 1366 or 32834 bytes in size to keep all messages the same size for privacy. Here I want to calculate what the maximum travel distance for the larger size is.

I've found that headers are 66 bytes (version 1, public\_key 33, HMAC 32) so the payload is 32834 - 66 = 32768 bytes.
OM intermediary hops payloads are at least 70 bytes (length 1, HMAC 32, type 1, subtype 1, blinded\_node\_id 33, enclen 2).
Hence the maximum travel distance is 32768 / 70 = 468 hops.
Are these calculations correct?


---

