Support p2tr bitcoin wallet#3026
Conversation
|
a682a75 is missing a lot of the changes from #3038...why didn't you instead review #3038 and make comments on it so that we can end up merging it into your branch? That would make reviewing a lot easier, because now I need to diff my branch with yours and iterate on adding comments here until the results are good :/ |
Because there are many different types of changes with a single commit and I found it easier to pick the changes that were obvious improvements and iterate on the ones I'm not sure about yet. But you're right reviewing your PR will be quicker here, that what I'll do. I can revert the last commit if it makes things easier for you. |
a682a75 to
f58a2e5
Compare
|
I've checked out a snapshot of that branch locally to be able to do the diff after the rebase. Can you:
Once that's done I think we can merge this! |
We defined an new AddressType type that can optionally be passed to calls tp `getReceiveAddress()`. This type can represent p2wpkh or p2tr addresses. There are no functional changes, we don't use p2tr addresses yet.
It is not used anymore.
We should not hardcode the type of change output that we want but instead use the default change type configured in bitcoin core.
Use a key manager to generate a local address and sign transactions (instead of signing them manually). No functional changes.
If our wallets adds p2tr inputs, to sign them we need to know all the utxos spent by the tx we're building, not just the one spent by the tx we're signing.
If the -changetype option is not set, then bitcoin core will fund transactions with inputs that match transaction's outputs (i.e it will add p2wpkh change outputs if the tx sends to p2wpkh outputs, p2tr change outputs if it sends to p2tr outputs...).
…itcoin core wallet
c931d22 to
8a1f963
Compare
|
Rebased on master at b98930b, I've added a test to verify that eclair properly signs transactions with mixed |
t-bast
left a comment
There was a problem hiding this comment.
LGTM, good work, I'm glad we got this done!
This PR makes eclair compatible with bitcoin core wallet that are configured to use
p2trdefault addresses (even if eclair is actually managing the wallet's private keys).It is best reviewed commit by commit , da7950b being the most tricky.
We still need to generate
p2wpkhscripts to sends funds to when a channel is mutually closed:static_remote_keychannels that do not support anchor outputsshutdown_anysegwitThis PR supersedes #2873.