-
Notifications
You must be signed in to change notification settings - Fork 179
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
Implement general purpose watch only wallet. #989
Implement general purpose watch only wallet. #989
Conversation
ad5b2a5
to
83af3c9
Compare
Thanks for this! Right now this watch-only wallet does not support joinmarket's concept of mixdepths. I expect the wallet will mainly be used for joinmarket wallets, so this is important to have. Both, for the case described in #663 (move to a new wallet) and #792 (joinmarket with hardware wallet) the mixdepths need to be preserved. The easiest way would be to always assume the imported key is the master key and force joinmarket's derivation path from there on. A more complex solution would be a dynamic approach, allowing to import keys at specified derivation paths and only do partial key derivation from there on. (eg import at path |
I'm not sure about #663 (hardware wallet support). But for #792 (YG coinjoin out to xpub), in the second use case (moving coins into cold storage, and an option to use the xpub address if the cj-out is larger than X BTC), the mixdepths is not needed.
One of my motivation, is that we should be able to import the xpub/ypub/zpub from other wallets like Electrum directly as a watch only wallet into jm. And the xpub/ypub/zpub from these wallets, Electrum for example, does not support the concept of mixdepth. Given a zpub of an Electrum wallet, the addresses of that wallet would be
I don't think these watch-only wallets can be used as main wallet at all. They'll be used as a secondary wallet that is loaded alongside the main wallet. For example, we can run things like |
In fact, this approach can also work for the first use case (moving from sw to native sw yg wallet) of #792 (YG coinjoin out to xpub). The user would get the xpub of After running as maker for some while, all his coins will be moved to the new jm wallet in the external addresses of mixdepth 0. |
I'm generally against breaking backwards compatibility, as people might have created scripts around JM commands, but I think it's ok here as fidelity bonds are very recent addition to JM. |
What I don't like here is that we don't support ypub/zpub in other places, like |
I think these 2 cases are different. In #558, it's about displaying While in this case, if the user prefer, they can continue to use |
@wukong1971, ok, good point! Will try to test / review this more carefully in coming days. |
Did basic testing, by imporing single mixdepth of different JM wallet, so far works as expected. About multiple mixdepth support - don't see other way to add some option to also specify derivation paths. But that could be added afterwards, if choose so. People will definitely want to use it currently supported way to add xpub's of non-JM wallets. One example - this already would help adding JM coinjoin support to Wasabi. |
d98d0a6
to
7d5cd9b
Compare
7d5cd9b
to
2bcaef6
Compare
Rebased to latest master, did not make any change. |
Considerations like this, and several follow up comments in this thread, are a very good argument for implementing wallet descriptor support (https://outputdescriptors.org/) - probably before adding this change? Well, either way: this whole idea of watch only plus #792 makes a lot of sense and is very much in tune with what Joinmarket users are mostly trying to do, I think. @chris-belcher when you get a chance could you take a look at some of the ideas here, in particular around the watch only wallet? |
I think when it comes to importing a wallet, it doesn't hurt for us to support both the currently wildly used In fact, I advocate that we support as many formats as possible when it comes to importing, we don't want to force the user to go through the hurdle of converting whatever they had into the "wallet descriptor", it adds friction to the user experience, and increases the risk of them exposing their public key to 3rd party websites. That being said, I do agree that when we display the extended public key information in joinmarket, like in the |
I also think that output descriptor support could be added after this, watch only wallet creation from simple xpub/ypub/zpub already is useful and should be supported even after switching to wallet descriptors. |
2bcaef6
to
8a7937e
Compare
Rebase |
8a7937e
to
52d1fac
Compare
Updated |
Noticed another issue with |
With "don't enter passphrase" I meant enter blank passphrase twice. |
This was the previous behavior from the original That being said, I just pushed a new commit that prints out an error message in this case, I do agree that an error message should be printed out in this case. |
I'm wondering shouldn't we print a warning if |
Needs rebase. |
f79e829
to
f90a760
Compare
Rebased to latest master. |
Implemented a new feature, if |
67700e1
to
0a43381
Compare
@kristapsk PR updated, PTAL, thanks! |
|
b9cf7a4
to
58d514b
Compare
Renamed the original createwatchonly command to createfbwatchonly, and repurposed the createwatchonly command to instead create a general purpose watch only wallet.
58d514b
to
2dcf2c9
Compare
Done. @kristapsk , please let me know if you have any other questions / concerns, thanks! |
I think we should allow it. Say the user has |
Tried testing, but doesn't work. On signet:
On mainnet, didn't give error, but also didn't create wallet either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I've tried about everything on areas to try so this doesn't really scare me that much we're going to give it a whirl
Replaced by #1632. |
Prepare for #663 and #792
Renamed the original
createwatchonly
command tocreatefbwatchonly
, and repurposed thecreatewatchonly
command to instead create a general purpose watch only wallet.python wallet-tool.py createwatchonly [xpub/ypub/zpub]
bitcoin-cli -rpcwallet=[jm_wallet] rescanblockchain [starting_block_height]