As we’ve seen already, there are many different kinds of bitcoin wallets (also called bitcoin clients). Each has different characteristics and functionalities, but each works in basically the same way: they store your public and private keys.
Your bitcoins – or rather, the pieces of code that represent them – are not actually stored in your wallet. They are stored on the blockchain, which in turn is stored on node computers all around the world.
What your wallet contains is your bitcoin address, which is the same as your randomly generated public key (a long string of numbers and characters). Anyone can see this, it’s public information. The wallet also contains the private key that goes with that address/public key. Without the combination of the two keys, you can’t use your bitcoins. Actually, most wallets contain several addresses, and hold the public and private key pairings that make each of them work.
Obviously, most bitcoin wallets today do a lot more than that. They also relate your public and private keys to the bitcoins that match those keys, and display the list of related transactions and the current balance in a clean user interface (ie. a nice, easy-to-understand format).
But it’s important to understand that the wallet doesn’t actually contain your bitcoin. It contains permission to spend your bitcoin. And if you lose access to that permission to spend, then you effectively also lose your bitcoins, because you no longer have access to them. That is why it is so important to keep the keys secure.
Some wallets, especially the older ones, are full node wallets. This means that you download the entire blockchain, and act as a relayer or transmitter of transactions, even those that you had nothing to do with. You receive transactions from nodes and pass them on to other nodes, and thus contribute to the updating of the bitcoin network. While no actual work on your part is involved (the transmitting is done automatically), it is onerous – the blockchain occupies approximately 40GB of memory.
Most wallets, however, are “thin wallets”, or an SPV wallet (which stands for Simplified Payment Verification). If you have a wallet on your mobile phone, it’s almost certainly one of these, and an increasing number of desktop wallets are also offering this option. SPV wallets do not download the entire blockchain, they only download block headers. There are concerns that this weakens the security of the network as a whole, since they cannot tell the difference between a block with valid transactions and one with invalid ones. (Segregated Witness offers a potential solution to this problem, but the project is still at the testing phase.) But they rely on nodes to check the transactions for validity, and assume that after a certain number of blocks have been added on top, a transaction can be counted on to be correct.
Wallet technology is evolving rapidly in terms of efficiency and functionality, so this overview does not hope to cover all wallet types, but the basic principle is the same for most: wallets hold your keys, not your bitcoins, although the distinction is actually not that relevant for the average user. Bitcoin wallets are a fundamental piece in the path to increase bitcoin use beyond geeks and techies, as it is the only face of bitcoin that most will ever see. Wallet ease of use and security will increase confidence in transactions, while at the same time encourage more use cases. With more users comes even more innovation, and the entire sector – from front-end wallets to back-end miners and including the many applications in between – benefits.