The Bitcoin network is a peer-to-peer network of nodes which implement the Bitcoin protocol. The protocol itself implements a highly available, public, and decentralized ledger. The nodes verify that each update to the ledger follows the rules of the Bitcoin protocol.
Users broadcast cryptographically signed messages to the network using Bitcoin cryptocurrency wallet software. These messages are proposed transactions, changes to be made in the ledger. Each node has a copy of the ledger's entire transaction history. If a transaction violates the rules of the Bitcoin protocol, it is ignored. Transactions only happen when the full network agrees they should happen. This "full network consensus" is achieved when each node on the network verifies the results of a proof-of-work operation called mining. Mining packages groups of transactions into blocks, and produces a hash code that follows the rules of the Bitcoin protocol. Creating this hash requires expensive energy, but a network node can verify the hash is valid using very little energy. If a miner proposes a block to the network, and its hash is valid, the block and its ledger changes are added to the blockchain, and the network moves on to yet unprocessed transactions. In case there is a dispute, then the longest chain is considered to be correct.
A new block is created every 10 minutes, on average.
Satoshi Nakamoto, the anonymous designer of the protocol, stated that design and coding of Bitcoin began in 2007. The project was released in 2009 as open source software.
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.[1][2]
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.[1]
To form a distributed timestamp server as a peer-to-peer network, bitcoin uses a proof-of-work system.[2] This work is often called bitcoin mining.
During mining, practically the entire computing power of the Bitcoin network is used to solve cryptographic tasks, the proof of work. Their purpose is to ensure that the generation of valid blocks involves a certain amount of effort, so that subsequent modification of the block chain, such as in the 51% attack scenario, can be practically ruled out. Because of the difficulty, miners form "mining pools" to get payouts despite these high power requirements, costly hardware deployments, and/or hardware under their own control. The largest proportion of mining pools are based in China, which is also where most of the miners—or about 75% of the computing power—of the cryptocurrency are based.[3]
Requiring a proof of work to accept a new block to 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. If there is a deviation in consensus then a blockchain fork can occur.
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.[2]
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.[2]
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 central processing units (CPUs), high-end graphics processing units (GPUs), field-programmable gate arrays (FPGAs) and application-specific integrated circuits (ASICs) all have been used, each reducing the profitability of the less-specialized technology. Bitcoin-specific ASICs are now the primary method of mining bitcoin and have surpassed GPU speed by as much as 300-fold. The difficulty of the mining process is periodically adjusted to the mining power active on the network. As bitcoins have become more difficult to mine, computer hardware manufacturing companies have seen an increase in sales of high-end ASIC products.[4]
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 depends on the amount of work an individual miner contributed to help find that block, and the payment system used by the pool.[5]
In 2013, Mark Gimein estimated electricity consumption to be about 40.9 megawatts (982 megawatt-hours a day).[7] In 2014, Hass McCook estimated 80.7 megawatts (80,666 kW). (As of 2015), The Economist estimated that even if all miners used modern facilities, the combined electricity consumption would be 166.7 megawatts (1.46 terawatt-hours per year).[8] The Cambridge Bitcoin Electricity Consumption Index estimates the energy use of the bitcoin network grew from 1.95 terawatt-hours per year at the end of 2014, to 77.1 terawatt-hours per year by the end of 2019.[6]
Seeking lower electricity costs, some bitcoin miners have set up in places like Iceland where geothermal energy is cheap and cooling Arctic air is free.[9] Chinese bitcoin miners are known to use hydroelectric power in Tibet to reduce electricity costs.[10] North American companies are utilizing stranded gas as a cost-effective source of energy for bitcoin mining.[11] In West Texas, wind powers bitcoin mining.[12] As of April 2021, at least one-third of Bitcoin mining was powered by coal in China's Xinjiang region.[13]
A 2021 study found that carbon emissions from Bitcoin mining in China—where a majority of the proof-of-work algorithm that generated economic value was computed prior to mid-2021[14]—had accelerated rapidly in the late 2010s, are largely fueled by nonrenewable sources and was expected to exceed total annual emissions of countries like Italy and Spain during 2016, interfering with international climate change mitigation commitments.[15][16] It was also found that in 2021, bitcoin mining consumed more energy than the country of New Zealand.[17] A formal Chinese ban on cryptocurrency mining operations in May 2021—reiterated in both September and November—resulted in the relocation of a large majority of mining equipment away from China. Yet as many as 20 percent of "all the world's bitcoin miners remain in China. This is well off its peak of around 65% to 75% of the global market."[14] By December 2021, the global hashrate had mostly recovered to a level before China's crackdown, with increased shares of the total mining power coming from the U.S. (35.4%), Kazakhstan (18.1%), and Russia (11%) instead.[18]
Here are the basic steps of the Bitcoin mining process:
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.[1] 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. The most recent halving, which occurred in May 2020 (with block number 630,000), reduced the block reward to 6.25 bitcoin. This halving process is programmed to continue a maximum 64 times before new coin creation ceases.[19]
Various potential attacks on the bitcoin network and its use as a payment system, real or theoretical, have been considered. The bitcoin protocol includes several features that protect it against some of those attacks, such as unauthorized spending, double spending, forging bitcoins, and tampering with the blockchain. Other attacks, such as theft of private keys, require due care by users.[20][21]
Unauthorized spending is mitigated by bitcoin's implementation of public-private key cryptography. For example, when Alice sends a bitcoin to Bob, Bob becomes the new owner of the bitcoin. Eve, observing the transaction, might want to spend the bitcoin Bob just received, but she cannot sign the transaction without the knowledge of Bob's private key.[21]
A specific problem that an internet payment system must solve is double-spending, whereby a user pays the same coin to two or more different recipients. An example of such a problem would be if Eve sent a bitcoin to Alice and later sent the same bitcoin to Bob. The bitcoin network guards against double-spending by recording all bitcoin transfers in a ledger (the blockchain) that is visible to all users, and ensuring for all transferred bitcoins that they have not been previously spent.[21]:4
If Eve offers to pay Alice a bitcoin in exchange for goods and signs a corresponding transaction, it is still possible that she also creates a different transaction at the same time sending the same bitcoin to Bob. By the rules, the network accepts only one of the transactions. This is called a race attack, since there is a race between the recipients to accept the transaction first. Alice can reduce the risk of race attack stipulating that she will not deliver the goods until Eve's payment to Alice appears in the blockchain.[22]
A variant race attack (which has been called a Finney attack by reference to Hal Finney) requires the participation of a miner. Instead of sending both payment requests (to pay Bob and Alice with the same coins) to the network, Eve issues only Alice's payment request to the network, while the accomplice tries to mine a block that includes the payment to Bob instead of Alice. There is a positive probability that the rogue miner will succeed before the network, in which case the payment to Alice will be rejected. As with the plain race attack, Alice can reduce the risk of a Finney attack by waiting for the payment to be included in the blockchain.[23]
Each block that is added to the blockchain, starting with the block containing a given transaction, is called a confirmation of that transaction. Ideally, merchants and services that receive payment in bitcoin should wait for at least a few confirmations to be distributed over the network before assuming that the payment was done. The more confirmations that the merchant waits for, the more difficult it is for an attacker to successfully reverse the transaction—unless the attacker controls more than half the total network power, in which case it is called a 51% attack, or a majority attack.[24] Although more difficult for attackers of a smaller size, there may be financial incentives that make history modification attacks profitable.[25]
Deanonymisation is a strategy in data mining in which anonymous data is cross-referenced with other sources of data to re-identify the anonymous data source. Along with transaction graph analysis, which may reveal connections between bitcoin addresses (pseudonyms),[20][26] there is a possible attack[27] which links a user's pseudonym to its IP address. If the peer is using Tor, the attack includes a method to separate the peer from the Tor network, forcing them to use their real IP address for any further transactions. The cost of the attack on the full bitcoin network was estimated to be under €1500 per month, as of 2014.[27]
Each miner can choose which transactions are included in or exempted from a block.[28] A greater number of transactions in a block does not equate to greater computational power required to solve that block.[28]
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 tree 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.[1]
While it is possible to store any digital file in the blockchain, the larger the transaction size, the larger any associated fees become. The more information that is stored on each block means more information is stored on nodes, potentially creating "blockchain bloating."[29] The first block of the Bitcoin blockchain, known as the "Genesis Block", contains a famous newspaper headline that may hint at Bitcoin's mission.[30] Various items have been embedded, including URLs to websites, an ASCII art image of Ben Bernanke, material from the Wikileaks cables, prayers from bitcoin miners, and the original bitcoin whitepaper.[31] Other important information is stored in the blockchain as well. In Blockchain: Insights You Need from Harvard Business Review, Tapscott, Lakhani, and Iansiti state "With blockchain, we can imagine a world in which contracts are embedded in digital code and stored in transparent, shared databases, where they are protected from deletion, tampering, and revision. Intermediaries like lawyers, brokers, and bankers might no longer be necessary. Individuals, organizations, machines, and algorithms would freely transact and interact with one another with little friction."[32]
The use of bitcoin by criminals has attracted the attention of financial regulators, legislative bodies, law enforcement, and the media.[33] The FBI prepared an intelligence assessment,[34] the SEC has issued a pointed warning about investment schemes using virtual currencies,[33] and the U.S. Senate held a hearing on virtual currencies in November 2013.[35]
Several news outlets have asserted that the popularity of bitcoins hinges on the ability to use them to purchase illegal goods.[36][37] In 2014, researchers at the University of Kentucky found "robust evidence that computer programming enthusiasts and illegal activity drive interest in bitcoin, and find limited or no support for political and investment motives."[38]
A Carnegie Mellon University researcher estimated that in 2012, 4.5% to 9% of all transactions on all exchanges in the world were for drug trades on a single dark web drugs market, Silk Road.[39] Child pornography,[40] murder-for-hire,[41] and weapons[42] are also allegedly available on black market sites that sell in bitcoin. Due to the anonymous nature and the lack of central control on these markets, it is hard to know whether the services are real or just trying to take the bitcoins.[43]
Several deep web black markets have been shut by authorities. In October 2013 Silk Road was shut down by U.S. law enforcement,[44][45][46] leading to a short-term decrease in the value of bitcoin.[47] In 2015, the founder of the site was sentenced to life in prison.[48] Alternative sites were soon available, and in early 2014 the Australian Broadcasting Corporation reported that the closure of Silk Road had little impact on the number of Australians selling drugs online, which had actually increased.[49] In early 2014, Dutch authorities closed Utopia, an online illegal goods market, and seized 900 bitcoins.[50] In late 2014, a joint police operation saw European and American authorities seize bitcoins and close 400 deep web sites including the illicit goods market Silk Road 2.0.[51] Law enforcement activity has resulted in several convictions. In December 2014, Charlie Shrem was sentenced to two years in prison for indirectly helping to send $1 million to the Silk Road drugs site,[52] and in February 2015, its founder, Ross Ulbricht, was convicted on drugs charges and given a sentence of double life imprisonment plus 40 years.[53]
Some black market sites may seek to steal bitcoins from customers. The bitcoin community branded one site, Sheep Marketplace, as a scam when it prevented withdrawals and shut down after an alleged bitcoins theft.[54] In a separate case, escrow accounts with bitcoins belonging to patrons of a different black market were hacked in early 2014.[55]
According to the Internet Watch Foundation, a UK-based charity, bitcoin is used to purchase child pornography, and almost 200 such websites accept it as payment. Bitcoin is not the sole way to purchase child pornography online, as Troels Oertling, head of the cybercrime unit at Europol, states, "Ukash and paysafecard... have [also] been used to pay for such material." However, the Internet Watch Foundation lists around 30 sites that exclusively accept bitcoins.[40] Some of these sites have shut down, such as a deep web crowdfunding website that aimed to fund the creation of new child porn.[56][better source needed] Furthermore, hyperlinks to child porn websites have been added to the blockchain as arbitrary data can be included when a transaction is made.[57][58]
Bitcoins may not be ideal for money laundering, because all transactions are public.[59] Authorities—including the European Banking Authority,[60] the FBI,[34] National Treasury (South Africa)[61] and the Financial Action Task Force of the G7[62]—have expressed concerns that bitcoin may be used for money laundering.
In early 2014, an operator of a U.S. bitcoin exchange, Charlie Shrem, was arrested for money laundering.[63] Subsequently, he was sentenced to two years in prison for "aiding and abetting an unlicensed money transmitting business".[52]
Alexander Vinnik, an alleged owner of BTC-e, was arrested in Greece on 25 July 2017, on $4 billion money laundering charges for flouting anti-money laundering (AML) laws of the US. A report by the UK's Treasury and Home Office named "UK national risk assessment of money laundering and terrorist financing" (October 2015) found that, of the twelve methods examined in the report, bitcoin carries the lowest risk of being used for money laundering, with the most common money laundering method being the banks.[64]
Roman Sterlingov was arrested on 27 April 2021 for allegedly laundering about 1.2 million BTC or US$336 million. According to reports from IRS Criminal Investigation, Sterlingov was the principal operator of a Cryptocurrency tumbler Bitcoin Fog, launched in 2011.[65]
In a Ponzi scheme using bitcoins, the Bitcoin Savings and Trust promised investors up to 7% weekly interest, and raised at least 700,000 bitcoins from 2011 to 2012.[66] In July 2013, the U.S. Securities and Exchange Commission charged the company and its founder in 2013 "with defrauding investors in a Ponzi scheme involving bitcoin".[66]