1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-10-09 17:39:16 +00:00
bitcoinbook/ch00.asciidoc
Andreas M. Antonopoulos 19e9d04327 reference
2013-08-05 11:39:21 -07:00

120 lines
8.7 KiB
Plaintext

[[ch00_intro_what_is_bitcoin]]
== Introduction
=== What is Bitcoin?
Bitcoin is digital money, a currency for and of the Internet. It is not owned or controlled by any company, group or country. It exists as a set of standards and reference software and as a running network with several thousand nodes worldwide. Behind the scenes, bitcoin is a network, a protocol, a standard and a currency. For now think of it simply as digital money that can be sent, received and stored by anyone, worldwide simply by downloading compatible software and joining a network.
Under the hood, bitcoin is the culmination of decades of research in cryptography and distributed systems and represents four key innovations brought together in a unique and powerful combination. Bitcoin consists of a de-centralized peer-to-peer network, a public transaction ledger, a de-centralized mathematical and deterministic currency issuance, a de-centralized transaction verification system and a set of powerful APIs. All of these are "bitcoin", and each of these aspects of bitcoin will be examined in this book.
More than all of these parts, bitcoin is a digital economy platform, just like the Internet is a digital communications platform. With bitcoin, it is possible to build entire new financial systems, transaction types and economies on top of a purely digital, instantaneous and frictionless platform, an Internet for money.
=== Stories
It is easiest to experience bitcoin from the perspective of a few specific stories that we will explore in detail throughout the book.
Each story represents a specific real use of bitcoin in different contexts.
==== Alice buys a cup of coffee from Bob's Cafe
Alice wants to buy a cup of coffee using bitcoin. She visits Bob's Cafe, a coffee shop that accepts bitcoin payments, as advertised by a sign declaring _"Bitcoin Accepted Here"_ in the window. At the counter, the prices may be listed in a local currency like Euros or Dollars. At the register, Bob would ring up a coffee, displaying
----
Total:
$1.50 USD
0.015 BTC
----
Or Bob might say _"That's one-dollar-fifty, or fifteen milibits"_.
Alice would use a smartphone to scan the barcode on display and send the payment. Her smartphone would show a payment of +0.0150 BTC+ to +Bob's Cafe+ and she would select +Send+ to authorize the payment. Within a few seconds (about the same time as a credit card authorization), Bob would see the transaction on the register, completing the transaction. Alice has purchased a cup of coffee for 15 millibits (or 0.015 bitcoin)
[TIP]
====
In the USA, it is customary to tip 20% for good service at coffee shops. Alice may choose to tip in dollars, or may add bitcoin.
====
==== A currency
Bitcoin is a currency, the operates much like any "foreign" currency. The main difference is that it is not issued by a national government. Bitcoin currency units are called "bitcoins". Unlike traditional currencies, bitcoins are divisible to much smaller units. The smallest unit is the _satoshi_, one hundred-millionth of a bitcoin (1/100,000,000). Bitcoin can be exchanged for other currencies at specialized currency exchanges that support crypto-currencies like bitcoin. There, a customer can exchange US dollars ($) or Euros (E) for bitcoin, at the prevailing market exchange rate.
==== A network and protocol
Bitcoin operates on top of a peer-to-peer network, also called "bitcoin". The bitcoin network is used to propagate transactions, new blocks and alert messages. The network operates using a relatively simple network protocol for peer discovery and blockchain replication.
[[table_units]]
table of bitcoin units from bitcoin wiki
One interesting feature of bitcoin is that the issuance of the currency decreases automatically over time, halving every four years, reaching an absolute maximum of 21 million bitcoins issued sometime around the year 2140.
[[chart_bitcoin_decreasing_issuance]]
Chart of decreasing issuance over time
==== Transactions
People can pay for goods and services using bitcoin as the currency.
Bitcoin transactions, which transfer value from one bitcoin address to another, are recorded in a distributed ledger, called the _blockchain_. In simple terms, think of the ledger as a book with lines like this:
----
A gives 1 bitcoin to B
C gives 2 bitcoin to D
----
The ledger is a record of all bitcoin transactions and can be independently verified by every node.
==== The blockchain
Bitcoin's core innovation is the _blockchain_, a distributed, timestamped ledger. The ledger consists of a cryptographically verified chain of _blocks_, each of which contains transactions, new coins and a signature (hash) of the previous block. Each full bitcoin node in the network will keep a complete local replica of the blockchain, and independently verify all transactions and balances from that replica.
==== Mining for blocks
Bitcoin's security is underpinned by computation. The blockchain is formed by solving a problem, called the _proof-of-work_ (PoW) that requires a predictable computational effort, one that takes approximately 10 minutes for the entire network of bitcoin nodes to solve. The process is called _mining_, since it has diminishing returns, just like mining for precious metals. It works a bit like a global lottery, where every bitcoin miner attempts to find a solution to a cryptographic equation. The first miner to find a solution, broadcasts it on the peer-to-peer bitcoin network for others to verify and include in the blockchain. For any transaction to be included in the global blockchain, it must be verified and included inside a new block. Each block includes the fingerprint of the previous block int he chain and any new transactions that have occured in the intervening 10 minutes.
When a bitcoin miner discovers a new solution to the proof of work algorithm, they create a new block which includes newly minted bitcoin in a transaction that pays to the miner's own bitcoin address. Bitcoin miners earn the newly minted bitcoin as a reward by creating a transaction to pay themselves. They can do this only if they discover a solution to the proof-of-work problem, thus providing an incentive to participate in mining and thereby to computationally secure the transactions.
Essentially, the bitcoin currency units are issued through mining, just like a central bank issues new money by printing bank notes. The amount of newly created bitcoin in each block decreases every four years. It started at 50 bitcoin per block in 2008 and halved to 25 bitcoin per block in 2012. It will halve again to 12.5 bitcoin per block in 2016. Based on this formula, bitcoin mining rewards decrease exponentially until approximately 2140 when all 21 million bitcoin have been issued.
Bitcoin miners also earn fees from transactions. Every transaction may include a transaction fee, in the form of a surplus of bitcoin between the transaction's inputs and outputs. The bitcoin miner gets to "keep the change" on the transactions.
At the time of writing this, the fees usually represent 1% or less of a bitcoin miner's income, the vast majority coming from the newly minted bitcoins. However, as the reward decreases over time, a greater proportion of bitcoin mining earnings will come from fees, until after 2140 all bitcoin miner earnings will be in the form of transaction fees.
==== A transaction language
A simple bitcoin transaction transfers value from one bitcoin address to another. However, there is much more to bitcoin transactions than that. Each transaction is a signed script that is evaluated using a stack-based interpreter. The language of transactions is Forth-like and not Turing-complete as it does not include looping constructs.
A transaction script can make a bitcoin payment payable to the owner of a bitcoin address, to multiple bitcoin addresses, to anyone who solves a riddle, to anyone who guesses a number or to infinitely more complex requirements.
The transaction script language is extremely powerful and can be used to express very complex and novel transactions. It is examined in more detail in <<complex_transactions>>.
==== An Application Programming Interface (API)
The reference bitcoin software implementation, known as the _Satoshi Client_ and with the application name +bitcoin-qt+ or +bitcoind+, offers a client-level API. The API is available as a JSON/RPC interface and offers programmatic access to bitcoin wallets, th blockchain and the bitcoin network.
=== Getting Bitcoin
==== Obtaining the bitcoin software
==== bitcoin-qt, bitcoind
==== mobile client
=== History of bitcoin
==== A brief history of money
==== A brief history of crypto currencies
==== Public key cryptography and crypto-currency
==== Peer-to-Peer networks
==== Why would I use bitcoin
===== As a merchant
===== As a consumer
===== As a developer, integrator
===== As an entrepreneur
===== As an investor