Open t-bast opened 1 year ago
Alice creates Bolt12 invoice with blinded hop Carol -> Alice, Carol pays it
I think I'm seeing this on two directly connected cln (23.05.2) peers. cln1
funds a channel with cln2
. cln2
creates an offer and gives it to cln1
. Then cln1 fetchinvoice
results in an invoice with invoice_path
giving a blinded path via cln1
. Then cln1 pay
of the invoice seems to decide that since its id matches .invoice_path.first_node_id
that it's a self payment, and it errors out. If you run fetchinvoice
before funding the channel, invoice_path
just includes the node itself, and everything's fine.
I hoped the "self pay" support in master might fix this, but I'm now getting a crash instead of an error (selfpay()
is called and passes bad data to json_add_secret
?).
I've been testing blinded payments between
cln
v22.11 andeclair
and I have exciting news: there are a few minor issues and incompatibilities, but once I worked around them, everything was working very smoothly!You can find more details about what tests I ran at the end of this issue, but I'll start with the list of things that should be fixed.
Bolt 12 feature bits
Currently
cln
doesn't set any feature bit in Bolt 12 invoices. This means that we don't know whether we can use MPP or not (so I had to force MPP usage ineclair
). On the contrary,eclair
sets a few feature bits in its Bolt 12 invoices:var_onion_optin:mandatory
,option_route_blinding:mandatory
,basic_mpp:optional
(removed if MPP was deactivated). The Bolt 12 invoiceseclair
generates by default were rejected bycln
because of these feature bits. We need to settle on what feature bits can be used here and clarify the Bolt 12 spec.EDIT: the offers spec PR says that the MPP feature bit is the only feature bit allowed in Bolt 12 objects: eclair will be updated to match that in https://github.com/ACINQ/eclair/pull/2386
update_add_htlc
's blinding pointThe route blinding PR specifies that tlv field number
0
must be used when sending theblinding_point
inupdate_add_htlc
(inside a blinded route). It looks likecln
is currently using tlv field2
instead when relaying payments, that should be fixed?total_amount_msat
field in onion payloadThe route blinding PR made the
total_amount_msat
field (tlv number18
) mandatory when sending to a blinded route, butcln
currently doesn't set it.Missing support for sending to a blinded route when the node is also its introduction point
We discussed that a while ago, this is a somewhat tricky edge case. Eclair already supports this, but it looks like
cln
doesn't, it replies to thepay
command with the following error:Obsolete interpretation of
blinded_payinfo
In the latest iterations, we decided to include one
blinded_payinfo
per blinded path, that represents the aggregated payment information for the whole path. It looks likecln
still expects oneblinded_payinfo
per hop of every blinded path, since it returns the following warning when decoding invoices:Detailed tests report
This section details the e2e tests I ran on
regtest
if someone wants to replay them or test other scenarios. Note that it would be nice to have a way to generate "real" blinded paths fromcln
(not only dummy hops) to do more testing.For all the following tests, Alice and Bob are running
eclair
and Carol and Dave are runningcln
.Dave creates Bolt12 invoice with just dummy hops, Bob pays it
We setup channels with the following balances:
Test steps:
Dave creates Bolt12 invoice with just dummy hops, Alice pays it using MPP
We setup channels with the following balances:
Test steps:
Alice creates Bolt12 invoice with just dummy hops, Dave pays it
We setup channels with the following balances:
Test steps:
Alice creates Bolt12 invoice with just dummy hops, Carol pays it
We setup channels with the following balances:
Test steps:
Alice creates Bolt12 invoice with blinded hop Bob -> Alice, Bob pays it
We setup channels with the following balances:
Test steps:
Bob -> Alice
and dummy hopsAlice creates Bolt12 invoice with blinded hop Carol -> Alice, Carol pays it
We setup channels with the following balances:
Test steps:
Carol -> Alice
and dummy hopscln
and no payment is sentAlice creates Bolt12 invoice with blinded hop Bob -> Alice, Dave pays it
We setup channels with the following balances:
Test steps:
Bob -> Alice
and dummy hopsAlice creates Bolt12 invoice with blinded hops Bob -> Alice and Carol -> Alice, Dave pays it using MPP
We setup channels with the following balances:
Test steps:
Bob -> Alice
and dummy hopsCarol -> Alice
and dummy hopsblinding_point
Dave creates Bolt12 invoice but not enough incoming liquidity, Alice tries to pay it
We setup channels with the following balances:
Test steps:
invalid_onion_blinding
instead ofmpp_timeout
-> that should probably change, Dave isn't hiding itsnode_id
and could return a normal failure?Alice creates Bolt12 invoice but not enough incoming liquidity, Dave tries to pay it
We setup channels with the following balances:
Test steps:
Bob -> Alice
and dummy hopsCarol -> Alice
and dummy hopsinvalid_onion_blinding
failures