bolts icon indicating copy to clipboard operation
bolts copied to clipboard

Additional auxillary data for HTLCs

Open TheBlueMatt opened this issue 1 month ago • 3 comments

For stateless payments, we often want to include information about an offer/invoice-request in the blinded path we return in an invoice so that we have the info after the sender has (finally) paid their anti-DoS token with an HTLC. Thus, we keep finding ourselves trying to add additional data back in the payment onion but struggling with its limited size. While increasing the size of the HTLC onion (ignoring compat concerns) isn't a very good idea as it allows for more loops and additional liquidity DoS concerns, that doesn't mean we can't add a second "auxillary data" onion in update_add_htlc messages.

There's obviously upgrade/rollout concerns, but assuming we are willing to wait, are people open to such a thing? It'd mean somewhat larger update_add_htlc messages and additional storage overhead for each HTLC between receipt and forward, but having an extra KB or five of data space without preventing someone from sending an HTLC over five hops would be quite nice. Thoughts?

TheBlueMatt avatar Nov 11 '25 20:11 TheBlueMatt

anti-DoS token

Anti-DoS token?

What would be in this extra onion? If a peer doesn't understand the onion, can the payment still be completed?

Roasbeef avatar Nov 12 '25 01:11 Roasbeef

Anti-DoS token?

eg someone might include some information in the BOLT 12 invoice_request that we want to have when we receive the payment, but we don't want to store that information in a DB immediately, as otherwise someone can just flood us with invoice_request messages and bloat our DB. Instead, we want that information to go in the blinded path, so that when someone pays with an HTLC we get the data back and can store it after there's no substantial DoS risk (which I referred to here as the "anti-DoS token" cause them actually paying is a reasonable way to provide anti-DoS :) ).

What would be in this extra onion?

Presumably just extra payment metadata from the blinded path.

If a peer doesn't understand the onion, can the payment still be completed?

Upgrade would be painful, yea, you'd have to only store optional data there and old nodes would drop it during forward so relying on it would be a thing that can only happen in a few years.

TheBlueMatt avatar Nov 12 '25 12:11 TheBlueMatt

This would be very useful for us, but if it's not reliable for a while we'd have to persist the metadata anyway, and since it's a few years out by then we will already have all this infrastructure built. Maybe it would save future wallet developers some headaches.

MaxFangX avatar Nov 14 '25 21:11 MaxFangX