Skip to content

Conversation

@tnull
Copy link
Contributor

@tnull tnull commented Nov 28, 2025

Previous research 1, 2 has shown that the Lightning Network is susceptible to passive network-layer attacks on privacy that can exploit metadata leaking from transmitted network messages.

While other factors such as timing come into play, the most severe information leakage is due to the fact that a passive adversary monitoring the Noise-encrypted network traffic can still observe clearly distinguished network message sizes, which allows them to reliably classify messages by type, and therefore in turn allows them to draw conclusions on node behavior. In the worst case, this allows a purely passive off-path adversary able to monitor traffic of multiple nodes on a payment path to not only observe that a payment took place, but also to identify the payment's endpoints.

To mitigate the information leakage coming from observable network message sizes, we here propose the introduction of option_message_padding, a simple protocol that allows Lightning counterparties to opt into padding network messages to fixed size thresholds large enough to cover update_add_htlc messages by including suitably sized TLV records in all sent TLV stream extensions.

This approach will lead to uniform message size distribution for 'normal' day-to-day operations. Note however that messages beyond the chosen size threshold will still stand out and leak some amount of information. Moreover, note that we abstained from including padding for custom messages, as it's not guaranteed that all application-layer protocols are able to handle TLV streams according to 'it's-okay-to-be-odd' rules (see #1302 for some questions around that).

A draft of a reference implementation can be found over at lightningdevkit/rust-lightning#4248

Some sidenotes on the chosen approach/current PR:

  • The absence of network message padding could be considered a shortcoming of the BOLT8 transport / Noise encryption protocol. Therefore, we could also consider adding a new Noise handshake version for it and adding the padding on this layer. While this could be considered the cleaner approach, I previously received feedback from a few people that they would prefer the optional-TLV-approach proposed in this PR, which is why I went this way for now. I however would be open to discuss either approach - maybe making it a (mandatory?) part of BOLT8 would be cleaner. In particular, it would also allow us to add padding for custom messages, which the current approach doesn't necessarily allow.
  • While the current proposal states that the receiver should discard the padding bytes, we could consider making use of the padding TLV, e.g., to opportunistically transmit enqueued gossip data. While this extension could result in a nice reduction of net overhead, I for now left it out of the proposal.
  • For now I set feature 68/69 as a placeholder as they look to be the next free ones, but I might be missing something.

@tnull tnull marked this pull request as draft November 28, 2025 14:17
@tnull tnull force-pushed the 2025-09-message-padding branch from 4b85b28 to dd85700 Compare November 28, 2025 15:10
@tnull tnull changed the title BOLT1: Add support for network message padding (option_message_padding) BOLT1: Add support for network message padding (feature ??) Nov 28, 2025
Previous research [1], [2] has shown that the Lightning Network is
susceptible to passive network-layer attacks on privacy that can exploit
metadata leaking from transmitted network messages.

While other factors such as timing come into play, the most severe
information leakage is due to the fact that a passive adversary
monitoring the Noise-encrypted network traffic can still observe clearly
distinguished network message sizes, which allows them to reliably
classify messages by type, and therefore in turn allows them to draw
conclusions on node behavior. In the worst case, this allows a purely
passive off-path adversary able to monitor traffic of multiple nodes on
a payment path to not only observe *that* a payment took place, but also
to identify the payment's endpoints.

To mitigate the information leakage coming from observable network
message sizes, we here propose the introduction of
`option_message_padding`, a simple protocol that allows Lightning
counterparties to opt into padding network messages to fixed size
thresholds large enough to cover `update_add_htlc` messages by including
suitably sized TLV records in all sent TLV stream `extension`s.

This approach will lead to uniform message size distribution for
'normal' day-to-day operations. Note however that messages beyond the
chosen size threshold will still stand out and leak some amount of
information. Moreover, note that we abstained from including padding for
custom messages, as it's not guaranteed that all application-layer
protocols are able to handle TLV streams according to
'it's-okay-to-be-odd' rules (see [3] for some questions around that).

[1]: https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/611970/paper.pdf
[2]: https://drops.dagstuhl.de/storage/00lipics/lipics-vol316-aft2024/LIPIcs.AFT.2024.12/LIPIcs.AFT.2024.12.pdf
[3]: lightning#1302
@tnull tnull force-pushed the 2025-09-message-padding branch from dd85700 to c81def0 Compare November 28, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant