Bitcoin mining protocol
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 cryptocurrency wallet software. Transactions are recorded into a distributed, replicated public database known spil the blockchain, with overeenstemming achieved by a proof-of-work system called mining. The protocol wasgoed designed ter 2008 and released ter 2009 spil 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 fundament, and knots can leave and rejoin the network at will. Upon reconnection, a knot downloads and verifies fresh blocks from other knots to accomplish its local copy of the blockchain.  [Two]
A bitcoin is defined by a sequence of digitally signed transactions that began with the bitcoin’s creation, spil a block prize. The possessor of a bitcoin transfers it by digitally signing it overheen to the next proprietor using a bitcoin transaction, much like endorsing a traditional handelsbank 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. [Trio]
Albeit it is possible to treat bitcoins individually, it would be unwieldy to require a separate transaction for every bitcoin ter a transaction. Transactions are therefore permitted to contain numerous inputs and outputs, [Four] [ better source needed ] permitting bitcoins to be split and combined. Common transactions will have either a single input from a larger previous transaction or numerous inputs combining smaller amounts, and one or two outputs: one for the payment, and one returning the switch, if any, to the sender. Any difference inbetween the total input and output amounts of a transaction goes to miners spil a transaction toverfee. 
To form a distributed timestamp server spil a peer-to-peer network, bitcoin uses a proof-of-work system. [Two] This work is often called bitcoin mining. The signature is discovered rather than provided by skill. [Five] This process is energy intensive.  Tens unit can consume more than 90% of operating costs for miners.  A gegevens center ter China, planned mostly for bitcoin mining, is expected to require up to 135 megawatts of power. 
Requiring a proof of work to provide the signature for the blockchain wasgoed Satoshi Nakamoto’s key innovation. [Five] 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 te inverse proportion to the difficulty target, a hash can always be verified by executing a single round of dual 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 onverdraagzaam. Once the hashing has produced a valid result, the block cannot be switched without redoing the work. Spil straks blocks are chained after it, the work to switch the block would include redoing the work for each subsequent block.
Majority overeenstemming te bitcoin is represented by the longest chain, which required the greatest amount of effort to produce. If a majority of computing power is managed by fair knots, the fair chain will grow fastest and outpace any contesting 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 fair knots. The probability of a slower attacker catching up diminishes exponentially spil subsequent blocks are added. [Two]
To compensate for enlargening hardware speed and varying rente te running knots overheen time, the difficulty of finding a valid hash is adjusted toughly every two weeks. If blocks are generated too quickly, the difficulty increases and more hashes are required to make a block and to generate fresh bitcoins. [Two]
Bitcoin mining is a competitive endeavor. An “arms wedren” has bot observed through the various hashing technologies that have bot used to mine bitcoins: basic CPUs, high-end GPUs common ter many gaming computers, FPGAs and ASICs all have bot used, each reducing the profitability of the less-specialized technology. Bitcoin-specific ASICs are now available.  Spil bitcoins become more difficult to mine, laptop hardware manufacturing companies have seen an increase te sales of high-end products. [Ten]
Computing power is often bundled together or “pooled” to reduce variance ter miner income. Individual mining equipments often have to wait for long periods to confirm a block of transactions and receive payment. Ter 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. 
Bitcoin gegevens centers choose to keep a low profile, are dispersed around the world and tend to cluster around the availability of cheap electrical play. 
Energy consumption Edit
Ter 2013, Mark Gimein estimated electrical play use to be about 40.9 megawatts (982 megawatt-hours a day).  Ter 2014, Hass McCook estimated 80.7 megawatts (80,666 kW).  Spil of 2015, The Economist estimated that even if all miners used modern facilities, the combined tens unit consumption would be 166.7 megawatts (1.46 terawatt-hours vanaf year).  Te October 2017 it wasgoed estimated that the total energy use of bitcoin mining wasgoed overheen 634 megawatts (20 TWh/year).  [ better source needed ]
Verslaggever Matt O’Brien opined that it is not evident whether bitcoin is lowering transaction costs, since the costs are transformed into pollution costs, which he characterizes spil “environmental spillovers on everyone else, or what economists call negative externalities.” 
To lower the costs, bitcoin miners have set up te places like Iceland where geothermal energy is cheap and cooling Arctic air is free.  Chinese bitcoin miners are known to use hydroelectric power ter Tibet to reduce electrical play costs. 
A rough overview of the process to mine bitcoins is: [Two]
- Fresh transactions are broadcast to all knots.
- Each miner knot collects fresh transactions into a block.
- Each miner knot works on finding a proof-of-work code for its block.
- When a knot finds a proof-of-work, it broadcasts the block to all knots.
- Receiving knots validate the transactions it holds and accept only if all are valid.
- Knots express their acceptance by moving to work on the next block, incorporating the hash of the accepted block.
Mined bitcoins Edit
By convention, the very first transaction ter a block is a special transaction that produces fresh bitcoins wielded by the creator of the block. This is the incentive for knots to support the network.  It provides the way to stir fresh bitcoins into circulation. The prize for mining halves every 210,000 blocks. It commenced at 50 bitcoin, dropped to 25 ter late 2012 and to 12.Five bitcoin ter 2016. [Legal] This halving process is programmed to proceed for 64 times before fresh coin creation ceases. [Eighteen]
Various potential attacks on the bitcoin network and its use spil a payment system, real or theoretical, have bot considered. The bitcoin protocol includes several features that protect it against some of those attacks, such spil unauthorized spending, dual spending, forging bitcoins, and tampering with the blockchain. Other attacks, such spil theft of private keys, require due care by users. [Nineteen]      
Unauthorized spending Edit
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 fresh possessor of the bitcoin. Eve observing the transaction might want to spend the bitcoin Bob just received, but she cannot sign the transaction without the skill of Bob’s private key. 
Dual spending Edit
A specific problem that an internet payment system vereiste 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 straks sent the same bitcoin to Bob. The bitcoin network guards against double-spending by recording all bitcoin transfers ter a ledger (the blockchain) that is visible to all users, and ensuring for all transferred bitcoins that they toevluchthaven’t bot previously spent.  : Four
Wedloop attack Edit
If Eve offers to pay Alice a bitcoin te 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 wedloop attack, since there is a wedstrijd which transaction will be accepted very first. Alice can reduce the risk of wedstrijd attack stipulating that she will not supply the goods until Eve’s payment to Alice shows up te the blockchain. 
A variant wedren attack (which has bot called a Finney attack by reference to Ridderzaal 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 attempts 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, te which case the payment to Alice will be rejected. Spil with the plain wedren attack, Alice can reduce the risk of a Finney attack by waiting for the payment to be included te the blockchain. 
History modification Edit
Each block that is added to the blockchain, embarking with the block containing a given transaction, is called a confirmation of that transaction. Ideally, merchants and services that receive payment ter bitcoin should wait for at least one confirmation to be distributed overheen the network, before assuming that the payment wasgoed done. The more confirmations that the merchant waits for, the more difficult it is for an attacker to successfully switch sides the transaction te a blockchain—unless the attacker controls more than half the total network power, te which case it is called a 51% attack. 
Deanonymisation of clients Edit
Deanonymisation is a strategy te gegevens mining ter which anonymous gegevens is cross-referenced with other sources of gegevens to re-identify the anonymous gegevens source. Along with transaction graph analysis, which may expose connections inbetween bitcoin addresses (pseudonyms), [Nineteen]  there is a possible attack  which linksaf 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 attack makes use of bitcoin mechanisms of relaying peer addresses and anti-DoS protection. The cost of the attack on the total bitcoin network is under €1500 vanaf month. 
Each miner can choose which transactions are included te or exempted from a block.  A greater number of transactions ter a block does not equate to greater computational power required to solve that block. 
Upon receiving a fresh transaction a knot voorwaarde validate it: ter particular, verify that none of the transaction’s inputs have bot previously spent. To carry out that check the knot needs to access the blockchain. Any user who does not trust his network neighbors, should keep a utter local copy of the blockchain, so that any input can be verified.
Spil noted te Nakamoto’s whitepaper, it is possible to verify bitcoin payments without running a utter network knot (simplified payment verification, SPV). A user only needs a copy of the block headers of the longest chain, which are available by querying network knots until it is apparent that the longest chain has bot obtained. Then, get the Merkle branch linking the transaction to its block. Linking the transaction to a place te the chain demonstrates that a network knot has accepted it, and blocks added after it further establish the confirmation. 
While it is possible to store any digital opstopping te the blockchain, the larger the transaction size, the larger any associated fees become.  Various items have bot embedded, including URLs to child pornography, an ASCII kunst picture of Ben Bernanke, material from the Wikileaks cables, prayers from bitcoin miners, and the original bitcoin whitepaper. 
The use of bitcoin by criminals has attracted the attention of financial regulators, legislative bods, law enforcement, and the media.  The FBI ready an intelligence assessment,  the SEC has issued a pointed warning about investment schemes using virtual currencies,  and the U.S. Senate held a hearing on virtual currencies te November 2013. 
Several news outlets have asserted that the popularity of bitcoins hinges on the capability to use them to purchase illegal goods.   Te 2014, researchers at the University of Kentucky found “sturdy evidence that pc programming enthusiasts and illegal activity drive rente ter bitcoin, and find limited or no support for political and investment motives.” 
Black markets Edit
A CMU researcher estimated that te 2012, Four.5% to 9% of all transactions on all exchanges ter the world were for drug trades on a single dark web drugs market, Silk Road.  Child pornography,  murder-for-hire services,  and weapons  are also allegedly available on black market sites that sell te bitcoin. Due to the anonymous nature and the lack of central control on thesis markets, it is hard to know whether the services are real or just attempting to take the bitcoins. 
Several deep web black markets have bot shut by authorities. Ter October 2013 Silk Road wasgoed shut down by U.S. law enforcement    leading to a short-term decrease te the value of bitcoin.  Ter 2015, the founder of the webpagina wasgoed sentenced to life ter prison.  Alternative sites were soon available, and ter early 2014 the Australian Broadcasting Corporation reported that the closure of Silk Road had little influence on the number of Australians selling drugs online, which had actually enlargened.  Te early 2014, Dutch authorities closed Utopia, an online illegal goods market, and seized 900 bitcoins.  Ter late 2014, a snaak police operation witnessed European and American authorities seize bitcoins and close 400 deep web sites including the illicit goods market Silk Road Two.0.  Law enforcement activity has resulted ter several convictions. Te December 2014, Charlie Shrem wasgoed sentenced to two years te prison for indirectly helping to send $1 million to the Silk Road drugs webpagina,  and te February 2015, its founder, Ross Ulbricht, wasgoed convicted on drugs charges and faces a life sentence. 
Some black market sites may seek to steal bitcoins from customers. The bitcoin community branded one webpagina, Sheep Marketplace, spil a scam when it prevented withdrawals and shut down after an alleged bitcoins theft.  Ter a separate case, escrow accounts with bitcoins belonging to patrons of a different black market were hacked ter early 2014. 
According to the Internet See Foundation, a UK-based charity, bitcoin is used to purchase child pornography, and almost 200 such websites accept it spil payment. Bitcoin isn’t the foot way to purchase child pornography online, spil Troels Oertling, head of the cybercrime unit at Europol, states, “Ukash and Paysafecard. have [also] bot used to pay for such material.” However, the Internet Witness Foundation lists around 30 sites that exclusively accept bitcoins.  Some of thesis sites have shut down, such spil a deep web crowdfunding webstek that aimed to fund the creation of fresh child porn.  [ better source needed ] Furthermore, hyperlinks to child porn websites have bot added to the blockchain spil arbitrary gegevens can be included when a transaction is made.  
Malware stealing Edit
Some malware can steal private keys for bitcoin wallets permitting the bitcoins themselves to be stolen. The most common type searches computers for cryptocurrency wallets to upload to a remote server where they can be cracked and their coins stolen.  Many of thesis also loom keystrokes to record passwords, often avoiding the need to crack the keys.  A different treatment detects when a bitcoin address is copied to a clipboard and quickly substitutes it with a different address, tricking people into sending bitcoins to the wrong address.  This method is effective because bitcoin transactions are irreversible.  : 57
One virus, spread through the Pony botnet, wasgoed reported ter February 2014 to have stolen up to $220,000 te cryptocurrencies including bitcoins from 85 wallets.  Security company Trustwave, which tracked the malware, reports that its latest version wasgoed able to steal 30 types of digital currency. 
A type of Mac malware active te August 2013, Bitvanity posed spil a vanity wallet address generator and stole addresses and private keys from other bitcoin client software.  A different trojan for macOS, called CoinThief wasgoed reported te February 2014 to be responsible for numerous bitcoin thefts.  The software wasgoed hidden ter versions of some cryptocurrency apps on Download.com and MacUpdate. 
Many types of ransomware request payment te bitcoin.   One program called CryptoLocker, typically spread through legitimate-looking email attachments, encrypts the hard drive of an infected rekentuig, then displays a countdown timer and requests a ransom te bitcoin, to decrypt it.  Massachusetts police said they paid a Two bitcoin ransom te November 2013, worth more than $1,300 at the time, to decrypt one of their hard drives.  Bitcoin wasgoed used spil the ransom medium te the WannaCry ransomware.  One ransomware variant disables internet access and requests credit card information to restore it, while secretly mining bitcoins. 
Unauthorized mining Edit
Ter June 2011, Symantec warned about the possibility that botnets could mine covertly for bitcoins.  Malware used the parallel processing capabilities of GPUs built into many modern movie cards.  Albeit the average PC with an integrated graphics processor is virtually futile for bitcoin mining, ems of thousands of PCs laden with mining malware could produce some results. 
Ter mid-August 2011, bitcoin mining botnets were detected, [Sixty nine] and less than three months zometeen, bitcoin mining trojans had infected Mac OS X. 
Te April 2013, electronic sports organization E-Sports Entertainment wasgoed accused of hijacking 14,000 computers to mine bitcoins, the company zometeen lodged the case with the State of Fresh Jersey. 
German police arrested two people ter December 2013 who customized existing botnet software to perform bitcoin mining, which police said had bot used to mine at least $950,000 worth of bitcoins. 
For four days ter December 2013 and January 2014, Yahoo! Europe hosted an ad containing bitcoin mining malware that infected an estimated two million computers.  The software, called Sefnit, wasgoed very first detected ter mid-2013 and has bot bundled with many software packages. Microsoft has bot removing the malware through its Microsoft Security Essentials and other security software. 
Several reports of employees or students using university or research computers to mine bitcoins have bot published. 
Money laundering Edit
Bitcoins may not be ideal for money laundering, because all transactions are public.  Authorities, including the European Banking Authority  the FBI,  and the Financial Activity Task Force of the G7  have voiced concerns that bitcoin may be used for money laundering. Ter early 2014, an technicus of a U.S. bitcoin exchange, Charlie Shrem, wasgoed arrested for money laundering.  Subsequently, he wasgoed sentenced to two years te prison for “aiding and abetting an unlicensed money transmitting business”.  A report by UK’s Treasury and Huis Office named “UK national risk assessment of money laundering and terrorist financing” (2015 October) found that, of the twelve methods examined te the report, bitcoin carries the lowest risk of being used for money laundering, with the most common money laundering method being the banks. 
Ponzi scheme Edit
Te a Ponzi scheme that utilized bitcoins, The Bitcoin Savings and Trust promised investors up to 7 procent weekly rente, and raised at least 700,000 bitcoins from 2011 to 2012.  Te July 2013 the U.S. Securities and Exchange Commission charged the company and its founder te 2013 “with defrauding investors te a Ponzi scheme involving bitcoin”.  Te September 2014 the judge fined Bitcoin Savings &, Trust and its holder $40 million for operating a bitcoin Ponzi scheme. 
There have bot many cases of bitcoin theft.  One way this is accomplished involves a third party accessing the private key to a victim’s bitcoin address,  or of an online wallet.  If the private key is stolen, all the bitcoins from the compromised address can be transferred. Te that case, the network does not have any provisions to identify the thief, block further transactions of those stolen bitcoins, or terugwedstrijd them to the legitimate possessor. 
Theft also occurs at sites where bitcoins are used to purchase illicit goods. Ter late November 2013, an estimated $100 million ter bitcoins were allegedly stolen from the online illicit goods marketplace Sheep Marketplace, which instantly closed.  Users tracked the coins spil they were processed and converted to metselspecie, but no funds were recovered and no culprits identified.  A different black market, Silk Road Two, stated that during a February 2014 hack, bitcoins valued at $Two.7 million were taken from escrow accounts. 
Sites where users exchange bitcoins for metselspecie or store them ter “wallets” are also targets for theft. Inputs.io, an Australian wallet service, wasgoed hacked twice te October 2013 and lost more than $1 million te bitcoins.  Te late February 2014 Mt. Gox, one of the largest virtual currency exchanges, filed for bankruptcy ter Tokyo amid reports that bitcoins worth $350 million had bot stolen.  Flexcoin, a bitcoin storage specialist based ter Alberta, Canada, shut down on March 2014 after telling it discovered a theft of about $650,000 ter bitcoins.  Poloniex, a digital currency exchange, reported on March 2014 that it lost bitcoins valued at around $50,000.  Te January 2015 UK-based bitstamp, the third busiest bitcoin exchange globally, wasgoed hacked and $Five million ter bitcoins were stolen.  February 2015 eyed a Chinese exchange named BTER lose bitcoins worth almost $Two million to hackers. 
A major bitcoin exchange, Bitfinex, wasgoed hacked and almost 120,000 bitcoins (around $60m) wasgoed stolen te 2016. Bitfinex wasgoed coerced to suspend its trading. The theft is the 2nd largest bitcoin heist everzwijn, dwarfed only by Mt. Gox theft te 2014. According to Forbes, “All of Bitfinex’s customers. will stand to lose money. The company has announced a haircut of 36.067% across the houtvezelplaat.”