The relation between cryptocurrencies and a blockchain is that cryptocurrencies exist on a blockchain. Users can log-in to their blockchain addresses (via private keys) to send and receive crypto.
Any blockchain has two kinds of cryptocurrencies, native (issued on the same blockchain) and non-native (transferred from other blockchains). Native cryptocurrencies can be used as transaction fees to send and receive any crypto that is present on the blockchain.
The best equivalent is a truck and diesel. Just like the diesel helps the truck move (i.e., change location), similarly to add any data on the blockchain, you need to spend its native crypto. If you are moving diesel (native crypto), you also need to spend some diesel to move the truck. Whereas, if you are moving gasoline/petrol, you need some diesel anyways to run the truck.
Native vs Non-Native Crypto in a Blockchain
How Is The Native Crypto Spent in a Blockchain? Transaction Fees
The fuel required to run a blockchain is called “gas” in many blockchains like Ethereum, Base, BNB, Optimism, Arbitrum and others. There are 6 broad stages by which a blockchain works and all of them are depicted in the infographic below.
Every base layer (layer-1) blockchain has its native crypto like Ethereum has ETH, Bitcoin has BTC, Cardano has ADA, Solana has SOL and many others. This native token is used to pay the transaction validators whose job is to make sure that no false transaction is added on the blockchain.
The process takes place in 7 steps:
User initiates a transaction.
Transaction gets deposited into a memory pool (mempool) and validators pick transactions from this pool In some cases, the blockchain client (software) assigns it to them.
They run computations to make sure that the transaction is valid.
Transaction is then added to a block.
Once found valid, this is broadcasted to a large number of validators who take note of the transaction.
It is then finalized when at least a few number of blocks are added to the blockchain.
Bitcoin Runes are a new token standard for the Bitcoin blockchain that helps create new cryptocurrencies from the UTXOs left after transactions. The token standard is an improvement over BRC-20 which is based on Ordinal Theory.
Bitcoin Runes were launched with the 840,000th block on the Bitcoin blockchain which also marked the 4th Bitcoin Halving.
Please note that Bitcoin Runes are different from BRC-20 tokens standards which were dependent on the Ordinals Theory and rely on the Taproot Upgrade.
Table of Contents
Casey Rodarmor’s Motive Behind Runes
The main motive of creating Bitcoin Runes was that it was an upgrade over the BRC-20 protocol. Also, runes severely help in the management of UTXOs which earlier went to junk.
Casey launched Bitcoin Runes with the 840,000th block in the Bitcoin blockchain which was the last block of the previous halving cycle and executed the 4th Bitcoin Halving. The work on Bitcoin Runes was started as far as September 2023.
Casey Rodarmor who was behind the creation of Bitcoin Ordinals based on the Ordinal Theory.
How do Bitcoin Runes Work?
Bitcoin Runes are created as a result of Unspent Transaction Outputs (UTXOs). These are the “change” that gets left behind when a certain transaction is successful. Think of it as the $2 note you get back when you buy something worth $18 and pay with a $20 note.
When a transaction is initiated, you typically send an entire UTXO to pay for the network fees. Now a portion of this UTXO is spent and a new UTXO is sent back to you. Runes are made when the original UTXO is marked with the Rune’s name, Symbol, Decimals and Total Supply.
Then an OP_RETURN function gives the output which is in the form of Runes.
Previously sent UTXOs were almost useless and had no further use.
Technical Details about Bitcoin Runes
Basic Concepts:
Rune ID: This is a numeric identifier unique to each Rune.
Output: In the context of a transaction, this refers to the specific place where Rune tokens are directed.
Amount: This specifies how many Rune tokens are being transferred.
Transaction Mechanics:
OP_RETURN Output: Every action involving Runes—whether creating new ones or transferring existing ones—is recorded using an OP_RETURN output in a Bitcoin transaction. This output includes necessary information like the rune’s divisibility, name, and other metadata. Casey Rodarmor went to call Runes as simple OP_RETURN thing.
Divisibility: Each Rune can be split into smaller parts, up to 38 decimal places. For example, a typical divisibility setting might be 18 decimal places, similar to many Ethereum-based ERC-20 tokens.
Max Supply: The total amount of Rune tokens is capped and represented by a 128-bit unsigned integer. The maximum value is extraordinarily large, allowing for a vast quantity of tokens when considered with their divisibility.
UTXO and Token Tracking:
UTXO (Unspent Transaction Output): The Rune protocol uses this Bitcoin mechanism to manage the supply of tokens. Unlike systems that link tokens directly to wallet addresses, Runes maintains its token supply within individual UTXOs. This means each UTXO contains information about the quantity of Runes it represents, independent of any wallet address.
Token Transfer: To move Runes, a transaction with an OP_RETURN output specifies how tokens are transferred from one UTXO to another. This system ensures the balance of tokens can be tracked across transactions without associating them directly with the personal identities of users.
How are Bitcoin Runes Created?
Runes are Created with Runestones.
Bitcoin Runes are created when a message is inserted in the genesis UTXO that the resultant UTXO is to be converted into a RUNE. This message is called “Runestone”.
Runestones are Etched on a UTXO
The act of inserting a message into a runestone is called as “ETCHING”. Typically an “etching” contains the following information:
Name: A name must contain letters between 1 and 28 characters. For example, XAEADD is a rune’s name.
Divisibility: Divisibility is the number of units a rune can be divided into.
Symbol: This is the symbol of a Rune. Note: Runes without a symbol are given the generic scarab (`¤`) as their sign.
Premine: A premine is the initial allocated amount of runes set aside by its creator.
Terms: Terms established during an open mint allow anyone to mint and allocate units.
Cap: This factor decides how many times the Rune can be minted.
Amount: This value decides how many rune units (a fixed amount) will be created with each mint transaction.
Start height: This is the block height where the minting of the Rune will start.
End height: This is the block height where the minting of a Rune will end.
Bitcoin Runes vs BRC-20
Bitcoin Runes are far more efficient and feature rich as compared to the BRC-20 token standard.
BRC-20 Tokens were created by DOMO.
Wallets
Bitcoin Runes do not need any special wallet and are also compatible with layer-2 solutions such as the Lightning Network.
BRC-20 need wallet that are compatible with the Taproot Upgrade.
Unspent Transaction Outputs (UTXO)
Bitcoin Runes do not create any UTXO, each UTXO can be further converted into more Runes. Also a single UTXO can be converted into multiple new runes such as 10 units of Rune A, 20 units of Rune B, 50 units of Rune C and so on.
BRC-20 Tokens do create UTXOs which go to junk.
Data Storage
Bitcoin Runes use the main Bitcoin blockchain to store data and do not need any off-chain or third party storage.
BRC-20 coins do need an off-chain storage.
Lightning Network Compatibility
Bitcoin Runes are compatible with Lightning network.
BRC-20 tokens are not compatible with the Lightning network.
Frequently Asked Questions
Were Bitcoin Runes a part of the Bitcoin Blockchain initially?
No, Satoshi Nakamoto never thought that individual sats could be turned into runes. Runes were never a part of Bitcoin originally. However, sats on which the Runes are based, have been the fundamental unit of Bitcoin always.
Smart Contracts are pieces of codes that automatically execute blockchain transactions based on a set of inputs given. These are basically used to automate activities such as crypto swaps, NFT minting, token sale, liquidity pools, escrow funds, etc.
Smart Contracts feature decentralized execution of tasks on a blockchain without the need of a central party as a guarantor.
#NOTE: All interactions with a smart contract are in the form of transactions and require necessary gas fees.
Table of Contents
Definition, Working and Example
A smart contract is basically a program that facilitates the execution of transactions on a blockchain. Once programmed smart contracts basically become tamper-proof and fully automated.
Smart contracts can be used to automate tasks such as Decentralized Exchanges, Auctions, Crypto Swaps, NFT trading, etc.
Working of a Smart Contract in Simple Terms
A smart contract works in a very simple way:
The creator of a smart contract creates a logic. It can be based on agreement between parties(such as Escrow) or in case of a solo creator, their needs and wishes(such as a Legal Will).
The smart contract is programmed based on the requirements.
Triggering conditions are set. These conditions can either be based on time or on specific actions.
In case of external conditions triggering smart contracts, a blockchain oracle is required to feed data to it.
The smart contract is executed based on its conditions.
The resulting transaction, for example, transfer of funds, is recorded on the blockchain.
How a Smart Contract Works
Example
Let me use the example of an auction to show how a smart contract works.
Suppose there is an auction where people are bidding for an iconic piece of art. Now this art can be an NFT or a real world painting. To ensure that the auction goes free and fair, the auctioneers have used a smart contract.
They have programmed it in a certain way that whoever is the highest bidder at 09:00 AM on February 7th, will automatically be the winner of the auction,
In real life, there could emerge a problem in such situations. If several people are betting on the same thing just before it ends, it would be impossible to accurately judge who did the last and the highest bid.
Even if you use a digital bidding system, the trust on them would be zero. I observed this when there was an allegation on Rarible for insider trading.
In such situations, blockchain-based bidding makes absolute sense since it can be verified and its history is immutable.
Working of a Smart Contract in Technical Terms
A smart contract uses various functions and logic to execute its actions. These functions and logic trigger actions such as transfer or funds, NFTs, Asset Tokens or other actions.
The transfers take place via public addresses on the blockchain. There are 4 types of addresses which are required to execute such transfer-based smart contracts.
Public address of the creator (Master Address).
Public address of the Smart Contract.
Public address of the beneficiary.
Public address of other parties (for example in smart contracts for auctions or governance).
After that, the smart contract is coded and works in this way.
The logic is coded based on the agreement between parties or the will of the creator.
The structures(user defined data types) are created for entities which are present in the smart contract. In the below example they are: Voter and Proposal. The item for which the smart contract is created is also an entity. Example of such entities are NFTs in Auctions.
Then the functions are defined along with their logic. A function is the piece of code which defines the working of a smart contract if its conditions are met.
A failsafe function is also created which gets executed when no other function is executed. Such as return funds to XYZ address if an auction fails.
Example of a Solidity Smart Contract Code for Governance
Below is a sample smart contract code of a voting system built using the Solidity programming language. Source: Remix IDE.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
}
struct Proposal {
// If you can limit the length to a certain number of bytes,
// always use one of bytes1 to bytes32 because they are much cheaper
bytes32 name; // short name (up to 32 bytes)
uint voteCount; // number of accumulated votes
}
address public chairperson;
mapping(address => Voter) public voters;
Proposal[] public proposals;
/**
* @dev Create a new ballot to choose one of ‘proposalNames’.
* @param proposalNames names of proposals
*/
constructor(bytes32[] memory proposalNames) {
chairperson = msg.sender;
voters[chairperson].weight = 1;
for (uint i = 0; i < proposalNames.length; i++) {
// ‘Proposal({…})’ creates a temporary
// Proposal object and ‘proposals.push(…)’
// appends it to the end of ‘proposals’.
proposals.push(Proposal({
name: proposalNames[i],
voteCount: 0
}));
}
}
/**
* @dev Give ‘voter’ the right to vote on this ballot. May only be called by ‘chairperson’.
* @param voter address of voter
*/
function giveRightToVote(address voter) public {
require(
msg.sender == chairperson,
“Only chairperson can give right to vote.”
);
require(
!voters[voter].voted,
“The voter already voted.”
);
require(voters[voter].weight == 0);
voters[voter].weight = 1;
}
/**
* @dev Delegate your vote to the voter ‘to’.
* @param to address to which vote is delegated
*/
function delegate(address to) public {
Voter storage sender = voters[msg.sender];
require(!sender.voted, “You already voted.”);
require(to != msg.sender, “Self-delegation is disallowed.”);
while (voters[to].delegate != address(0)) {
to = voters[to].delegate;
// We found a loop in the delegation, not allowed.
require(to != msg.sender, “Found loop in delegation.”);
* @dev Give your vote (including votes delegated to you) to proposal ‘proposals[proposal].name’.
* @param proposal index of proposal in the proposals array
*/
function vote(uint proposal) public {
Voter storage sender = voters[msg.sender];
require(sender.weight != 0, “Has no right to vote”);
require(!sender.voted, “Already voted.”);
sender.voted = true;
sender.vote = proposal;
// If ‘proposal’ is out of the range of the array,
// this will throw automatically and revert all
// changes.
proposals[proposal].voteCount += sender.weight;
}
/**
* @dev Computes the winning proposal taking all previous votes into account.
* @return winningProposal_ index of winning proposal in the proposals array
*/
function winningProposal() public view
returns (uint winningProposal_)
{
uint winningVoteCount = 0;
for (uint p = 0; p < proposals.length; p++) {
if (proposals[p].voteCount > winningVoteCount) {
winningVoteCount = proposals[p].voteCount;
winningProposal_ = p;
}
}
}
/**
* @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then
* @return winnerName_ the name of the winner
*/
function winnerName() public view
returns (bytes32 winnerName_)
{
winnerName_ = proposals[winningProposal()].name;
}
}
Benefits of Using Smart Contracts
Smart Contracts are fast in execution and barely take a few seconds or a few minutes to execute.
They are free of any bias. No third party involvement eliminates the question of bias.
They are transparent as blockchain transactions are open for verification by anyone.
Encryption of data provides a high degree of security.
Smart contracts save money as the fees for a third party is not required.
Disadvantage – Non-Editable
In my experience, the greatest disadvantage of using a smart contract comes when there is a need to change them. Even for the smallest changes, I have seen developers deleting and re-deploying an new smart contract.
I am well aware that these feature contributes to their security but deploying a new smart contract every time changes its address and tokens sent to the old address are simply lost.
Applications and Use
Smart contracts are used extensively these days in Decentralized Exchanges, DApps, Swap Protocols, Liquidity Protocols, Blockchain Bridges, Escrow Accounts, etc.
Decentralized Exchanges
Simplified Working of a Decentralized Exchange
Perhaps the most widely used application of a smart contract is its usage in the decentralized exchanges. Since, these exchanges are automated they need some tool to facilitate the automated exchange of cryptocurrencies. This role is fulfilled by smart contracts.
With some DEXes, you might also get an option to do cross chain transfers.
Swap and Liquidity Protocols
How Swapping Protocol Works
These protocols rely on smart contracts to provide swap features and generate LP tokens.
Smart contracts facilitate the swapping of assets on the same blockchain (such as between USDT and WBTC on Ethereum).
They also help generate Liquidity Provider Tokens(LP Tokens)
LP tokens are those cryptocurrencies which you get once you deposit some liquidity(popular cryptocurrencies) to a liquidity pool. These LP tokens are required to claim back your original crypto along with its rewards.
Blockchain Bridges
How does a Blockchain Bridge Work
Blockchain Bridges use two sets of smart contracts to transfer assets between different blockchains. One smart contract locks the assets on one chain and another smart contract mints them on another blockchain. While redeeming the tokens, the same method is followed.
Halving means a phenomenon in blockchains by which block rewards are reduced to half of their previous value. This is done to keep a limit on the amount of new coins entering the circulating supply.
Though halving is not seen in all blockchains, it is mostly common for blockchains with a limited coin supply.
#NOTE: Block rewards are the share of transaction fees that are awarded to those who verify the transactions and add new blocks to the blockchain.
Table of Contents
Definition
Halving refers to the reduction of block verification rewards by 50% every certain number of years (for Bitcoin it is 4). This reduction in the creation of new tokens makes the tokenomics less inflationary, increasing the token value. Further, halving also indirectly forces users to use the blockchain token for their personal transactions, bringing in utility for the token.
#Note: Halving rewards are the only way new tokens are created in major public blockchains like Bitcoin. Therefore, lowering the rewards introduces a smaller number of coins in circulation, helping in token value appreciation.
Why Halving is Necessary? Its Benefits and Significance
Halving becomes necessary in blockchains due to a few reasons. It keeps the coin supply within reasonable limits and therefore helps alleviate the value of the coins. Halving also promotes the usage of transaction fees only to pay miners/validators so that the blockchain becomes intrinsically sustainable.
1. Limit on Coin Supply
Halving works best for those coins that have a limited supply, for example, Bitcoin, which has a limit of 21 million coins.
Further, adding more coins dilutes the value of older coins due following the law of demand and supply.
However, adding a hard cap during the time of launch does more harm than benefit. Because if the blockchain is not adopted instantly, then there would be very less transactions and therefore validators won’t be paid which would make them abandon the work.
Therefore, some token supply is kept as unmined coins which are released slowly to the miners or validators in a controlled manner. This way of releasing new coin supply does not act as a shock and is easily absorbed.
2. Helps Price Appreciation
A reduced coin supply is beneficial as it helps increase the demand of those coins which are in circulation. For example, when Bitcoin halving occurs, it reduced the coin supply and after each Bitcoin halving, the coin value appreciates.
We observed this each time Bitcoin halving occurred. You can see the price of Bitcoin vs halving events below.
3. Makes the Blockchain Self Sustainable
During the initial days of any blockchain, only a few users were use it. However, to keep it authentic there were special users called miners who checked and approved transactions to make sure they were valid.
To encourage these miners, the blockchain automatically rewarded them with cryptocurrencies every time they successfully completed a set of verifications, which we call a block.
However, it couldn’t keep giving out lots of coins forever, otherwise the price of the coin will collapse due to over supply.
So, after a certain number of blocks (every 210,000 in Bitcoin), the rewards became smaller. This would theoretically make the blockchain miners rely more on transaction fees and not on block rewards.
What Happens after Halving?
After halving, usually the price of the coin appreciates as after this situation, there will be a lesser amount of coins that will enter the markets.
Further, since the block reward decreases, miners/validators get reduced block rewards. However, they also get rewards from increased transactions as more users are seen to be attracted towards the blockchain due to reduced prices.
Bitcoin Halving History
Bitcoin Halving Dates vs Logarithmic Price, Source: Techopedia.com
In Bitcoin halving occurs every 210,000 blocks. There have been three halving as of January 2024.
November 28, 2012 that reduced the block rewards from 50 Bitcoins to 25 Bitcoins.
July 09, 2016 that reduced the block rewards from 25 Bitcoins to 12.5 Bitcoins.
May 11, 2020 that reduced the block rewards from 12.5 Bitcoins to 6.25 Bitcoins.
There is also a trend that 1 year after each halving date, Bitcoin’s price grows.
1 Year after first halving date : Growth is 8069% (28 Nov 2012 to 28 Nov 2013)
1 Year after second halving date : Growth is 284% (09 July 2016 to 9 July 2017)
1 Year after third halving date : Growth is 538% (11 May 2020 to 11 May 2021)
Bitcoin Price in History
First Bitcoin Halving Date 2012
Closing Price of Bitcoin on 28 Nov 2012 was $12.20.
At the beginning of Bitcoin, nobody knew the blockchain and its usage. So, there were not many miners who would want to verify transactions. Therefore a high block reward of 50 Bitcoins($610) till November 2012 was given.
Second Bitcoin Halving Date 9 July 2016
Closing Price of Bitcoin on 09 July 2016 was $650.96.
Slowly, as people began to do transactions on the Bitcoin, its demand increased and as a result, its token price also increased. This increased the value of Bitcoin to $963 by 2016 when the second halving occurred. This decreased the block rewards from 25 Bitcoins to 12.5 Bitcoins(=$8,137) after the halving.
Third Bitcoin Halving Date 11 May 2020
Closing Price of Bitcoin on 11 May 2020 was $8618.48.
The third and the last halving decreased the Bitcoin block rewards from 12.5 Bitcoins to 6.125 Bitcoins(=$53,865.5) after the halving.
#NOTE: There is a trend that after each halving, Bitcoin price increases.
Fourth Bitcoin Halving Date April 2024 (expected)
The fourth halving is expected to occur around April 2024 which will reduce the block rewards from 6.25 Bitcoins to 3.125 Bitcoins. Now if Bitcoin even stays at the price range of $41.5k, the reward per block will still be higher than the last halving (2020) at $130,000 after the halving.
Frequently Asked Questions
Does halving occur in Ethereum?
No, halving does not occur in Ethereum because it is a blockchain with an unlimited token supply. Validators are paid with a combination of new tokens and transaction fees.
Why Bitcoin halving does not occur exactly after 4 years?
Halving occurs every 210,000 blocks and each block does not exactly 10 minutes as expected. Some blocks take more time and some take less, this leads to the mismatch in timing.
Cryptocurrencies is the widest term of all and covers all type of digital currencies irrespective of blockchains. Coins are those cryptocurrencies which exist primarily on their own blockchain. Tokens are those cryptocurrencies which exist on other blockchains; and might or might not have their own blockchain.
Let us explore briefly the confusion between coins vs tokens and understand what make them different.
Table of Contents
Definitions
Cryptocurrencies are digital assets on a blockchain that can be used in a similar way as fiat currencies. They satisfy all the requirements of a currency such as fungibility, store of value and are widely accepted.
Properties of Fiat Currency
Fiat currency has some properties which must be followed by every asset that need to be called a currency. Some of them are fungibility, storage of value and wide acceptance.
Fungibility
Fungibility
Fungibility is the property through which an asset such as a currency can be divided in to smaller parts. The following two examples depict how Bitcoin is more fungible than fiat currencies such as US Dollar.
For example:
A US Dollar($) can be divided into 100 cents.
An Indian Rupee (₹) can be divided into 100 paisas.
A Bitcoin can be divided in to 100 Million Satoshis.
Store of Value
Store of Value
Store of Value is the property of currencies which helps people store them for future needs. Currencies need to have a way through which they can be stored and be of value even after a long time. Cryptocurrencies can be held on as savings or investments and can be used at a late stage.
The above image shows how more than 68% of Bitcoin owners have held to their Bitcoins for over a year now.
Wide Acceptance
Wide Acceptance
Wide Acceptance is also a major aspect of a currency because it cannot be freely used otherwise. Cryptocurrencies satisfy this aspect as millions of people across the world, including me, accept cryptocurrencies as a mode of payment.
Coins vs Tokens
By definition coins are those cryptocurrencies which have their own blockchain. For example, Bitcoin has its own blockchain where its cryptocurrency exists. Similarly, Shiba Inu is a coin when it exists in its own blockchain, Shibarium.
Tokens are those cryptocurrencies which either do not have their own blockchain or are those which are transferred to a different blockchain.
For example, USDT is a token on the Ethereum Blockchain because USDT does not have its own blockchain. Similarly, Shiba Inu when it is an ERC20-standard token, it is a called to be a token on the Ethereum blockchain and not coin.
Coins vs Tokens
Let me give you another example. Bitcoin is a coin on its own blockchain but when it is send to the Ethereum blockchain, it takes the form of a ERC20-token called Wrapped Bitcoin (wBTC). This Wrapped Bitcoin is a token on the Ethereum Blockchain.
Fungible vs Non-Fungible Tokens
Basically, fungible tokens ae those which can be divided into smaller units and non-fungible tokens are those which cannot be subdivided.
#NOTE: There is another token category on Ethereum called Semi Fungible token which can be issued in both fungible and non-fungible forms. Its token standard is ERC-1151.
Fungible Tokens
Fungible Tokens are those which can be divided into numerous smaller denominations which can be sent and received independently. For example a Bitcoin can be divided into 100 Million Satoshis each of which can be sent individually.
#NOTE: This property of Bitcoin which enables independent transaction of each Satoshi, has given rise to Ordinal Theory based on which Bitcoin Ordinals (NFT-like tokens on Bitcoin’s blockchain) were created by Casey Rodarmor.
Non Fungible Tokens
On the other hand Non-Fungible Tokens are those which are transacted individually and cannot be divided into smaller groups. These tokens are minted on a blockchain and can be transferred to other blockchains via cross-chain transfer protocols such as a Blockchain Bridge.
Non-Fungible tokens usually represent digital or real world assets and can be used to trade the ownerships of these assets. For example, real world land or building can be tokenized and sold via the blockchain. This process is called as Asset Tokenization.
In Ethereum, Gas War means a competitive situation where senders compete for gas fee to get their transactions executed in priority. Since, Ethereum transactions are auctioned to the highest bidder, the bidding results in spiraling up of bids which eventually results in a unsustainable gas price.
Why Gas Wars Take Place?
Ethereum never worked earlier on increasing its transactions speed because it thought doing so might reduce the security of the blockchain.
This caused its transaction speed to remain stagnant at 10-15 TPS.
However, this could not match the growing demand of the time and soon people had to wait un queue to get their transactions executed. Those who paid a higher fees got their transactions executed first.
The only reason why Gas Fees are still high because most users prefer Ethereum for its security.
During times of increased demand for transactions such as during airdrops, during NFT minting, or launch of popular DApps, the competition for gas increased to become Gas Wars.
Need of Gas in Ethereum
In the Ethereum Blockchain, gas is used to estimate the amount of work done by validators to verify transactions. The higher the work needed, the higher will be gas fees.
Work is required to execute operations such as sending transactions, deploying smart contracts, or interacting with decentralized applications (DApps).
For example, NFT transactions need higher work to validate them and therefore have a higher gas fees than Ethereum.
Gas Fee Comparison in Ethereum
What is Ethereum doing to avoid Gas Wars?
Gas wars present a brutal scenario where small transactions are not economically viable because several times the transacted value is much lesser than the gas fees.
Therefore, to reduce Gas fee, users use two methods to decrease transaction costs. They are Zero Knowledge Rollups and Optimistic Rollups. Both these processes rely on off-chain work which might compromise Ethereum’s security.
Ethereum has also currently implemented a third way called Proto-Dank Sharding which helps reduce its dependency on other blockchains.
Zero Knowledge Rollups
Though Ethereum has not done much until 2024 for decreasing pressure on Gas Fees, other blockchains presented them as Layer-2 scaling solutions and helped offload the pressure on Ethereum by validating Ethereum transactions out of the Ethereum blockchains and submitting a summary of these transactions.
When the summary is found to be true, all the transactions are also validated at the same time because the final state of the blockchain after the transactions is as expected.
The entire process is known as Zero Knowledge Rollup because only the summary of transactions are kept and individual transaction details do not exist on Ethereum and it has no knowledge of the off-chain (Layer-2) transactions.
Optimistic Rollups
Optimistic Rollups also summarize transactions and only submit a summary of them for validation by Ethereum. But, there is a small difference between Zero Knowledge and Optimistic Rollups.
Optimistic Rollups use call-data where the individual transactions (of the summary) are written. Call data is a space on the Ethereum block which is not validated by validators.
This process decreases the transaction costs but also makes the blocks bulky because all the individual transaction data is still present inside the block.
Proto-Dank Sharding
Proto-Dank Sharding is a process where a feature called a “Blob” is attached to each block and this blob stores all the individual transaction data. The blobs do not make Ethereum blocks heavy because each blob in a block is deleted after 3 months of creation.
This is different than Sharding which aims to increase the speed of Ethereum by dividing its 900k validators in to smaller groups each of which can independently verify transactions and add blocks to Ethereum.
Gas fee is the transaction fee charged in the Ethereum blockchain. The fee is paid to Ethereum validators for verifying transactions and adding blocks to the blockchain.
The term originated in the Ethereum blockchain but is now widely used to refer to transaction costs in other blockchains too.
Table of Contents
How is Gas Fee Calculated?
Gas fees are calculated on the basis of network congestion. If a network is highly congested, like Ethereum, its gas fees will definitely be high. These usually happens in a network with low TPS (transaction per second) like Ethereum (10-15 TPS).
Similarly, for networks with higher TPS like Solana (avg. 3000 TPS on 18 Jan 2024) there is less network congestion and therefore gas fees is low.
Gas Auctions
In Ethereum, gas fees are denominated in Gwei and are auctioned to the highest bidder. Bidders big on the amount they are willing to pay and the highest bidder gets to send their transactions first.
However, this does not mean that anyone can bid any random amount to send their transactions first.
Gas Price Categories in Gas Auctions
Usually there are three categories of gas fees that a user buys to send a transaction. They are Low, Average and High.
The below screenshot from Etherscan’s gas tracker shows the three available options for gas auctions.
Categories of Gas Fees
The low gas fee category has the least priority and gets executed at the last. The priority to execute the transactions increases with the bidding amount which is visible as 31 Gwei, 32 Gwei and 35 Gwei.
Gas Limit
Usually there is a cap of the Gas that can be used to send a transaction and this limit is called the Gas Limit. This limit can be set by the user who sends a transaction. Most wallets like MetaMask feature a gas fee limit setting which allows the user to pay gas fees within a limit.
Gas fee and gas limits differ on Ethereum for tokens and NFTs since the latter needs much more validation work to be able to process. Therefore, NFT gas fees are usually higher than gas fees for Tokens.
Here is a snapshot from Etherscan that shows the gas fee details for various actions. See how NFT sale needs the highest amount of Gas Fee. Other actions like token swapping, bridging, and borrowing costs much less.
Gas Wars
Gas Wars are scenarios where too many people compete with each other to send their transactions first. This causes a scenario where people compete very violently and it seems that there is a war to execute transactions.
Such wars usually occur during specific events such as Airdrops, Free NFT minting and when DEXs are launched.
Problem of High Gas Prices in Ethereum
Ethereum had a problem of high gas costs during 2018 when its popularity rose. This caused users flock to it and start transacting on the blockchain. As a result, its Gas Prices elevated.
Other factors which have resulted in high prices in Ethereum are its high degree of security, majority share in NFT markets, and the sheer number of DeFi protocols associated with it. Ethereum still commands 59% of the total volume in DeFi markets.
Also, Ethereum witnesses the highest DApp development than any blockchain.
These causes a perpetual demand of Ethereum for various transactions.
However, Ethereum still has the 10-15 TPS speed which has not changed over time. This causes a network congestion.
Solutions for Combating High Gas Fees
Currently there are 3 solutions being used for combating high gas fees in Ethereum. However, all these are temporary and the ultimate solution is supposed to be the Surge, which is expected to help Ethereum reach 100k TPS (transactions per second) from the current TPS of 15.
Zero Knowledge Rollups
Though Ethereum has not done much until 2024 for decreasing pressure on Gas Fees, other blockchains presented them as Layer-2 scaling solutions and helped offload the pressure on Ethereum by validating Ethereum transactions out of the Ethereum blockchains and submitting a summary of these transactions.
When the summary is found to be true, all the transactions are also validated at the same time because the final state of the blockchain after the transactions is as expected.
The entire process is known as Zero Knowledge Rollup because only the summary of transactions are kept and individual transaction details do not exist on Ethereum and it has no knowledge of the off-chain (Layer-2) transactions.
Optimistic Rollups
Optimistic Rollups also summarize transactions and only submit a summary of them for validation by Ethereum. But, there is a small difference between Zero Knowledge and Optimistic Rollups.
Optimistic Rollups use call-data where the individual transactions (of the summary) are written. Call data is a space on the Ethereum block which is not validated by validators.
This process decreases the transaction costs but also makes the blocks bulky because all the individual transaction data is still present inside the block.
Proto-Dank Sharding
Proto-Dank Sharding is a process where a feature called a “Blob” is attached to each block and this blob stores all the individual transaction data. The blobs do not make Ethereum blocks heavy because each blob in a block is deleted after 3 months of creation.
Sharding in Ethereum
This is different than Sharding which aims to increase the speed of Ethereum by dividing its 900k validators in to smaller groups each of which can independently verify transactions and add blocks to Ethereum.
Frequently Asked Questions
What Is a Gas Fee on NFTs?
On the block height of 190333373 the Gas Fee for NFT was in the range of $51.91 – $53.44.
What Is Ethereum’s Gas Fee Now?
Ethereum gas fees is highly volatile and changes every 15-20 seconds. I witnessed the gas fee to be $31.62 max for Token transfers and $53.44 max for NFT sales at the block height of 190333373 .
Why do I have to pay a Gas Fee?
The gas fee is basically meant to pay the validators for their work in securing the blockchain and validating transactions. Therefore any transaction that needs to be validated and processed must pay a Gas Fee.
How can I pay less Gas Fee in Ethereum?
To pay less gas fees in Ethereum, use L2 blockchains like Polygon, Arbitrum and Optimism and transfer your Ethereum assets to these blockchains.
If you do not want to pay any fees, transfer crypto within your preferred exchange. I use CoinDCX for Indian transfers and Binance for international since both of them are widely used. Any transfer outside the exchange will cost you Gas Fee.
Block Headers are the meta data of each block on a blockchain. They contain details such as nonce value, hash of previous block, timestamp, difficulty target, etc.
Block headers play a crucial role in the blockchain’s safety.
Once the block header is assembled, it is hashed to obtain block hash or block ID which is unique for every block in the blockchain.
Table of Contents
Components of a Block Header
A block header is composed of several data points below.
1. Version Number
Version number is the identifier of the format of the block which is in use for that blockchain. Formats change after soft forks and hard forks.
Format numbers are incremental and they increase as the block height progresses.
2. Previous Block Hash
Hash is the result of running all the information in the block through a hashing function. Usually, hashes of a block are the Merkle Roots of the block.
The hashing function is a non-reversible function which means that once you can get a hash out of some information but you cannot get back the original information by reversing the hash function or by any means.
For example, you make an apple pie (similar to a hash value) from flour, sugar and apple (similar to transactions details, merkle root and previous block’s header), but you cannot recreate the apple from the apple pie.
3. Merkle Root
A merkle root is the hash of all the values of preceeding transactions in a blockchain. To obtain a merkle root, transactions are hashed in pairs till the time there is just a single merkle root derived from all transactions.
This is a very crucial component of blockchain security because any change in any element in the Merkle Tree would change the value of the end Merkle Root.
4. Timestamp
A timestamp records the time when a block was created. Different blockchains have different methods of adding timestamps to a block. In most cases these timestamps are added by the miner. However, in the case of Proof of History, there is a function called the Verifiable Delay Function (used in Solana) which automatically adds timestamps to each block.
5. Difficulty Target
Difficulty target specifies the level of difficulty that a validator (who verifies transactions) must encounter and overcome to get the nonce value for that block.
6. Nonce Value
A nonce value is a number that is used to find a hash that meets the difficulty target. This nonce value is generated in several ways.
In Bitcoin a nonce value is obtained by selecting a random number and incrementing it till the resultant hash meets the difficulty target.
In Ethereum this nonce value is obtained by validators by putting down a collateral which is seized if they introduce errors in the blocks.
In Proof of Capacity consensus mechanism, nonce values are stored in the local disk of the validator in advance. The validator just has through scan the local disk to obtain it.
A Merkle Root is the hash of all the transactions in a block by hashing transactions and again hashing those results in pair till the time there exists only a single hash result for the entire block.
These values play a critical role in ensuing blockchain security and are also used to create Zero Knowledge rollups and Blobs in Sharding of the Ethereum Blockchain.
The map of all the hashes are called as the Merkle Tree or even Hash Trees as they are obtained from hashing. The concepts were invented by computer scientist Ralph Merkle in 1998. You can read his original paper here.
Table of Contents
How is a Merkle Root obtained?
In a block, there exists multiple transactions. To generate a Merkle Root from all the transactions,:
The transactions are first hashed to obtain a transaction result.
Then the results are again hashed.
Each step reduces the number of valued to be hashed by half.
This is continued till the time there exists only a single hash result.
Merkle Tree with a Merkle Root (R)
Example
Suppose there are four transactions in a block which are hashed to generate hash results A, B, C and D.
I have depicted in the diagram above that transactionhashes A and B are hashed again to obtain a hash result X and similarly transaction hashes C and D are hashed to obtain hash result Y. Now, hash results X and Y are again hashed together to obtain hash result R. Since there is no other value left to hash with R, it is considered to be the Merkle Root.
How Merkle Root Secures the Blockchain?
Each transaction is unique in the blockchain and the hashing of two unique transactions produce a unique result.
If there is a slight change in one transaction detail, this change will be reflected in its hash. This change in hash value will continue till it changes the value of the old Merkle Root to a new value.
Now. if you compare the original Merkle tree(left) and the changed Merkle Tree(right) after transaction 1 changes to 1*, you will notice that there is a series of changes as a result.
A changes to A*
X changes to X*
Merkle Root R changes to R*
Therefore, if any hacker changes the value of a transaction, it will soon be reflected in the new Merkle root and will be identified soon because other it will not match with the Merkle root of that block with other verifiers.
As soon as an anomaly is detected in the Merkle root, it can then be traced which transactions were tampered with. In our example, the tampered transaction 1 can be detected by starting at Merkle Root and going upwards.
Consensus Mechanisms are different ways to verify blockchain transactions by running it through multiple validators each of whom verifies them individually.
Note, that throughout the article, the terms Consensus Mechanism, Consensus Protocol and Consensus Algorithm have been used interchangeable and have the same meaning.
Table of Contents
Need for Consensus Mechanisms
Consensus Mechanisms essentially make sure that every blockchain transaction is genuine. This helps the blockchain remain secure since each user is confident that their funds are safe. Therefore, the most important job of a consensus mechanism is to ensure the safety of the blockchain.
History of Consensus Mechanisms
Consensus Mechanisms were first developed successfully using the Bitcoin blockchain where verifiers(miners). Later, as Bitcoin grew in size, there were concerns that it might be unsustainable. Other blockchains could not use its consensus mechanism (Proof of Work). This was primarily because of its high energy consumption.
The came the existence of blockchains like Algorand which was based on Pure Proof of Stake. Such blockchains were using 99.9% less energy than Bitcoin with remarkable security.
Ethereum’s Transition from Proof of Work to Proof of Stake via the Merge
Later in 2022, Ethereum too changed from Proof of Work to Proof of Stake through a year-long event ending on 15 September 2023, called the Merge. The name was so because it merged an existing Proof of Work blockchain with a new blockchain called the Beacon Chain which was created in Proof of Stake.
How do Consensus Mechanisms Work?
Let me give you a broad overview of how consensus mechanisms work. Though there are differences, yet the basic process is all the same.
Consensus mechanisms basically need to make sure that the distributed ledger of a blockchain stays true. This is done through the following steps:
When a transaction is initiated, it is verified by a designated verifier such as a validator(PoS) or miner(PoW).
Then the verifier broadcasts the transaction to the network.
Multiple verifiers, other than the first verifier, also verify the transactions.
After the transaction is verified by a certain number of verifiers, it is added to a block.
The block is then added to a blockchain when it has sufficient numbers of transactions.
Centralized consensus algorithms are the ones where decision making and authorization of transactions take place in a top down approach. A few verifiers validate all the transactions. Usually I have seen these kind of mechanisms in permissioned blockchains such as Hyperledger where even a single authority such as a company’s CEO authorizes the blockchain transactions.
In Decentralized consensus algorithms, the number of verifiers are higher, with more power and they are often geographically distributed. Here, the transactions are verified in a democratic process. Usually some kind of mechanism is put so that they do not act in a fraudulent manner.
Sybil Resistance Mechanisms vs Consensus Mechanisms
Sybil Resistance Mechanisms are those which prevent a majority takeover of a blockchain’s verifiers. These takeovers are in the form of attacks called 51% attacks.
10 Different Types of Consensus Mechanisms with Examples
Here is a list of 10 different consensus mechanisms that are used in major blockchains.
Summary
Consensus Mechanism
Pro
Con
Example
Proof of Work
Increased security
High Energy Consumption
Bitcoin, Ethereum Classic
Proof of Stake
Highly efficient and secure
Needs a high number of validators to be secure.
Ethereum, Algorand
Proof of Delegated Stake
Faster speed
Lower no of verifications
EOS, Tron
Proof of History
Very high speeds (100k TPS)
Prone to blockchain halt.
Solana
Proof of Authority
Faster and Cheaper
Less Democratic
VeChain
Proof of Delegated Authority
Delegated decision-making
Less Democratic
Private blockchains
Proof of Elapsed Time
Low energy consumption
Validators are idle most of the time.
Hyperledger Sawtooth
Proof of Burn
Easy to operate
Unsustainable when coins get short
Slimcoin
Proof of Capacity
Easy to use
Prone to hackers
Signum
Proof of Contribution
1. Proof of Work (PoW)
This was the first consensus mechanism to come into existence with Bitcoin’s blockchain. Here, transaction verifiers, also called as miners, run complex calculations to guess the nonce value which is unique for every transaction. These nonce values are obtained from the hashing function with the following inputs (non-exhaustive list):
Transaction amount
Public address of receiver
Private key of sender
Hash of previous transaction
Examples of Proof of Work Blockchains:
How does Proof of Work Functions
Bitcoin
Dogecoin
Ethereum Classic
2. Proof of Stake (PoS)
In this consensus mechanism, the transactions are verified by validators who have to stake some collateral (32 ETH in Ethereum) to be able to sign transaction. Any mistake or faulty behavior of the validators can lead to a partial or total loss of their stake.
The working of Proof of Stake is similar to Proof of Work but there is no need to perform complex calculations in the Proof of Stake consensus mechanism.
Examples of Proof of Stake Blockchains:
Ethereum
Algorand
Avalanche
3. Proof of Delegated Stake (PoDS)
This is a special type of blockchain consensus protocol where instead of using their own funds to stake, validators receive funds from people called delegators. Since these delegators fund the stake for the validator, they are entitled to share the rewards that the validator generates.
A special type of election is conducted to elect witnesses (delegates) who take the role of validators. Only those who own the native Governance token are allowed to vote.
Example of Proof of Delegated Stake Blockchains:
Tron
EOS
4. Proof of History (PoH)
In Proof of History, which was developed by Solana, blocks are time-stamped using function called Verifiable Delay Function(VDF). These timestamps record at what point a block was validated and also record the order of the blocks. The VDF is designed to be a computation intensive function and resists attacks from the outside.
Proof of History cannot work alone and it needs another blockchain consensus to verify individual transactions, which is in the case of Solana is Proof of Stake.
These blockchain consensus has a dual layer of protection and is very effective against Replay Attacks.
In the case of Solana, Proof of History achieves a theoretical transaction speed of 100k per second.
5. Proof of Authority (PoA)
In this type of blockchain, the command structure follows a top-down approach. Here, transaction verifiers are selected and authorized to validate transactions. Selection can be from done by a top authority such as leadership of an organization or through a vote by token holders.
Example of Proof of Authority consensus:
VeChain uses this consensus mechanism to select its 101 blockchain validators which are called as Masternode Operators. This helps VeChain operate its blockchain in an energy efficient way. As per its claims VeChain uses only 0.04% of energy as compared to other blockchains.
6. Proof of Delegated Authority (PoDA)
In the proof of delegated authority consensus mechanism, the validators are selected by the key decision makers. This is opposed to Proof of Authority where a decision maker is directly responsible for validating blockchain transactions.
The consensus mechanism is mostly seen in private blockchains where day to day decision making is done through and recoded on blockchains.
7. Proof of Elapsed Time (PoET)
In Proof of Elapsed Time, every validator generates a random waiting (using a function) time after which they are allotted a block. They then add transactions to the block and then the next validator whose waiting time is overtakes the creation of the next block.
How Proof of Elapsed Time Works
It was invented by Intel Inc in early 2016 in collaboration with Hyperledger, IBM and Linux Project. The primary aim of this project is to reduce the energy consumption in Proof of Work blockchains.
8. Proof of Burn (PoB)
In Proof of Burn, the validators are required to burn the native coins to be able to verify transactions. The greater the number of tokens burnt, the higher will be their share in validating transactions. Tokens are sent to a dead irrecoverable wallet for burning.
It was invented by Iain Stewart.
Tokens are mostly sold to validators during ICOs or can be bought from the market.
Since, after buying tokens, the validators already have a stake in securing the blockchain, it creates a mental barrier against any ill thought plan to sabotage the blockchain.
Example of Proof of Burn consensus mechanism:
Slimcoin
9. Proof of Capacity (PoC)
In this type of consensus mechanism, local hard drive of the validator is used to store a list of possible solutions to the function that is run for validation. If there is a large space on the computer, a larger list of solutions can be stored and therefore a larger probability of discovering the right solutions and add it to blocks.
One key disadvantage of Proof of Capacity is that a hacker could obtain an virtual computer on the cloud to have infinite storage and therefore legally could mine all or a major chunk of the crypto alone.
Example of Proof of Capacity consensus mechanism:
Signum
Chia
Spacemint
10. Proof of Contribution (PoCo)
Here, the contribution of users and their behavior is recorded and those with the highest contributions in a consensus round are rewarded a block. The benefit is that it does not rely on a cryptocurrency to become a validator unlike Ethereum.
Proof of Contribution consensus mechanism was built by Hongyu Song, Nafei Zhu, Ruixin Xue, Jingsha He, Kun Zang and Jianyu Wang to secure Intellectual Property Rights without the use of a cryptocurrency.
Frequently Asked Questions
What is the best crypto Consensus Mechanism?
In my experience, if you prefer safety, Proof of Work is the best. If you prefer centralization, permissioned mechanisms like Proof of Authority is best. If you prefer a lean consensus mechanism with safety, Proof of Stake works best.
Is Bitcoin based on Consensus Mechanism?
Yes, Bitcoin was the first blockchain which had established the practical usage of a consensus mechanism which was Proof of Work on which it is based.
What is Ripple’s Consensus Mechanism?
Ripple uses the Federated Byzantine Agreement Model for its consensus and it is called as RPCA (Ripple Protocol Consensus Algorithm).
Which Consensus protocol is fastest?
The fastest consensus protocol as far as I have seen is possible with Proof of Authority since it requires much lesser number of confirmations than other consensus protocols.
Ethereum changed its Consensus Mechanism from what to what?
In 2022, Ethereum changed its consensus mechanism from Proof of work to Proof of Stake. This reduced its energy consumption by 99.9%.
Which Type of Novel Sybil-resistant Consensus Mechanism Does Berachain Use?
Berachain uses Proof of Liquidity protocol which is based on the principle that higher the liquidity, higher will be the trust on the liquidity provider.
What is the concept of Consensus Mechanism in Blockchain?
In blockchain, the concept of consensus mechanism tests the validity of every transaction and then spreads the valid transaction to other nodes for multiple verifications. This helps in avoiding a single point failure for authentication.