Cryptocurrency Basics - Blockchain: Blueprint for a New Economy (2015)

Blockchain: Blueprint for a New Economy (2015)

Appendix A. Cryptocurrency Basics

Bitcoin and other altcoins are digital cash, a way of buying and selling things over the Internet. The first step is establishing a digital wallet, either via a browser-based web wallet or by downloading a desktop or smartphone wallet from Blockchain.info, Mycelium, Coinbase, Electrum, or other Bitcoin wallet providers. Your Bitcoin address as well as your public and private keys are generated automatically when you set up your wallet. Your Bitcoin address is typically an identifier of 26 to 34 alphanumeric characters, beginning with the number 1 or 3, that represents a possible destination for a Bitcoin payment—for example, 1JDQ5KSqUTBo5M3GUPx8vm9134eJRosLoH, represented like this string of characters or as a QR code. (This example Bitcoin address is the tip jar of an informative podcast covering blockchain technology called Let’s Talk Bitcoin.) Your Bitcoin address is like your email address; people with your email address can send you email; people with your public-key wallet address can send you Bitcoins.

Because Bitcoin is digital cash, your wallet does not contain the actual cash (thus the term wallet is a bit of a misnomer). Your wallet has your address, public and private keys, and a record of the amount of Bitcoin you control on the blockchain ledger, but not any actual cash. Your wallet should be kept as safe as any traditional wallet to protect your private keys; anyone with access to them has access to controlling or spending or transferring your Bitcoin. You should not give your private keys to any other party, or store them at an exchange (poor private-key security has been one of the contributing factors in Bitcoin-related thefts and scams).

With your address, anyone can send you Bitcoins (just as anyone can send you email with your email address). To send someone else Bitcoins, you need his address and the private-key part of your wallet where the software checks that you have control over the Bitcoins you would like to spend or transfer. To send someone Bitcoins, you scan his wallet address QR code or otherwise obtain his address characters or QR code (e.g., by email or SMS). The sender scans the QR code address of the receiver’s wallet and uses the wallet application to enter additional information about the transaction, such as amount, transaction fee (usually affirming the amount prespecified by the wallet software), and any other parameters to send the receiver Bitcoins. When the sender submits the transaction, a message is broadcast from the owner of the sending address to the network that x number of coins from that address now belong to the new address. This operation is authorized by the sender’s private key; if that wallet does not have the private key corresponding to those coins, the coins cannot be spent. A bona fide transaction is received nearly immediately in the receiver’s wallet application, with an “unconfirmed” status. It then takes about 10 minutes for the transaction to confirm and be inscribed in the blockchain per blockchain miners. So, for large purchases such as a car or real estate, you would want to wait to see the transaction confirmed, but you wouldn’t bother to do so for a coffee purchase.

Public/Private-Key Cryptography 101

When the wallet is initialized or set up for the first time, an address, public key, and private key are automatically generated. Bitcoin is based on public-key encryption, meaning that you can give out the public key freely but must keep the private key to yourself.

Bitcoin addresses are created by the software picking a random number and creating a public/private key pair (per the current standard, Elliptic Curve Digital Signature Algorithm, or ECDSA) that is mathematically related, and confirmed at the time of spending the Bitcoin. This startup operation generates the private key, but additional steps are required to generate the Bitcoin address. The Bitcoin address is not simply the public key; rather, the public key is further transformed for more effective use. It is cycled through additional encryption protocols (like SHA-256 and RIPEMD-160), a hashing operation (transforming a string of characters into a shorter fixed-length value or key that represents the original string), and administrative operations (removal of similar-looking characters, like lowercase L and uppercase I, and 0 and O; adding a checksum to the end; and adding an identifying number to the beginning of the address—for most Bitcoin addresses, this is a 1, indicating it is a public Bitcoin network address).

It is infeasible though technically possible that two different people could generate the same Bitcoin address. In such a case, both would be able to spend the coins on that particular address. The odds of this happening are so small, however, that it is almost 99.9999999999 percent impossible. A Bitcoin wallet can contain multiple addresses (one security procedure is using or generating a new address for each transaction), and one or more private keys, which are saved in the wallet file. The private keys are mathematically related to all Bitcoin addresses generated for the wallet.

In Bitcoin, a private key is usually a 256-bit number (although some wallets might use between 128 and 512 bits), which can be represented in one of several ways. Here is one example of a private key in hexadecimal format (256 bits in hexadecimal is 32 bytes, or 64 characters in the range 0–9 or A–F):

E9 87 3D 79 C6 D8 7D C0 FB 6A 57 78 63 33 89 F4

45 32 13 30 3D A6 1F 20 BD 67 FC 23 3A A3 32 62

Here is another example of a private key and its corresponding public address:

Private key:

79186670301299046436858412936420417076660923359050732094116068951337164773779

Public address:

1EE8rpFCSSaBmG19sLdgQLEWuDaiYVFT9J

Doing some sort of back calculation to derive the private key from the public key is either impossible (per the hashing operation, which is one-way only, or other techniques) or prohibitively expensive (tremendous computing power operating over a longer time than would be necessary to confirm the transaction). Only the address is needed to receive Bitcoins, whereas the public/private key pair is required to send Bitcoins.