joinmarket-clientserver
joinmarket-clientserver copied to clipboard
FEATURE: ability to import/recover wallet via rpc
It would be useful to be able to sync my existing wallet with JM rpc rather than having to create a new wallet.
Right; just to note you can open (unlock) an existing wallet file in datadir/wallets
but yes, we did not implement the recover mechanism yet, so PRs welcome on this. A pain point however: this requires a call to rescanblockchain
so we may have to add that request to the front end, too.
Would love to submit a PR but I do not have the Python experience to be comfortable doing so at present.
For background I am adding light client JM functionality to my app Fully Noded (iOS, macOS) which also works with Bitcoin Core as a backend. The UX Id like to build would be to allow users to use an existing seed/wallet from FN to generate a JM wallet with so that they get full JM functionality with their existing familiar wallet, not necessarily a literal JM recovery if that makes sense.
Right that can make sense. In that direction, the fact that JM has 5 accounts is fine if the pre-existing wallet uses only account 0, but obviously the other way round can be a problem (unless yours is one of the very few wallets that allows multiple bip32 accounts).
@theborakompanioni as far as you're aware, is this still actionable on Joinmarket's side? Perhaps .. a rescanblockchain
API call that passes through to Core? It seems a bit weird to do that, but maybe?
[...], is this still actionable on Joinmarket's side?
It depends, but I think: Yes.
Perhaps .. a
rescanblockchain
API call that passes through to Core? It seems a bit weird to do that, but maybe?
In order for it to be useful to an API consumer, a seed phrase must also be able to be passed along, right?
As far as I am aware, that is not possible at the moment (see /wallet/create
).
If I am not mistaken, some wallets offer to rescan the chain to the point of the "wallet's birthday" (a date the user must provide). It sounds like a reasonable thing to do:
- Offer a way to create a wallet from seed phrase
- Offer a way to rescan from a given blockheight/date
Having said that, I think it is not "super urgent", and it should probably be a little more thought out and better planned than I stated here. But overall, it'd be a great feature for any external application.
Re-reading this half a year later, I can't help but think this is a really necessary improvement. My first thought is to ping @openoms because I presume you did a similar thing in Joininbox (essentially give the user access to rescanblockchain
.
Re wallet birthday, see:
https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/d3b62f2a557f1dbdaa370209271c4cc52d5680a1/jmclient/jmclient/wallet.py#L440
... but, after having checked that, I now realize it's irrelevant in recovery :) As you say it must be passed in to whatever the RPC call is going to be.
Any update on this? Do you think it is worthwhile to be implemented in the foreseeable future?
I think the approach of passing an optional seed phrase to create the wallet makes a lot of sense.