Anthony Towns [ARCHIVE] on Nostr: 📅 Original date posted:2021-07-12 📝 Original message: Hello world, Suppose you ...
📅 Original date posted:2021-07-12
📝 Original message:
Hello world,
Suppose you have some payments going from Alice to Bob to Carol with
eltoo channels. Bob's lightning node crashes, and he recovers from an
old backup, and Alice and Carol end up dropping newer channel states
onto the blockchain.
Suppose the timeout for the payments is a few hours away, while the
channels have specified a week long CSV delay to rectify any problems
on-chain.
Then I think that that means that:
1) Carol will reveal the point preimages on-chain via adaptor
signatures, but Bob won't be able to decode those adaptor signatures
because those signatures will need to change for each state
2) Even if Bob knows the point preimages, he won't be able to
claim the PTLC payments on-chain, for the same reason: he needs
newer adaptor signatures that he'll have lost with the state update
3) For any payments that timeout, Carol doesn't have any particular
incentive to make it easy for Bob to claim the refund, and Bob won't
have the adaptor signatures for the latest state to do so
4) But Alice will be able to claim refunds easily. This is working how
it's meant to, at least!
I think you could fix (3) by giving Carol (who does have all the adaptor
signatures for the latest state) the ability to steal funds that are
meant to have been refunded, provided she gives Bob the option of claiming
them first.
However fixing (1) and (2) aren't really going against Alice or Carol's
interests, so maybe you can just ask: Carol loses nothing by allowing
Bob to claim funds from Alice; and Alice has already indicated that
knowing P is worth more to her than the PTLC's funds -- otherwise she
wouldn't have forwarded the PTLC to Bob in the first place.
Likewise, everyone's probably incentivised to negotiate cooperative
closes instead of going on-chain -- better privacy, less fees, and less
delay before the funds can be used elsewhere.
FWIW, I think a similar flaw exists even in the original eltoo spec --
Alice could simply decline to publish the settlement transaction until
the timeout has been reached, preventing Bob from revealing the HTLC
preimage before Alice can claim the refund.
So I think that adds up to:
a) Nodes should share state on reconnection; if you find a node that
doesn't do this, close the channel and put the node on your enemies
list. If you disagree on what the current state is, share your most
recent state, and if the other guy's state is more recent, and all
the signatures verify, update your state to match theirs.
b) Always negotiate a mutual/cooperative close if possible, to avoid
actually using the eltoo protocol on-chain.
c) If you want to allow continuing the channel after restoring an old
state from backup, set the channel state index based on the real time,
eg (real_time-start_time)*(max_updates_per_second). That way your
first update after a restore from backup will ensure that any old
states that your channel partner may not have told you about are
invalidated.
d) Accept that if you lose connectivity to a channel partner, you will
have to pay any PTLCs that were going to them, and won't be able
to claim the PTLCs that were funding them. Perhaps limit the total
value of inbound PTLCs for forwarding that you're willing to accept
at any one itme?
Also, layered commitments seem like they make channel factories
complicated too. Nobody came up with a way to avoid layered commitments
while I wasn't watching did they?
Cheers,
aj
Published at
2023-06-09 13:03:08Event JSON
{
"id": "13c808916c0446ee404aeb5f175c9724bcfbf237dd072e8932e20a94345a7acf",
"pubkey": "f0feda6ad58ea9f486e469f87b3b9996494363a26982b864667c5d8acb0542ab",
"created_at": 1686315788,
"kind": 1,
"tags": [
[
"e",
"8a0e1cf8bfd207b00d21258bc21868551465e91d678978834dc2fb7ceb2cdcbd",
"",
"reply"
],
[
"p",
"9456f7acb763eaab2e02bd8e60cf17df74f352c2ae579dce1f1dd25c95dd611c"
]
],
"content": "📅 Original date posted:2021-07-12\n📝 Original message:\nHello world,\n\nSuppose you have some payments going from Alice to Bob to Carol with\neltoo channels. Bob's lightning node crashes, and he recovers from an\nold backup, and Alice and Carol end up dropping newer channel states\nonto the blockchain.\n\nSuppose the timeout for the payments is a few hours away, while the\nchannels have specified a week long CSV delay to rectify any problems\non-chain.\n\nThen I think that that means that:\n\n 1) Carol will reveal the point preimages on-chain via adaptor\n signatures, but Bob won't be able to decode those adaptor signatures\n because those signatures will need to change for each state\n\n 2) Even if Bob knows the point preimages, he won't be able to\n claim the PTLC payments on-chain, for the same reason: he needs\n newer adaptor signatures that he'll have lost with the state update\n\n 3) For any payments that timeout, Carol doesn't have any particular\n incentive to make it easy for Bob to claim the refund, and Bob won't\n have the adaptor signatures for the latest state to do so\n\n 4) But Alice will be able to claim refunds easily. This is working how\n it's meant to, at least!\n\nI think you could fix (3) by giving Carol (who does have all the adaptor\nsignatures for the latest state) the ability to steal funds that are\nmeant to have been refunded, provided she gives Bob the option of claiming\nthem first.\n\nHowever fixing (1) and (2) aren't really going against Alice or Carol's\ninterests, so maybe you can just ask: Carol loses nothing by allowing\nBob to claim funds from Alice; and Alice has already indicated that\nknowing P is worth more to her than the PTLC's funds -- otherwise she\nwouldn't have forwarded the PTLC to Bob in the first place.\n\nLikewise, everyone's probably incentivised to negotiate cooperative\ncloses instead of going on-chain -- better privacy, less fees, and less\ndelay before the funds can be used elsewhere.\n\nFWIW, I think a similar flaw exists even in the original eltoo spec --\nAlice could simply decline to publish the settlement transaction until\nthe timeout has been reached, preventing Bob from revealing the HTLC\npreimage before Alice can claim the refund.\n\nSo I think that adds up to:\n\n a) Nodes should share state on reconnection; if you find a node that\n doesn't do this, close the channel and put the node on your enemies\n list. If you disagree on what the current state is, share your most\n recent state, and if the other guy's state is more recent, and all\n the signatures verify, update your state to match theirs.\n\n b) Always negotiate a mutual/cooperative close if possible, to avoid\n actually using the eltoo protocol on-chain.\n\n c) If you want to allow continuing the channel after restoring an old\n state from backup, set the channel state index based on the real time,\n eg (real_time-start_time)*(max_updates_per_second). That way your\n first update after a restore from backup will ensure that any old\n states that your channel partner may not have told you about are\n invalidated.\n\n d) Accept that if you lose connectivity to a channel partner, you will\n have to pay any PTLCs that were going to them, and won't be able\n to claim the PTLCs that were funding them. Perhaps limit the total\n value of inbound PTLCs for forwarding that you're willing to accept\n at any one itme?\n\nAlso, layered commitments seem like they make channel factories\ncomplicated too. Nobody came up with a way to avoid layered commitments\nwhile I wasn't watching did they?\n\nCheers,\naj",
"sig": "6744689cec8343b31ab2dceebf6b96f95ba77983db6ed5b777e6d7e0b1e094c83d82b79e68dece99ca4b2fcc8b05463f769bdf1dbf3871818219d4947d43ed68"
}