12.3 Cryptocurrency & Blockchain
A cryptocurrency, a subset of digital currencies, is a medium of exchange that depends on cryptography to secure transactions and to control the creation of new units of currency.A protocol, more generally, is a payment system or a set of rules for crediting accounts.Meanwhile, a blockchain is a data structure that serves as a public digital ledger and is shared across a distributed network of computers.As an immutable record, it stores transactions in the form of a time-ordered series.The blockchain protocol describes a chain of blocks, where a block is a group of transactions that have been sealed and added to the existing chain at the same time.
Any participant in the blockchain network can add a new block to the chain, as long as a majority of the other participants in the network ratify the addition.When a node proposes the addition of a new block, the other nodes check the blockchain transaction history to ensure the new transactions proposed are valid.If a majority of the network approves the new block, it is appended to the last block in the blockchain, increasing the length of the chain.The newly added block contains a hash of the contents of the block to which it is chained, which timestamps the block in the chain.Every new block is guaranteed to have appeared chronologically after the previous block, because the previous block’s hash value would be otherwise unknown.The network only considers the longest chain (the chain with the most blocks)at any given point to be the working blockchain, which is continually ratified by at least 50% of the network.This stipulation, along with “proof-of-work” (computationally intensive hashing puzzles), makes it near impossible to double-spend a coin or modify a transaction once added to the ledger.The example proof-of-work problem in the Bitcoin white paper “involves scanning for a value that when hashed… with SHA-256, the hash begins with a number of zero bits.” This is an especially useful problem because “the average work required is exponential in the number of zero bits required,” which means the difficulty of the problem can be scaled up easily, and because the solution in constant time “can be verified by executing a single hash.” The first node to solve the hash puzzle is rewarded by the network with newly instantiated currency, increasing the money supply.
The blockchain protocol was first proposed in 2008 in a white paper entitled “Bitcoin: A Peer to Peer Electronic Cash System,” by the mysterious Satoshi Nakamoto.The paper argues it is possible to replace centralized authorities that verify currency-commercial and central banks—with a decentralized public blockchain of transactions.People trust that dollars used in everyday monetary transactions have value because they are guaranteed by the Federal Reserve, because they can be used to pay your taxes to the U.S.government, and because it is impossible for anyone to spend the same dollar more than once.A blockchain can offer trust in a currency system and solve the double-spending problem.
A coin on a blockchain refers to the “chain of digital signatures” that makes up the history of a transaction, where an exchange is a transfer of control of coins from the sender’s wallet to the recipient’s wallet.The money transfer protocol for user X to transfer coins to user Y is as follows: user X’s coin client arranges a set of prior transfers to X which, when added together,are of equal or greater value than the intended value to be sent to Y.If the value of prior transfers is greater than the amount to be sent, then X transfers the “change” value back to a new address of his own.Note that an address is a hashed form of a public key.X proves these transfers are genuine by signing them with his private key, affirming in a publicly verifiable way (via public key)that X and only X chose to execute the transaction.Accordingly, any transfer of currency contains the evidence that the transferor has the funds to backup the transaction.
A wallet is a cryptocurrency analogue to a conventional bank account.Wallets allow users to receive, store, and send digital money relying on public key cryptography.Wallets can generate new public-private key-pairs anytime, and reveal no information a priori on the identity of the user operating it.
As a single shared ledger, blockchain has the potential to solve the fragmented chaos of the modern financial system.With a single source of truth, transactions enjoy instant settlement instead of taking days, because payment is settlement—which means improvements in transaction time, cost, transparency, and security.Recording, clearing, settlement, and reconciliation across multiple organizations are collapsed into one step.