What is a wallet and how does it work?

Please read before continuing: Technical Explanation of Bitcoin, Private Keys, List

 

A bitcoin wallet isn’t really a wallet, at least in the way we think about them.

walletnot.png

The first thing to understand is that your bitcoin is not stored in your wallet. Bitcoin isn’t inside your computer and it’s not sitting on a USB stick. Remember, your bitcoin only exists on the shared list.

So what is the function of a wallet then? To store your private keys.

Remember back to the analogy in our private key lesson. The bitcoin list is like a public set of lockers, that is where your bitcoin exists. So your wallet is actually just storing the keys to your bitcoin, not the bitcoin itself. This means that a wallet can be all kinds of different things. Since it’s really just something that stores your keys, it can even be a piece of paper!

This system makes bitcoin incredibly resilient. You can lose your wallet, but as long as you know your private key, your bitcoin is safe. There are people all around the world who are storing the list where your bitcoin is kept, and you can store a copy for yourself too. What happens if you lose your list? Just ask someone else to send you their copy.

Although a bitcoin wallet can be a piece of paper, there is a reason you may want to avoid that. Every bitcoin locker (or address) has exactly one key to open it. That means for every address you want to use, you need a separate key. Imagine keeping track of dozens, or even hundreds of pieces of paper with all your private keys and addresses on them!

For privacy concerns, it is best to use multiple addresses.

Our privacy lesson presented some good reasons why you want to have multiple addresses on the list. Once someone pays your address, they can see all the bitcoin you have been paid already, and what you will be paid in the future.

So we need a way to manage all the different addresses we will be using, and a way to create new ones as needed. This is where the modern bitcoin wallet comes into play.. also known as a hierarchical deterministic wallet. It’s a complicated name, but its function is simple.

Create many keys from one!

The HD wallet solves the issue of managing hundreds of keys and addresses by creating all of them from a single “seed”. In this case, we’re going to look how you can use a set of words to create all the lockers and keys you’ll ever need.

seed2.png

The above example is how some of the most popular HD wallets work today. They store a seed, which is a set of words, and then use some complicated formulas to create pairs of lockers and keys from them. In fact, an HD wallet is capable of creating billions of addresses from the same set of words!

The formulas that are used to create these keys from your seed are actually the same for different wallet manufacturers. This means if your device is lost or broken, all you need is your words and a new wallet to recover your bitcoin. Even if your chosen wallet manufacturer goes out of business, you can pick up a device from a competitor and all your bitcoin keys will be restored. You just need to give it your set of words.

Keep your seed words safe!!!

Since those 12 words can create all of your bitcoin keys, NEVER let anyone see them and NEVER type them on a computer. They are all someone needs to steal your bitcoin.

The Wallet

Obviously, it doesn’t make sense for us to run the formulas ourselves.. so we will need a bitcoin wallet. This can either be software, or a hardware wallet. A hardware wallet is a USB-like device that stores your seed words and manages your keys and addresses for you. It is also responsible for helping you send bitcoin by signing your transactions and broadcasting them to the network. A software wallet serves the same function, but it can simply be an app on your phone or computer.