<p>Bitcoin doesn't "register" addresses on the blockchain. The reason I was having trouble looking up arbitrarily-generated public addresses on the testnet Block Explorer website is because I was searching for <strong>mainnet</strong> addresses, not <strong>testnet</strong> addresses. For example, addresses generated using the above <a href="https://bitaddress.org" rel="nofollow noreferrer">https://bitaddress.org</a> website are by default meant for mainnet, and are <em>invalid</em> on the testnet blockchain. If you use add <code>?testnet=true</code> to the URL you will generate valid testnet addresses.</p>

<p>The exact differences between testnet and mainnet addresses are documented in numerous places online. Among them, the <a href="https://en.bitcoin.it/wiki/Testnet#Differences" rel="nofollow noreferrer">Testnet page on the Bitcoin wiki</a>, which states:</p>

<blockquote>
  <p>A different value of ADDRESSVERSION field ensures no testnet Bitcoin addresses will work on the production network. (0x6F rather than 0x00)</p>
</blockquote>

CC BY-SA 3.0
2017-07-16T14:23:53.523Z
2017-07-16T14:23:53.523Z
Andrew
<p>Addresses are not registered. You don't register addresses on the blockchain. How addresses work is that they correspond to the hash of a public key. Since all possible public keys and all possible hashes of those are known, you can look up the "balance" of any arbitrary address. It's quite simple since all transactions are known, so you can easily tell if an address was used or not by looking at every transaction in the blockchain.</p>

<p>The vast majority of wallets do this as it is more efficient. It allows the wallet to give you an address easily when the wallet is locked. It also means that the wallet does not need to generate a new key every single time you want a new address as it pre-generates several keys (Bitcoin Core defaults to 100) and can then later batch generate more when needed.</p>

CC BY-SA 3.0
2017-07-15T18:09:18.280Z
The original reason for pregenerating keys was because of backups. It meant that you didn't need to create a new backup after every new key you generated, as your future 100 keys are already in the wallet file. This is partially mitigated now that we use HD derivation for keys in wallets.
Pieter Wuille
CC BY-SA 3.0
2017-07-15T04:54:49.060Z
2017-07-15T04:54:49.060Z
Ava Chow
<p>I'm currently running <code>bitcoind -testnet</code>. I ran <code>bitcoin-cli dumpwallet ~/wallet-output</code> just to explore the output and it looks like it created 102 private/public key pairs that I assume are just sort of pre-generated just for the convenience of having them on hand.</p>

<p>However, I'm surprised they all seem to be somehow "recognized" as part of the testnet blockchain already, even though they've never been used. For example, when I search for one of these addresses in Block Explorer I see an address with zero transactions and a 0 BTC balance: <a href="https://testnet.blockexplorer.com/address/mxwDTWg556BDzZhEWvJ1EeYwSYxG42wKZC" rel="nofollow noreferrer">https://testnet.blockexplorer.com/address/mxwDTWg556BDzZhEWvJ1EeYwSYxG42wKZC</a>. This is different from addresses I've created "outside" of the bitcoin tools (e.g., <a href="https://www.bitaddress.org" rel="nofollow noreferrer">https://www.bitaddress.org</a>). For example, Block Explorer "can't find" this address: 1XitCFAkFhNR6PoJsPcxjsFzkMegx4Ky5. I would expect that to happen to <em>all</em> of the addresses pre-generated in my wallet until I actually use them.</p>

<p>Why did <code>bitcoind</code> "register" these addresses on the testnet blockchain? And how exactly did it do that? Is that a special transaction type?</p>

CC BY-SA 3.0
2017-07-15T16:54:46.363Z
Could you please edit the answer part out of your question and post it as an answer instead? It shouldn't be in the question.
Murch
CC BY-SA 3.0
2017-07-15T17:23:32.543Z
I rolled back to the previous revision, you can find your self-answer in the edit history.
Murch
<bitcoin-core><testnet><address-generation><address-format>
Why does bitcoin create several "empty" wallet addresses?
Andrew
# Why does bitcoin create several "empty" wallet addresses?

(Asked by: username_0 on 2017-07-15)

I'm currently running `bitcoind -testnet`. I ran `bitcoin-cli dumpwallet ~/wallet-output` just to explore the output and it looks like it created 102 private/public key pairs that I assume are just sort of pre-generated just for the convenience of having them on hand.

However, I'm surprised they all seem to be somehow "recognized" as part of the testnet blockchain already, even though they've never been used. For example, when I search for one of these addresses in Block Explorer I see an address with zero transactions and a 0 BTC balance: <https://testnet.blockexplorer.com/address/mxwDTWg556BDzZhEWvJ1EeYwSYxG42wKZC>. This is different from addresses I've created "outside" of the bitcoin tools (e.g., <https://www.bitaddress.org>). For example, Block Explorer "can't find" this address: 1XitCFAkFhNR6PoJsPcxjsFzkMegx4Ky5. I would expect that to happen to *all* of the addresses pre-generated in my wallet until I actually use them.

Why did `bitcoind` "register" these addresses on the testnet blockchain? And how exactly did it do that? Is that a special transaction type?

**Tags:** bitcoin-core, testnet, address-generation, address-format

> **Comments:**
> **username_1**: Could you please edit the answer part out of your question and post it as an answer instead? It shouldn't be in the question.  
> **username_1**: I rolled back to the previous revision, you can find your self-answer in the edit history.  

---

## 2 answers

### Answer by username_0 on 2017-07-16. Score: 1 | Accepted answer

Bitcoin doesn't "register" addresses on the blockchain. The reason I was having trouble looking up arbitrarily-generated public addresses on the testnet Block Explorer website is because I was searching for **mainnet** addresses, not **testnet** addresses. For example, addresses generated using the above <https://bitaddress.org> website are by default meant for mainnet, and are *invalid* on the testnet blockchain. If you use add `?testnet=true` to the URL you will generate valid testnet addresses.

The exact differences between testnet and mainnet addresses are documented in numerous places online. Among them, the [Testnet page on the Bitcoin wiki](https://en.bitcoin.it/wiki/Testnet#Differences), which states:

> A different value of ADDRESSVERSION field ensures no testnet Bitcoin addresses will work on the production network. (0x6F rather than 0x00)


---

### Answer by username_2 on 2017-07-15. Score: 1

Addresses are not registered. You don't register addresses on the blockchain. How addresses work is that they correspond to the hash of a public key. Since all possible public keys and all possible hashes of those are known, you can look up the "balance" of any arbitrary address. It's quite simple since all transactions are known, so you can easily tell if an address was used or not by looking at every transaction in the blockchain.

The vast majority of wallets do this as it is more efficient. It allows the wallet to give you an address easily when the wallet is locked. It also means that the wallet does not need to generate a new key every single time you want a new address as it pre-generates several keys (Bitcoin Core defaults to 100) and can then later batch generate more when needed.

> **Comments:**
> **username_3**: The original reason for pregenerating keys was because of backups. It meant that you didn't need to create a new backup after every new key you generated, as your future 100 keys are already in the wallet file. This is partially mitigated now that we use HD derivation for keys in wallets.  

---

