Why does bitcoin create several "empty" wallet addresses? 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?
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, which states:


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