importprivkey
importprivkey "privkey" ( "label" rescan )
Adds a private key (as returned by dumpprivkey
) to your wallet. This action requires a new wallet backup.
Hint: Use importmulti
if you need to import more than one private key.
Note: If rescan
is set to true, this process can take over an hour to complete. During that time, other RPC calls may show that the imported key exists, but related transactions may not yet appear, causing temporarily inaccurate balances and unspent outputs until the rescan finishes.
To check the progress of the scan, use getwalletinfo
.
Argument #1 – privkey
Type: string, required
The private key (see dumpprivkey)
Argument #2 – label
Type: string, optional, default=current label if address exists, otherwise “”
An optional label
Argument #3 – rescan
Type: boolean, optional, default=true
Rescan the wallet for transactions
Result
Examples
Dump a private key:
Import the private key with rescan:
Import using a label and without rescan:
Import using default blank label and without rescan:
As a JSON-RPC call: