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

Implement better private key import RPC extension. #24

Open
jrick opened this issue Dec 16, 2013 · 3 comments
Open

Implement better private key import RPC extension. #24

jrick opened this issue Dec 16, 2013 · 3 comments

Comments

@jrick
Copy link
Member

jrick commented Dec 16, 2013

The standard RPC call for importing private keys, importprivkey, has a number of issues. Namely:

  1. The command does not allow specifying any hints as to when an address first appeard, either by date or blockchain height. This can result in unnecessarily long rescans.
  2. As a rescan is triggered for each import, and importprivkey has no way of importing multiple private keys at once, this ends up triggering multiple rescans.

An extension RPC command should be added which resolves these issues.

jimmysong pushed a commit to jimmysong/btcwallet that referenced this issue Sep 8, 2014
Add more error codes and message, reflow some doc comments.
@jrick jrick added the rpc-api label Mar 31, 2015
@arnuschky
Copy link

As a workaround for issue 2), I tried the following:
When batch-importing, I used importprivkey <key> <label> false to avoid triggering multiple rescans.

My idea was that I could trigger a rescan afterwards manually. But alas, there is apparently no way to trigger a rescan (see #250)

By the way, after importing the keys as indicated above, btcwallet starts up like as follows:

14:00:35 2015-04-18 [INF] WLLT: Started rescan from block 00000000f952d926901f537502c834baa9790a8a178adc46ec9d7c82cb5d5bf0 (height 349578) for 14 addresses
14:00:35 2015-04-18 [INF] WLLT: Finished rescan for 14 addresses (synced to block 00000000f952d926901f537502c834baa9790a8a178adc46ec9d7c82cb5d5bf0, height 349578)

@arnuschky
Copy link

For completeness, here the hint from @jrick how to trigger a rescan manuall:

On master (which uses the old txstore package) this can be triggered by closing wallet, deleting the file ~/.btcwallet/{main,test,sim}net/tx.bin, and restarting

@jrick
Copy link
Member Author

jrick commented Mar 9, 2016

Rather than adding an extension to the legacy RPC server, these improvements should be added to the walletrpc.WalletService/ImportPrivateKey RPC.

jrick added a commit to jrick/btcwallet that referenced this issue Nov 15, 2016
This only adds the dialog and will call the CreateNewWallet RPC with
the decoded seed rather than a randomly-generated one.

As btcwallet does not support recovering addresses and transactions
for an imported seed, this feature won't work correctly and
transaction history will have to be recovered after generating the
same number of addresses used from the previous wallet.  However, once
that is implemented, this GUI feature should work as intended.

The seed can be inputed using either hex or the PGP word list
encoding.  At the moment, no checksumming is used or removed from the
input, and all bytes are considered part of the seed.  If any
additional data is added to a seed encoding later, the
WalletSeed.DecodeAndValidateUserInput method will need to be changed
to interpret this separately.

Closes btcsuite#24.
vapopov pushed a commit to vapopov/btcwallet that referenced this issue Jul 4, 2018
wallet: add call to modify both public and private passphrases atomically
buck54321 pushed a commit to buck54321/btcwallet that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@arnuschky @jrick @davecgh and others