-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: some confusion re blinded path max_cltv
#1174
Comments
I also think that perhaps some clarification is needed in BOLT 4 to make the answer to the above more clear as currently it is explicit about how the One other place I think could use some clarity is around if we still expect the sender to add the extra blocks for the "shadow route" or if we can now just leave that up to the receiver since they now have the ability to easily create shadow hops. This was mentioned in this thread in the offers proposal but I think this suggestion should possibly be added to the current spec as it stands today. Once there is some clarity here, im happy to open a PR 😊 |
I agree this is currently a bit unclear, because there is currently no way in the spec to communicate a blinded route to a potential payer: that is introduced by the Bolt 12 PR, which is why I previously said that it was the responsibility of that PR (or any other PR that uses blinded paths) to detail how
You are completely correct, and that's a mistake in the example! And when implementing it in eclair, we actually got it right. The mistake is that in the
This needs to be fixed in proposal doc, probably in the same PR that details how this should be computed! |
More info [here](lightning#1174 (comment)) outlining why the example needed to be updated.
* BOLT4: include `min_final_cltv_expiry_delta` in `max_cltv_expiry` calc Include `min_final_cltv_expiry_delta` in the `max_cltv_expiry` calculation. Also add a note that indicates that this field may be set for the final node too. This is useful for the final node as then it does not need to persist the path expiry separately and can rely on just checking the `payment_relay` field when the payment arrives. * BOLT4: include calculation for `total_cltv_delta` of a blinded path Include an explicit formula to use for determining the total CLTV delta of a blinded path so that it is clear that it should include the recipient's `min_final_cltv_expiry_delta`. * proposals: fix `max_cltv_expiry` value for final hop in example More info [here](#1174 (comment)) outlining why the example needed to be updated.
Going through the example outlines in the route blinding proposal doc
And I'm just a bit confused about the values used for CLTVs.
To recap the example a bit:
payment_constraints.max_cltv
to herself.min_final_cltv_expiry
of 12 which iiuc, she does not explicitly communicate to the recipient. Instead, she will add this to the accumulated route CLTV delta.max_expiry
so that they can fail the payment early. The example shows that she sets this value to1356
for B which seems to indicate that this was calculated by taking the maximum cltv: 1200, and adding Alice'smin_final_cltv_expiry
of 12 and finally adding B's cltv delta of 144 to get a final value of 1356. Then for C, she takes the previous value (1356) and adds C's delta of 144 to get 1500.max_cltv
of 1200.The rest of the example, where Erin pays via the route, because Erin chooses a final CLTV that is significantly below Alice's given maximum.
But let's say that Erin wants to play on the edge and instead chooses a final CLTV value of 1200. Erin would then add the total blinded route delta of 300 to get the CLTV value to use on C's incoming link: 1500. Ok so let's say C get's this incoming CLTV of 1300, then C will check it's encoded
max_cltv
from Alice, see that it is 1500 so the incoming value is ok. C then subtracts the 144 delta and sends B a CLTV of 1356. This is also ok given C's encodedmax_cltv
so he subtracts 144 and sends Alice a CLTV of 1212. But this then violates Alice's initial chosenmax_cltv
value of 1200.My first thought was perhaps the
max_cltv
value for B should not have included A'smin_final_cltv_expiry
but all this would mean is thatC
'smax_cltv
will end up being 1488 which is then lower than themax_cltv
+total_blinded_path_cltv
value of 1500. Meaning we can have the same issue just earlier in the path.This makes me wonder if either:
A
should not be too strict about themax_cltv
or should always account for the fact that it might bemin_final_cltv_expiry
less than they originally intended.min_final_cltv_expiry
to the recipient and hence not include it in the total blinded cltv calcEDIT: apologies if this is the wrong spot for a question like this 🙏 lemme know where a better spot would be if so
The text was updated successfully, but these errors were encountered: