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

null    (json null)

Examples

Dump a private key:

bitcoinevo-cli dumpprivkey "myaddress"

Import the private key with rescan:

bitcoinevo-cli importprivkey "mykey"

Import using a label and without rescan:

bitcoinevo-cli importprivkey "mykey" "testing" false

Import using default blank label and without rescan:

bitcoinevo-cli importprivkey "mykey" "" false

As a JSON-RPC call:

curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importprivkey", "params": ["mykey", "testing", false]}' -H 'content-type: text/plain;' http://127.0.0.1:7332/