|This article needs additional citations for verification. (March 2014) (Learn how and when to remove this template message)|
The bitcoin network is a peer-to-peer payment network that operates on a cryptographic protocol. Users send and receive bitcoins, the units of currency, by broadcasting digitally signed messages to the network using bitcoin wallet software. Transactions are recorded into a distributed, replicated public database known as the blockchain, with consensus achieved by a proof-of-work system called "mining". The protocol was designed in 2008 and released in 2009 as open source software by "Satoshi Nakamoto", the name or pseudonym of the original developer/developer group.
The network requires minimal structure to share transactions. An ad hoc decentralized network of volunteers is sufficient. Messages are broadcast on a best effort basis, and nodes can leave and rejoin the network at will. Upon reconnection, a node downloads and verifies new blocks from other nodes to complete its local copy of the blockchain.
A bitcoin is defined by a sequence of digitally signed transactions that began with the bitcoin's creation, as a block reward. The owner of a bitcoin transfers it by digitally signing it over to the next owner using a bitcoin transaction, much like endorsing a traditional bank check. A payee can examine each previous transaction to verify the chain of ownership. Unlike traditional check endorsements, bitcoin transactions are irreversible, which eliminates risk of chargeback fraud.
Although it is possible to handle bitcoins individually, it would be unwieldy to require a separate transaction for every bitcoin in a transaction. Transactions are therefore allowed to contain multiple inputs and outputs, allowing bitcoins to be split and combined. Common transactions will have either a single input from a larger previous transaction or multiple inputs combining smaller amounts, and one or two outputs: one for the payment, and one returning the change, if any, to the sender. Any difference between the total input and output amounts of a transaction goes to miners as a transaction fee.
To form a distributed timestamp server as a peer-to-peer network, bitcoin uses a proof-of-work system. The work in this system is what is often referred to as bitcoin mining. The signature is discovered rather than provided by knowledge. This process is energy intensive. Electricity can consume more than 90% of operating costs for miners. A data center in China, planned mostly for bitcoin mining, is expected to require up to 135 MW of power.
The rule of requiring a proof-of-work to provide the signature for the blockchain was Satoshi Nakamoto's key innovation. The mining process involves identifying a block that when hashed twice with SHA-256, yields a number smaller than the given difficulty target. While the average work required increases in inverse proportion to the difficulty target, a hash can always be verified by executing a single round of double SHA-256.
For the bitcoin timestamp network, a valid "proof-of-work" is found by incrementing a nonce until a value is found that gives the block's hash the required number of leading zero bits. Once the hashing has produced a valid result, the block cannot be changed without redoing the work. As later blocks are chained after it, the work to change the block would include redoing the work for each subsequent block.
Majority consensus in bitcoin is represented by the longest chain, which required the greatest amount of effort to produce. If a majority of computing power is controlled by honest nodes, the honest chain will grow fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of-work of that block and all blocks after it and then surpass the work of the honest nodes. The probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added.
To compensate for increasing hardware speed and varying interest in running nodes over time, the difficulty of finding a valid hash is adjusted roughly every two weeks. If blocks are generated too quickly, the difficulty increases and more hashes are required to make a block and to generate new bitcoins.
Bitcoin mining is a competitive endeavor. An "arms race" has been observed through the various hashing technologies that have been used to mine bitcoins: basic CPUs, high-end GPUs common in many gaming computers, FPGAs and ASICs all have been used, each reducing the profitability of the less-specialized technology. Bitcoin-specific ASICs are now available. As bitcoins become more difficult to mine, computer hardware manufacturing companies have seen an increase in sales of high-end products.
Computing power is often bundled together or "pooled" to reduce variance in miner income. Individual mining rigs often have to wait for long periods to confirm a block of transactions and receive payment. In a pool, all participating miners get paid every time a participating server solves a block. This payment is proportional to the amount of work an individual miner contributed to help find that block.
A rough overview of the process to mine bitcoins is:
- New transactions are broadcast to all nodes.
- Each miner node collects new transactions into a block.
- Each miner node works on finding a proof-of-work code for its block.
- When a node finds a proof-of-work, it broadcasts the block to all nodes.
- Receiving nodes validate the transactions it holds and accept only if all are valid.
- Nodes express their acceptance by moving to work on the next block, incorporating the hash of the accepted block.
By convention, the first transaction in a block is a special transaction that produces new bitcoins owned by the creator of the block. This is the incentive for nodes to support the network. It provides the way to move new bitcoins into circulation. The reward for mining halves every 210,000 blocks. It started at 50 bitcoin, dropped to 25 in late 2012 and to 12.5 bitcoin in 2016. This halving process is programmed to continue for 64 times before new coin creation ceases.
Each miner can choose which transactions are included in or exempted from a block. A greater number of transactions in a block does not equate to greater computational power required to solve that block.
Upon receiving a new transaction a node must validate it: in particular, verify that none of the transaction's inputs have been previously spent. To carry out that check the node needs to access the blockchain. Any user who does not trust his network neighbors, should keep a full local copy of the blockchain, so that any input can be verified.
As noted in Nakamoto's whitepaper, it is possible to verify bitcoin payments without running a full network node (simplified payment verification, SPV). A user only needs a copy of the block headers of the longest chain, which are available by querying network nodes until it is apparent that the longest chain has been obtained. Then, get the Merkle branch linking the transaction to its block. Linking the transaction to a place in the chain demonstrates that a network node has accepted it, and blocks added after it further establish the confirmation.
- Nakamoto, Satoshi (24 May 2009). "Bitcoin: A Peer-to-Peer Electronic Cash System" (PDF). Retrieved 20 December 2012.
- Barber, Simon; Boyen, Xavier; Shi, Elaine & Uzun, Ersin (2012). "Bitter to Better — how to make Bitcoin a better currency" (PDF). Financial Cryptography and Data Security. Springer Publishing.
- Dean, Andrew (14 August 2014). "Online Gambling Meets Bitcoin". Retrieved 21 August 2014.
- "Block Chain Overview". bitcoin.org/. © Bitcoin Project 2009-2014 Released under the MIT license. 2009–2014. Retrieved 14 August 2014.
- "Enabling Blockchain Innovations with Pegged Sidechains" (PDF). Blockstream. 22 October 2014. p. 3. Retrieved 9 January 2017.
- Peter Kelly-Detwiler (21 July 2016). "Mining Bitcoins Is A Surprisingly Energy-Intensive Endeavor". Forbes. Retrieved 7 January 2017.
- Lester Coleman (25 July 2016). "As Mining Expands, Will Electricity Consumption Constrain Bitcoin?". cryptocoin news. Retrieved 7 January 2017.
- "Mining Bitcoin With Wind And Solar Power". Energy Matters. 7 November 2016. Retrieved 7 January 2017.
- Tindell, Ken (5 April 2013). "Geeks Love The Bitcoin Phenomenon Like They Loved The Internet In 1995". Business Insider.
- "Bitcoin boom benefiting TSMC: report". Taipei Times. 4 January 2014.
- Biggs, John (8 April 2013). "How To Mine Bitcoins". Techcrunch.
- Jacob Donnelly (12 June 2016). "What is the 'Halving'? A Primer to Bitcoin's Big Mining Change". CoinDesk. Retrieved 10 January 2017.
- Houy, N. (2016). "The Bitcoin Mining Game". Ledger. 1 (0): 53–68. doi:10.5195/ledger.2016.13. Retrieved 14 January 2017.