importpubkey

importpubkey "pubkey" ( "label" rescan )

Adds a public key (in hex) that can be watched as if it were part of your wallet but cannot be used to spend from. This requires a new wallet backup.

Hint: Use importmulti to import multiple public keys at once.

Note: If rescan is set to true, this process can take over an hour to complete. During that time, other RPC calls may indicate that the imported public key exists, but related transactions may still be missing, resulting in temporarily incorrect balances and unspent outputs until the rescan completes.

To monitor the scanning progress, use getwalletinfo.

Argument #1 – pubkey

Type: string, required

The hex-encoded public key

Argument #2 – label

Type: string, optional, default=””

An optional label

Argument #3 – rescan

Type: boolean, optional, default=true

Rescan the wallet for transactions

Result

null    (json null)

Examples

Import a public key with rescan:

bitcoinevo-cli importpubkey "mypubkey"

Import using a label without rescan:

bitcoinevo-cli importpubkey "mypubkey" "testing" false

As a JSON-RPC call:

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