Skip to content
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

Miners can evade the 100 block relative timelock with lightning #1011

Open
antonilol opened this issue Jul 21, 2022 · 2 comments
Open

Miners can evade the 100 block relative timelock with lightning #1011

antonilol opened this issue Jul 21, 2022 · 2 comments

Comments

@antonilol
Copy link
Contributor

Miners can open a lightning channel directly from the coinbase transaction to spend funds locked in there for 100 blocks by bitcoin's consensus rules earlier. Channels created from coinbase transactions also can't be closed in the 100 blocks after the block has been mined.
This can be fixed by either

  • waiting 100 blocks before sending channel ready (funding locked)
  • disallowing channels to be opened from coinbase transactions
  • ... or other ways i have not come up with (yet)

I believe this an issue of the lightning network (not a specific implementation) an that it should be addressed in the spec

Questions/feedback welcome!

@TheBlueMatt
Copy link
Collaborator

Yes, lightning implementations need to specifically check if the funding transaction is a coinbase, and in that case need to delay channel_ready until 100 blocks have passed.

@antonilol
Copy link
Contributor Author

When (coop or force) closing the channel before the 100 blocks the lightning implementation needs to wait until the close tx is valid an then broadcast it instead of giving the user bitcoind's error and giving up (or if the transaction is rebroadcast every block (and ignores errors) or so that should be fine too)

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

No branches or pull requests

2 participants