A wallet generates a bitcoin address that you can use to receive and store bitcoin. You can store as many bitcoins as you want in as many addresses as you want.
Public Key Cryptography
Bitcoin wallets are based on public-key cryptography, where the Bitcoin protocol uses the Elliptic Curve Digital Signature Algorithm (ECDSA) to create a private key and a public key. The wallet contains a private key that is used to sign a transaction. The signature mathematically proves that the transaction is genuine, was signed by the owner and prevents the transaction from being altered.
Private keys can generate lots of public keys, where public keys are put through a hash function to generate public addresses. These addresses are used to receive bitcoins. To spend bitcoins, you need to control the private keys and that is why you need to keep them a secret. If someone has access to your private key, they will be able to spend your bitcoins.
Once a transaction is signed with the private key, it is added to the mempool (a waiting list of bitcoin transactions that every node keeps a copy of) for miners to confirm it. Miners will use the sender’s public key to guarantee the signature is authentic and include the transaction in the next block if it checks out.
Once the transaction is included in the next block, the bitcoins are transferred from one wallet to another.
Different Types of Bitcoin Wallets
There are many different types of bitcoin wallets, and they have different trade-offs regarding convenience and security.
The official bitcoin wallet is the Bitcoin Core client, which can be downloaded here and allows you to run a full node so you can verify your transactions and support the network by validating transactions and blocks.
You can also store bitcoins online using services like Blockchain, but these are not as secure as desktop wallets and have suffered security breaches in the past.
If want to use online bitcoin wallets, then it is best to store only small amounts and enable 2-factor authentication.
Mobile wallets are convenient when using and spending bitcoin. Your smartphone’s camera can read QR codes, which represent bitcoin addresses, to spend bitcoin.
Offline wallets, which include hardware wallets and paper wallets, offer enhanced security as compared to mobile and online wallets. Offline wallets are also known as ‘cold storage’. Manufacturers such as Coldcard, Trezor and Ledger are the most popular hardware wallets and can be used to send, store and receive bitcoins.
Paper wallets can also be generated by using paper wallet generators such as bitaddress.org. A paper wallet usually displays your public and private keys, and the challenge is then to keep your private key safe. Setting up a paper wallet can be complicated if you want maximum security, as you will need two laptops, one of which has never been connected to the internet.
Whatever wallet you use, ensure you back it up so you can restore it if your computer is hacked or malfunctions or you cannot access your mobile wallet.
A backup is usually a secret combination of 24 words, known as a seed, or an encrypted version of your private key. You may also want to encrypt the seed backups, especially if you are storing them on your computer. Storing your private keys in several locations is the most secure option. You can store your private keys on paper, USB drives, and CDs.
To gain a deeper understanding of storing and securing your bitcoin wallet, check out this lecture by Pamela Morgan. There are also complicated protocols aimed at people who want to safeguard large amounts of bitcoin offline, such as Glacier.