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
Examples
Import a public key with rescan:
Import using a label without rescan:
As a JSON-RPC call: