(Please note that ads placed on this site were not pre-selected. Please use caution when following unfamiliar links.)
This section is for info on different blockchain consensus mechanisms. Glossary at bottom of page.
What is Consensus?
Consensus is the process that allows all user nodes to agree on the state of the blockchain. Calculation processes allow for the secure validating and updating of a blockchain ledger. Usually performed by decentralized user nodes. The more extensive and widely distributed the nodes (participants), the lower the probability of collusion and corruption.
Consensus is important because security of the ledger dictates that participants/nodes agree on the state of the ledger.
Most mechanisms are variations of Proof of Work or Proof of Stake consensus, so I suggest understanding these two well, first.
Determining which consensus mechanism is preferable often comes down to a trilemma tradeoff between security, scalability, and decentralization. The best systems attempt to maximize each of these elements.
The "proof" is showing that each validator/miner/staker/participant/etc. is invested in the network; thus has aligned incentives to not corrupt the network.
There is a glossary section at the end of this section.
Proof of Work (PoW):
The following explanation for Proof of Work consensus will largely be in reference to the SHA-256 version that Bitcoin uses. However, there are many Proof of Work derivatives used by other cryptocurrencies, that follow somewhat different rules.
The Chill Explanation for Proof of Work: A bunch of different people, from around the world, use their computers to calculate that everything happening in the system is correct. Participants get compensated/rewarded for using the energy and bandwidth (“work”) of their computers.
A miner checks that transactions are valid (non malicious, not double spent, etc.).
If valid, the miner loads those transactions into a block of predetermined size.
The miner then attempts to generate a correct hash id for that block. This involves a lot of energy expended to find the correct hash.
If the correct hash is found, that miner broadcasts the result to the rest of the nodes in the network to confirm the block contains valid transactions an hash id.
Once the majority of nodes add this new block to their copy of the blockchain ledger (come to consensus that the block is valid by building the next block after it), the miner who built it receives the block reward (currency, fees, etc.)
Now, let’s get gritty...
Proof of Work- Consensus mechanism that involves mining blocks, using a designated hashing algorithm. The process of mining is the “work” (energy consumption) being proven.
Mining Blocks-
A miner/participant/validator takes thousands of transactions that are unconfirmed/outstanding and builds a candidate block of transactions to be verified against the system rules. This candidate block also includes:
The header (id) from the previous block, which helps maintain links, forming the blockchain.
A nonce (random numbers added to the data to achieve the desired difficulty target).
The miner’s BTC address for receiving the potential reward amount.
Once a candidate block is constructed, the miner uses the SHA-256 hashing algorithm to calculate the correct hash (64 character long) id of that block data.
The SHA-256 hashing algorithm is deterministic (not random), meaning that if you run the SHA-256 computer command on the word "Cat" it will produce a very specific 64 character hash id for the word "Cat" (data). However, if you slightly change the data to read "CaT", then the 64 character hash id will be entirely different than the one was derived from "Cat".
The tricky part of consensus that involves intensive amounts of brute force computing "work". This work is the process of adding all sorts of nonce options to the block data and hashing each option, until the desired difficulty target (number of leading zeros on the hash id) is met. This would be like adding a series of random numbers to the word "Cat" (i.e. "Cat9903412") and hashing it with SHA-256 in hopes that it will yield the difficulty target you want in the hash id.
"Proof" of all the work being done is when a miner shows their valid hash, and the nonce used to produce it.
If the miner obtains the stipulated difficulty target, then their computer boradcasts the correct hash id to all the other nodes in the network so those nodes can begin to verify that block id, then compile and hash out the next valid block id.
Video explanation of the interactive program is below.
Race Conditions-
When a miner receives a new block, they know that they lost the race for the block they were working on, and it’s time to start racing to mine the next block.
If more than one miner discovers the correct hash id and broadcasts the result, then a (non-contentious) fork is happening in the network, as new blocks are being added to each respective previous correct block. This becomes a relay race, where ultimately the longest chain wins; is accepted by the network as the winning blockchain. For this reason, most Proof of Work systems stipulate that the block reward cannot be spent by the miner who won it, until a certain number of other blocks have been mined on top of it.
The power of a miner's CPU, GPU, or ASIC determines the number of hashes per second their computer/node can run, thus is positively correlated to that miner's ability to calculate the correct nonce that will result in the correct hash id, which wins them the block reward. The Bitcoin network processes hundreds of quadrillions (peta) hashes per second, and it still takes an average of 10 minutes to produce a valid block.
Network bandwidth is also an economic factor in mining (potential constraint), because if a miner has poor bandwidth relative to other miners, it puts them at a disadvantage in winning the race to be the validated block.
Corruption-
Blocks get built in a chain that can reference everything down to the past. It's difficult to corrupt the network because in order to take control of the network, a user would have to exactly reproduce every transaction of the blockchain, up to the current point in time, including software bugs. This is extremely time and energy prohibitive. Thus, the more established (longer) the blockchain becomes, the more difficult it is to attack.
Every user node (participant) includes every block ever mined, including the first (genesis) block Each block is kept as a constant in the code.Each node is able to independently verify every transaction on that blockchain.
The PoW consensus design is a huge deterrent for DDoS attacks, because a hacker would have to use an enormous amount of energy to overwhelm a widely distributed network of nodes.
Electricity and Security-
Mining uses a lot of electric power (work), thus the cost of electricity is an economic factor in mining (potential constraint).
More sustainable ways of harvesting energy (wind, solar, geothermal, hydroelectric, etc.) can help reduce the biggest argument against using Bitcoin.
Proof of Work uses the cost of electricity to underpin the security of the network. In order to participate, miners have to incur costs (energy), for the possibility of rewards (coins). This helps keep the system honest because if users spend money on energy, and play fair (using correct inputs to try and produce correct outputs), then users may be rewarded with money back. It doesn’t pay to cheat. It takes too much energy, just to end up with a non-verifiable hash/output.
There is incentive to comply with new consensus, because if a miner works against a new protocol agreement, they are essentially burning energy for nothing.
Halving and Inflation-
Inflation most often occurs when money supply growth outpaces economic growth. To help control inflation, many PoW currencies undergo a halving of block rewards, every few years (designated by a number of blocks that have been mined).
When block rewards are cut in half, half of the amount of that currency is being generated for total circulating supply. Decreasing the generated supply of any asset, while holding demand constant, will increase the value/price of that asset.
Limiting the supply of a currency helps to preserve its purchasing power; minimizing inflation by not allowing the over-printing or over-generation of a currency to decrease its value, relative to the goods and services it is purchasing.
Proof of Work miners make money when the revenue generated from mining a cryptocurrency exceeds the cost (electricity, hardware, etc.) of running the miners. Thus, when a halving takes place, there is half the amount of incentive for miners to mine blocks and support validating transactions in the network, often contributing to a short-run decrease in hashrate.
If not as many miners are are producing blocks (which generates more supply of a PoW cryptocurrency), then the supply decreases further, causing more of an increase in price/value of the given currency.
Eventually the price/value of the halved currency increases to a level that re-incentivizes miners mine blocks/validate the network; receive the block rewards that now have enough relative value to justify them running miners.
Use, Scale, and Capacity-
A secure transaction settlement takes time to verify, which affects scalability.If tons of everyday transactions (i.e. buying a cup of coffee) happen on a blockchain, then the capacity must be able to handle all those transactions.Or, many of these transactions can happen on overlay networks (with eventual settlement) which preserves the benefits of using the blockchain, without flooding the network.
“The best protocol doesn’t win. The protocol that’s good enough, and achieves network scale first, wins.” -Andreas Antonopoulos
Great video demo on how the hashing and mining simulator works:
Another link to hashing and mining simulator: https://andersbrownworth.com/blockchain/hash The video and simulator also give great demonstrations on the security of a PoW blockchain.
Great video on the more technical aspects of how Bitcoin's PoW works:
Proof of Stake (PoS):
Participants from around the world, stake money (usually by placing it in an escrow account) for the opportunity to use their computers to validate the network (calculate that everything happening in the system is correct).
Participants are often rewarded with more money if they are chosen to validate the network, and do so correctly. Participant's stake is often penalized if they are chosen to validate the network, and do so incorrectly. Thus, the amount of money (usually in the form of that network's native cryptocurrency) a participant stakes is their incentive to follow the rules and participate fairly, or else they loose some, or all, of what they staked, and can possibly loose opportunity to validate the network, in the future. The overall idea is that currency holders with the highest amount of value at stake, have the lowest incentive to corrupt the system.
Decentralization and Security-
If the required amount staked to validate in PoS is less expensive than processors used to competitively validate in PoW, then there is more incentive for participation in the network. The greater the number of diversely distributed participants/nodes/validators of the network, the less likely a collusion attack becomes.
Energy Use-
PoS uses less energy than PoW because users are not feverishly competing with computer power to validate the next block. Instead, they are chosen either deterministically (often based on the stake they place in escrow), or at random, to run software that validates the next block of transactions, to be added to the blockchain.
Hoarding-
This model tends to lend itself to stakers hoarding their holdings, instead of spending/using their coinage.
Rich Get Richer-
Although PoS saves on energy consumption, a big argument against it relates to the wealthiest participants in the network being the most likely chosen to make even more money by being selected as validators, thus earning the block reward.
The remainder of consensus algorithms discussed below are largely derivatives of PoW and PoS.
Delegated Proof of Stake (DPoS):
Just like Proof of Stake, but the participants in the network elect for certain nodes/delegates that they feel are trustworthy, to validate the network and possibly update network rules. Much like PoS, this model still gives the highest stakeholders the most control over how the network is run, however, these high stakeholders can play a more passive role when it comes to participation and decision making. Some examples of this model are BitShares, EOS, and Steemit.
Byzantine Fault Tolerance (BFT):
BFT is classically based on the Byzantine generals' problem, where there is a collection of Byzantine generals (nodes) that would have to agree on how to attack a city, in order to be successful. Coordination and commitment to the plan is crucial. Assuming the generals are distributed in different places surrounding the target location, there runs a risk of plan changes being tampered with by an enemy before being communicated to each general, or generals not agreeing to the plan.
BFT theory plays a huge role in how most consensus algorithms are designed. Byzantine fault tolerance represents conditions within distributed computing (blockchain is a distributed ledger system) where members of the distributed system (nodes/perticipants) may fail to behave properly, and there is imperfect information if a node has misbehaved.
In blockchain consensus, this is why it's important for validators to be called upon to determine if the next block given to them is correct/trustworthy.
Practical Byzantine Fault Tolerance (pBFT)-
Where less than 20 pre-selected and trusted validators determine consensus for the entire network.
Used by Hyperledger Fabric.
Federated Byzantine Fault Tolerance (fBFT)-
Consensus system where each node ("general") is called upon to establish truth for each of their respective chains.
Used by Stellar and Ripple.
BFT models often end up being more centralized; with a smaller collection of nodes ("generals") having control over the network. This can be secure, as long as those nodes are established as trusted representatives to validate the system. Fewer nodes participating in consensus usually implies more efficient validation, thus faster throughput and ability for the network to scale.
Proof of Activity:
The process starts as proof of work consensus, then moves into proof of stake consensus once a miner validates a block.
A miner uses a hashing function on their computer to come up with the correct hash for the current block. There are no nonces or transaction roots included in a block, just the block header and the miner's reward address. Then, a selected group of validating nodes sign off on a new block that is mined. The larger a node's stake, the more likely they are to be added to the trusted signing group. Mining rewards are split among the miner who hashed the correct block, and the nodes who signed it. Decred currently uses this model of consensus.
Proof of Authority:
Network consensus mechanism where a validator's identity and social capital (not financial capital) are at stake. This is a consensus model that lends itself to more transparency of the validators, and if they misbehave their reputation and ability to support the network is diminished. Favors validators with more established reputations.
Proof of Burn:
Consensus algorithm that involves PoW validators "burning" their stake by sending specified amounts of currency to unspendable "eater" addresses, in order to prove fidelity to the network and hopefully get rewarded with lifetime privlidges to validate the next block. Eater addresses are made at random so no one can determine the private key. By burning their holdings, miners are proving that they follow consensus rules with likely no reward in the short-run, in hopes of always having an option of pay-out, in the long run. Burners are not guaranteed to be selected to mine future blocks. Slimcoin and Counterparty run types of Proof of Burn consensus.
Proof of Capacity (PoC):
Proof of Capacity consensus happens in two main steps. Step 1) the miner's node plots all possible solutions to the hashing algorithm before the mining process even begins and stores a list of possible solutions on the mining node's hard drive. Thus, user nodes with more hard drive space can store more solution possibilities. Miners with more solution possibilities stored have better chances of matching the set difficulty target (required hash value)., thus have more chances in winning the mining reward. Step 2) the miner with the fastest plotted solution stored on their hard drive gets to be the next one to mine a block. Mining rights are determined based on a user node's extra hard drive space (instead of processing power, or stake). Burstcoin currently uses this method.
Proof of Elapsed Time (PoET):
Consensus mechanism where each node is assigned a random wait time; like placing them in a validator queue. The first node to finish its wait time gets validate the next block that is added to the blockchain. Most common in closed/permissioned blockchain networks, where all node representatives are known and trusted, because there is no other mechanism to ensure that participants have aligned incentives to protect the network. Invented by Intel and used in their Hyperledger Fabric.
Proof of Importance (PoI):
Consensus system where validators are selected based on a combination of three factors: 1) net transfers or total amount spent within a certain time frame, 2) vested amount of currency, and 3) being a node that is heavily connected with other nodes in the system. This is like a PoS system where hoarding is less incentivized because validators are also chosen based on their ability to facilitate transfers (use of the native currency). XEM currently uses this model.
Proof of Weight:
Mechanics are a lot like Proof of Stake, but where the validators are chosen by the "weight" (aligned incentives) they have with the network, outside of currency. For example, if there is a blockchain network that specializes in file storage and transfer, some of the biggest stakeholders in that network, that carry the most weight (thus have the greatest incentive to support the network), are the ones that store the most files, so they are given the first options to validate the network.
Ripple's Protocol Consensus Algorithm (RPCA):
Voting system that operates as a distributed agreement protocol, to determine proper order of transactions and if a transaction is valid. Each ledger is determined by a consensus of participants; not a miner building a block with the transactions they want.
There is not block reward incentive in RPCA. Many argue that this does not encourage enough decentralized participation.
Ripple's consensus process incurs minimal energy consumption, especially compared to PoW.
Ripple employs use of a "Unique Node List" to determine nodes that are trusted within the network, and thus can help build a candidate set of transactions to update the ledger with. When a trusted node sends in a transaction proposal that matches a transaction in the candidate set, that transaction receives one vote. This process continues for a specified amount of time, and if a transaction gets at least a 50% approval rating within this given amount of time, the transaction is then packaged into a new proposal. The new proposal is then distributed to trusted nodes and the process of voting on valid transactions continues, this time with an approval threshold of 60%. This process continues to 70%, then 80%. When 80% is reached, a ledger is considered valid, and the consensus process for that newest ledger is closed and added to the Last Closed Ledger, discarding any transactions found to be invalid. In each iteration, disputed transactions are disposed of until the initial 80% threshold is reached.
Even though Ripple has a relatively fast and efficient consensus protocol to run its network, this is done so at the price of increased centralization. This is often the case with consensus protocols; a trilemma tradeoff among speed, security, and centralization.
Litecoin and Dogecoin use the sCrypt hashing algorithm, as a Proof of Work alternative to Bitcoin's SHA-256 hashing algorithm.
The sCrypt algorithm is less energy intensive when it comes to miners validating blocks, which is what contributes to the faster block time, relative to SHA-256 cryptocurrencies, like Bitcoin. The sCrypt hashing algorithm requires kilohashes (thousands) and megahashes (millions) of hashes per second for miners to remain competitive at producing the next block, thus achieving the associated block reward. The SHA-256 hashing algorithm requires gigahashes (billions), terrahashes (trillions), and even petahashes (quadrillions) per second for miners to remain competitive. Critics of sCrypt site that, although faster, sCrypt is less secure- requiring less work to be proved in order to validate a block of transactions.
The sCrypt hashing algorighm was originally used in cryptography to deter large scale custom hardware (ASIC) attacks by requiring a large amount of memory to run the algorithm. The large memory requirements of sCrypt come from a large vector of bit strings that are generated as part of the hashing algorithm. Once the vector is generated, the elements of it are accessed in a pseudo-random order and combined to produce the derived key. A straightforward implementation would need to keep the entire vector in RAM so that it can be accessed as needed.
Because elements of the vector are generated algorithmically, each element can be generated on the fly, as needed- only storing one element in memory at a time and therefore cutting the memory requirements significantly. However, the generation of each element is intended to be computationally expensive, and the elements are expected to be accessed many times throughout the execution of the function. Thus there is a significant tradeoff in speed in order to get rid of the large memory requirements.
This time and memory tradeoff often exists in hashing algorithms: speed can be increased at the cost of using more memory, or memory requirements decreased at the cost of performing more operations and taking longer. The idea behind sCrypt is to deliberately make this tradeoff costly in either direction. Thus an attacker can use an implementation that doesn't require many resources (and can therefore be massively parallelized with limited expense) but runs very slowly, or use an implementation that runs more quickly but has very large memory requirements and is therefore more expensive to parallelize (carry out many computations simultaneously, usually by using an ASIC).
Even though many cryptocurrencies chose the sCrypt hashing algorithm due to its ASIC-resistant (memory intensive) nature, as of 2014, ASICS have been built to mine sCrypt based cryptocurrencies.
Bonus Concept: Direct Acyclic Graphs(DAGs)
This is a popular form of consensus for non-blockchain database structures. To send a transaction, a node must validate two other transactions that already took place. As more transactions are sent through the network, the system of checks and balances gets stronger. There are no transaction fees (i.e. gas) in a DAG network, outside of having to participate in proving past transactions. This models lends itself to running an asynchronous network because not all transactions are being validated at the same time, as is the case in a blockchain network. This model is designed to scale far beyond monetary transactions, by being a mechanism for interconnected devices within the Internet of Things (IoT). The graph itself looks like dots (validator nodes) with lines pointing to other dots, and all lines are pointing in the same direction; expanding the network. IOTA's Tangle uses this model.
Glossary:
Block Header-
Used to identify a particular block within an entire blockchain and is hashed repeatedly to create proof of work for mining rewards.
Consensus-
Process used in distributed computing systems to achieve overall agreement, thus system reliability. Nodes/participants agree on how to validate and maintain the system (ledger, in the case of blockchain).
Deadline-
The duration of time that must elapse since the last block was forged before a miner is allowed to forge a new block. If no one else has forged a block within this time, the miner can forge a block and claim the block reward.
Difficulty target-
Sets the number of bits (usually leading zeros) that must be present in the hash required to mine a given block. The lower the difficulty target, the harder it is to find the numbers. For example, if the difficulty target is to get two zeros at the front of the hash function, then you have to brute force run (“work”) as many attempts as it takes to produce a hash that leads with the two zeros.
Target is adjusted by the system to help ensure that blocks are mined within a certain time target; makes sure coins are being released into circulation, at the rate specified by the network.
The difficulty of the algorithm can be set to an arbitrary target, and the cumulative difficulty of a given chain is referred to as "chain weight".
Double Spend-
When a user conducts a transaction, then attempts to send the same coins to a second location, before the block with the first transaction is confirmed. When consensus is working optimally, a blockchain network will ignore the second transaction.
Double-spends are more easily conducted on networks with a fee market. For example, a user can purchase a new computer using their cryptocurrency (with relatively low fees attached), walk out of the store with the new computer, then quickly send that same cryptocurrency (with relatively higher fees attached) to another address they control. The transaction with the higher fees will likely be approved first, thus the merchant who accepted payment at the relatively lower fee will not get paid, and they lost out on the (now stolen) computer.
Fork-
(Non-contentious)- Race condition where Miner A and Miner B produce a valid block at approximately the same time; two competing blockchains are being propagated around the world (via P2P network nodes). When Miner C begins building a candidate block using the inputs (header) from Miner A’s block, then they are effectively voting for that received block, as the valid block; continuing the chain with Miner A’s block as the valid one; Miner B’s block is therefore losing. The chain that ends up longer (based on miners building new blocks on it) wins the race condition; the other blockchain is abandoned. Does not result in a different blockchain.
(Contentious)- Occurs when the network participants disagree on how to update the system. Usually begins as discussion within the development community, then is examined and tested (usually in a testnet/safe chain duplicate). Subject to participants in the system (those who run nodes of that blockchain), including developers, miners, exchanges, wallets, and merchants. Upgrading to a new consensus protocol becomes increasingly difficult over time, due to the former protocol being diversely and extensively ingrained in decentralized systems; harder and harder to pool all participants to officially change the entire network. Results in a different blockchain.
Halving-
To help control inflation, many cryptocurrencies undergo a halving of supply. Decreasing the generated supply of any asset, while holding demand constant, will increase the value/price of that asset.
Limiting the supply of a currency helps to preserve its purchasing power; minimizing inflation by not allowing the over-printing or over-generation of a currency to decrease its value, relative to the goods and services it is purchasing.
In Proof of Work blockchains, miners make money when the revenue generated from mining a cryptocurrency exceeds the cost (electricity, hardware, etc.) of running the miners. Thus, when a halving takes place, there is half the amount of incentive for miners to mine blocks and support validating transactions in the network, often contributing to a short-run decrease in hashrate.
If not as many miners are are producing blocks (which generates more supply of a PoW cryptocurrency), then the supply decreases further, causing more of an increase in price/value of the given currency.
Eventually the price/value of the halved currency increases to a level that re-incentivizes miners mine blocks/validate the network; receive the block rewards that now have enough relative value to justify them running miners.
Hash-
64 character long identification fingerprint for the block data, written in hexadecimal format. Takes a lot of energy to perform the number of hash operations needed to mine a block with a low difficulty target.
Header-
Unique id that is used to identify each block on a blockchain. In the Bitcoin network, the header is an 80 byte string, and is comprised of a 4 byte Bitcoin version number, 32 byte previous block hash, 32 byte merkle root, 4 byte timestamp of the block, 4 byte difficulty target for the block, and 4 byte nonce used by miners. The block header is hashed by altering the nonce value, until the desired difficulty target is achieved.
Hexadecimal-
Base 16 number system that simplifies how binary (base 2 number system) is represented.
Uses 0,1,2,3,4,5,6,7,8,9 and a,b,c,d,e,f = 16 characters
A represents 10
B represents 11
C represents 12
D represents 13
E represents 14
F represents 15
Ex. the number 231 would be represented as E7. E sixteens + 7 ones; (14*16) + 7; 224+7 = 231
Note- we commonly use a base 10 number system in everyday life (0-9).
Inflation-
Inflation most often occurs when money supply growth outpaces economic growth.
Latency-
The delay before data begins following an instruction for its transfer. Poor bandwidth causes latency issues. As block size increases, miners with poorer bandwidth are at a greater disadvantage. For example, propagating a 1mb block to 8 nodes takes a certain amount of time. Propagating an 8mb block to those same 8 nodes, takes 8 times as long.
Merkle Tree-
Binary tree where nodes store hashes of data, instead of storing the data itself.
Hashes are run on the main blocks of data to create the leaf nodes. Then leaf node data is combined and hashed to create parent nodes. Then parent nodes are combined and hashed to a single point of info, called the root node.
A change in any single piece of data will result in entirely different hashes. Thus if there are any discrepancies in data, this will be identifiable by different resulting root hashes.
Allows for efficient data verification across a network of peers because there is much less raw data that needs to be transmitted in order to verify that the given data is trusted.
In blockchain this allows a user to prove that a particular transaction was included in a block, by only following the block headers.
Miner-
A participant who uses their computing power to add a new block to the blockchain, and be compensated in that network's native currency, for doing so.
Node-
Network participant, often recognized by a computer that is running a full copy of a given blockchain network.
In most systems, a user must run a full node on their computer in order to participate in mining.
Nonce-
Random numbers added to the block header that, when rehashed, meets the difficulty target restrictions.. Finding the correct nonce is what finally makes a miners proof of work able to be validated.
Processors (CPU, GPU, ASIC)-
CPU (Central Processing Unit)- silicon-based microprocessor in charge of completing most of a computer's calculations. Often better at processing the most diverse and general computing tasks.
GPU (Graphical Processing Unit)- specialized type of silicon-based microprocessor that are often more powerful than CPUs, thus used for more data intensive applications. Often better at processing more focused and specific computing tasks.
ASIC (Application-Specific Integrated Circuit)- microchip designed to conduct a very specific instruction set, often very quickly. In the case of blockcahin mining, ASICs are made to specifically follow a given currency's hashing algorithm very quickly, in order to be the first to find the correct nonce that produces a hash id that matches the current difficulty target. CPUs and GPUs can also perform these hashes, but are often not specific/fast enough to be competitive with ASICs. Some PoW networks are designed to be ASIC resistant, in order to encourage more participants, thus security, within the network.
Reward-
Component added to beginning of every candidate block that pays the miner a certain amount (i.e. 25 BTC). So, if that miner properly mines the constructed block, they get a lot of money. If that block gets created (that miner wins the race to mine the block), then 25 new bitcoins (or other native currency) enter the system, in the form of that miner's reward. Reward is only granted to longest valid chain (see "fork" section).
In Bitcoin Core, you cannot spend your reward in less than 100 blocks, in order to ensure what the longest valid chain is.
When there are no more amounts of currency being produced with each new block, then the reward to validators often becomes the transaction fees present in that block. This gives incentive for validators to construct blocks of transactions that have higher fees attached to them.
Rules-
Software codes containing functions are used to evaluate block data for compliance to a system’s rules.
Example rules include:
Transactions must be properly signed
Transactions may not have been spent before
Outputs are properly formatted
Can’t spend mining rewards in less than 100 blocks
Miners can only pay themselves a reward at the correct rate for whatever block the network is at (i.e. 25 BTC reward, based on block number)
Bitcoin Core Implementation Guide, written in C++, contains functions that evaluate block data for Bitcoin’s rule compliance.
Segregated Witness (SegWit)-
Encompasses the idea that transaction signatures are no longer relevant data to maintain, once a transaction becomes part of an immutable block. Once a transaction is immutable, the signature data can be removed ("pruned"), and other witnesses of the blockchain (usually nodes) can still derive the current state. Signatures represent a large percentage of most transactions, so SegWit represents potential savings in disk usage and syncing time.
SHA-256-
Computer command that takes data input of any size and mixes it up, to produce a fixed output that is a 256 bit long hash (64 characters long). Output appears random, but is in fact, deterministic (same inputs will always generate the same output); can be used to proof a data set.
If only one bit (piece of data) is changed (i.e. “HELLO” to “HELLo”), then the hash/fingerprint/outcome can be TOTALLY different (i.e. A$GN009&^ to J7^65kU00PL7). This allows users to “fingerprint” data, generating a unique id for PDFs, software downloads, statements, etc.
History- originally developed to prevent spammers on message boards. The extra effort it took to compute a hash for their post was worth it to legitimate participants, but not to spammers.
. Validation-
When full nodes in the network examine a candidate block to determine if transaction and block rules are met. Validators use their computers to verify that transactions are legal (not malicious, double spends etc). Validation of transactions is initially handled by miners before the transactions are added to the block, then once more by the remainder of the validators when a block winner is picked. If Consensus is reached, then the network successfully moves on to the next block.
In many networks, a participant can be a validator by running a full node (copy of the ledger).
The more copies (full nodes) there are, the more secure the ledger is, because if one or many nodes are corrupt or go offline, there are still many nodes that have a correct copy.
Many participants who run a full node often participate in mining, staking, etc. as an extra incentive for maintaining a copy of the ledger.
Zero Confirmation Transactions (0 Conf)-
When a transaction on the network occurs instantly. This is usually most feasible when there are no fee markets on the network; gas a user can pay to expedite the processing of their transaction.
If there is a fee market, then a user can more easily double-spend by making a transaction with a given amount of money at a lower fee, then quickly spending that same money somewhere else with a higher fee attached (thus elevating the transaction's position in the meme pool for processing).
If there is no fee market (no hierarchy in transaction processing; thus transactions are first come-first served), then a user is less able to double-spend because their second transaction will automatically be rejected by the network.