Handle if funding output is in a coinbase transaction (ChannelManager, Channel)
Host: dunxen -
- Miners are able to open a Lightning channel using the coinbase transaction of a new block. However, according to bitcoin consensus rules, the outputs of coinbase transactions are not spendable until they reach 100 blocks, known as the coinbase maturity delay.
- As pointed out in lightning/bolts#1011, Lightning implementations need to ensure that
channel_readyis delayed for 100 blocks.
- Did you have a quick glance or review of the PR?
- How do we practically enforce the delay of 100 blocks before sending a
channel_openfor channels with coinbase funding transaction in the PR?
- Why do we not need to worry about adding any buffer on top of the 100 block maturation delay? Think in terms of re-orgs.
- In the Lightning protocol, it’s important that the funding transactions (and all others) are non-malleable (their txids are not malleable). Usually we think of transactions solely spending segwit-style UTXOs as being non-malleable. In what sense are coinbase transactions non-malleable?
- Before this PR was it possible for LDK users (who are miners) to open channels using coinbase transactions with the checks we had. Why or why not?
- How should 0conf coinbase-funded channels be handled? What if we want to close them within the coinbase maturation period?