Even to those who are otherwise technologically savvy, Bitcoin can seem like magic. Despite not relying on any sort of central authority, this distributed currency keeps exact track of countless financial transactions and, when properly secured, is considered by most to be a very safe way of storing wealth. Underneath that apparent magic, though, are some very well-established and cleverly applied cryptographic principles.

Those who have investigated the phenomenon will undoubtedly have come across references to the Bitcoin “blockchain.” This distributed document, shared among the many network nodes that make up the Bitcoin system, contains a complete record of every Bitcoin-related transaction since the currency was unleashed upon the world. Records of withdrawals, deposits, and the creation of Bitcoins are bunched up in bundles called “blocks,” and these individual blocks are tied together cryptographically in ways that make forging any of them impossible.

While this might seem fairly straightforward, it raises the question as to where the Bitcoin belonging to a single person are actually stored. If they are stored in the blockchain, as they seem to be, then it seems likely that others would be able to spend and transfer them, which would defeat the technology’s goal of providing strong security.

In order to understand why this is not the case, one must only grasp the notion of public-key, or asymmetric cryptography. Unlike traditional methods of encoding and decoding messages, this one relies on pairs of keys, each of which can be used to encrypt messages that only the other can unscramble. Cryptography of this sort, in fact, is used widely on the Internet, underlying virtually every secure system on it, so the creators of Bitcoin knew that it could be relied upon for their purposes as well.

In the case of Bitcoin, one half of one of these public-key pairs is displayed publicly on the distributed blockchain described previously. This is used as an address for receiving and sending coins, so it is in some sense the “wallet” that many are seeking as they try to understand what is going on with Bitcoin.

The key, quite literally, to that wallet lies in the other half of the public key pair. This one is kept secret, because anyone in possession of it can use it to control the Bitcoin associated with its other half on the blockchain. When an owner of some Bitcoin, then, decides that he wants to spend or transfer them, he uses this private key to sign the desired transaction.

The nodes on the Bitcoin network, because they all have access to the corresponding public key, can verify that the transaction was signed, and therefore made, by someone with access to that secret. That, in effect, is Bitcoin wallets explained, and it’s a simpler picture than many would expect. It also shows why it is so important that access to the secret key portion of Bitcoin wallets be guarded very carefully, whether through strong passwords or even through storing offline when possible.