How to tell whether an address is local or remote?

2

For example, I have a BTC address. Can I (using RPC) get information is this address my local or remote?

karasiov

Posted 2015-01-17T20:10:55.860

Reputation: 23

Answers

2

The validateaddress RPC will do precisely that. Here's sample output from a testnet address with Bitcoin Core 0.10.0:

{
    "isvalid" : true,
    "address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe",
    "ismine" : true,
    "iswatchonly" : false,
    "isscript" : false,
    "pubkey" : "03bacb84c6464a58b3e0a53cc0ba4cb3b82848cd7bed25a7724b3cc75d76c9c1ba",
    "iscompressed" : true,
    "account" : "test label"
}

If the field ismine is false, the address doesn't belong to the currently-running Bitcoin Core wallet.

David A. Harding

Posted 2015-01-17T20:10:55.860

Reputation: 10 154

1verifyaddress or validateaddress?karasiov 2015-01-17T21:10:01.447

@theymos thanks for editing. Karaslov: It was validateaddress; see the edit. (And sorry about the confusion.)David A. Harding 2015-01-17T21:19:04.317