Bitcoin uses a public ledger that indicates the number of bitcoins and their owners at any given time. But instead of associating names of people with accounts, the ledger only lists Bitcoin addresses. Each address can be thought of as a pseudonym for a person (or group of people, business, etc.), and the use of pseudonyms is why people can use bitcoins without revealing personal information. The following is an example of a Bitcoin address: 13tQ1fbTMB6GxUJfMqCSDgivc8fvkHEh3J
Like a bank account number, a Bitcoin address consists of a string of letters and numbers (usually beginning with the number 1). To send bitcoins to others (e.g., an online merchant, a friend, or a family member), you only need to know their Bitcoin address. In turn, when you share your address with others, they can send you bitcoins. Because Bitcoin addresses are cumbersome to type, many people use quick response (QR) codes to represent their address. For convenience, you can put your Bitcoin address, either typed or as a QR code (or both), on your business card, personal website, or storefront (if you’re a merchant). Although you need an Internet connection to send bitcoins, you don’t need to be connected to receive them.
For example, if you work for a charity and pass out thousands of business cards containing your Bitcoin address and a statement like “Please consider donating in bitcoins,” your organization can collect bitcoins while you sleep.
As you know, in traditional banking, moving money from one account to another means that the bank would update its privately held ledger that listed every account at that bank. If a fire or other disaster destroyed that ledger, information about who owned the assets at the bank might be lost forever. Although Bitcoin also uses a ledger, identical copies of it are distributed across millions of computers around the world. Consequently, no central point of failure exists, and transactions recorded on the Bitcoin ledger are permanent and impossible to erase. Moving bitcoins from one address to another is equivalent to sending an instruction to all of the computers on the Bitcoin network to update each ledger in the same way.
Because all transactions on the Bitcoin ledger are public information, maintaining privacy (if that is desired) can be a challenge. Although no personal information is on the ledger, if you share your Bitcoin address with your friends or post it in a public place that others can associate with your identity, your Bitcoin balance at that address will be known to everyone (including all incoming and outgoing transactions). To enhance your privacy, you can use many Bitcoin addresses but publicly share only some of them.
So how do you move bitcoins from one address to another (i.e., spend them)? Well, this action requires a private key.
THE PRIVATE KEY
A private key, like a Bitcoin address, is a long string of numbers and letters (usually beginning with the number 5). As with Bitcoin addresses, QR codes are often used to represent private keys because of their length. Each private key is paired with a single Bitcoin address and is able to unlock the bitcoins at that address (i.e., move them elsewhere). The following is an example of a private key: 5J2ae37Jwqzt7kSp9rE17Mi2LbkHXx4tzNSzbq7xDp2cQJCzhYo
Whereas a Bitcoin address is similar to a bank account number, a private key is more like a PIN: You need it to authorize a withdrawal or an expenditure. When a transaction is broadcast to the Bitcoin network, instructing bitcoins to be moved from one address to another, computers on the network check whether the transaction is authorized before making any updates to the public ledger. Specifically, they check whether the transaction has been digitally signed using a private key. A digital signature is extra data appended to a transaction that can only be created by someone possessing the corresponding private key. Similar to a PIN, a private key should be kept secret. If someone obtains your private key, he will be able to spend your bitcoins.
Note that although a private key can be used to produce a digital signature, a digital signature cannot be used to obtain a private key. Digital signatures also cannot be reused to make new transactions; therefore, broadcasting a signed transaction to the Bitcoin network is not a risk. This action is fundamentally different from making an online payment with a credit card.
When you use a credit card, you provide your credit card number to someone to authorize a transaction. That number can then be reused (maliciously) to authorize more transactions that you never intended.
Unlike a PIN, which both you and the bank know, only you know the private key. The risk you take in this circumstance is if you lose the private key to an address in which you’ve stored bitcoins, those bitcoins will remain locked in that address forever. Clearly, it is extremely important not to lose your private key! Fortunately, you can easily make digital backups of your private keys or write them on a piece of paper and keep them in a safe place. Losing your Bitcoin address is not a problem, however, as it can be recovered from the corresponding private key (Bitcoin wallet programs, described later in this chapter, can do this for you automatically).
Although it’s possible to use Bitcoin with only a single address and private key, in practice most people use many addresses, each with its own private key, and store them in a digital wallet.
THE BITCOIN WALLET
A Bitcoin wallet is a collection of addresses and private keys owned by one person.
Having multiple Bitcoin addresses can help you organize your money.
You may want separate addresses for paying rent, for shopping online, and for saving bitcoins to pay for a house in the future. So a person could have two bitcoins in his wallet that are distributed among many different Bitcoin addresses.
Using multiple addresses, in the form of a wallet, also helps you maintain privacy. This is because the public ledger maintained by Bitcoin, which anyone can look at, has no way of knowing that any two addresses are in the same wallet and are owned by the same person (as long as that person hasn’t done anything to show that the two addresses are linked, such as making a single purchase using bitcoins from both accounts).
To manage several addresses and private keys, people use Bitcoin wallet programs. Whereas a Bitcoin wallet is an abstract concept, referring to a group of Bitcoin addresses, a wallet program is a concrete tool that helps users with common Bitcoin tasks, such as creating new Bitcoin addresses, sending bitcoins to others, backing up private keys, and many others. But be aware that the terminology surrounding Bitcoin wallets is not always used consistently. Often, Bitcoin wallet programs are called Bitcoin wallets for short, confusing these two distinct concepts. When you save a Bitcoin wallet (perhaps to make a backup copy), you create a wallet file, which contains information for multiple Bitcoin addresses. Later, you can load your wallet files into a Bitcoin wallet program.
Many Bitcoin wallet programs are available to choose from; most are free downloads and can be run on your laptop or phone, or even in your web browser. The Electrum wallet, which is open source, cross platform, and very simple to use.
For more on Bitcoin for the Befuddled look for the four article in this series called Creating your first Bitcoin wallet in a future edition of CDN Now.
About the Author
Conrad Barski has an M.D. from the University of Miami, as well as nearly 20 years of programming experience. Barski is a cartoonist, programmer, and the author of Land of Lisp. He’s been using bitcoins since 2011.
Chris Wilmer holds a Ph.D. in chemical engineering from Northwestern University and is a professor at the University of Pittsburgh. Wilmer’s first purchase with bitcoin was a bag of honey caramels from a farm in Utah. They were delicious.
There is one caveat when broadcasting a signed transaction. The Bitcoin address is not the public key. To get the Bitcoin address there is a multi-step process to calculate the Bitcoin address from the public key. One you sign a transaction the public key is exposed.
This is normally not a problem because it would require breaking the SHA256 cryptography to calculate the private key from the public key. The caveat is that your wallet program needs to generate a random number as well as use the private key in order to sign a transaction. if your wallet program is faulty and uses the same “random” number for 2 different transactions then your private key can be calculated from the signed transaction data.
Still have no clue…