bitcoind.app
CommandsGuidesContact ↗
Home/Wallet/importpubkey
Wallet

importpubkey

Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Only for legacy wallets.

Parameters

pubkeystringREQUIRED
The hex-encoded public key
labelstringoptional
Label. Default: ""
rescanbooleanoptional
Rescan the blockchain. Default: true

Returns

nullnull on success

Code Examples

curl --user myuser --data-binary '{"jsonrpc":"1.0","id":"1","method":"importpubkey","params":["pubkey"]}' -H 'content-type:text/plain;' http://127.0.0.1:8332/

Example Response

null
← Previous
importprunedfunds
Next →
importwallet

More Wallet Commands

abandontransactioncreatewalletdumpprivkeygetbalancegetnewaddressgettransaction

bitcoind.app — Bitcoin Core RPC Reference

GuidesContact ↗