Decentralized networks require a method to achieve consensus, or agreement, among a majority of participants in the network about the validity of transactions without those participants necessarily knowing or trusting each other. Nakamoto consensus is the algorithm proposed by Satoshi Nakamoto to achieve this trustless consensus among participants in the Bitcoin network.
Critical to Nakamoto consensus is the idea of Proof of Work (PoW). Bitcoin's PoW protocol creates an economic disincentive (i.e. cost) for spamming or attacking the Bitcoin network by making it expensive to mine Bitcoin. This cost is due to the "lottery" system by which Bitcoin miners propose new blocks and earn block rewards.
All of the active miners in the network are continuously using electricity to perform computations with the hope of being the first miner to find the nonce that solves a cryptographic puzzle. The probability of any single miner finding a given nonce first is equal to the percentage of the total network mining power - (also called "hash power") - that they are contributing. For example, a miner who has 10% of the total network hash power has a 10% chance of being first to find a nonce.
The reason that being first to find the nonce is important is because finding the nonce gives the miner the chance to propose a new block to be added to the blockchain. The block is then propagated by the miner to the other miners across the network who check that all of the transactions in the block are valid. If the majority of miners agree that the block is valid, it is added to the blockchain and the miners continue building on that chain by adding future blocks to the end of it. Contained within each block is one extra transaction, called the block reward, which gives newly minted coins and transaction fees to the block proposer. The block reward is the only way for miners to directly profit from mining.
This block selection process prevents attacks and spam by making it economically wasteful for the malicious actor unless said actor controls a majority of the network's hash power. In other words, an attacker who controls 49% of the network's hash power can be dishonest by including invalid transactions such as double spend transactions in the blocks they propose, but over time the 51% of miners who remain honest will continue adding blocks to the blockchain proposed by other honest miners, while leaving out all of the blocks proposed by the attacker. As a result, the attacker's invalid transactions and block rewards won't be included in the longest chain with the greatest proof of work, so the entirety of the cost of electricity to mine during that time will be a loss.
On the other hand, if a malicious actor does control 51% or more of the total network hash power, they will be able to mine the longest chain with the greatest accumulated proof of work, allowing them to keep the block rewards and include invalid transactions. This is called a 51% attack. Apart from the cost of a failed attempt at a 51% attack, the other disincentive for miners to make this attempt is that it would cause the network's value to crash as users realize that invalid transactions have been or can be included. That means that the attacker would spend a lot of money on electricity in order to control the network, while simultaneously devaluing the network. Therefore, the most logical reason to attempt a 51% attack is not to control the blockchain for personal enrichment, but rather to destroy the blockchain network entirely.
In summary, Nakamoto consensus incorporates proof of work along with a "lottery" block selection process in order to make it costly to mine Bitcoin and to disincentivize spam and attacks on the network.
The first "hash war" begins with the Bitcoin Cash network
Two camps, called ABC and SV, disagree about changes to the Bitcoin Cash protocol, causing a hard fork. Actors from the SV camp state publicly that they will attempt to attack and destabilize the ABC chain to make it unusable by mining it maliciously with 51% or more of the total hash power. This is considered the first major challenge of Nakamoto consensus
Satoshi Nakamoto publishes the Bitcoin whitepaper
In the whitepaper, Nakamoto proposes the block selection mechanism and proof of work mechanism that will be used in Bitcoin to incentivize honest miners and make Bitcoin trustless.
Bitcoin: A Peer-to-Peer Electronic Cash System
Let's take a crack at understanding distributed "consensus"
Nakamoto Consensus - nakamo.to - Medium
What is Nakamoto Consensus? Complete Beginner's Guide
Documentaries, videos and podcasts
Andreas M. Antonopoulos: "Consensus Algorithms, Blockchain Technology and Bitcoin"
July 10, 2015
- BitcoinBitcoin is a cryptocurrency and a digital payment system invented by an unknown programmer, or a group of programmers, under the name Satoshi Nakamoto. It was released as open-source software in 2009.
- CryptocurrencyA cryptocurrency (or crypto currency) is a digital asset designed to work as a medium of exchange using cryptography to secure the transactions and to control the creation of additional units of the currency. Cryptocurrencies are a subset of alternative currencies, or specifically of digital currencies.
- BlockchainA blockchain is an append-only digital ledger storing a set of time-ordered transactions grouped in blocks that are linked together using cryptographic hashes.
- Cryptographic hash functionMathematical hash function that is cryptographically secure and has the properties of collision resistance, hiding, and puzzle friendliness
- Byzantine fault toleranceByzantine fault tolerance is a property of a distributed system such that it can tolerate components of a system failing in arbitrary ways, processing incorrect states, rather than simply stopping or crashing.