The first thing to remember is that bitcoins don't actually exist. Note that nothing in the earlier example requires real-world assets or paper money in order to function — everyone's money is just information listed on the chalkboard. This is actually similar to how modern digital banks work. The savings in your account aren't backed by gold or anything real, they're just numbers in a database, and if the bank lost that data nobody would know how much money you had. Similarly, when you "buy" bitcoin, you're not getting anything real — rather, you're just increasing your balance in the global bitcoin database (the decentralized ledger), and decreasing your balance in the traditional banking database. This is a critical point in understanding how bitcoins (or any other cryptocurrencies) are stored.
Addresses are public keys and they're like wallets.
In the concrete example we had earlier, everyone stored the balances and names of everyone else they knew about in a notebook. In bitcoin, instead of associating balances with names, balances are associated with addresses. In that sense, your address is referred to as your digital wallet, since it's technically the only thing your balance is associated with. An address is just a string of letters and numbers such as 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2.
Getting even more technical, your address is actually a public key and every public key has a corresponding private key that can be used to encrypt things. As obviated by their name, only the owner of the address knows the private key — the public key is known to all.
Public-private key cryptography is used to implement digital signatures in bitcoin transactions. The basic concept is that if you encrypt something with your private key, the only way to decrypt it is using your corresponding public key, which is also your address. The best way to understand why this works like a signature is with the following example:
- You tell everyone your public key and keep your private key secret.
- You want to send money from an address with your public key to someone else's address (also a public key).
- You create a transaction and encrypt it with your private key and send it to a validator to be approved. Remember that only your public key can successfully decrypt this transaction.
- The validator verifies that he can indeed decrypt the transaction with your public key. When he does this, he knows that the transaction was encrypted with your private key, because otherwise your public key wouldn't have been able to decrypt the transaction.
- Because you're the only person with access to your private key, nobody other than you can successfully create a transaction from your public key (which is your address) to anyone else that the validator will accept.
- In that sense, your private key acts like your "digital signature."