Blockchain Beginner To Advanced Guides
Blockchain Beginner To Advanced Guides
Search Medium
You have 1 free member-only story left this month. Upgrade for unlimited access.
Save
Is there a technology that can help record information at each step and make that
information available to everyone transparently?
287 2
image by author
Bitcoin as a concept was first proposed by Satoshi Nakamoto through a white paper in
2008
image by author
Real Estate Title Issuance: title registry system uses blockchain to make title
issuance instantaneous.
Money Transfer from anywhere to anywhere on the globe: The global money
transfer is time-consuming, error-prone, costly, and subjected to money
laundering. The secure, immutable, decentralized, and transparency feature of
Blockchain helps solve money transfer issues without any intermediary.
How is a Blockchain ledger different from a database? Are the two not the same used for
recording, organizing, monitoring, and controlling information?
Database and Blockchain both record transactions, but the database is centralized and
has a single point of failure. In contrast, the Blockchain is decentralized and
distributed on multiple nodes across the network.
Every node in the blockchain network collectively takes part in the consensus
algorithm using Proof-of-Work.
Before diving deep into the blockchain, let us familiarize ourselves with key terminologies.
Ledger
SHA-256
SHA-256 is a cryptographic algorithm that accepts input of any length, scrambles the
data deterministically, and returns a hash that is 256 bits or 64 characters long. SHA-
256 hashing algorithm ensures the input can never be derived from the output, making
it very secure.
Mining
It is the process of validating and recording new transactions on a blockchain
performed by Miners for which they have a special mining software.
Node
A Node in a blockchain can be any electronic device that is part of a peer-to-peer
network and maintain its own copy of the blockchain.
Merkle Tree
Merkle tree is also referred to as “hash binary tree,” a data structure for efficient and
secure storage of transactions in a blockchain.
image by author
Merkle trees are used in blockchain to store transaction as it enables users to use the
root hash to verify if a transaction was part of the block.
Merkle tree requires little memory, computationally fast, and only a small amount of
information needs to be transmitted over the blockchain network.
What is a Block?
Every time a new transaction occurs on the blockchain, a record of that transaction is
added as a new block to the chain. The new block is added to every participant’s
nodes ledger only after applying a consensus algorithm like proof of work to validate
the transaction. A block in the chain is immutable. It can never be updated and only
be appended to the chain.
The Genesis block is the very first block added to the blockchain
image by author
1. Version number to track the software or protocol that will allow other computers
to read the block correctly.
2. Timestamp: when the transaction was recorded, or the block was created and is
expressed as seconds since 1970–01–01T00:00 UTC.
3. 256 bit Cryptographic hash of the previous block header that links one block with
another block in a Blockchain. This ensures the integrity of the previous block all
the way back to the first block referred to as a Genesis block.
4. Nonce stands for number only used once. The nonce is a randomly generated
number that miners generate to solve a complex mathematical problem to create
a block.
5. The target represents the difficulty of generating the nonce, which validates a
transaction before it is added to a blockchain. It regulates the speed at which new
blocks are added to the blockchain and are adjusted roughly every 2016 block.
Higher difficulty in generating the nonce represents a lower target value.
Transaction or Transactions are stored in the Block using the Merkle tree hash.
The block hash is a separate hash derived from data in the block header using SHA-256.
Block hash uses nonce, and hence hash is tied to the nonce forever. The nonce is used
to come up with a secure hash that meets the criteria as per the target. Hash must
start with a huge number of zeroes based on the target.
Blockchain miners install and run a special Blockchain mining software that enables
their computers to communicate securely with one another. Once a computer installs
the software, joins the network, and begins mining, it becomes what is called a ‘node.’
Blockchain can be used to record any transaction like real estate contracts when
person A sells a property to Person B at x amount or when food is produced at the
farm, travel through the entire supply chain, and finally consumed by the consumer.
Digital signatures are a fundamental building block in blockchains; they are primarily
used to verify the authenticity of transactions. The sender of the transaction uses the
data and the private key to encrypt the message.
If Peter wants to transact with Patty, he must digitally sign the transaction using his
private key and the transaction data and send it to nodes on the network.
After a transaction is transmitted to the network, it gets verified by all of the available
Blockchain nodes.
Knowledge of Peter’s public key will enable confirm the authenticity of the
transaction. Peter’s public key, transaction, and Peter’s digitally signed transaction will
authenticate the transaction.
image by author
The mempool stores all valid transactions waiting to be confirmed by the network.
Miners pull transactions from the mempool for them to be bundled together into a
block.
Miners pull authenticated transactions from the mempool and try to solve the complex
mathematical problem. Miners find the nonce such that the hash of the block is less
than or equal to the current target of the Blockchain network, also called POW(Proof
of Work)
The first Miner that has solves the cryptographic challenge then broadcasts the newly
generated block using the Gossip protocol. Once a block of transactions has been
verified, then it is added to the blockchain network.
A reward is given to the first miner who solves each cryptographic problem.
POS(Proof of Stake)
In a distributed consensus-based on the Proof of Work(POW), miners need a lot of
energy to come up with the hash for the block that is less than or equal to the target
for the blockchain network. In contrast, the Proof of Stake creator of the next block is
chosen deterministically based on the stake in the blockchain.
Susceptible to 51%attack
No one individual or entity controls the blockchain and the transactions that are
recorded in the blockchain.
Private blockchain
Transactions are private and are only available to authorized users in the closed
network.
Hybrid blockchain
Combines the permissioned feature of the private blockchain with the security
and transparency feature of a public blockchain.
Access-driven control decides which users can view the data on the blockchain or
add data to the blockchain.
Suited for businesses providing them with the required flexibility to operate
securely and transparently
Conclusion:
Blockchain is a secure, immutable, peer-to-peer distributed ledger that is
decentralized. It contains a secure block that is linked in a chain and replicated across
multiple nodes connected in a blockchain network. The public, private and hybrid
blockchain can be used based on features of blockchain helpful
References:
https://www.investopedia.com/terms/b/blockchain.asp
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Search Medium
Before we go into any details of what the blockchain is, let’s set our mind with this
logic:
Let’s be blunt about this, the internet is amazing, and it’s changing the world,
fundamentally touching almost all aspects of life. The internet plays a role in how we
work, learn, communicate, play, and so much more. It has significantly impacted
industries like newspapers and brick-and-mortar retail, reinvented others like how we
manage our money, and created new industries such as social media and online dating
-- 1
or shopping.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 1/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
You get it, the internet has been a big deal and continues to be. Of course, it’s easy to
focus on all the positives of the internet, such as low-cost communications anywhere
in the world, low barriers to setting up and running a global online business, and new
ways to access healthcare information and services. We’d be kidding ourselves if we
didn’t recognize that the vast network of networks didn’t have some stubborn problems
associated with it.
Beyond some of the obvious, social media trolling, software viruses, online fraud, fake
news, and criminal hacking, the internet often struggles with the fundamental
challenges of trust. We face ongoing questions such as is the person you are doing
business with online really who they say they are? Is a service real? And are only
authorized people granted access to private systems? Of course, we could all think of
hundreds of other examples of trust on the internet.
Healthy ecosystems rely on trust. Now, this being said, we’ve done wonders with
existing technology. In addition to usernames and passwords, we now use two-factor
authentication, which requires more effort to validate an identity for an individual. We
have firewalls and intrusion detection systems, biometric such as using your
fingerprint for access, and CAPTCHAs, those online boxes that require you to type in
letters and numbers from a photograph to prove you’re not a computer.
With these mechanisms for security and trust, we’ve come a long way, and yet we still
get hacked. Our systems and databases are compromised, made unavailable, money
and identities are stolen, and our confidence to innovate even further using the
internet is stifled and, at worst, impeded. If we want ironclad online voting, workable
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 2/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
what is blockchain?
Blockchain technology is like the internet in that it has a built-in robustness. By storing
blocks of information that are identical across its network.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 3/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
Blockchain, the backend database technology that makes Bitcoin work, is one of the
most exciting technologies emerging right now. Although commonly associated with
Bitcoin, blockchain technology has many other applications that go way beyond digital
currencies. Bitcoin is only one of several hundred applications that use blockchain
technology today.
In other words:
Beyond cryptocurrency, it’s redefining how we store, update, and move data across
networks. It’s enabling a completely new way to write and deploy applications. It has
the potential to improve online security and trust. It may even enable the creation of a
new type of organization that is without hierarchy and centralized decision making.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 4/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 5/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
This is one of the most exciting areas of the blockchain and we call it Smart contracts.
While a Smart contract actually is software code executed on the blockchain, the
terminology used of the word contract indicates that the code enforces some form of
governance or rule. We should think of this as the general concept since many argue
that the use of the term Smart contract is also misleading.
The term “smart contract” simply describes computer code that can facilitate the
exchange of money, content, property, shares, or anything of value.
Cryptography / cryptocurrency
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 6/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 7/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
Like Bitcoin, Ethereum is a distributed public blockchain network and no one controls
or owns Ethereum — it is an open-source project built by many people around the
world.
However, Bitcoin and Ethereum differ substantially in purpose and capability. While
the Bitcoin blockchain is used to track ownership of digital currency (bitcoins), the
Ethereum blockchain focuses on running the programming code of any decentralized
application.
Miners in the Ethereum blockchain work to earn Ether, a type of crypto token that
fuels the network, also used by application developers to pay for transaction fees and
services on the Ethereum network.
While all blockchains have the ability to process code, most are severely limited.
Ethereum is different. Rather than giving a set of limited operations, Ethereum allows
developers to create whatever operations they want. This means developers can build
thousands of different applications that go way beyond anything we have seen before.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 8/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
Hyperledger of the Linux Foundation is one of the projects you will inevitably stumble
upon when you visit blockchain conferences and follow blockchain news. With it, the
Linux Foundation aims to create an environment in which communities of software
developer and companies meet and coordinate to build blockchain frameworks.
The most fundamental difference between Ethereum and Hyperledger is the way they
are designed and their target audience. Hyperledger is not a company, a
cryptocurrency or a blockchain but rather something like a hub for open industrial
blockchain development
The Hyperledger Fabric (one amongst the many Hyper ledger projects) is a blockchain
infrastructure that Delivers an architecture that accomplishes the configurable
agreement, smart contracts, and association services. It covers the peer nodes that
implement the chain code of blockchain development, ledger data, endorses record
with applications.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 9/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
There is so much hype and confusion in the blockchain, distributed ledger and
cryptocurrency world and one name that keeps increasingly coming up in that space is
Ripple.
While Bitcoin is a digital currency intended as a means of payment for goods and
services, Ripple is a payment settling, currency exchange and remittance system
intended for banks and payment networks. The idea is to provide a system for direct
transfer of assets (e.g. money, gold, etc.) that settles in almost real-time and is a
cheaper, more transparent and secure alternative to transfer systems used by banks
today, such as the SWIFT payment system.
Bitcoin is based on blockchain technology, while Ripple doesn’t use blockchain but
uses a distributed consensus ledger using a network of validating servers and crypto
tokens called XRP (sometimes referred to as Ripples).
Just like the rise of the internet, blockchain will bring with it all kinds of changes,
challenges and complex questions around Security, governance, international laws,
trade, and economics. But whether it lives up to its promises remains to be seen.
This article is a result of researches and online courses by Jonathan Reichental, articles by
Bernard Marr, and Blockgeeks.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 10/11
2/8/23, 10:01 PM What is BlockChain? “In Simple English” | by Yann Mulonda | Medium
👩💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech
waiting in your inbox. Read the Noteworthy in Tech newsletter.
https://yannmjl.medium.com/what-is-blockchain-in-simple-english-25e684c1cea3 11/11
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Save
We as individuals and businesses interact with a lot of other businesses and service
providers online and offline on a daily basis. We buy clothes online, import medicines
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 1/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
from different parts of the world, and use remote financial and banking services. In
such a scenario, where everything is available at your fingertips except the trust for the
other party, how do you validate the authenticity of the clothes that you got online, or
how do you know that the medicines you imported are genuine and not some cheap
counterfeit or how do you know that your financial and personal data is safe and is not
getting misused by some hacker sitting in some part of the world. There has always
been a dire need for a system that can assure us that whatever we are buying is
authentic, whatever data we are sharing is safe and secure. There has always been a
need for a system that is reliable and robust so that trust is no longer a barrier for
businesses and individuals to get things done.
The solution to all of these pain points lies in Blockchain Technology. You might have
heard about various cryptocurrencies like Bitcoin, Ether, Ripple, etc., and Blockchain
is the technology that powers them all.
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 2/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Blockchain has gained a lot of popularity recently. It has been claimed to be a game-
changer and has been even referred to as the internet of value by many industry
experts. The invention of Blockchain technology can be compared to the invention of
the wheel, motor, and internet that changed the world. It has been predicted that
Blockchain technology will rule the next decade.
What is Blockchain?
Blockchain is a tamper-proof distributed digital ledger. This digital ledger is safe,
secure, transparent, and decentralized, which simply means that it is not controlled by
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 3/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
a single authority. It is like a ledger that a bank uses to keep track of all customer
transactions. However, in a bank, the ledger is controlled by the bank, and only the
bank can see the transactions. Whereas in blockchain, there is no central authority,
and the ledger runs on multiple computers and doesn’t require any single person to
authenticate or settle transactions.
Let’s try to understand how Blockchain works through a real-life analogy. For this
analogy, we are going to take the example of Google Sheets on Google Drive. While
Google Sheets is not technically a Blockchain, it’s a pretty accurate analogy to how
Blockchain works.
· When someone creates a spreadsheet in Google Drive, they can share it with multiple
people. In our analogy, this spreadsheet can be compared to a Blockchain.
· The spreadsheet is generally shared over a large network of computers when shared
with multiple people. The computers having a copy of the spreadsheet are referred to
as nodes in the Blockchain world.
· Every node on the network has access to the same spreadsheet. Whenever someone
edits or modifies the spreadsheet, it gets updated automatically on every computer on
the network. Thus, the spreadsheet is updated in real-time, and a single version of the
spreadsheet is always visible to everyone on the network.
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 4/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
On the contrary, if you put data on an Excel sheet on your computer, it is just one file
that has to be shared with the other people on the network by emailing them. If one
makes some modifications in the Excel sheet, the modified file has to be saved and
emailed to other recipients. Sometimes, many versions of a single Excel sheet are
created, and it is quite possible to lose track of the most recent versions of the
document and wind up updating old versions of the Excel sheet. Also, when the
records or files are present on one central computer, they can easily be hacked and
manipulated.
On Blockchain, like Google Sheets, there will be multiple copies of the digital
document, and each node/user on the network will have a copy and access to the same
exact document. Therefore, it is not possible to tamper with them. Before any change
can be made in the documents, the majority of the users have to agree to it. It puts the
control in the hands of all the users instead of one central database that can be
changed anytime by anyone with proper access.
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 5/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Properties of Blockchain
There are certain features and properties of Blockchain that makes it suitable for such
a wide array of industries:
1. Decentralized
Decentralization is one of the most critical components of Blockchain. It has even
been viewed as a revolutionary technology that will decentralize the web.
Decentralization refers to the transfer of control from a centralized entity (individual,
organization, or group) to a distributed network.
Decentralization gives you the power to store your valuable assets like your data,
money, documents in a network that can then be easily accessed from anywhere in the
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 6/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
world over the internet. Through this decentralized technology, a user has direct
control over his asset via his private key.
A user can also easily transfer his asset to anyone at any point of time from anywhere
in the world. This feature of decentralization eliminates the need to rely on any third
party or middlemen for these transactions. Thus, cutting down the high transaction
fees charged by these third-party service providers. For instance, when you transfer a
sum of money to your friend, you have to rely on a bank to perform this task. But with
Blockchain, you can do these transactions without the involvement of any third party.
The main rationale behind this concept is to place your trust in the network rather
than in a single centralized body like a bank or a government.
· A decentralized system shifts the power back to the users as they are the ones
controlling all of their data and transactions.
· As the data doesn’t reside with a third party, this eliminates the possibility of data
tampering and misuse of the data. Further removing these third parties from the
equation lowers the transaction costs significantly.
· The changes made in a public Blockchain are visible to all the parties on the network,
thus making them transparent.
2. Distributed Ledger
Distributed Ledger is the second critical feature that makes a Blockchain so powerful
and effective. The word distributed ledger is composed of two terms — Distributed and
Ledger. Ledger, as the name suggests, is the record of all transactions, and distributed
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 7/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
means that the ledger is shared with every person on the same network. The
distributed ledger contains the record of each and every transaction that took place
over the network.
And every node of the network has access to a copy of this updated ledger. Any updates
or changes in the ledger are reflected in almost real-time in all the copies of the ledger
across the network.
Distributed ledger
Some of the key advantages of such a distributed system for the stakeholders involved
are as follows:
· A distributed system makes it easier to track the movement of goods as the same
ledger is shared across all the users on the network. This is one of the main reasons
why many big companies have started integrating Blockchain Technology into their
supply chain.
· All the transactions are recorded on one single ledger, making it easier to manage,
view, refer to, and verify the transactions. In simple terms, it reduces the complexity
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 8/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
3. Immutability
Immutability is another critical component of Blockchain. Immutability means
something that can’t be changed or altered. Once the data has been recorded inside a
Blockchain, it becomes nearly impossible to change it, thus making it tamper-proof
and immutable. To better understand the concept of immutability, let us take the
example of an email. Once you share a document in an email with a group of your
friends, you can not take it back. The only way to do this is to ask all of your friends to
delete that email which is quite difficult. This is exactly how immutability works in the
Blockchain network. This is very important when you want to trust something or when
you want to make something more trustable. For example, suppose you have built a
database on your computer, and if you want to change data because everything is in
your control, you can change the data and change the data in any way you want to. But
with blockchain, that is not possible.
4. Consensus
As the name indicates, Blockchain is a chain of blocks that store transactions or data.
Each block can be thought of as a page in the ledger.
A new block of transactions is created after a certain fixed duration. The block is then
sent to each node which verifies the block. And once the verification is done, the block
gets added to the Blockchain. This verification and validation of blocks by these
participating nodes is called consensus.
Without consent from the majority of nodes, any transaction block can not be added to
the ledger. And once the transaction block gets added to the ledger, no user on the
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 9/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Block is added to the Blockchain only after getting verified by each node
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 10/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Double-spending was one of the very serious concerns with Bitcoin initially because
there was no central authority to verify that a token is spent only once.
Let us understand it through an example — there are three persons Phil, Lyra, and
Matt. Lyra has 1 Bitcoin with her. Lyra sends that Bitcoin to Phil. Simultaneously, Lyra
does another transaction and sends the same Bitcoin to Matt as well. The second
transaction will be rejected by the participating nodes on Blockchain. Every
transaction before getting committed to the Blockchain is verified against the ledger
records by the nodes. So in the first case, when Lyra sends money to Phil, the
transaction will be validated against the ledger, which will show that Lyra has one
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 11/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Bitcoin with her, which means that she can transfer her one Bitcoin to Phil. Thus,
making it a valid transaction. But in the second transaction, which Lyra does to Matt
when the transaction is validated against the ledger, it gets rejected as there is no
Bitcoin left with Lyra, so she can’t make any transaction to Matt.
If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and
their applications, click the below link.
Happy learning!
Blockchain Game
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 12/13
2/9/23, 2:39 AM What is Blockchain technology? (Part 1- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
SubscribeSearch Medium
https://medium.com/techskill-brew/what-is-blockchain-technology-part-1-blockchain-basics-e44847198c94 13/13
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
Save
While the philosophical spectrum ranges from satoshi minimalists to mass enterprise
adopters, it is important to first understand the technical componentry of blockchain
in order to deploy it as a useful application. Here is a “feature-first” definition that may
be useful in understanding these technical underpinnings:
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 1/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 2/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
Across the hundreds of articles and conversations around Blockchain, you’ll find the
term “immutable” almost always present. Immutability — the ability for a blockchain
ledger to remain a permanent, indelible, and unalterable history of transactions — is a
definitive feature that blockchain evangelists highlight as a key benefit. Immutability
has the potential to transform the auditing process into a quick, efficient, and cost-
effective procedure, and bring more trust and integrity to the data businesses use and
share every day.
A hash function takes existing data (an input like “Blockchain is Disruptive” in the
example below…) and outputs a “Checksum” — a string of numbers and letters that
serve as a digital signature.
The Checksum is guaranteed to point to your exact data input — if just one byte is
different between two files, the outputs after hashing will be two completely
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 3/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
strings. One can liken this to an avalanche effect — a small change in your input
can drastically change your output.
Probably the most famous hashing algorithm, SHA-2 (and its variants: Sha-256
being the most popular in the blockchain world) was created by the NSA.
The key utility in the hashing process is that you can’t reverse-engineer a hash. In
other words, you won’t be able to work backward from an output string to
determine the input data.
Credit: www.flur.ee
Want to test out some basic hashing? Here is a free Sha-256 hash calculator:
http://www.xorbin.com/tools/sha256-hash-calculator
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 4/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
The hashing process of a new block always includes meta-data from the previous
block’s hash output. This link in the hashing process makes the chain “unbreakable” —
it’s impossible to manipulate or delete data after it has been validated and placed in the
blockchain, because if attempted, the subsequent blocks in the chain would reject the
attempted modification (as their hashes wouldn’t be valid). In other words, if data is
tampered with, the blockchain will break, and the reason could be readily identified.
This characteristic is not found in traditional databases, where information can be
modified or deleted with ease.
The blockchain is essentially a ledger of facts at a specific point in time. For Bitcoin,
those facts involve information about Bitcoin transfers between addresses. The below
image shows how the checksum of transaction data is added as part of the header,
which, in turn, is hashed into and becomes that entire block’s checksum.
Source: http://docs.flur.ee
Benefits, Explained
Why does immutability matter? For the enterprise, immutability as a result of
blockchain implementation presents a serious overhead saver as well as simplified
auditing efforts & fraud prevention. We’ll break these concepts down:
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 5/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
Complete Data Integrity — Ledgers that deploy blockchain technology can guarantee
the full history and data trail of an application: once a transaction joins the blockchain,
it stays there as a representation of the ledger up to that point in time. The integrity of
the chain can be validated at any time by simply re-calculating the block hashes — if a
discrepancy exists between block data and its corresponding hash, that means the
transactions are not valid. This allows organizations and its industry regulators to
quickly detect data tinkering.
This capability allows for a host of time and cost savings — including tracking the
provenance of major bugs, auditing specific application data, backup and restoring
database state changes to retrieve information. Immutability can make the most
modern-day data problems that plague enterprise applications irrelevant.
Proof of Fault — Disputes over fault in business are all-too-common. The construction
industry accounts for $1 Trillion dollars in losses as a result of unresolved disputes.
While blockchain won’t wholly dissolve this massive category of legal proceedings, it
could be leveraged to prevent a majority of disputes related to data provenance and
integrity (essentially proving who did what and at what time).
Blockchain finality allows us — and a jury — to fully trust every piece of information.
FlureeDB secures every transaction — proving who initiated it, when it was completed,
and that it is free of tampering.
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 6/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
It even tracks the changes a SaaS vendor makes to your transaction before it reaches
the data storage tier, meaning you can trust your SaaS data without fully trusting your
SaaS vendor:
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 7/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
In addition: the stronger the enforcement rules, the more reliable the data on the
blockchain (Exhibit A: Bitcoin’s proof of work).
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 8/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
This requires a few things — collusion between parties and a complete recalculation of
hashes. For a public blockchain like Bitcoin, both are expensive and both require an
incredible amount of computing effort to re-mine the blocks until their hashes could
be passed off as valid.
If running a private, federated blockchain, your company would have to convince the
other parties to agree to a “fork” in the blockchain — where a blockchain splits into two
paths and the new designated database continues on. All or most parties involved in
this blockchain will have to agree on the terms including which block to fork at and
any additional rules of the new database. If this blockchain is truly public, it is next to
impossible to have this information removed (a hard fork is also required here, but you
are much more unlikely to convince the other parties in the network to comply).
In terms of Databases and Infrastructure, isn’t holding the entire transaction history very
costly with regards to space?
Not really. Holding every database state might have been costly in the 90s, but current
storage costs (1GB in AWS = $.023) are incredibly cheap. And the benefits (data
integrity, ability to issue queries against any point in time) far outweigh the slight cost
difference.
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 9/10
2/9/23, 2:55 AM Blockchain Immutability — Why Does it Matter? | by Kevin Doubleday | Fluree PBC | Medium
Fluree transforms data ownership, access, and security. Fluree offers an ACID-
compliant blockchain distributed ledger that records every state change in history as
an immutable changelog entry. It allows for powerful query capability with FlureeDB,
a graph query engine. By bringing blockchain to the data tier, Fluree is a practical and
powerful infrastructure on which to build, distribute, and scale custom blockchains.
Website: www.flur.ee
Docs: http://docs.flur.ee
Twitter: https://twitter.com/FlureePBC
Linkedin: https://www.linkedin.com/company/fluree-pbc/
Email: [email protected]
Search Medium
https://medium.com/fluree/immutability-and-the-enterprise-an-immense-value-proposition-98cd3bf900b1 10/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Save
This is the second part of the 100 part series on Blockchain. You can read the first part here to
understand what is Blockchain and its components.
data is stored in the block. Let’s take a real-life scenario to understand it in a better
way. Suppose I make a transaction of some amount in Steve’s account. There has to be
a place where this transaction information will be stored. This place is called a block in
the blockchain. A block records some or all of the most recent transactions that have
not yet entered any prior blocks. Each time a block is ‘completed,’ it becomes part of
the past and gives way to the next block in the Blockchain. A completed block is a
permanent record of transactions, which, once written, cannot be altered or removed.
Block time
The average time it takes for the Blockchain network to generate a new block of
transactions and add it to the Blockchain is called the block time. Some Blockchains
create a new block as frequently as every five seconds, and some may even take a few
minutes. For instance, the block time for Ethereum Blockchain is between 14 and 15
seconds, while the block time for bitcoin Blockchain is around 10 minutes. In
cryptocurrency, a shorter block time means faster transactions.
Elements of a block
The first block in the Blockchain is known as the genesis block, as it is the block from
where the chain originates.
1. Data and transactions: The first element is data and transactions. Let’s come to our
example. The amount associated with that transaction and all the other related
information like sender information, receiver information, etc., will be stored in the
block. The data contained in each block depends on the type of Blockchain. For
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 2/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
example, the food supply Blockchain will have information on all the processes
involved in that specific food supply chain.
2. Hash: Each block also includes a Hash- a unique identifier for the block and all of its
contents. To better understand, you can assume a hash to be equivalent to a
fingerprint. It is always unique, and no two blocks can have the same hash, just like in
the case of fingerprints. As soon as a block is created, its hash gets generated
simultaneously. Tampering with a block changes its hash. Simply put, if fingerprints or
hash of the block change, it indicates that the block has been tampered with and is no
longer the same block. So hash can be a very powerful tool to detect any changes made
in the block.
3. Hash of the previous block: Another important element that every block contains is
the hash of the previous block. This piece of information is what links one block to
another and makes the whole network safe and secure.
In the figure, block 4 contains the hash of block 3, block 3 contains the hash of block 2,
and so on. As discussed earlier, any change in the data of a block leads to a change in
its hash. In the given figure, when we change the data in block 2, the hash of block 2
gets changed as well, which makes the whole blockchain unstable. This happens
because each block contains hash of the previous block. When block 2 is tampered
with, the old hash becomes invalid, and a new hash is generated for the block. This
affects all the subsequent blocks in the chain and thus making all of them invalid. This
unique property of the blockchain makes it transparent and secure, as in any case of
data tampering whole network gets to know which block got compromised in the
blockchain.
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 3/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Hash of the previous block links the block to another block in the Blockchain
4. Timestamp: The fourth essential element that every block contains is the
timestamp. Timestamp simply means “a proof that some data existed at a particular
date and time.” In other words, the timestamp can be referred to as “Proof of
existence.” Any digital data can be timestamped. The hash of the block containing data
and transactions is timestamped and is then published on the network. By doing so, it
is ensured that the transactions have existed at this point in time. Implementing a
timestamp on the block also makes the block impossible to be repeated in the future
since, in addition to the time, the date of creation of the block is also stored. Therefore,
there is no possibility that any block in the future can be assigned a repeated hash that
was given to any of the previous blocks a week, two months, or a year ago.
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 4/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
5. Nonce: The fifth element of a block is nonce. The nonce is an abbreviation for
“number only used once.” The Nonce is an integer number that, along with the block
number, data, and previous hash, serves as an input for the hashing algorithm to
calculate the valid hash for the block. A valid hash for the block is a hash that meets a
certain difficulty i.e. contains a number of predefined zeros at the beginning of the
hash. Let’s take the example of Anders Brownworth Hash Program to understand how
nonce value is used to generate a valid hash
(https://andersbrownworth.com/blockchain/block).
If any change is made in the data, the hashing algorithm generates a completely
different hash for the block. If the newly generating hash does not have four leading
zeroes, then it will not be a valid block.
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 5/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
The block is made valid by the field called a nonce, which is not predetermined. Every
time a new nonce is selected for the same block, the resulting hash will be a different
value.
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 6/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 7/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Mining gives a unique nonce that corresponds to a valid hash to make a valid block
Since the nonce value can only be used once, it plays an important role to keep the
Blockchain immutable. Suppose the data is changed on Block 2, because of which the
hash changes as data is used to calculate the hash. Also, Block 2 becomes invalid
because its hash no longer has four leading 0’s. Block 3’s hash changes because Block
2’s hash was used to calculate Block 3’s hash. Also, Block 3 becomes invalid because its
hash no longer has four leading 0’s. The same is the case with other blocks in the
blockchain.
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 8/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Change in the data of Block 2 makes other blocks invalid in the Blockchain
The only way to mutate Block 2 is to mine the block again to find a valid hash with four
leading 0’s and then mine all the blocks after to find their valid hash because all the
blocks are linked together with the hash of the previous block. Since new blocks are
always being added, it’s nearly impossible to mutate the blockchain.
Open in app Get unlimited access
If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and
Searchclick
their applications, Medium
the below link.
Happy learning!
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 9/10
2/9/23, 2:43 AM What is a Block in the Blockchain? (Part 2- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Blockchain Game
Subscribe
https://medium.com/techskill-brew/what-is-a-block-in-the-blockchain-part-2-blockchain-basics-53ad20c766cc 10/10
2/9/23, 2:57 AM Why Is Blockchain Important?. Over the past few years, you have heard… | by Emmanuel Nwaka | Coinmonks | Medium
Published in Coinmonks
Save
Over the past few years, you have heard of the word ‘Blockchain,’ and you’ve always
thought it was synonymous with Bitcoin. This is not exactly true. As the world tends
towards decentralization, Blockchain is the power house of this technology. If you are
trying to learn what blockchain is, why it works, and what it powers, you have to stick
to this article until the end.
https://medium.com/coinmonks/why-is-blockchain-important-ab54d511d2ef 1/5
2/9/23, 2:57 AM Why Is Blockchain Important?. Over the past few years, you have heard… | by Emmanuel Nwaka | Coinmonks | Medium
Blockchain.
According to Simplilearn, Blockchain technology is a structure that stores
transactional records — the block — of the public in several databases — the chain — in
a network that is connected through peer-to-peer nodes. This type of storage is
commonly referred to as a ‘digital ledger.’
In the technology by which the blockchain works, every transaction in this ledger is
authorized by the owner’s digital signature. This type of signature authenticates the
transaction, safeguards it from manipulation, and ensures its accuracy. Hence, the
information the digital ledger contains is very, very secure.
In layman’s terms, the digital ledger is like a spreadsheet on Microsoft Excel that is
shared among numerous computers in a network. That means the transactional
records are stored based on actual purchases. The mind-blowing phenomenon of
blockchain technology is that anybody can see the data, but they can’t corrupt it.
The blockchain is an immutable distributed digital ledger with many use cases beyond
cryptocurrencies. It is immutable because every transaction on the blockchain cannot
be changed. It is a digital ledger because all the transactions made are digitally stored
in multiple places across various computer networks.
Although these people were not the originators of blockchain, Satoshi Nakamoto
invented and implemented the first blockchain network after deploying the world’s
first digital currency, Bitcoin. Many people presume that Satoshi Nakamoto was the
https://medium.com/coinmonks/why-is-blockchain-important-ab54d511d2ef 2/5
2/9/23, 2:57 AM Why Is Blockchain Important?. Over the past few years, you have heard… | by Emmanuel Nwaka | Coinmonks | Medium
It is programmable because anyone can see the results of any computation. Ethereum
is one of the cryptocurrencies that powers programmable blockchains, and these
blockchains can be used to create smart contracts which enable peer-to-peer
transactions. Programmability is one of the most important aspects of a blockchain.
Blockchain technology is immutable because all the validated records are irreversible
and cannot be changed.
Blockchain technology is secure because all the individual records are individually
encrypted, and the identities of the Blockchain members can be anonymous or
pseudonymous. Blockchain is unanimous because all the individual members have to
agree on a transaction before it is authenticated. It is time-stamped as all transaction
records have a timestamp that is recorded on the block. It is on a distributed ledger as
all individual members have a copy of the ledger for complete transparency.
https://medium.com/coinmonks/why-is-blockchain-important-ab54d511d2ef 3/5
2/9/23, 2:57 AM Why Is Blockchain Important?. Over the past few years, you have heard… | by Emmanuel Nwaka | Coinmonks | Medium
client is at risk. If the client’s government collapses, the value of their currency may be
at risk. This was the fallout of the financial crisis of 2008. Due to predatory lending and
excessive risk-taking, financial institutions all over the world suffered a massive crisis.
These were the issues that brightened the emergence of Bitcoin.
Because of its distributed ledger technology that spreads its operations across multiple
networks, blockchain allows Bitcoin and other cryptocurrencies to operate without the
need for a central authority. This reduces the risk of theft and eliminates huge
transaction fees. It can also give countries with unstable currencies or financial
infrastructures a currency with a wide range of applications. This makes it easier for
individuals and institutions to do business domestically and internationally.
The method of safety in a Blockchain is the use of public and private keys, which poses
an issue. If a user loses their private key, they may not be able to access the network.
The scalability restrictions are a hassle due to the limited number of transactions per
node. This means that multiple transactions can take several hours to complete. It is
also difficult to change or add information after it is recorded, another disadvantage of
blockchain.
Conclusion.
As we conclude, a blockchain is a database that stores encrypted data as blocks and
chains them together to form a chronological single-source of truth for the data. The
inherent security of Blockchain makes it a prime technology for almost every single
sector. While I am fascinated with this technology, I found it necessary to share my
thoughts.
If you loved this article, give it a clap and comment if you found it helpful.
https://medium.com/coinmonks/why-is-blockchain-important-ab54d511d2ef 4/5
2/9/23, 2:57 AM Why Is Blockchain Important?. Over the past few years, you have heard… | by Emmanuel Nwaka | Coinmonks | Medium
Follow me on:
Twitter: @EmmanuelNwaka_
Instagram: @Emma_Nwaka
179
https://medium.com/coinmonks/why-is-blockchain-important-ab54d511d2ef 5/5
2/9/23, 2:35 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Save
Hash functions are one of the most extensively-used cryptographic algorithms that
generate a fixed-length output for any input data irrespective of its size and length. The
input data can be a word, a sentence, a longer text, or an entire file. The fixed-length
output generated for the input data is called a hash. Many types of cryptographic hash
functions/ algorithms are available like MD5, BLAKE2, SHA-1, SHA-256, etc. Secure
Hashing Algorithm 256, commonly referred to as SHA-256, is one of the most famous
cryptographic hash functions used extensively in Blockchain technology. It was
developed by the National Security Agency (NSA) in 2001.
When we pass a certain message through the hash algorithm, it generates a hash
against this input. Regardless of the size of the letters or numbers you input, the hash
algorithm always generates a fixed-length output. The fixed-length output can vary like
32-bit, 64-bit, 128-bit, or 256-bit depending on the hash algorithm being used. For
instance, SHA-256 generates a hash value of 256 bits, equivalent to the size of 64
characters.
Using a fixed-length output increases security since anyone trying to decrypt the hash
won’t be able to tell how long or short the input is simply by looking at the length of the
output. The only method to determine the original string from its hash is by using
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 2/8
2/9/23, 2:35 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
“brute-force.” Brute-force basically means that one has to take random inputs, hash
them and compare them with the target hash. For instance, if the SHA-256 hash
algorithm is used, a brute-force attack would need to make 2^256 attempts to generate
the initial data.
Now, let’s discuss the important properties of a cryptographic hash function used in
the Blockchain:
A small change in the input value alters the Hash value significantly
One of the unique properties of a cryptographic hash function is that even a small
change in the input value brings about a drastic change in its output value. This is
referred to as the Avalanche Effect. For instance, when the first input, ‘Blockchain is
the future’ is passed through the hash function, a specific output or hash is generated.
But when a small change is made to the input, like, an extra exclamation mark is
added- ‘Blockchain is the future!’ you can see that the new hash is generated, which is
entirely different from the previous hash. This property of cryptographic hash
functions makes them resistant to hacking as no correlation can be derived about the
input data by just looking at the hash alone.
Computationally Efficient
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 3/8
2/9/23, 2:35 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
One of the other crucial properties of a cryptographic hash function used in the
Blockchain is its quick computation. The hash function requires computers on the
Blockchain network to perform certain complex mathematical tasks to generate a hash
from the input data. So when we say that the hash function should be computationally
efficient, it simply means that the computers should be able to finish the required
mathematical task in a short time.
Deterministic
A cryptographic hash function used in the Blockchain must be deterministic. In simple
words, a hash function is said to be deterministic if it generates the same hash
whenever the same input is passed through it. No matter how many times we pass an
input ‘ Blockchain is the future’ through the hash function, it should always generate
the same exact output or hash every single time.
If different outputs are generated by a hash function for the same input, the hash
function will become useless, and it would be impossible to verify a specific input.
Pre-Image Resistance
The input for a cryptographic hash function can be any kind of data. This data can be a
number, a word, a sentence, a passcode, a song, a book, or a complete movie. But the
hash generated for any kind of input data by the hashing algorithm will be an
alphanumeric code and that too of a fixed length.
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 4/8
2/9/23, 2:35 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Collision Resistant
Collision resistance is another important property of a cryptographic hash function.
Being collision-resistant simply means that it should be highly improbable to generate
the same output or hash for two different inputs.
As discussed earlier, the input for a hash function can be of any type, size, and length.
Therefore, there are infinite possibilities for the data input that can be fed into a hash
function. But the corresponding hash or output generated will have a fixed length. This
means that there will be a finite number of outputs that can be generated using the
hash algorithm. If inputs can be infinite and outputs are finite in number, it is quite
possible that more than one input can produce the same output.
So the goal of being collision-resistant is to make the probability of finding any two
such inputs which share the same output negligible. So if a hashing function is
collision-resistant, this possibility won’t pose any security risk to the data.
One-way functions
Hash functions are generally referred to as one-way functions because they are not
reversible. While a hash function is a cryptographic function, it’s not encryption.
Encryption works by encrypting the relevant data with an encryption algorithm and an
encryption key. This results in a ciphertext that can only be viewed in its original form
if decrypted with the correct key. A hash function, in contrast to encryption, works as a
one-way function; in simple words, if you have a hash, you can not decrypt it to find
the corresponding input. So in a real-life scenario, even if a hacker gets access to a
hash output, it is completely useless as he can’t decrypt it to get the input.
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 6/8
2/9/23, 2:35 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
To help you understand it in a better way, let us take an example — Suppose Mr. A
holds the land entitlement of a piece of land. That information is stored with the
relevant Government Authority in their database. Now, this land record data is given a
unique hash using a hash function. As the record is a centralized record, it can be
tampered with, and changes can be made in the records by some corrupt officials
because of their personal gains. Assume that some corrupt official tampers the data
and changes the land area Mr. A owns. In this case, when the altered land record data
will be passed through the hash function, the hash generated would be different from
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 7/8
2/9/23, 2:35 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
the previous one. Thus, indicating that the land data has been tampered with. So this is
how a hash can be used to track and validate the data.
On the other hand, it is not possible to decrypt this hash and find out that it represents
land record data for the land owned by Mr. A. Therefore, we can say that a hash can be
used to track and validate the information but can’t decrypt and find the original data.
If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and
their applications, click the below link.
Search Medium
Happy learning!
Blockchain Game
Subscribe
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 8/8
2/9/23, 3:21 AM What Are Hash Functions, and How Do They Work? | by Matt Stokes | Geek Culture | Medium
Save
You could theoretically continue with your day, forget you ever saw this article, and
risk future embarrassment of a most profound order when you get out-geeked by the
guy sitting behind you (and listening intently to you and your friend’s conversation). Or
you could make the right decision, take 5-minutes now, and never be out-geeked again.
😏
https://medium.com/geekculture/what-are-hash-functions-and-how-do-they-work-3177553e429e 2/7
2/9/23, 3:21 AM What Are Hash Functions, and How Do They Work? | by Matt Stokes | Geek Culture | Medium
https://medium.com/geekculture/what-are-hash-functions-and-how-do-they-work-3177553e429e 3/7
2/9/23, 3:21 AM What Are Hash Functions, and How Do They Work? | by Matt Stokes | Geek Culture | Medium
Deterministic: The same input must always result in the same output. It would be
unfortunate if you inputted the words “pay Michael $10” into your hash function and
used the key to later receive the message “pay Sally $10,000.”
https://medium.com/geekculture/what-are-hash-functions-and-how-do-they-work-3177553e429e 4/7
2/9/23, 3:21 AM What Are Hash Functions, and How Do They Work? | by Matt Stokes | Geek Culture | Medium
Collision Resistant: It should be basically impossible to find two inputs that hash to the
same output, i.e. the scenario F(g) = F(c) should never occur.
Non-Predictable: The same input should always create the same output, and said
output should be impossible to predict in advance, meaning the output must be
entirely random.
Time to Rehash 😏
Let’s recap. Hash functions in their most basic form are just functions that take an
input and provide a random and unpredictable output of a fixed length. The hash
functions used in blockchain-specific applications are known as Cryptographic Hash
Functions, and although they are categorized under the umbrella of hash functions,
they have a specific set of guidelines that they must satiate in order to fulfill the
purpose required of them. These guidelines ensure that the hashes created by said
functions result in the blockchain’s famed immutability.
https://medium.com/geekculture/what-are-hash-functions-and-how-do-they-work-3177553e429e 5/7
2/9/23, 3:21 AM What Are Hash Functions, and How Do They Work? | by Matt Stokes | Geek Culture | Medium
Further Resources:
https://www.tutorialspoint.com/cryptography/cryptography_hash_functions.htm — Tutorials
Point
https://www.thesslstore.com/blog/what-is-a-hash-function-in-cryptography-a-beginners-
guide/ — The SSL Store
Search Medium
Sign up for Geek Culture Hits
By Geek Culture
Subscribe to receive top 10 most read stories of Geek Culture — delivered straight into your inbox, once a week. Take a
look.
https://medium.com/geekculture/what-are-hash-functions-and-how-do-they-work-3177553e429e 6/7
2/9/23, 3:21 AM What Are Hash Functions, and How Do They Work? | by Matt Stokes | Geek Culture | Medium
https://medium.com/geekculture/what-are-hash-functions-and-how-do-they-work-3177553e429e 7/7
2/9/23, 3:08 AM What is P2P?. If using the Internet daily, it’s… | by Kript Team | kriptio | Medium
Published in kriptio
Save
What is P2P?
If using the Internet daily, it’s unlikely that you haven’t heard of a peer-to-peer
network. So what exactly is p2p and how does it differ from a traditional centralized
network? Let’s dig deeper.
https://medium.com/kriptapp/what-is-p2p-6069b355e076#:~:text=P2P vs Centralized Network&text=In the centralized network the,files are accessible f… 1/6
2/9/23, 3:08 AM What is P2P?. If using the Internet daily, it’s… | by Kript Team | kriptio | Medium
To join the p2p network computers should have the Internet connection and a special
p2p software. If your computer is connected to the p2p network, you can look for files
on other computers in the network in the particular folders designated for sharing.
The P2P concept was popularized by file sharing systems at the end of the 20th
century. The most famous example of the p2p network is Torrent. File sharing in
Torrent network is organized with special programs called torrent clients (BitTorrent,
uTorrent, etc.) that automatize exchange process between the peers.
The main difference between a centralized network and a p2p network concerns a
data backup, recovery, and availability of files.
https://medium.com/kriptapp/what-is-p2p-6069b355e076#:~:text=P2P vs Centralized Network&text=In the centralized network the,files are accessible f… 2/6
2/9/23, 3:08 AM What is P2P?. If using the Internet daily, it’s… | by Kript Team | kriptio | Medium
While in the p2p network only the community of users is responsible for deciding
what files are accessible for sharing. Once the file is removed from the central server,
there is no way to download it anymore. Meanwhile, to make the file unavailable for
download in the p2p it needs to be deleted from all the computers in the network.
The main disadvantage of the centralized network is that users have no right to decide
which files to remain and which ones to remove. As for the drawback of the p2p, it
brings a vast number of disliked files since if the file is stored in only one computer, it
will be available in the network anyway.
There are structured and unstructured p2p networks. The structured networks
organize overlay, ensuring efficient search for files. As examples, you can look for
Torrent, Kad network, and Storm botnet.
https://medium.com/kriptapp/what-is-p2p-6069b355e076#:~:text=P2P vs Centralized Network&text=In the centralized network the,files are accessible f… 3/6
2/9/23, 3:08 AM What is P2P?. If using the Internet daily, it’s… | by Kript Team | kriptio | Medium
Meantime, the unstructured networks are created by nodes that randomly form
connections to each other. Search for Gnutella, Gossip, and Kazaa to get a more clear
idea of the systems
https://medium.com/kriptapp/what-is-p2p-6069b355e076#:~:text=P2P vs Centralized Network&text=In the centralized network the,files are accessible f… 4/6
2/9/23, 3:08 AM What is P2P?. If using the Internet daily, it’s… | by Kript Team | kriptio | Medium
Search Medium
There is also one more type of the network called hybrid models. A hybrid model is a
combination of the p2p and the client-server networks. The hybrid models usually
have a central server to help peers find each other in the chain.
Today, the p2p networks are the most widespread methods to share files for Internet
users all around the world. And there are many different p2p networks that provide
people with a convenient way of decentralized interaction.
Content kript.io
Share with your friends if you enjoyed this post
Download Kript on AppStore and GooglePlay
Follow us on Telegram, Facebook, Twitter
https://medium.com/kriptapp/what-is-p2p-6069b355e076#:~:text=P2P vs Centralized Network&text=In the centralized network the,files are accessible f… 5/6
2/9/23, 3:08 AM What is P2P?. If using the Internet daily, it’s… | by Kript Team | kriptio | Medium
https://medium.com/kriptapp/what-is-p2p-6069b355e076#:~:text=P2P vs Centralized Network&text=In the centralized network the,files are accessible f… 6/6
2/9/23, 3:03 AM PEER-TO-PEER NETWORK EXPLAINED. Peer-to-peer, or P2P in its abbreviated… | by XcelToken Plus | XcelLab Magazine | Med…
Save
In a way, peer-to-peer networks are the most egalitarian networks in the computer
world. Each peer is equal to the others, and each peer has the same rights and duties as
the others. Peers are both clients and servers at the same time.
In fact, every resource and each asset that’s available in a peer-to-peer network is
shared among peers, without any central server being involved. The shared resources
in a P2P network can be things such as processor usage, disk storage capacity, or
network bandwidth.
The next big thing in the history of P2P was the year 1999 when Napster came to life.
Napster was file-sharing software that was used by people to distribute and download
music. The music shared on Napster was usually copyrighted and thus illegal to
distribute. However, that did not stop people from getting it. Although Napster was the
one that got P2P into the mainstream, Napster ultimately failed and was shut down by
authorities because of all the content that was shared illegally on it. Nowadays, P2P
remains one of the most popular technologies for sharing files over the internet, both
lawfully and unlawfully.
The primary goal of peer-to-peer networks is to share resources and help computers
and devices work collaboratively, provide specific services, or execute specific tasks.
As mentioned earlier, P2P is used to share all kinds of computing resources such as
processing power, network bandwidth, or disk storage space. However, the most
common use case for peer-to-peer networks is the sharing of files on the internet.
Peer-to-peer networks are ideal for file sharing because they allow the computers
connected to them to receive files and send files simultaneously.
Example: you open your web browser and visit a website where you download a file. In
this case, the website works as a server, and your computer acts as a client receiving
the file. You can compare it to a one-way road: the file that you download is a car that
goes from point A (the website) to point B (your computer).
When you download the same file from a peer-to-peer network, using a BitTorrent
platform as a starting point, the download is performed differently. The file is
downloaded to your computer in bits and parts that come from many other computers
that also connected to the same P2P network and already have that file or at least parts
of it. At the same time, the file is also sent (uploaded) from your computer to other
devices that are asking for it. This situation is similar to a two-way road: the file is like
multiple small cars coming to your PC, while also leaving to others when it is
requested.
Source: Google.com
It’s hard to take them down. Even if one of the peers is shut down, the others are still
operating and communicating. For a P2P (peer-to-peer) network to stop working, you
have to close down all its peers.
Peer-to-peer networks are incredibly scalable. Adding new peers is easy as you don’t
need to do any central configuration on a central server.
When it comes to file-sharing, the larger a peer-to-peer network is, the faster it is.
Having the same file stored on many of the peers in a P2P network means that when
someone needs to download it, the file is downloaded from multiple locations
simultaneously.
Search Medium
Save
P2P network module is an underlying part of TRON’s architecture. This article will
provide a detailed illustration on how P2P is implemented in TRON’s network
including the rules of node discovery and of connection establishment.
2. Introduction
The public chain is governed by all nodes in a P2P network. Each node needs to seek
out the other peers in the network and choose trusted nodes to build a local routing
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 1/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
table by discovering unknown nodes in the network. Once the table is established,
nodes will be able to use their own filtering rules as a defense mechanism and select
the reliable nodes to build connections.
3. Kademlia algorithm
To construct a blockchain system using P2P network, there are a couple of questions to
consider:
Based on the above considerations, TRON chose Kademlia algorithm, which specifies
the logical structure of the routing table and conducts information exchange through
node discovery. The article will elucidate how TRON implement Kademlia, and the
above-mentioned questions will be answered as the article goes on.
3.1 Introduction
Kademlia is one of the many versions of DHT (Distributed Hash Table). Compared with
previous versions, Kademlia has many advantages such as:
3.2 Nodes
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 2/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
A distributed P2P network consists of many nodes. In a Kademlia network, each node
has a unique ID generated by random encryption algorithm, replacing IP as the node’s
identifier. In addition, the distance between two nodes can be calculated by
performing XOR operation on two nodes, and that is how other nodes are located.
In the implementation, B = 512, the length of the node ID is 512 bits (64 bytes).
Here some questions may rise: Why would there be nodes that do not really exist?
What is the meaning of this field?
A Kademlia network can be indicated with a binary tree. The height of the tree equals
the length of the node ID, and each leaf represents a Kademlia node. Thus, when B =
512, the tree can host a maximum of 2⁵¹¹ Kademlia nodes. In reality, the number of
nodes will not be tremendous. In order to look for other nodes, the algorithm will
generate an ID that complies with all rules (the said ID will be known as target). This
ID may not have a real node under it, but whether real or not, it serves as an important
aid in terms of expanding the routing table.
3.3 Distance
Kademlia calculates the distance between two nodes using the XOR operation.
“Distance” here refers to the logical distance computed using a mathematical method
rather than the physical distance (e.g. two nodes in China and the US are close in
distance in a Kademlia network if assigned similar IDs).
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 3/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
Now, there are two node IDs, A and B. For ease of illustration, let’s assume the length
of them is 4 binary bits (0001 and 0010). The steps to compute the distance between the
two are as follows:
Subtract the number of consecutive 0s following the most significant bit from 4
(e.g. two consecutive 0s will make 4 -2 = 2 )
We can draw the following conclusion from the above calculation: the more bits match
at the beginning of the two IDs, the smaller is the distance between them (a node is
closest in distance to itself because the according output from XOR operation equals 0).
We can draw an analogy between logical distance and interpersonal distance from the
above illustration. One thing to note is that A also obtains B and C’s information
alongside M’s, making three friends, B, C, and M.
In actual node discovery, the letters aforementioned each represent a node. M may be
non-existent, but it doesn’t matter as B and C must be real nodes. Upon completing a
node discovery, A obtains B and C’s information, and through which it expands its
routing table.
Kademlia adopts the XOR operation to calculate distance based on the following three
considerations:
it is symmetric: the “distances” calculated from A to B and from B to A are the same
it follows the triangle inequality: given A, B and C are vertices (points) of a triangle,
then the distance from A to B is shorter than (or equal to) the sum of the distance
from A to C plus the distance from C to B. dist(A, C) ≤ dist(A, B) + dist(B, C)
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 4/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
The above three features qualify the XOR operation as an easy and convenient method
to calculate the distance between nodes.
Essentially, building a routing table is creating a map of the overall network. According
to the aforementioned example, neighbor discovery is a process where nodes
constantly converge towards the target. Given a random target node X, the node N will
gradually move towards X by constantly obtaining information from nodes that are
closer to X. In this process, N’s routing table keeps on expanding even if X does not
exist.
The specific implementation of the Kademlia routing table can be adjusted based on
the actual situation. In our implementation, each node maintains a fixed-sized routing
table that consists of n lists. According to the Kademlia paper, these lists are named “k-
buckets”, with k referring to the maximum entries that can be stored in each list (e.g.
k=16).
In the implementation, for list m(0 < m < 256), the distance between the local node
and all nodes stored in this list equals m; for nodes stored in list 0, the distance
between them and the local node is , and we have -256 ≤ dis ≤ 0
Based on the discussion above, bucket 0 seems more likely to be full as it needs to store
nodes covering a wider range, but the actual case is different. The reason for this will
be explained below.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 5/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
For ease of illustration, we assume each node ID has three bits and there is a
maximum of 2³ nodes, as shown in the figure below:
local node with ID=110 as an example. There are four nodes with 0 matched bit at the
beginning (001, which should be next to 010, is not shown in the figure), two with 1
matched bit and one with 2 matched bits.
This shows that with a randomly-generated ID, there is a much bigger chance that the
distance between the local node to any node on the network is greater rather than
smaller. If we denote the number of matched bits at the beginning as x, then the
probability is 2⁻ˣ⁻¹.
It can be inferred from the above binary tree that the greater the bucket’s number is,
the bigger the chance of a node falling into it and hence it’s more likely to be filled.
Considering the actual situation, each node maintains 256 buckets, among them,
buckets No. 1 to No. 255 store nodes with a distance of 1 to 255 respectively; bucket No.
0 stores nodes whose distance is no greater than zero other than itself.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 6/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
Methods for addressing full buckets will be explained in “Node State” below.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 7/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
• Search its own routing table and obtain information from the node that is close to the
target. It will refresh its routing table if a node closer to the target is identified.
• Regenerate a target ID and repeat the above steps after entering the maximum
number of rounds.
Each node stores information from a fraction of nodes on the whole network. While
approaching the target, the local node obtains more information from other nodes
through constant neighbor discovery, thus expanding its routing table. To ensure the
availability of its neighboring network and the stable operation of the whole network
in a broader sense, each node chooses to store information from nodes with a longer
uptime in its routing table.
In the implementation, trusted seed nodes will be first included in the routing table
when they start as the guide to node discovery.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 8/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 9/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 10/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 11/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
Read the preset seed node and ping it. If the seed node is alive (the node replies
with a pong message), add it to the routing table and set the state as active.
Send a ping message to the newly-discovered node. If the node returns a pong
message, it is alive. Then set its status as active. Otherwise, set it as dead.
Try to add nodes that are alive into the routing table based on their distance (into
the corresponding k-bucket).
1. If the k-bucket is not full, add the node directly and set it as active.
2. If the bucket is full, find the node with the smallest modified value (modified
refers to the last time the node pinged successfully. The smaller the modified
value, the less likely the node is active) and challenge it. Then change the state of
the challenged node from active to evictcandidate.
1. If the evictcandidate node returns a pong message, it is alive. Then reset its state as
active and change the modified value to the current time; make no changes to
nodes that are alive.
2. If the evictcandidate node does not return a pong message, it is offline. Then set its
state as nonactive and remove it from the routing table; add nodes that are alive
into the routing table and change their state to active.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 12/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
According to the above steps, new nodes will join only when there are offline nodes in
the routing table.
4. Build Connection
Since each node only has a limited number of slots for connection, a scoring system is
introduced to rate and rank nodes in the routing table in order to help connect high-
quality nodes. Whether a node is categorized as “High-quality” is determined based on
many metrics including connection stability and value of the information stored by
other nodes.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 13/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
Penalty will be first considered when scoring a node. A node can be penalized for the
following reasons:
It has not been 60 seconds since the last time the node was disconnected.
Block information of the nodes do not match (such as genesis block or solidity
blocks)
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 14/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
Here handshake is not the 3-way TCP handshake. It refers to the process during which
the node verifies whether the node it has built connection with is on the same chain.
When selecting nodes for connection, nodes pre-declared in configuration files will be
first considered.
These are two types of trusted nodes. It should be noted that scoring is only one of the
filtering rules. While trusted notes can skip scoring and be first considered to build
connection with, they still need to meet other filtering criteria to qualify for
connection.
Determine if connections from the same IP have reached the limit, including
connections sent to the same IP. The purpose is to fend off attacks.
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 15/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
After taking such risk into consideration, we have taken some counter-measures in
implementation:
Among the fixed peak number of connections, some of them must be initiated by
the node itself (instead of passively accepting all connections).
A node can build a maximum of two connections with the same IP.
Starting multiple nodes on one device will be deemed an attack. That’s why there is a
limit to the number of connections with the same IP. Meanwhile, as a node is started, it
will first connect the preset trusted nodes (proactively build connections with active
nodes and give priority to connection requests from passive nodes). Node filtering
makes it harder for attackers to get their way.
4.3 Handshake
Handshake happens after TCP connection with other nodes is built and before sync
starts. The purpose is to determine if the nodes share the same block information.
There is no use interacting with a node storing different block information.
Both parties in the handshake will send HelloMessage to each other, which includes
the following information:
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 16/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
Current time
Genesis block ID
Solidity node ID
Block header ID
The connection will be cut off when the two parties verify their HelloMessage in the
following cases:
Local solidity nodes have a larger block height than the other party and the solidity
nodes of the other party are not recorded on the local blockchain.
5 Concluding Remarks
This article introduces TRON’s P2P network. Co-governance of a distributed P2P
network lays the foundation for decentralization, an important feature of blockchain.
A thorough understanding of the P2P network, the cornerstone of blockchain, takes us
to the world of blockchain faster.
6 References
https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf
Telegram: https://t.me/troncoredevscommunity
[1] The extent to which a node is new or old is determined by its modified value. When
a ping is sent to an existing node in the routing table and a pong is returned
successfully, the modified value of the node will be changed to the time when pong is
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 17/18
2/9/23, 3:27 AM A Detailed Description of P2P Network Modules | by TRON Core Devs | Medium
received (in the form of a timestamp). The larger the modified value, the newer the
node.
Search Medium
https://coredevs.medium.com/a-detailed-description-of-p2p-network-modules-ff8f03ebda20 18/18
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
Courses
In this part of the Blockchain tutorial, we shall focus on Blockchain mining. We will understand its complete definition,
importance, and where it is used, inception story, types of bitcoin mining, how you can mine bitcoins, and various processes that
are centered around mining bitcoins. Read on!
Blockchain Tutorial
For Beginners
Blockchain
What is Blockchain?
Blockchain Currency -
Cryptocurrency
Blockchain Wallet
Blockchain Explorer
What is Blockchain
Database - Difference
between Blockchain and
Relational database
Understanding
Blockchain Forks
What is Bitcoin
Blockchain?
What is Blockchain
Mining?
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 1/7
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
What is Bitcoin?
Hyperledger
What is Ripple
Download Salary
Blockchain? Trends
Email Address Phone Number Submit
Learn how professionals like you got upto 100% hike!
What is EOS Blockchain?
Use Cases of
Blockchains
Hyperledger Blockchain
Blockchain Applications
At its core, the term ‘Blockchain mining’ is used to describe the process of adding transaction records to the bitcoin blockch
ain. This process of adding blocks to the Blockchain is how transactions are processed and how money moves around
securely on Bitcoins. This process of Blockchain mining is performed by a community of people around the world called
‘Blockchain miners.’
Anyone can apply to become a Blockchain miner. These Blockchain miners install and run a special Blockchain mining
software that enables their computers to communicate securely with one another. Once a computer installs the software,
joins the network, and begins mining bitcoins, it becomes what is called a ‘node.’ Together, all these nodes communicate
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 2/7
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
with one another and process transactions to add new blocks to the blockchain which is commonly known as the bitcoin
network. This bitcoin network runs throughout the day. It processes equivalent to millions of dollars in bitcoin transactions
and has never been hacked or experienced downtime since its launch in 2009.
Types of Mining
The process of mining can get really complex and a regular desktop or PC cannot cut it. Hence, it requires a unique set of
hardware and software that works well for the user. It helps to have a custom set specific to mining certain blocks.
1. Individual Mining
When mining is done by an individual, user registration as a miner is necessary. As soon as a transaction takes place, a
mathematical problem is given to all the single users in the blockchain network to solve. The first one to solve it gets
rewarded.
Once the solution is found, all the other miners in the blockchain network will validate the decrypted value and then add it
to the blockchain. Thus, verifying the transaction.
2. Pool Mining
In pool mining, a group of users works together to approve the transaction. Sometimes, the complexity of the data
encrypted in the blocks makes it difficult for a user to decrypt the encoded data alone. So, a group of miners works as a
team to solve it. After the validation of the result, the reward is then split between all users.
3. Cloud Mining
Cloud mining eliminates the need for computer hardware and software. It’s a hassle-free method to extract blocks. With
cloud mining, handling all the machinery, order timings, or selling profits is no longer a constant worry.
While it is hassle-free, it has its own set of disadvantages. The operational functionality is limited with the limitations on
bitcoin hashing. The operational expenses increase as the reward profits are low. Software upgrades are restricted and so
is the verification process.
Submit
Curious to know the Blockchain Interview Questions and Answers for 2023?
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 3/7
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
You can buy and trade for bitcoins, or you can mine them. For mining bitcoins, users are rewarded in bitcoins. This
mechanism forms the pivot around which the bitcoin economy revolves. While the cost and difficulty of mining bitcoins
individually continue to increase, several cloud-based mining services have gradually emerged. These services allow
individual users to lease the processing power of mining equipment and mine bitcoins remotely. However, you can mine
bitcoins in person too.
Read more: Check out our blog on Blockchain developer salary!
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 4/7
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
Pick a mining pool: This is the best shot you can get to earn bitcoins easily. There are many mining pools that charge a
mere 2 percent of your total earnings. Over here, you will have to create workers which are basically subaccounts that
can be used to track your contributions to the pool.
Connect the power supply to the ASIC Blockchain miner.
Connect the ASIC Blockchain miner to your router.
Boot up your ASIC miner.
Enter your router’s IP address in a web browser.
Find ‘connected devices in the router miner page.
Find your ASIC miner and click on it to display the device information.
Copy and paste the IP address of your ASIC miner into your web browser.
Log in to the ASIC miner with the default username and password that are ‘Root’ and ‘Root.’
Select ‘Miner Configuration’ to set up the miner according to your preferences.
Enter the URL, username, and password for your mining pool on the Miner Configuration page of the ASIC Miner.
Click ‘Save and Apply’ to save your credentials for future use.
Start mining and in periodic intervals check your profitability.
Put your earnings in your own secure wallet: Whenever you witness an ROI, simply withdraw your earnings and put
them in your own secure wallet.
Career Transition
1. Validating Transactions
Bitcoin transactions take place in huge figures every day. Cryptocurrencies function without a central administrator and the
insecurity can be substantial with the transactions that transpire. So, what is the authentication method with such
cryptocurrencies? With each transaction, new blocks are added to the blockchain in the network and the validation lies in
the mining results from the blockchain miners.
2. Confirming Transactions
Miners work the blockchain mining process to confirm whether the transaction is authentic or not. All confirmed
transactions are then included in the blockchain.
3. Securing Network
To secure the transaction network, bitcoin miners work together. With more users mining the blockchain, blockchain
network security increases. Network security ensures that there are no fraudulent activities happening with
cryptocurrencies.
Sounds interesting? You can check the offers for an online Blockchain training course or get back to other topics in this Bloc
kchain online tutorial.
Now that we have shared with you how to mine bitcoins, why don’t you give it a shot?
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 5/7
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
Previous Next
Course Schedule
11 Feb 2023
AWS Certification View Details
(Sat-Sun) Weekend Batch
18 Feb 2023
AWS Certification View Details
(Sat-Sun) Weekend Batch
25 Feb 2023
AWS Certification View Details
(Sat-Sun) Weekend Batch
Good article. Helped me in understanding how blockchain works JUNE 26, 2021 AT 6:08 PM
Reply
Mitli says:
Reply
Usman says:
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name * Email *
Post Comment
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 6/7
2/9/23, 3:38 AM What is Blockchain Mining and who is a Blockchain Miner? - Intellipaat
Browse Categories
Master Program Big Data Data Science Business Intelligence Salesforce Cloud Computing
Website Development
Bangalore Charlotte Chennai Chicago New Delhi Gurgaon Houston Hyderabad Kolkata London
Melbourne Mumbai New York Noida Pune San Jose Sydney Toronto Dubai Jersey City Los Angeles San
https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-bitcoin-mining/ 7/7
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Save
While inspiring overall, this extreme pace also comes with a negative side: it means
that education simply cannot keep up. The absence of quality training programs
around blockchain means that many people will either miss out on opportunities in
this new and exciting field, or even worse — will make premature career choices based
on an erroneous understanding of what is possible and what isn’t.
There are lots of concepts that allow Blockchain-powered projects and ideas to exist. It
would take a whole online course to cover all of these topics (see end of this post for more
details). That’s why today we are going to laser-in on just one concept. For this article
I’ve picked perhaps the most used and, at the same time, most misunderstood topic:
Mining.
We’ve all heard about Bitcoin mining and miners. We’ve probably even used these
terms. But what exactly do these miners do? What is mining all about? Those are the
question we will be answering today and we will do this in three parts:
Note: We’re going to look at the example of Bitcoin. Other cryptocurrencies such as Ethereum
may use different ideas (e.g. a different type of hash function) and therefore the specifics will
vary, however the underlying concepts remain the same.
But what does this mean and how is this connected to mining? Let’s have a closer look.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 2/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
A hash (or cryptographic hash) is a long number which acts as a digital fingerprint of
any collection of data. In Bitcoin the SHA256 hashing function is used which generates
a 64-digit hexadecimal number. For example, the cryptographic hash of the words in
this paragraph is:
C019286295F2CDEC9958BEE25B9603B5F94C76B2CCC69A59CE54872ED26DC479
Note: in the images here hashes are shortened for illustration purposes.
Hashing algorithms have many interesting properties, however today we are most
interested in three: 1) the SHA256 function is deterministic — you will always get the
same hash output if you recalculate the function with the same input; 2) the SHA256
function is impossible to reverse-engineer. Meaning that you can never know in
advance what hash value you will get until you actually calculate it; and 3) if you feed
the SHA256 function two even slightly varying inputs (for example, you change a dot
for a comma), you will get wildly different outputs.
From our example above, we would input the current block’s number, the data stored
in the block and the hash of the previous block into the SHA256 function to get the
value of the current block’s hash:
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 3/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Now we can see how the blocks are linked — not only does each block reference the
previous block’s cryptographic hash — but, in fact, that hash directly affects the value
of the current block’s hash. Therefore, if anyone were to tamper with any given block’s
data, such action would render not only that specific block’s hash invalid — but also all
of the following blocks’ hashes invalid.
Such connection between blocks means that the Blockchain as a whole is much more
tamper-proof than standard database structures and other record-keeping methods.
And since a Blockchain is in essence a ledger of records, this tamper-proof property is
known as the “Immutable Ledger” property.
Okay, great. That’s how blockchains work. But what has this got to do with mining? The
straightforward answer is that mining is all about calculating the hash value for the
newest block which is being added to the chain. However, it’s not all that simple.
The thing is that the SHA256 function only takes a fraction of a second to calculate.
And yet, you may have heard of the numerous mining pools such as BTC.com and
AntPool, and even industrial scale mines — all competing to generate the next Bitcoin
block. So the question is — why do we need all that computing power?
Blocks in the blockchain have another field which we have not spoke about yet. This
field is called “The Nonce” which stands for number used only once:
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 4/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The Nonce is an integer number and along with the Block Number, Data and Previous
hash the Nonce serves as an input for the SHA256 function to calculate the current
block’s hash:
Unlike other components of a block, the Nonce is designed to be totally under our
control. This means that now we have a mechanism to vary the current block’s hash
while keeping the data inside it intact. Indeed, thanks to the nature of the hash
function (property #3 in our discussion above), every time we select a new Nonce for the
same block the resulting hash will be a different value.
Alright, that’s great. But what has any of this got to do with mining? This is where we
come to the fun stuff.
There is a total of 16⁶⁴ possible SHA256 cryptographic hash values (each hexadecimal
digit has 16 possible values and there are 64 of them in a hash). However, not all of
them are valid hashes. Why is that? Well, every two weeks the Bitcoin network will
define a minimal target for the hash. Anything above this target will be rejected,
anything below — accepted.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 5/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The diagram above illustrates the pool (not to be confused with ‘mining pool’) of all
possible SHA256 hashes — starting at the bottom with smallest and increasing towards
the largest at the top. Somewhere along the vertical we have the target. Note that this
diagram is for illustrative purposes only as it is not proportionate — we’ll see why in a
bit.
0000000000000000005d97dc0000000000000000000000000000000000000000
What is really important in the target is the number of leading zeroes. Just like in the
decimal system, leading zeros in a fixed-size number will determine its magnitude.
Every leading zero reduces the number’s magnitude by a factor of 16 (ten in the
decimal system, but here we’re working with hexadecimals).
There are 18 leading zeros in the current target, meaning that the number of total valid
hashes is 16⁴⁶ (only 64-18=46 non-zero digits remain). Therefore, the probability that a
randomly picked hash is valid can be calculated as:
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 6/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
In Bitcoin mining terms, this is the probability that any given Nonce value will
generate a valid hash for the current block. We can now see why the diagram is out of
proportion: the pool of valid hashes in reality is extremely small in comparison to the
complete SHA256 pool.
And that’s what the cryptographic puzzle is all about: miners compete to find a Nonce
(also called a Golden Nonce) which will generate a valid hash for the upcoming block.
Whoever finds it first is allowed to add the block to the chain and get’s their reward of
12.5 Bitcoins. At the time of writing one Bitcoin is worth around $10,000 USD making
mining a rather worthwhile activity.
How to read this diagram: the red ‘X’ marks relate to SHA256 hashes while the labels beside
them illustrate which Nonce generated which hash value.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 7/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The target is defined based on the network’s hashrate (aggregate computational power
of all Bitcoin miners). The more miners join the network — the lower the target will be,
and therefore the harder it will be to find a suitable hash. The goal of this difficulty
algorithm is to ensure that only one new block to is added every 10 minutes. This is part
of the Bitcoin monetary policy to control the total number of coins in circulation.
In a nutshell, that’s what the millions and millions of mining machines are doing day
and night — they are simply iterating different values of the Nonce in hopes of being
the first to find a valid hash for the next block. Once a valid hash if found, the block is
added to the chain and the race starts over again, this time for the next block.
The Nonce is an integer value with 32 bits of memory allocated to it. Meaning that it
has a limited range of around 4 Billion values. This poses two problems:
First, even an average mining device can calculate up to 100 million hashes per
second, and therefore will go through the Nonce range in 40 seconds. And that’s an
average miner. Mining pools and industrial scale mines are able to go through the
Nonce range in fractions of a second.
Secondly, the chance of finding a valid hash is so small that even with 4 billion tries the
probability of success is still extremely low:
For starters, the block contains… you guessed it — another field which we haven’t
spoken about yet. This field is a timestamp representing the current Unix time
(number of seconds elapsed since 1st January 1970):
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 8/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The Timestamp is also included in the SHA256 calculation for the hash of the current
block that’s being mined:
SHA256(Block Number, Timestamp, Nonce, Data, Prev. Block’s Hash) -> Hash
And since the timestamp is constantly refreshing (until the block is successfully
mined), this effectively resets the Nonce range every second. Why? Well, as we
discussed at the very start — even if the inputs of the SHA256 function are varied
slightly, this causes the hash to change.
Therefore, if we try all 4 Billion Nonce values for a fixed combination of other inputs
(block number, timestamp, data, previous block’s hash) but have no luck finding a
valid hash, all we have to do is wait until the the timestamp increases. A change in the
timestamp will mean that the combination is now different and if we try all 4 Billion
Nonce values again, every time we will get a brand new hash value.
The timestamp solves the problem for the average miner since it will reset before they
get to the end of the Nonce range (reminder: average miner takes 40 seconds to do 4 Billion
passes). However, for a mining pool or industrial scale miner even one second is too long
— as we discussed, they would get through the Nonce range in fractions of a second. So
how do they solve the problem? This is where block transaction configuration comes
in.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 9/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Participants of the Bitcoin network transact with each other all the time. However, a
new block is only added once every ten minutes. So where do the transactions go
before they are added to a block? New entries are added to a staging area called the
mempool. It is then the miners’ job to pick up a batch of these transactions from the
mempool and add them to the new block they are mining.
Block size is limited and not all transactions from the mempool will fit into the new
block. This means that miners get to pick which transactions will go into the next
block. What this also means is that miners can change the configuration of
transactions at will (before the block has been successfully mined).
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 10/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
And this is how miners get additional control over the hash. Well… Control isn’t the
right word since the hash cannot be reverse engineered or predicted. Variability is a
better term here: changing the configuration of transactions creates additional
variability in the hash function inputs.
Similar to the timestamp situation, whenever we try out all 4 Billion possible values in
the Nonce range and have no luck, all we have to do is slightly alter the combination of
transactions which we have selected from the mempool.
The main difference here is that we don’t have to wait. By altering the selected
transactions, we can reset our Nonce range at will — therefore we can do this as many
times per second as we want. Of course, all this is done algorithmically. This way even
mining pools and industrial scale miners can test new hash values continuously without
any idle time.
Let’s sum up
We’ve covered a lot of ground. Let’s recap the Bitcoin / Blockchain mining process to
ensure we haven’t missed anything:
calculation of its own hash. Tampering with data in any one block will render its and
all following blocks’ hashes invalid.
2. The cryptographic puzzle requires miners to find a hash smaller than the set target
for it to be valid. Miners search for a valid hash by iterating through a designated
parameter within the block called the Nonce. Whoever is first to find a valid hash gets
to add the block and collect the reward.
3. The Nonce range contains 4 Billion possible values which is insufficient to find a
valid hash with a high degree of certainty. Resetting of the Nonce range is achieved by
including the current timestamp and through varying the configuration of transactions
included in the the block.
Join us
In March this year we successfully funded a Kickstarter project to create the most
comprehensive online course on blockchain the World has ever seen.
Today this course is Live on Udemy.com where over 3,000 students have already signed
up to master the concepts of Blockchain, Bitcoin, Smart Contracts and more. If you’d
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 12/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
like to become a Blockchain pioneer, then join us on this incredible adventure and take
your career to the next level:
https://www.udemy.com/build-your-blockchain-az/?couponCode=MEDIUM90
The link above already includes a special coupon for our Medium readers. Use it to get
90% OFF.
Kirill Eremenko
This story is published in The Startup, Medium’s largest entrepreneurship publication followed
by 320,924+ people.
Blockchain
2.2K 2
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 13/14
2/9/23, 3:41 AM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Search Medium
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 14/14
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
Published in @blockchain
Blockchain.com Follow
Save
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 1/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
What if we told you the answer to all three questions was the same: Bitcoin mining.
If you’re new to Bitcoin, you’ll want to read our article “Bitcoin, Explained” first to get a
better understanding of the original cryptocurrency.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 2/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
The bitcoin network is a blockchain, a linked series of data “blocks” with each block
containing a set of bitcoin transactions. All over the world, thousands of Bitcoin
miners race to be the first to complete a complex cryptographic “puzzle” using
specialized computer equipment.
The math problems the miners solve during each puzzle period (or “block”) enable the
release of new bitcoins and the confirmation of transactions on the network.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 3/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
1. When a new transaction is made on the Bitcoin network, it is broadcast to all nodes
in the network.
3. Other nodes in the network check the solution to verify that it is correct. If it is,
they add the transaction to their own copy of the blockchain and move on to the
next puzzle.
4. As a reward for their efforts, the miner who solved the puzzle is awarded a certain
number of bitcoins. This helps to incentivize miners to contribute their
computational power to the network.
5. The difficulty of the puzzles is adjusted over time to ensure that it takes an average
of about 10 minutes to add a new block of transactions to the blockchain. This
helps keep the rate at which new bitcoins are created steady and makes it more
difficult for attackers to manipulate the network.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 4/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
ASIC stands for Application-Specific Integrated Circuit, and while there are a variety of
ASICs created for different purposes, these are made just to mine bitcoin.
While standard consumer devices like CPUs and GPUs were used in the past to mine
bitcoin, those systems don’t offer the computational power needed to solve the hashing
puzzle at the current level of mining difficulty.
Block rewards. When a miner is the first to solve the validation riddle, they earn
BTC and add the next block of data to the chain.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 5/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
Listen to the full podcast with Jaime Leverton, CEO of Hut 8 Mining
The final bitcoin is expected to be mined in 2140, and this scarcity is where the
comparison to gold comes from. Once the last bitcoin is mined, that’s all there will
ever be, making bitcoin a deflationary asset.
The very first Bitcoin miners received 50 BTC as a block reward. However, the next
halving will be in 2024, further reducing the block reward to 3.125 BTC.
As you can imagine, Bitcoin mining has become big business. There are mining
“farms,” also known as hashing facilities, all over the world, and a quick online image
search will show the scale of these operations.
Gone are the days of a single Bitcoin user mining on their PC; computational power is
king, and more is better when it comes to processing transactions, winning the block
reward, and securing the blockchain.
Mining pools offer an alternative for regular users to participate in mining, without
needing to purchase warehouses full of ASIC mining rigs. In a mining pool, individual
miners lend their computing power to a mining farm through a shared server.
In exchange for their computing power, miners in the pool receive a proportional
share of the block reward when their pool solves the hash.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 6/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
This is how the Bitcoin blockchain is secured. If a hacker tries to manipulate the
blockchain, the data they try to enter into the ledger won’t match up with the data that
other nodes have, flagging it as a fraud.
Even if a hacker had enough computing power to go back far enough in the blockchain
to rewrite a transaction, it would be so costly and time consuming that it likely
wouldn’t be profitable.
This type of attack is called a 51% attack, and it would cost billions of dollars to
attempt. Even if successful, an attack of this type would essentially destroy the
blockchain by eroding the trust in the ledger, and the price of bitcoin would likely fall
to zero, making the entire thing pointless.
This is the superpower of the Proof of Work consensus mechanism–it takes a lot of
time, money and energy to validate transactions, and this work is self-protecting since
it’s almost impossible to undo.
The security of the blockchain increases as more miners join the network, since more
transactions can be processed and there are more nodes available to share greater
consensus.
The more transactions that are processed and validated, the larger the amount of data
that a criminal would have to “rewind” to hack the network.
At the time of this writing (November 2022), Bitcoin operations expend just over 100
Terawatt hours (TWh) of energy each year. As a point of reference, that’s about the
same amount of energy that is required to power all of the refrigerators in the United
States.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 7/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
For a global comparison, air conditioning alone uses 2,199 TWh per year.
The need for greater computing power, and the hefty price tag that comes with the
equipment and electricity needed to run these operations, has resulted in innovative
expansions into crypto mining.
For example, many mining operations have moved to countries with an abundance of
electricity, such as Canada and Iceland, that would otherwise go unused.
The oil and gas industry has become involved in mining, since they often have power
that would be wasted, and the cryptocurrency mining industry gets more than half of
its power from sustainable energy sources.
In this way, miners could potentially make the power grid more efficient by harnessing
non-traditional energy sources.
Many critics ask why Bitcoin doesn’t just move to a more energy efficient consensus
mechanism like Proof of Stake. This is a complex question, but in short, Proof of Work
has some distinct advantages over Proof of Stake with regard to the purpose of bitcoin.
BTC is a store of value and part of what maintains this value is the difficulty in creating
new bitcoins and the inability of malicious actors to hack or even game the system in
an effort to monopolize control of the currency.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 8/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
The Proof of Work consensus mechanism provides unique benefits in this regard,
making it optimal for a cryptocurrency like bitcoin that could be a long-term store of
value.
As you’ve read, miners are responsible for a lot more than just creating new bitcoins.
They’ll still validate transactions, and collectively secure the entire Bitcoin network.
Miners won’t receive block rewards anymore, but they will still receive transaction
fees. The validation of the network will continue to be an extremely important
function.
If there weren’t miners to validate new copies of the ledger, the blockchain would likely
fall under attack, rendering bitcoin as a store of value useless.
Even after all bitcoins are created, mining is still necessary to maintain the value of the
bitcoin cryptocurrency and process ongoing transactions on the network.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 9/11
2/9/23, 3:31 AM What is Bitcoin mining, and how does it work? | @blockchain
Mining is essential to the Proof of Work consensus mechanism, and miners have
proven that they are committed to finding new ways to power their operations, and
subsequently, Bitcoin.
There’s another way to get bitcoin though, and it doesn’t involve setting up a mining
rig.
Buying BTC may be a more straightforward way of adding it to your holdings, and if
you choose to use a dollar cost averaging method, you can buy bitcoin incrementally,
over a long period of time, instead of trying to time the market.
If you’ve never bought BTC before, you’d need what’s called an “on-ramp” — a way of
exchanging fiat currency for crypto. Then, you can transfer your crypto to a non-
custodial wallet, so you have complete control over your funds.
Blockchain.com is the only place you can find both of these wallet types in one place,
and you can create your free account in just a few minutes.
Get Started
Important Note:
This information is provided for informational purposes only and is not intended to substitute
for obtaining accounting, tax or financial advice from a professional advisor.
The purchase of crypto entails risk. The value of crypto can fluctuate and capital involved in a
crypto transaction is subject to market volatility and loss.
Digital currencies are not bank deposits, are not legal tender, and are not backed by the
government. Blockchain.com’s products and services are not subject to any governmental or
government-backed deposit protection schemes.
Search Medium
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 11/11
2/9/23, 3:47 AM The Byzantine Generals Problem. In a decentralized peer-to-peer system… | by Robert A. Küfner | nakamo.to | Medium
Published in nakamo.to
Save
Take a public blockchain for example. To make it work, enough participants in the
blockchain must agree on the history of validation and permanent registration of
transactions on the blockchain ledger up until that point. If we could rely on everybody
to be honest, there would be little or no problem — but we can’t. The temptation to
register fraudulent transactions or illicitly reverse genuine transactions, while hanging
onto their ill-gotten gains is simply too much for some users to resist.
Go home
Public blockchain protocols must deal with this issue autonomously. No single
participant can step in and unilaterally declare transactions to be valid or invalid. That
would make nonsense of the principle of decentralization. But to understand how a
blockchain protocol can handle such a challenge, we first need to know more about
the problem.
Let’s allow the Byzantine Generals step forward and tell us all about it. The Byzantine
Generals Problem was given its name by Leslie Lamport, one of the three authors of a
pivotal paper on the subject in 1982. He reasoned that ‘the best way to attract attention
to a problem is to present it in terms of a story’, meaning the Byzantine Generals didn’t
actually have a problem with achieving decentralized consensus — it’s just an effective
way of helping people understand the problem.
Imagine a military operation in the East Roman Empire (aka Byzantium), more than
1,000 years ago. Several Byzantine generals and their armies are positioned around a
rebel city. Each general and army is in a separate camp. Communication between the
generals is only possible by messengers who must cross the open terrain from one
camp to another.
For the generals and their armies to successfully attack the city or retreat safely from
it, they must all act together. Failure to coordinate their actions by even one of the
generals will mean that all the armies will be individually massacred by the forces of
the rebel city. To act together and take over the rebel city, they must agree on when to
attack and at what time — but here’s the catch:
They could send messengers on horseback, but what if one is captured or killed
before delivering the message?
They’d need to reply to one another to confirm they’ve received and agree with the
message, but this would entail sending another messenger on horseback who may
also be captured or killed.
How do any of the generals know that the messages they received are genuine?
What if one or more of the generals are traitors and intentionally send the wrong
message to other generals?
It’s a tough problem to crack, but one that Satoshi Nakamoto managed to solve through
the Bitcoin blockchain.
Distributed systems with mechanisms to overcome this problem are said to have
Byzantine Fault Tolerance or BFT. Bitcoin has BFT built into its protocol. Its proof of
work consensus mechanism is designed to produce new blocks every 10 minutes,
using the total available computing power in the Bitcoin network and rewarding the
first node to mine the next valid block.
All the other Bitcoin nodes in the network can easily and individually check that a new
block of transactions proposed by one of the nodes has been correctly mined. In this
way they can then reach agreement on whether to add the new block to the existing
blockchain.
And so, unlike the Byzantine generals who — rumour has it, are still stationed around
the rebel city to this day — users of public blockchain systems can safely and securely
run their operations.
Search Medium
Blockchain Application
Published in DataDrivenInvestor
Save
This cannot really be coordinated since the issue here is that there is no direct link to
communication among the participants (e.g. generals). These links are also not trusted
since we don’t have any guarantee the message will reach its destination. Let us say
that there are 5 generals ready to attack the city. They are not directly near one
another, so there is a distance gap between the armies. Coordination is needed in
order to carry out the plan to attack. They must communicate using messengers.
Each general issues commands that must be obeyed, but they have to take orders from
their king. Supposed the king issued an order to attack the city. In order for the
message to get across, the king sends 2 messengers to each general (total of 10
messengers). The second messenger is actually a back up to the first messenger. Now
herein lies the problem.
What if the messengers were spies and instead of delivering the message to attack, they change
it to retreat?
What if all of the messengers or some of the messengers were ambushed and some or all of the
generals did not get the message to attack?
https://medium.datadriveninvestor.com/the-byzantine-generals-problem-solution-using-the-blockchain-31eb5318f37f 2/7
2/9/23, 3:50 AM The Byzantine General’s Problem Solution Using The Blockchain | by Vincent Tabora | DataDrivenInvestor
What if one or more of the generals was a traitor and decides to not attack or maybe even
attack his fellow generals to help the enemy?
These are scenarios we can play in our head. This makes it important to have a system
in place to address these issues. In the case where no message is received to attack,
should the general attack anyway? Logic would say no, don’t attack, but if you don’t
attack you could be missing an opportunity to do so.
If you don’t attack, but the others attack the city, you will be put under subordination
for not obeying the king’s orders. The general can be punished severely, so that is why
critical thinking becomes important in situations like these.
Fault Tolerance
The solution to the problem is to have a protocol in place that use fault tolerant
measures. Adopting a protocol among the generals is the best way to make decisions
when faced with uncertainty. Therefore, it becomes probabilistic rather than
deterministic since there is no guarantee on what will happen. That is exactly the case
when you have less direct communication among peers, and each is independent from
the other. Each general is in a different location, so there is physical distance among
them.
A system should be put in place logically speaking, so that there is more clarity on
what to do. Here are some actions that the generals can agree to:
1. When no general has received an official message from the king to attack, that
means to hold ground and DO NOT ATTACK. After a certain period has elapsed and
no message has been received, the generals can retreat back to camp. There can
still be exceptions to this rule.
2. In order to verify the order from the king to attack, the general can verify the
message from the messenger by asking for a secret phrase (which only the generals
and the king know, aside from the messengers) and an official seal from the king
on the written message itself to prove it was the king who issued the order.
However, the message must be received from at least one of the two messengers
sent by the king.
https://medium.datadriveninvestor.com/the-byzantine-generals-problem-solution-using-the-blockchain-31eb5318f37f 3/7
2/9/23, 3:50 AM The Byzantine General’s Problem Solution Using The Blockchain | by Vincent Tabora | DataDrivenInvestor
3. To coordinate the attack, a horseman will ride from each general with a raised
banner that indicates to attack to all the other generals. That means one banner
form each army. The problem here is what if there is an army that did not receive a
message to attack and therefore did not raise a banner? The generals could agree
that if at minimum 3 of the 5 generals raised their banner, then the order to attack
is legitimate. Then they proceed with the attack on the city.
If the messengers were ambushed, at least the generals will know what to do if they
don’t receive a message. That makes things more probable, in the likelihood of an
uncertain condition.
Loyal generals will obey the orders of their king and carry out the plan.
The more messengers you have, the greater the likelihood of the message getting to
the generals.
If there are more loyal generals who carry out the orders, the better the outcome.
If the majority of the generals receive the message, the better is the outcome
regardless of an attack or retreat.
Consensus
What makes Bitcoin innovative is not just providing a decentralized platform for
making payments. It solved the problem of how to make payments using a trustless and
permissionless system. What Satoshi developed was a way to implement the solution to
the Byzantine General’s Problem in a digital electronic network using cryptographic
security and public key encryption. Cryptographic security involves a process of
encoding called hashing to prevent tampering of data. Public key encryption verifies
the identity of a user on the network.
computer nodes called miners, who also compete with other miners to solve
cryptographic puzzles to produce blocks as part of a consensus mechanism called PoW
(Proof-of-Work). The miner that is able to solve the puzzle receives a reward for their
contribution as an incentive.
Users who are a part of this network must have a key pair consisting of a private key
and public key to verify their identity. The private key is used for digital signatures
which authorize a transaction from the rightful owner in order to release funds to
make payments. Only the private key’s holder has this privilege and no other user.
Private keys are unique and is also where the public key is derived from. The public
key is used to create a public address which is how the user is identified on the
network. It is viewable to all and it is associated with a digital wallet of the user.The
private key must be kept secret, but the public address is what a user tells other users
to use when sending money. This system is like the secret phrase and official seal.
The Nakamoto Consensus (i.e. Proof-of-Work) was a mechanism intended for fault
tolerance in a trustless and permissionless environment. We take a probabilistic
approach to the decision of nodes that validate the truth based on majority consensus,
where n node validators out of x total nodes must be greater than or equal to 51%.
The network then comes to an agreement and produce blocks to record the version of
truth that n nodes verified.
Distributed Systems
Distributed systems which need to perform mission critical tasks use BFT. The
blockchain is also a distributed system. In Satoshi’s version of the blockchain, the
Byzantine General’s Problem is resolved by the miners who are like the generals. Each
node must try to validate transactions, which are like the messages being sent to the
generals. The enemy can be thought of as bad actors (e.g. hackers) who want to steal
the messages or attack the network.
https://medium.datadriveninvestor.com/the-byzantine-generals-problem-solution-using-the-blockchain-31eb5318f37f 5/7
2/9/23, 3:50 AM The Byzantine General’s Problem Solution Using The Blockchain | by Vincent Tabora | DataDrivenInvestor
things more probabilistic by having the miners compete with each other to try to
validate the blocks. This makes it more decentralized since no miner can monopolize
validation to earn all the rewards. Instead miners must compete with one another
using their computing resources called hash rate to solve a puzzle. The greater the hash
rate a miner has, the more likely they can solve the puzzle.
Since there are many miners, the network is secured through their consensus
mechanism. Validated blocks become immutable and protected by hashing so that
attempts to overturn transactions can be prevented. Consensus is achieved when the
miner who has solved the puzzle broadcasts it to the network which all the other
miners must validate or deny if the value is incorrect. The correct value must be equal
to or less than what is called a difficulty target.
The blockchain is also decentralized, which means there should be no central point of
failure in the system. The blocks are stored in a distributed database that is copied to
other computers on the network. This redundancy helps provide fault tolerance as
well, so that no failed computer can bring the entire system down. This is like having
multiple messengers in case one messenger gets ambushed by the enemy. The
message will not be lost because other messengers will have a copy of it.
Synopsis
The use of a blockchain can provide a general solution to the Byzantine General’s
Problem. It is all about providing a way to communicate securely with trust in a very
uncertain environment. In the real world, transactions occur mainly among people
who do not know or trust each other. Each person is like a general, waiting to hear
orders to attack or hold their ground. There are no middle men who arbitrate the
attack on your behalf, you are very much on your own to decide.
A blockchain provides a layer that can be trusted without having to trust each and
every person. This is through a consensus from a network of nodes that validate the
truth before it is recorded. If the general is not sure about the contents of the message,
it can be verified by the other generals based on what they know is the truth. Once it is
recorded by one node, a copy is sent to other nodes that are a part of the network so
the information becomes redundant. That is the purpose of the PoW consensus
algorithm.
https://medium.datadriveninvestor.com/the-byzantine-generals-problem-solution-using-the-blockchain-31eb5318f37f 6/7
2/9/23, 3:50 AM The Byzantine General’s Problem Solution Using The Blockchain | by Vincent Tabora | DataDrivenInvestor
Information is not always perfect and bad actors will try to game the system. In a
blockchain there are fault tolerant measures and security in place since the system
itself was meant to be used by the public. Cryptography became necessary in this case
so that altering the messages will not be allowed. The system provides key pairs for
digitally signing a message to verify identity as proof it is from who it claims to be.
Once messages are validated they are recorded for transparency, which provides a
historical proof for accountability.
Search Medium
https://medium.datadriveninvestor.com/the-byzantine-generals-problem-solution-using-the-blockchain-31eb5318f37f 7/7
2/11/23, 10:53 PM Proof of Work. Proof of Work is yet another buzzword… | by Miguel Palhas | UTRUST | Medium
Published in UTRUST
Save
Proof of Work
Proof of Work is yet another buzzword that gets thrown around a lot in the
cryptosphere. This is because it is an important component of some of the most
important blockchains like Bitcoin. In this post we aim to shed some light into what
exactly this means, and why it is such an important term.
Consensus
In short, Proof of Work (PoW) is one of the mechanisms through which a blockchain
can achieve consensus. That is to say, ensuring that all nodes of the system can agree
on the state of the public ledger. Value, information, and wealth can only be
transferred when actors in an exchange agree upon what is being exchanged and how.
This is usually dealt with by banks, companies and even governments, but blockchains
can do this peer-to-peer, so long as they achieve consensus.
This is important, as you may guess, because it’s what creates consistency in the
blockchain data, prevents users from double-spending their funds, or attacking each
other.
In a Proof of Work (PoW) system, consensus is agreed upon via the work done by
network miners. These are the miners you keep hearing about. They collect your
transaction fees in exchange for keeping the network up and running.
In a broad sense, it can be said that miners process network transactions, and take up
their fees as payment for their effort (e.g.: electricity spent on computing power), and
as an incentive to keep working.
The real processing that happens is more of an endless competition between all
miners, the winner of which gets to create the next block in the chain.
The broadcasting of a single block, and some of its caveats, is a topic I already covered
in more detail on my previous post about [achieving Finality].
Here, we’ll focus a bit more on how this cryptographic puzzle works, and why it is
needed in the first place.
Cryptographic hashes
A hash works very similarly to a written signature.
Your signature proves that a document was read and validated by you, without your
own presence being required. Only you can produce your own signature, but everyone
else can easily check it’s yours. This can be summed up in two simple properties:
1. hard to fake;
2. easy to validate.
These properties are what makes signatures, and hashes, interesting for quickly
validating something.
Yes, I know. Written signatures are not really that secure. But cryptographic signatures,
on the other hand, can be. They serve the same function as the written ones, which is
why the analogy works so well, but they’re generated through mathematical functions
that are designed to provide better guarantees.
Let’s see a quick example of what a cryptographic hash would look like. In many
software download pages, you’ll often see a hash checksum. For example, here’s the
download page for Ubuntu:
After downloading the file, I should be able to independently calculate a SHA256 hash
of that file, and compare it against the hash displayed on the page. If they match, I
have proof that the download file is not corrupted or tampered with. And that’s exactly
what I did:
Great, the hash works perfectly! You can notice that the resulting hash (add461…)
matches exactly the hash from the screenshot.
This is a one-way operation. While I can calculate a SHA256 hash for any file or piece
of data, the reverse is not possible. It’s obviously impossible to recreate the entire
Ubuntu file from just this small string of random characters.
The process I just did manually is similar to what’s used in a blockchain to ensure the
integrity of all transactions. Each transaction hash is derived from the data of the
transaction itself, and serves as a unique identifier.
Each block has a hash, too. And that hash needs to follow certain rules. Let’s take a
look at the latest Bitcoin block hashes, for example:
Notice how all of them start with a bunch of zeros? How did this happen, if hashes are
supposedly random?
Each miner is constantly trying to mine the next block in the chain. And they’re on a
constant race with each other.
As they aggregate transactions sent in by users, they aggregate them in a new block,
and then try to create a hash for the entire block.
This hash can’t be just any hash tough. The blockchain imposes some rules on it.
Bitcoin, for example, requires the hash to start with a certain number of leading zeros.
The actual amount of zeros required is called the network’s difficulty, and it’s a number
that is adjusted every few blocks.
If the current difficulty is 2, then 00abc… would be a valid hash, but 0abc… would not.
Couple this with the fact that hashes are, for all intents and purposes, randomly
generated and unguessable, and miners have only one way to produce different
hashes: brute force. They keep trying over and over to generate new hashes, until they
find one that fulfils the requirement.
Since the same block always generates the same hash, they need to change it slightly
for every new attempt. This is often done by adding a random number within the
block’s data. The only purpose of this number is for miners to change it in order to be
able to make different blocks, and therefore, different hashes.
The better your hardware, the more hashes you can produce. That’s called your Hash
Rate. If you increase your hash rate (by improving your hardware) you get a better
chance of finding valid hashes before everyone else. But since this process is
essentially random, having slower hardware still gives you a small chance at
preventing more powerful miners from getting 100% of the blocks.
This difficulty is adjusted automatically every few blocks, in response to changes in the
total hash rate of the network. If a lot of miners significantly increase their hash rate,
or if a lot of miners join the game, the average time to mine a block will decrease. In
response to this, the difficulty may increase, to keep the average block time around 10
minutes.
If you’ve ever wondered why it takes 10 minutes to mine a Bitcoin block, there’s your
answer. The blockchain itself is enforcing that rule, by adjusting the mining difficulty.
https://medium.com/utrust/proof-of-work-ab12b8e13c7#:~:text=In a Proof of Work,the network up and running. 6/9
2/11/23, 10:53 PM Proof of Work. Proof of Work is yet another buzzword… | by Miguel Palhas | UTRUST | Medium
Maybe you’re wondering why this is done at all! Good question! Let’s talk about that:
It is also important for the number of miners to be sufficiently large, or else the
decentralization of the system could be compromised. This compromises security as
well. These are some of the basic tenets of a decentralized blockchain.
On the other side of the system, we have the users, sending transactions through their
wallets.
Users want the blockchain to support as many transactions per second as possible, to
reduce their waiting times. They also want lower fees, or even no fees at all!
Miners, on the other hand, want the reverse. The more fees are paid, the more they
get. And the less transactions there are, the easier it is for them to compute hashes for
new blocks.
Even if miners were willing to mine for free, you still wouldn’t be able to do as the
users wish. More transactions per minute mean that we’d have to support larger block
sizes (or increase the rate of blocks), or decrease the 10 minutes it takes for a block to
be produced.
This would make the mining process more difficult, possibly to a point where only
those with more powerful hardware would be able to do anything at all.
If only the most powerful can compete in the game, then the whole system will
degrade to a much less decentralized one. And decentralization is what guarantees the
security of your transactions.
Preserving the size of blocks, as well as the time between them, is a balance that has to
be done to keep the network usable while still preserving the ability of small miners to
be able to contribute to the network.
Yes, this is a tough one. We’ve all seen the scary news about how Bitcoin consumes
more energy than Switzerland, or the entire cryptocurrency ecosystem, for that
matter, is wasting tons of energy.
Not only that, the incentive given to miners (read: the ability to convert electricity into
money) is driving the industry to produce more powerful mining hardware, and
driving the miners to purchase more and more of that hardware.
So, not only are we creating an incentive to spend energy, but the competitive nature of
this is pushing everyone to spend increasingly more!
This is all true, and of course, a concern. But unlike some may claim, it’s not an
inherent problem of cryptocurrencies, and not even inherent to Proof-of-Work. This
means that there are ways to create Proof-of-Work systems that don’t drive energy
usage up like we’re seeing today.
If you’re into computer science research, then there are a few research papers worth
looking into (such as the Cuckoo Cycle algorithm, or Proofs of Useful Work)
If not though, rest assured that this is an acknowledged problem, and is being actively
worked on by many communities. While it is true that cryptocurrencies do consume
excessive amounts of energy right now, this is a problem that can be solved, and
should see some improvements over the next couple of years.
Search Medium
Save
https://maxthake.medium.com/what-is-proof-of-work-pow-2574ddebf916 1/4
2/11/23, 10:57 PM What is Proof-of-Work (PoW)?. Considered to be one of the crowning… | by Max Thake | Medium
In short, the purpose of this consensus mechanism and others like it, is to reach
consensus. Consensus = agreement.
These mathematical problems are hard to compute but easy to verify. Once miners
solve them, they are rewarded with the corresponding digital currency, referred to as a
block reward.
If the minors are mining on the Bitcoin blockchain, they're rewarded in Bitcoin, if
they're mining on the Monero.
The transactions in the block are then validated and the block is added to the chain.
Real computational work goes behind this, hence the term, Proof-of-Work. As time
goes by the mathematical equations become harder and harder.
Bittersweet Symphony
PoW is expensive. The Bitcoin network, according to a recent study published in Joule,
claimed that the network currently uses about 24 TWh of energy per year - about as
much as Ireland does.
As the Bitcoin network grows, it will require even greater computing power. The neatly
designed Bitcoin Energy Consumption Index provides the latest facts and figures. And
https://maxthake.medium.com/what-is-proof-of-work-pow-2574ddebf916 2/4
2/11/23, 10:57 PM What is Proof-of-Work (PoW)?. Considered to be one of the crowning… | by Max Thake | Medium
you can see the charts are only going up. The energy usage is doubling every six
months.
It is estimated that by the end of 2018 it will consume 0.3% of the world's electricity for
the simple purpose of verifying transactions, albeit in a decentralized manner. Since
these rising energy costs are paid in fiat currency, it builds a downward pressure that
results in most miners selling the coins as soon as they are mined.
While PoW is expensive for miners, it does make a structure that is relatively safe from
attacks. That's because the only way for an entity to disrupt the system and take over
the network is by controlling 51% of the hashing power. This is not a problem, but it is
not a problem.
Ultimately, a Proof of Work system ensures that a blockchain is valid. For Bitcoin, it
also means that the coins are not mined too quickly and miners have incentives to
maintain the network. On the flipside, this is also an infinitely scalable protocol.
Another big drawback is the formation of mining pools (groups of miners who pool
their resources together) who could potentially control the network and collectively
shepard the network, adding a very real danger to a decentralized solution.
https://maxthake.medium.com/what-is-proof-of-work-pow-2574ddebf916 3/4
2/11/23, 10:57 PM What is Proof-of-Work (PoW)?. Considered to be one of the crowning… | by Max Thake | Medium
Blockchain Education
Your email
Open in app Sign up Sign In
Subscribe
Search Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://maxthake.medium.com/what-is-proof-of-work-pow-2574ddebf916 4/4
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
Published in Coinmonks
Aakash S Follow
Save
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 1/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 2/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
Blockchain first appeared in Nakamoto’s Bitcoin white paper that describes a new
decentralized cryptocurrency. Bitcoin takes blockchain technology to the extreme and
attracts people’s wide attention. Afterward, many cryptocurrencies and projects based
on the blockchain spring up. Blockchain thus has become a hot topic. Interestingly, the
technology adopted by the blockchain is not new. Blockchain simply combines
cryptography, distributed system technology, peer-to-peer networking technology, and
other well-known technologies. Besides, blockchain also provides a secure framework
for cryptocurrencies, in which anyone cannot tamper with the content of transactions
and all the nodes participate in transactions anonymously. For this reason, blockchain
technology can be widely used in various fields, e.g., financial field, medical systems,
supply chain, and Internet of Things (IoT).
Flow of PoW.
However, in the process of applying the blockchain technology, there will be many
challenges and issues, among which how to design an appropriate consensus protocol
is a big issue. The consensus of blockchain is that all nodes maintain the same
distributed ledger. In traditional software architecture, the consensus is hardly a
problem due to the existence of the center server, hence the other nodes only need to
be aligned with the server. However, in a distributed network such as blockchain, each
node is both a host and a server, and it needs to exchange information with other
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 3/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
nodes to reach a consensus. Sometimes some nodes will be down or offline, and there
will also be some malicious nodes, which will seriously affect or destroy the process of
consensus. Therefore, an excellent consensus protocol can tolerate the occurrence of
these phenomena and minimize the harm so as not to affect the final consensus result.
In addition, the consensus protocol adopted by the system also needs to be suitable for
the blockchain type used by the system. There are three basic types of blockchain:
public blockchain, consortium blockchain and private blockchain. Each type of
blockchain has different application scenarios. The adopted consensus protocol thus
needs to fit the demands of specific application scenario. In this paper, we introduce
some main consensus protocols of blockchain and analyze their performance and
application scenarios.
Flow of PoS.
Consensus Protocols
In distributed systems, there is no perfect consensus protocol. The consensus protocol
needs to make a trade-off among consistency, availability and partition fault tolerance.
Besides, the consensus protocol also needs to address Byzantine Generals Problem
that there will be some malicious nodes deliberately undermining the consensus
process. In this section, we make a detailed description of some popular blockchain
consensus protocols that can effectively address the Byzantine Generals Problem.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 4/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 5/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
PoW is adopted by Bitcoin, Ethereum, etc. PoW selects one node to create a new block
in each round of consensus by computational power competition. In the competition,
the participating nodes need to solve a cryptographic puzzle. The node that first
addresses the puzzle can have a right to create a new block. It is very difficult to solve a
PoW puzzle. Nodes need to keep adjusting the value of nonce to get the correct answer,
which requires much computational power. It is feasible for a malicious attacker to
overthrow one block in a chain, but as the valid blocks in the chain increase, the
workload is also accumulated, therefore overthrowing a long chain requires a huge
amount of computational power. PoW belongs to the probabilistic-finality consensus
protocols since it guarantees eventual consistency.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 6/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
extreme power requirements, which may not always come from renewable and
environmentally friendly sources.
Expensive initial investment: The high costs of computer hardware and other physical
costs (facilities, management, etc.) act as a deterrent and barrier for entry into the
crypto mining space. Many critique mining practices as a way to reserve power and
control over processing transactions for a handful of people.
High energy costs: Some argue that mining processes (such as Bitcoin mining) have
too extreme of energy costs. Some energy consumption trackers show that mining
consumes about 77.78 terawatt-hours per year. This figure is comparable to the total
energy consumption of entire countries such as the Netherlands
Carbon Footprint: Much criticism is relayed on crypto mining towards it’s reliance on
electricity generated by fossil fuels. Many large crypto mining facilities are known to
use coal and other ”unclean” sources of fuel. Studies in 2019 have estimated that
Bitcoin mining generated between 22–23 million metric tons of carbon dioxide
emissions per year.
While PoW based blockchains have been running successfully for years, many experts
find mining-based systems to be inefficient when it comes to network scalability and
energy efficiency. New approaches to decentralized consensus mechanisms have led
to the creation of Proof of Stake (PoS) or simply staking. PoS has a similar purpose to
PoW systems where a network participant is selected to add the newest block of
transactions to the blockchain and receive a reward. Instead of “mining” to solve
puzzles for rewards, participants can choose to lock in (or ”stake”) their coins into the
network (their stake in the network) and periodically receive rewards for helping
secure the network and process transactions.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 8/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
In PoS, selecting each round of nodes, that who creates a new block depends on the
held stake rather than the computational power. Although nodes still need to solve a
SHA256 puzzle:
PoS systems differ from PoW in that instead of using computing hardware to process
transactions, participants use their own tokens as a “stake” in the network to have a
chance to add a new block to the blockchain. Essentially cryptocurrencies are locked
away to receive rewards. Participants are incentivized to stake their coins with reward
offers from the network for successfully validating transactions. At regular intervals,
the protocol will nominate a participant to validate the next block in the blockchain.
Each PoS system handles the details regarding reward intervals differently. The chance
of being nominated is relative to the number of coins staked, where the more coins a
user stakes the higher the chance of them being selected and rewarded is. This acts as
an incentive for users to stake large amounts of coins.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 9/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 10/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
Besides the high consumption of electricity, which exceeds that of Poland for Bitcoin
and that of Austria for Ethereum on a yearly basis, these two blockchains also produce
staggering amounts of electronic waste, with Bitcoin generating 25,060 tonnes yearly,
comparable to the small IT equipment waste of the Netherlands. This is caused by the
mining farms which very often replace the burned-out equipment. Data from
Digiconomist.
Conversely, with its Proof of Stake (PoS) consensus mechanism, Cardano’s network
doesn’t rely on processing power for block validation. What is required is a stable
internet connection and enough staked ADA to produce blocks. There are also some
SPOs who run their stake pools on a Raspberry Pi, consuming about 5 Watts of energy.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 11/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 12/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
Only time will tell whether Cardano or some other blockchain will rule the crypto
space, though what is more realistic is that we will have an internet of blockchains,
and the developers behind Cardano are well aware of this. This is evidenced by their
effort in creating an NFT bridge with Ethereum and an ERC-20 Converter.
Interoperability and cooperation between blockchains are essential. In the end, the
common goal is to create an economic system that can be accessed by anyone
anywhere, allowing the unbanked to start building a financial reputation free from
intermediaries, which has disappointed us repeatedly throughout history.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 13/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
OpenLocalBitcoins
in app Review | Cryptocurrency Savings Accounts Sign up Sign In
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 14/15
2/11/23, 11:00 PM Blockchain Blog 15: Blockchain Consensus Protocols | by Aakash S | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/blockchain-blog-15-blockchain-consensus-protocols-ac07d35bce4c 15/15
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Published in Coinmonks
Sangmoon Oh Follow
Save
Byzantine Fault
Consensus is a process for all the nodes in a distributed system to agree on a single
state or to make same decision. Consensus algorithm is a set of protocols or rules for
the process.
Consensus is complex because it is basically many body problem, and even far more
complex when various constraints are included. One of the most difficult constraints is
Byzantine fault.
Byzantine fault says that there could be abnormal or malicious nodes which don’t
follow rules or even violate intentionally to prevent consensus. Those nodes might do
so because they are broken or occupied by a hacker. Although the problem can seem to
be very old problem from the title of ‘Byzantine’ which is the name of an ancient Greek
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 1/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
city or Roman province, it was not until 80’s that people had started to study Byzantine
fault.
The early paper¹ published in 1982, Byzantine fault was described like the following
picture.
Byzantine Problem
Several divisions of Byzantine army setup camps surrounding enemy. Each general of
division has to make decision to attack or retreat. They want to reach same decision to
avoid troublesome case where some divisions attack but others retreat. To align the
decision, Byzantine general can send messengers carrying his intention to the other
generals. But the problem is that there can be traitors among generals. These traitors
will disturb the message exchange to prevent all the normal generals reaching a same
conclusion. For example, if the general ⑥ is traitor, he may send attack intention to
general ① but retreat intention to general ② and general ⑤ to prevent consensus.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 2/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
If there is no traitor, a simple majority rule can always lead the generals to consensus.
In other words, each general collects all the other generals’ intentions and concludes
following the intention more than half of the generals including himself made. If all
the generals are split exactly in half, the default action can be applied.
But with a possibility of traitor(s), the problem become complex. If there is only one
traitor among 6 generals, can this majority rule also make the other 5 generals reach
consensus all the time? Or, is there any other rule that guarantee consensus? How
about 2 traitors among 6 generals?
Under the circumstances like above, if a consensus algorithm can make all loyal(non-
traitor) generals to arrive at the same decision, this algorithm is said to be Byzantine
fault tolerant. And feature or requirement for an algorithm to be Byzantine fault
tolerant is Byzantine fault tolerance or BFT in short.
Let’s move on to more detailed explanation with a simplest case for more clear
understanding.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 3/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Suppose there are 3 generals in all and only one of them is traitor. Of course nobody
knows who is traitor. Consensus algorithm is a simple majority rule.
The traitor always send opposite intentions to the other 2 generals to hinder the
consensus. As you can see case (1) and case (2) in the above picture, if the 2 loyal
generals have a same intention, they will build a same conclusion regardless of the
traitor’s disturbance. But like case (3), if the 2 loyal generals have different intentions,
one of them will attack and the other retreat at the end. The consensus will be broken
in case (3), so the majority rule is not Byzantine fault tolerant for these 2 loyal generals
and 1 traitor. Then, what is the Byzantine fault tolerant consensus algorithm for this
situation?
There are various constraints other than Byzantine fault, in the consensus. The most
usual constraints are whether message delivery is guaranteed or not, whether message
is signed or not, and whether network is fully connected or not.
A network is said to be synchronous(sync.) if the delivery is guaranteed within a
certain delay limit, or asynchronous(async.) if a message can be lost due to
communication failure or overload. Surely it is far more difficult to make
asynchronous networks Byzantine fault tolerant than synchronous networks.
If message signing² is applied, a malicious node can not alter messages when relaying
messages from other nodes, although its own message can be still manipulated. So,
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 4/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
with message signing, it is possible to design Byzantine fault tolerant algorithm more
easily. But, building reliable message signing system also requires considerable cost
and effort.
[1] L. Lamport, R. Shostak, and M. Pease, “The Byzantine Generals Problem”, 1982
[2] Digital signature
3m + 1 Processor Algorithm
The first achievement on general algorithm guaranteeing Byzantine fault tolerance is
“3m + 1 processor algorithm” appeared in 1980.
The paper¹ proves first that for a synchronous network with m faulty nodes, there is no
Byzantine fault tolerant consensus algorithm, if the network has equal or less than 3m
nodes in all. In other words, it is prerequisite to have equal or more than 3m + 1 nodes.
For example, if there is 1 faulty node among 3 nodes, no Byzantine fault tolerant
algorithm can exist. When 1 faulty node is expected, the network should has at least 4
(3m + 1, m = 1) nodes like the 2nd from the left in above picture. If the node is more
fragile and 2 faulty nodes can exist at the same time, the network should has at least 7
(3m + 1, m = 2) nodes for Byzantine fault tolerance like the last in above picture.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 5/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
The above picture shows message delivery for a simple 4-nodes network. There can be
at most 5 different paths to deliver a message from node ① to node ④ including
relays. But duplicate relays where a message would visit intermediate nodes more than
2 times are excluded.
5 paths include 1 path for direct delivery, 2 paths for indirect deliveries with 1 relay,
and 2 paths with 2 relays.
These cases are denoted like the followings
For example, v:1:3:2:4 means the message is sent by node ① to node ③, relayed by
node ③ to node ②, relayed again by node ②, and finally arrived at node ④.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 6/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
3m + 1 Processor Algorithm
The above statements are the consensus algorithm called 3m + 1 processor algorithm.
The algorithm enforces enough relays for Byzantine fault tolerance.
More exactly, for a network which may at most m faulty nodes and so contains at least
3m + 1 nodes, should relay each message m times. And each node has to decide other
node’s intention on behalf of majority rule considering m-times relayed ones.
If the network has 4 nodes (m = 1) to cover at most 1 faulty node, each node has to
make decision after gathering direct messages(OM(1)) from the other 3 nodes and 1-
time relayed messages(OM(0)). For m = 1, 2 times relay is also possible, but 1 time relay
is enough according to the algorithm.
For m = 2, where the network has 7 nodes to overcome 2 faulty nodes, each node
should gather direct messages(OM(2)), 1-time relayed messages(OM(1)) and 2 times
relayed messages(OM(0)). With 7 nodes, 5 times relay is possible at most, but 2 times
relay is enough.
So, when generalized with m faulty nodes, each normal node among at least 3m + 1
nodes has to collect messages directly delivered(OM(m)), 1 time relayed(OM(m-1)), 2
times relayed(OM(m-2)), and so on up to those m times relayed(OM(0)).
1 4 OM(1), OM(0)
3m + OM(m), OM(m - 1), OM(m - 2), OM(m - 3), ... , OM(2), OM(1), OM(0)
m
1
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 7/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
You may notice that when relaying message, the message wouldn’t be sent again to
nodes already passed before. For example, in the 7-nodes network, the message of
node ① which and arrives at node ③ after relayed by node ② will not be sent to node
② or node ① again. This message will be sent to other nodes from ④ to ⑦.
Simplest Case
To understand how relays can contribute Byzantine fault tolerance a bit more, let’s
discuss the simplest case (where m = 1 ) in more detail.
The below picture shows how each of node ①, ③, and ④ collects the message
originated by node ② according to the 3m + 1 processor algorithm
If node ② is traitor, there are 6 different cases where node ② sends its intentions to
other nodes to disturb the consensus. You can see those cases from v:2:1, v:2:3, and
v:2:4 columns in the following table. In these 6 cases, node ② sends different
intentions to other nodes. Cases where node ② sends same intentions are excluded
because those cases will not disturb consensus.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 8/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
If node ①, ③, and ④ receive only direct messages from node ②, they will conclude
different intentions (Attack or Retreat) for each case. You can see it in the light orange
background columns of above table.
But surprisingly, if one time relayed messages are collected, things change.
See the light green columns in the above table. For case 1). Although node ② sends
‘Attack’ to node ① and ③, but ‘Retreat’ to node ④, each node can gather all these
‘Attack’, ‘Attack’ and ‘Retreat’. In other words, all of node ①, ③, and ④ collect same
values from node ② (2A + R, 2 ‘Attack’s and 1 ‘Retreat’), so they will have same
conclusion on node ②.
For other cases — case 2) case 6), things are same. Even though the gathered values can
vary from case to case — 2A + R or A + 2R. the values are same for all nodes in a single
case.
Among 6 cases only one case occurs. So, node ①, ③, and ④ will have same
conclusion on node ② in any case.
To review above more generally, by virtue of relay, each normal node (①, ③, or ④)
can collect all the messages sent to other nodes (③ and ④for ①, ④ and ① for ③, ①
and ③ for ④) from the sender (②). In other words, each node will see the same set of
messages, and so have same conclusion.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 9/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
v:2:1:4 = v:2:1
v:2:3:4 = v:2:3
v:2:::4 = v:2:4 + v:2:1:4 + v:2:3:4 = v:2:4 + v:2:1 + v:2:3
v:2:::1 = v:2:::3 = v:2:::4
The same principal based on relay applies even when there are more nodes. After
enough relays, each node can collect all the messages sent to other nodes from a node
and so make same decision.
3m + 1 processor algorithm may look perfectly useful with its simple recursive rules.
But actually the algorithm has a fatal weakness in scalability due to its complexity. As
can be seen in table below, the number of message increases radically as relays are
repeated. The complexity against m (the number of faulty nodes) is O(nᵐ). So the
algorithm is only useful with small networks. With large networks, we need other
algorithms.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 10/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Proof of Work
In 3m + 1 processor algorithm or pBFT explained above, nodes collaborate to
overcome the Byzantine fault. To collaborate over the disturbance of broken or hacked
nodes, algorithms have a constraint on the number of node and require enough
communications, which restricts the scalability.
3m + 1 processor algorithm has complexity of O(nᵐ) and pBFT has complexity of O(n²).
Proof of Work¹ (PoW) algorithm takes totally different approach. In PoW network,
every node competes rather than collaborate. The node which succeeds to solve a
mathematical puzzle that is extremely difficult to solve but very easy to verify will
make a decision for the whole network at that time. Right after a puzzle is solved and
the solution is propagated throughout the network, the competition for the next puzzle
starts.
There are a few types of such puzzles including hash computation and prime
factorization² of huge integer. There are no special formulas or techniques to solve
these kind of puzzle more quickly. Only simple repeated trial and error³ is valid
strategy.
So, the chance for a node to solve the puzzle is completely probabilistic. The
probability is solely dependent on the computing power of the node. If the computing
power is decentralized enough among nodes, it is actually impossible for particular
node or nodes to reign the PoW network.
Public blockchain network such as Bitcoin and Ethereum, as the network is open for
anyone to join as a peer with his or her own node, computing power concentration is
largely suppressed.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 11/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Process of PoW
For Bitcoin and Ethereum, the puzzle is finding a nonce that satisfies very specific
condition on the hash of block header combined with the nonce.
As a simple (not real) example for understanding, the condition says the hash should
start with 4 leading zeros. The following sentence express the condition or puzzle
more concisely and clearly — SHA-256 is one of popular hash functions and data
means block header
Hash function⁴ is a function that convert arbitrary-size data into fixed-size data of
totally different and unpredictable values.
Hash function has some important and unique features. The first and foremost one is
the the function is irreversible. More formally, there is no inverse function for a hash
function.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 12/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
For example, it is simple and straightforward the SHA-256⁵ hash value of “Hello, world!”
is “0x315f5bdb76d0…”, but it is impossible to calculate the inverse SHA-256 for the hash
value of “0x315f5bdb76d0…” is “Hello, world!” using any formula or special technique.
The second feature is that the hash function changes the output(hash value) a lot even
for a very small change of input. In other words, hash function diffuses input very
dynamically.
You can see this in the below table. In the table, the input values are different a little
from “Hello, world!” to “Hello, world!0”, “Hello, world!1”, “Hello, world!2”, and so on. But
the hash values of those are totally different. You can never guess or calculate the hash
of “Hello, world!1” from the hash of “Hello, world!0”, “Hello, world!2”, or other similar
input.
If you need to find a nonce which would produce hash value starting with 4 leading
zeros (“0x0000”) when appended after “Hello, world!” — like the “Hello, world!4250” at
the last row of the above table, there’s no special way or method more effective than
simple sequential trials from “Hello, world!0” to “Hello, world!4250”.
The concrete PoW algorithm being used by Ethereum is Ethash⁶. Ethash uses Keccak-
256 as a hash function. The puzzle of Ethash is to find a nonce which makes the
Keccak-256 hash of the block header and that nonce less than the specified value.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 13/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
In the while clause of the above function, the trials are repeated changing nonce by
one until the hash value ( hashimoto_full ) become equal or less than a certain target .
The target is a value given by dividing 2²⁵⁶ by the specified difficulty . The hash
value of SHA-256 is 64-digit hexadecimal and the largest value is 2²⁵⁶. The target is
smaller than 2²⁵⁶, so when expressed in 64-digit hexadecimal, the value has leading
0 (zero)s. For example, target value 2²²⁷ has 7 leading 0s and target value 2²⁰⁵ has 12
leading 0 s.
2227 = 0x0000000800000000000000000000000000000000000000000000000000000
2205 = 0x0000000000002000000000000000000000000000000000000000000000000
2256
dif f iculty =
target
1 target
= 256 = mining probability
2
dif f iculty
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 14/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
The product of target and difficulty is constant 2²⁵⁶. Raising difficulty will
lowering target so that more leading 0s necessary.
The number of all hash values of SHA-256 is 2²⁵⁶ and at a given difficulty the number of
hash values of successful mining is target . So, target /2²⁵⁶ is the possibility of
successful mining in a single trial. This is same with the inverse of
difficulty (1/ difficulty ).
The table below shows the real difficulty s and target s of a few blocks in Ethereum
mainnet. If difficulty is managed to be constant, the block creation interval will be
affected by the number of node or the total computing power they are consuming. To
prevent fluctuation of block creation interval and keep block creation timing uniform
and predictable, Ethereum continuously reconcile the difficulty for the new block
based on recent block times.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 15/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
waste due to heavy competition and another important one is finality problem
explained in detail below.
Finality Problem
To recap, the successful puzzle solving is called mining in PoW network. Mining means
a new block is created and the miner is rewarded. Large number of nodes compete
intensively to get the reward.
Looking into details of mining rule, the hash calculation includes the hash value of last
block in addition to the transactions to add and nonce. It is for maintaining the
blockchain linear or 1-dimensional. This makes it more difficult to compromise the
integrity of blockchain and prevents the conflicting states in blockchain.
In most of the cases, minings occur with intervals enough to keep the blockchain
linear. But almost simultaneous minings can occur no matter how much the
difficulty is increased, because mining is probabilistic by nature.
Although the verification is much simple, it takes time to propagate a mined block to
all nodes across the world. So simultaneous minings make the whole network a little
non-uniform.
Like the following example. if two distant nodes P and Q succeed to mine a block —
block B(m) and block B(n) in each — almost at the same time, within time not enough
to propagate B(m) and B(n) across the whole network, nodes around P will have B(m)
as a last block and nodes around Q will have B(m) as a last block. Nodes at similar
distance from both P and Q can not distinguish which block actually mined first.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 16/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Both B(m) and B(n) are based on the same previous block. In other word, they contain
the same hash of previous block header. So, the previous block is called parent block.
Nodes continuously try to mine next blocks to acquire rewards. Some nodes which
received B(m) first would challenge next block based on B(m), but other nodes which
received B(n) right before would challenge next block based on B(n). Although
successful minings occur with enough time intervals due to the difficulty in most
cases, it is possible with very low probability that the right next mining also occurs
almost simultaneously. In these case, mined blocks can have different parent blocks.
For example one of the 2nd simultaneous blocks is base on B(m) and the other is base
on B(n) like the following example image.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 17/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Next time, another 2 different miners may succeed mining almost simultaneously again.
You can see that the entire chain is not liner any more, although there was no violation
against PoW rules before. This is called fork, and each linear (connected linearly) part
from the fork point is called branch. In the above example, there are 2 branches. One
branch is B(m) followed by B(m2) and the other is B(n) followed by B(n2).
With high competition for mining and non-uniformity in the network, the previous
abnormal (but not illegal) situation can continue further. In other words, 2 branches
grow more like B(m)-B(m2)-B(m3)-B(m4) and B(n)-B(n2)-B(n3)-B(n4). Or even
another branch may appear.
But, eventually only one branch will survive because mining is really difficult and all
of these are probabilistic. There is also another mechanism called longest chain rule
which enforces to select the longest branch under a fork situation. The longest rule
would accelerate only one branch to survive once one of the simultaneous branches
starts to grow quickly.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 18/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Although the chain remains linear in the long term, there could be a serious trouble
called finality problem in the meanwhile. Finality problem is a situation where
successfully mined transactions or blocks become invalid or canceled later due to a
fork explained above. It is not caused by a violation of PoW. It is an intrinsic aspect of
PoW.
The picture below describes a typical process of finality problem. It shows growth of a
blockchain as time goes by. At ②, block B(n) containing tx(b) was mined successfully.
But almost simultaneously another block B(m) which is not child of B(n) also was
mined making a fork(③). Although two branches had kept growing together, after all a
branch stemmed from B(m) survived invalidating the block B(n) and the transaction
tx(b), like ⑥. This implies that a transaction completely committed once can be roll-
backed later. It is a significant drawback from the data persistence system’s point of
view.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 19/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
To workaround the finality problem, we should wait and watch for a while a block
including our transaction to grow further even after mining. Usually, 6 more blocks is
thought to be necessary for Bitcoin and 12 blocks for Ethereum. Of course, these
numbers doesn’t guarantee prefect finality.
Currently block time of Ethereum is about 13 seconds. But finality problem makes the
actual time to confirm a transaction 2.6 minutes instead of 13 seconds.
Finality problem can be exploited by a huge miner to compromise integrity and trust
of a Blockchain. If he or she has more than 50% of entire mining capabilities, he or she
could invalidate very important or expensive transactions to earn a profit or to achieve
evil purpose. This is called “51% attack”.
Even though it may considered almost impossible to occupy more than 50% mining
power among hundreds of independent and active miners, there are actual thread of
51% attack⁷. Ethereum Class(ETC) was attacked⁸ at Jan. 2019 and Bitcoin Gold(BTG) at
Jan. 2020⁹.
To solve finality problem, Ethereum has developed a new consensus algorithm called
Casper FFG and it is among key features of Ethereum 2.0.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 20/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Casper FFG
Casper FFG is a type of PoS(Proof-of-Stake) consensus algorithm and has a few unique
features that is expected to solve or improve dramatically the finality problem. It was
first proposed by Vitalik Buterin and Virgil Griffith in 2017¹.
First, Casper FFG is a partial consensus algorithm which undertakes only finality
agreement. Casper FFG doesn’t include any rule to make or confirm blocks. It defines
a protocol to more quickly determine a real final block among several branches under
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 21/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
fork situation. It can be applied over other consensus algorithm such as PoW. So,
Casper FFG is classified as an overlay algorithm.
Third, Casper FFG defines both incentive rules and penalty rules. Other PoS
algorithms including pBFT usually don’t have penalty rules. So even if some malicious
nodes try to disturb consensus, there’s no efficient way to prevent them. “Nothing at
stake”² is one of the most well-known problems for PoS algorithms. But, in case of
Casper FFG, validators to exploit nothing at stake will be punished and lose all their
stakes.
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 22/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
Like pBFT or usual PoS algorithms, Casper FFG runs rounds in a fixed time schedule.
In each round, all validators should vote in each round following 2 strict rules. If a
validator violates a rule even once, it will lose its stake and be evicted from validators.
So, these rules are called slash conditions.
If a block receives votes from more than 2/3 validators in a round, the block is said to
be justified. Justified blocks still can be forked, so are not finalized. But if two
sequential blocks are justified, the parent block of the two becomes ultimately
finalized.
To add some details, because slash conditions prohibit a spanning vote, after two
adjacent blocks win votes, at most 1/3 validators can vote any block below the parent
block following the rules in later rounds. So, unless another 1/3 validators violate the
slash conditions losing all their stakes, the parent block would be an ancestor of all the
later justified votes.
Due to a penalty rules (slash conditions), Casper FFG is expected to promote more tight
cooperation and lead to far more fast and effective finalization than longest chain rule.
Casper FFG is a governing algorithm of Beacon chain which is the topmost feature of
Ethereum 2.0³ phase 0⁴.
[1] Vitalik Buterin and Virgil Griffith, “Casper the Friendly Finality Gadget”, 2017
[2] Nothing At Stake Problem — A Forkin’ Mess!
[3] Ethereum 2.0 Info
[4] Validated: Staking on eth2 #0
[5] Casper FFG Explained
[6] Vitalik Buterin and Virgil Griffith, “Casper the Friendly Finality Gadget, Ver. 4”, 2019
Also Read
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 24/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 25/26
2/11/23, 11:02 PM Basic Consensus Algorithms, Explained | by Sangmoon Oh | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/coinmonks/basic-consensus-algorithms-explained-69a7a67ac13e 26/26
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
Published in Coinmonks
Save
The consensus algorithm provides the standards for the nodes in the network to join
the Blockchain in a trustless manner. Trustless means a node doesn’t have to validate
its identity before joining a public blockchain.
Consensus algorithms check the integrity of new blocks and past blocks.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 1/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
It is a set of rules written using computer code and follows specific governance
standards. Let’s proceed to understand a few consensus algorithms.
When calculating the successful block, the miners agree on the longest chain rule. Any
entity holding 51 % of hashing power in the POW consensus can maintain the longest
chain and control or undermine the blockchain. They can introduce false transactions,
eliminate or exploit the blockchain by double-spending and steal assets of other
miners. GHash.io owned 54% of the BTC blockchain at one point.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 2/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
“ The majority decision is represented by the longest chain, which has the greatest proof-of-
work effort invested in it. — Satoshi Nakamoto”
All the nodes trust the longest chain in a blockchain without trusting each other
directly.
Building any block requires energy. The miners work on blocks that form the
longest chain and have the most effort. The chain with the longest block needs the
most power to create. The algorithm discards the shorter chains, and the longest
chain is adopted.
Based on the difficulty, blocks will take more effort to reach the nonce value which
is smaller than the target. Because difficulty changes, the greater the difficulty the
more the effort/resources.
Chainwork is the metric to calculate the longest chain. It is the total number of
hashes that are required to produce the current chain. To get the complete hash,
you need to sum the hashes needed for each block.
When there are the same blocks, the nodes disagree on which nodes to reach a
consensus. The nodes pick the newer block built on top of the last block, forming
the longest chain.
It is difficult for a single miner to replace the chain with the longest chain principle
because the resource required is way too high to replace. This rule protects the
blocks already mined. It is a cooperative effort to mine a block.
The rewards motivate the miners to calculate and mine the longest block. The
longest chain that is 100 blocks deep gets awarded in the Bitcoin blockchain.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 3/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
Bitcoin and Ethereum are the different blockchains using the POW consensus
algorithms.
Double spending
In double-spending, a miner can use the same coins to make multiple transactions.
Double spending leads to spending more than expected. It is vital to approve all the
transactions in blockchain that could potentially stop such double-spending attacks.
Selfish mining
In selfish mining, the miner withholds mined blocks and selectively releases them into
the blockchain. A miner with a 33 percent stake can earn 50 percent of mining power
by progressively submitting the blocks.
POS system introduced the Ethereum 2.0 standards-based POS algorithm (Casper ) to
solve the Byzantine General problem(BGP). In this, a two-thirds majority is required
among the nodes to reach a consensus.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 4/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
In POS, security is easier to achieve because a 51% stake is a vast amount for a single
entity to lose if the malicious activity miner is caught in the blockchain. Double
spending is still possible where one who has 51% of the stake can do malicious
spending. The same technique of approving and validating transactions before
committing to the blockchain will help mitigate this attack.
ADA/ Cardano currently uses Proof of Stake (POS). Ethereum plans to move to POS
soon.
The chosen person/witness miner should do a quality job and should not do any
malicious activity. The voters have the right to withdraw the vote if the actor’s
performance is not on par, or he is identified as a bad actor. The delegated proof of
stake approach saves a lot of computational power and reaches a consensus in a
democratic way.
It does not require high power computational hardware, it has predictable block time,
paid high transaction fees, and has tolerance to malicious nodes.
POA verifies the identity of the node before accepting it. This consensus algorithm is
used in the private blockchain setup. Since the identity of the block is verified, the
nodes are allowed to submit a block and it is considered valid. In the POA consensus
algorithm, the block creation is dynamic and the verification time is faster.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 5/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
situations. Using BFT, the healthy nodes or the nodes which provide the correct
response can reach a consensus to overcome such node failures and make a decision
to proceed or stop the node.
The parallel to the Byzantine General problem (BGP) is seen when the Generals
separated by distance have to decide to either proceed to attack or retreat from an
attack. In this situation, the generals have to agree on a majority. If one of the generals
plays the double role of voting to attack and also voting to retreat and does not join the
team of attacking generals, then the result could be catastrophic. The BGP also gets
aggravated by the chances of the message getting lost by the messengers who have to
travel distant places to deliver. The BFT consensus algorithm is designed to address
BGP scenarios of the crypto currencies world.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 6/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
Periodic burning of the coins disallows the unfair advantage of over-investing initially,
rather that promotes periodic burning of coins and keeps the system active. For
instance, Slimcoin, a virtual currency network that uses POB, allows a miner to burn
coins that gives them the right to compete for the next block and also gives them the
chance to receive blocks during a longer one year time period.
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 7/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
POET was developed by Intel Corporation. This algorithm uses a lottery system where
the miners are selected in a timed manner and all the miners get equal chances to
mine. Each participating node of the POET system goes to a passive mode for an
allocated random wait time.
The miner’s node with the shortest wait time awakes and starts the mining. This is
similar to POW but not all nodes are the time competing to provide the proof of validity
for a block. The nodes that are dormant because of their downtime can save resources
and execute some other non-primary tasks.
This article covered a few predominantly used consensus algorithms in the Blockchain
technology. Read more articles on IAM & Security @https://iamblockc.medium.com/
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 9/10
2/11/23, 11:05 PM Blockchain Consensus Algorithms. Proof Of Work (POW) Proof Of Stake… | by Mat David | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/coinmonks/blockchain-consensus-algorithms-6c2459737a61 10/10
2/11/23, 11:06 PM Advantages and Disadvantages of the Longest Chain Rule | by Conflux Network | Medium
Save
In this article, the discussion will be focusing on the Longest Chain Rule adopted by
Bitcoin, namely the “Satoshi Nakamoto consensus algorithm” .
Conflux adopts the Heaviest Chain Rule, which is different from the Longest Chain Rule.
Previously, we often talked about why Conflux did not choose the Longest Chain Rule,
but barely mentioned any advantages of such. Therefore, a more comprehensive
discussion that covers both strengths and weakness is shared here.
Starting from the Bitcoin, followed by the Litecoin — which only altered a couple of
parameters of Bitcoin, the later proposed Bitcoin-NG[1], and the OHIE[2] using the DAG
structure, the core concept of many public chain consensus algorithms is the Longest
Chain Rule.
Favored by so many public chain projects, what is the biggest advantage of the Longest
Chain Rule?
OHIE’s paper[2] mentioned a key point: for a blockchain system, one crucial point is an
“end-to-end” security proof, that is, a security proof only work for a few specific attacks
is far from enough, as there is no way to avoid smarter people to design smarter attack
strategies in the future.
https://confluxnetwork.medium.com/advantages-and-disadvantages-of-the-longest-chain-rule-bc27225a2728 1/5
2/11/23, 11:06 PM Advantages and Disadvantages of the Longest Chain Rule | by Conflux Network | Medium
As for the end-to-end security proof, the Longest Chain Rule advances much more than
others. As the core rule of Bitcoin, the first of cryptocurrencies, the most extensive and
in-depth study has been carried out for the Longest Chain Rule.
In fact, even though it was the most studied, the full proof of its safety was not
completed until September 2016 by Rafael Pass, a cryptography professor at Cornell
University[3]. (Satoshi Nakamoto’s proof in the Bitcoin white paper only considered the
specific attack. Other earlier works only proved the security of the Longest Chain Rule
under certain conditions.) Rafael’s proof can be directly extended to any reasonably
designed public chain systems based on the Longest Chain Rule.
In contrast, other consensus algorithms, including the Heaviest Chain Rule, did not have
complete security proof until 2019, and some consensus algorithms did not even have a
security proof under defined conditions. We will leave the questions related with the
Heaviest Chain Rule and how Conflux will cope with them in the following issues, here I
will expand no further.
So why doesn’t Conflux employ the Longest Chain Rule?
The main reason is that the Longest Chain Rule is very sensitive to “orphan blocks”.
“Orphan block” refers to blocks that are formally legal but are not eventually included
by the main chain (the longest chain). In the ideal case, the honest node will increase the
length of the longest chain by one each time a block is generated. However, if two
honest nodes mine two blocks almost at the same time and do not yet refer to each
other as the parent block, then the two blocks will form a competitive relationship. At
best, only one of the competing blocks will be included in the longest chain, and the rest
will become “orphan blocks” that do not contribute to the longest chain.
Once there are too many orphan blocks in the system, the growth rate of the longest
chain will be affected, which will increase the chances of being attacked. For example, in
the case where 50% of the honest blocks become orphans, the average growth rate of
the longest chain is only half of the block-generating speed of the honest nodes. At this
time, the attacker only needs 34% of the total computing power (more than half of the
computing power of the honest node) to initiate a double-spend attack on any previous
transactions.
https://confluxnetwork.medium.com/advantages-and-disadvantages-of-the-longest-chain-rule-bc27225a2728 2/5
2/11/23, 11:06 PM Advantages and Disadvantages of the Longest Chain Rule | by Conflux Network | Medium
The frequency of the occurrence of orphan blocks is related to a ratio: Average block-
generating time/ Block broadcasting time in a peer-to-peer network. We will refer this
ratio as the security factor for the time being. The higher the ratio is, the less frequently
the orphan blocks will appear, and the safer the main chain will be. According to the
analysis in the article [3], when the ratio is larger than 7, the theoretical threshold of the
computational power required for the double-spend attack is about 45%; when the ratio
is greater than 60, the theoretical threshold is about 49.5%. At present, the ratio of
Bitcoin is around 60.
That is, Security Factor * Payload per Transaction * TPS = Network Bandwidth factor
Each item, besides TPS itself, in the above equations, corresponds to an entry point to
improve the TPS under the Longest Chain Rule:
1. Lower the Security Factor: simply change the parameters of Bitcoin and sacrifice part
of the security in exchange for higher efficiency. For example, shorten the block
generation time or increase the block size (equivalent to increase the block broadcast
time).
2. Lower the Payload per Transaction: apply the Compact Block Technology to convert
the complete transmission of each transaction (appx. several hundred KB) into the
short transaction ID (4~6B).
3. Increase the Network Bandwidth Factor: increase the threshold for joining the
consensus nodes and sacrifice a degree of decentralization in exchange for higher
efficiency. In extreme cases, keep only a small number of supernodes (such as 21) that
are directly connected to the network.
The approaches above are very direct and effective, but the performance improvement
that they can bring is limited, and the sacrifices caused by the overuse of them is also
https://confluxnetwork.medium.com/advantages-and-disadvantages-of-the-longest-chain-rule-bc27225a2728 3/5
2/11/23, 11:06 PM Advantages and Disadvantages of the Longest Chain Rule | by Conflux Network | Medium
significant. For example, increasing the size of a block to hundreds of MBs or reducing
the number of consensus nodes to 20 is probably not worth the effort.
In fact, Bitcoin-NG and OHIE adopt some special designs to bypass the above
limitations. On the other hand, if the Tree Graph and the Longest Chain Rule are
combined, a high TPS consensus mechanism can be designed easily. In this regard, we
will address in another article to discuss it thoroughly.
All in all, on the road to improve the TPS, although the Longest Chain Rule is subject to
the above analysis, the ceiling can be bypassed by a reasonable design.
The biggest weakness of the Longest Chain Rule is the Block Confirmation Time.
If the Security Factor is set to 10, the average waiting time to confirm 6 blocks is 60 *
Block Broadcast Time; if a transaction needs to be confirmed within two minutes, the
Block Broadcast Time needs to be controlled within 2 seconds.
In fact, in each hop of the block broadcasting, every node needs to perform a series of
operations such as signature verification and transaction execution before forwarding
toward the next hop. When the number of nodes is large, it is very difficult to broadcast
even a small/medium size block to all (or most) nodes in the whole network within 2
seconds. For the current network environment, a confirmation time of 3 to 5 minutes is
basically the limit of the Longest Chain Rule.
The prototype of Conflux (also known as the current public version, the new version of
the article and technical specifications has not been publicly released) has a
confirmation time of 4 to 7 minutes, which does not seem to do a better job. In fact, as
we conduct more in-depth research on the Heaviest Chain Rule and further explore its
unique potential, we have made amazing breakthroughs in the confirmation time of the
PoW chain, and have achieved a confirmation speed way above that in the Longest
Chain Rule.
What is the most attractive feature of the Heaviest Chain Rule? We will discuss further in
the next issue.
[2] Haifeng Yu, et al. “OHIE: Blockchain Scaling Made Simple.” arXiv:1811.12628 (2018).
https://confluxnetwork.medium.com/advantages-and-disadvantages-of-the-longest-chain-rule-bc27225a2728 4/5
2/11/23, 11:06 PM Advantages and Disadvantages of the Longest Chain Rule | by Conflux Network | Medium
[3] Rafael Pass, Lior Seeman, and Abhi Shelat. “Analysis of the Blockchain Protocol in
Asynchronous Networks.” EUROCRYPT 2017.
[4] Yonatan Sompolinsky and Aviv Zohar. “Secure High-Rate Transaction Processing in
Bitcoin.” International Conference on Financial Cryptography and Data Security, FC
2015.
Search Medium
About Help Terms Privacy
https://confluxnetwork.medium.com/advantages-and-disadvantages-of-the-longest-chain-rule-bc27225a2728 5/5
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
Published in Coinmonks
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
The Blockchain
An Introduction to Blockchain, Bitcoin ₿, and related concepts
Bitcoin crossed $40,000 USD for the first time recently, so it’s again in the news. Bitcoin
is just the most-known cryptocurrency. It is one application using a blockchain. In
this article, I will walk you through some core concepts of blockchain and
https://medium.com/coinmonks/the-blockchain-473aac352e5 1/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
cryptocurrencies. This article is written for beginners and a bit fluffy in some areas.
There will be follow-up articles to address that. Let’s start!
Suppose we lived in a simpler world without credits and with only one bank.
Everybody just owns a non-negative amount of money. The bank keeps track of
transactions. Let’s say we have three students living in the same shared apartment:
Anna, Bob, and Charlie. They all put $100 USD in their bank account:
Now they make a few transactions. Before the bank's system accepts any transaction, it
checks if the account balance would still be non-negative. To get the account balance,
they can sum up all previous transactions. To make it a bit easier to follow, I will
shorten the “Date” to just a number counting up and add the balance after the
https://medium.com/coinmonks/the-blockchain-473aac352e5 2/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
transaction is executed for Anna, Bob, and Charlie to the table. The ABC columns are
just for you to keep track of; they are not necessary:
(I’m simplifying a lot here. If you’re interested in Accounting Stuff, James Hearle
summarized those ideas and more, including double-entry accounting in the linked
channel.)
https://medium.com/coinmonks/the-blockchain-473aac352e5 3/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
Anna, Bob, and Charlie are unhappy with their bank. They don’t like that it takes
typically two working days until the booked transaction actually takes place. They are
unhappy with paying fees. They wonder what would happen if their bank suddenly
closed or maybe even manipulated the numbers.
As Anna, Bob, and Charlie live in the same apartment and they spent their money on
stuff for the apartment (soap, toilet paper, dishwasher tabs, …), they put a list on the
fridge. They simply make it public who made which transaction. They don’t have
complete trust in each other, though.
For example, Bob might write in the ledger that he got $20 from Charlie — although
Charlie never approved that. To make sure only the account owners can send money
from their accounts, every new transaction needs the signature of the sender. To make
sure that everybody only sends money they have, the remaining participants check
the balance of the sender. If an invalid balance is seen, the transaction is rejected.
They also want to make sure that nobody can erase any transaction. The solution is
simple: Every transaction gets an incrementing transaction number.
https://medium.com/coinmonks/the-blockchain-473aac352e5 4/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
Anna, Bob, and Charlie want to be certain they will never lose their ledger. Instead of
having a single central ledger, they decide to distribute it. They all want to have a copy
of it.
Being young students, all of them happen to have a website. So they come up with this
protocol which they all want to follow:
1. If anybody wants to make a new transaction, they add the transaction to the copy
of the ledger they have on their website.
2. Everybody regularly checks if there are newer transactions in any of the other
ledgers.
3. If there is just one ledger with at least one new transaction, they just copy the
newer transactions.
Then they notice two problems. The first one is the signature. Luckily, one of them
heard of Public-Key Cryptography and digital signatures. They quickly realized that for
https://medium.com/coinmonks/the-blockchain-473aac352e5 5/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
any transaction, they can easily make a digital version of a signature that cannot be
forged. The digital signature does not only prove who made the transaction but also
makes sure that the content of the transaction is not modified. As the content of the
transaction contains the transaction number it is also not possible to delete a single
transaction. As the longest list of transactions is shared, one cannot simply crop a
whole lot of transactions off at the end.
Anna sees new transactions from Bob and Charlie. They all have the same green blocks, but bob discarded the
blue blocks in which he sent money to charlie. He created the red and the yellow ones to fool Anna. Image by
Martin Thoma
What happens if Anna sees a new transaction from Bob and a new transaction from
Charlie? Let’s say Anna has already confirmed that both, Bob and Charlie, have the
same indices up to #42. Bob and Charlie had a lot of transactions after that and the
correct latest transaction #60. But Bob doesn’t like that he had to send quite a bit of
money to Charlie in transactions #43 to #60, so he simply writes 10 transactions after
#42. Charlie still receives some money, but less than he should. Anna sees that Charlie
has already transaction number #70 and ignores what Charlie has.
To prevent this, they make it more difficult to create a transaction. They have heard of
Hashcash to prevent spammers from sending too many emails. The idea is to make the
Email sender (the potential spammer) execute a computationally heavy function. The
result of that function is easy to verify, but there is no way to speed the execution of the
function up in the first place. The result is then called Proof of Work. The specific kind
of proof of work that is typically used is called a nonce: Number only used once.
Finding such a nonce is intentionally computationally intensive. This is what mining
https://medium.com/coinmonks/the-blockchain-473aac352e5 6/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
is. Alice, Bob, and Charlie agree to add the proof of work to each transaction. Thus re-
calculating a lot of transactions is just not worth it anymore.
Anna sees the same number of new transactions from Bob and Charlie, but transaction #43 is different. Bob
tries to tamper with the amount he sent Charlie. Image by Martin Thoma
However, there is one big flaw: If they just store the transaction number, one could
replace transactions in the middle. If Bob is unhappy that he has sent $100 to Charlie in
transaction #43, he could just craft another transaction #43. So instead of storing the
transaction number, they agree to store an identifier that is unique to the content of
the previous transaction. A so-called hash value.
Let’s summarize:
Having the chain of transactions, the ledger, distributed among all participants
makes the current state transparent. It’s a pre-requisite of preventing the re-
computation.
https://medium.com/coinmonks/the-blockchain-473aac352e5 7/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
You might already have guessed it: A transaction in this example is pretty close to a
block in the blockchain. In our example, a transaction contains:
Amount of transaction
Sender
Receiver
There is one special case: The first block. It does not have a previous block and thus
there cannot be a hash value of a previous block. The first block is called the genesis
block.
Example vs Bitcoin
One part I haven’t addressed at all is how the users of Bitcoin interact. We didn’t talk
about the network at all. Just to be clear: It’s NOT the case that everybody adds their
own website and everybody else has to know and check. That was just a simplification.
There is a Peer-To-Peer protocol in place.
An important element of Bitcoin is the consensus algorithm which decides what the
latest block is. The network members check new data before it’s added with a
consensus mechanism. The consensus algorithm has two elements. One consensus
mechanism is proof of work. The proof of work mechanism uses the computing
capacity of the members to validate work. In the example, I made it constant. It’s more
complicated.
The other element of the consensus algorithm is that in the case of a draw, if multiple
parties have created a new block at exactly the same time, one waits until one of the
chains gets longer. The longer chain wins.
Bitcoin also does not store the account balance. It’s more complicated. It stores a
sequence of transactions. A transaction consists of inputs and outputs. The sum of
inputs must be greater than or equal to the sum of outputs. This way, the double-
spending problem is solved. The inputs must be associated with the signature of the
https://medium.com/coinmonks/the-blockchain-473aac352e5 8/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
transaction — only the owner is allowed to send money. This structure is the reason
why you typically have two outputs: The receiver of the money and your own address
for the change. You can imagine every input as a coin. Coins can only be split by
having multiple outputs in a transaction, not by taking a part of a coin as input. You
can also join coins by having just one output.
It took me quite a while and the help of Rene Pickhardt to understand that Bitcoin is
actually NOT account-based, but everything that really matters is the transactions. It’s
not verified that the account is a non-negative balance, but that a transaction spends
only available money. That is a crucial difference! Rene is an awesome educator; check
out his introductory video about electronic cash.
Bitcoin vs Blockchain
https://medium.com/coinmonks/the-blockchain-473aac352e5 9/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
Bitcoin is an application that uses the blockchain. As an analogy, think of email. Email
is an application that uses the internet.
A Consensus Algorithm
Cryptography: Bitcoin uses ECDSA for signatures, double SHA-256 for hashing
Blockchain vs DLT
Blockchain is a distributed ledger technology (DLT). Two other examples of DLT are
Tangle and Hashgraph.
You can see the blockchain as a very special database. It only supports insertions, but
no deletions or edits. It’s managed by the network. Depending on the protocol, this
can mean that the data in the blockchain is immutable. The data is distributed.
https://medium.com/coinmonks/the-blockchain-473aac352e5 10/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
There are some properties where blockchain will never be able to compete with well-
known database systems:
Latency: Probably less than 5 seconds for Visa, but about 1 hour for Bitcoin
(source).
Queries: We have lots of database types. Especially relational databases allow very
complex queries. You will not have that with the blockchain.
Those alone already show that you want traditional database systems for a lot of
problems. So let’s see where the Blockchain shines:
Supply Chain Management: Many brands nowadays want to make their supply
chain more transparent. They want to prove to the customers where their product
came from; “traceability” is the buzzword. They also want to make sure that
counterfeits can be identified. So they upload data and about the origin of their
products at every step. Those steps have timestamps and are very fine-granular.
One problem the blockchain doesn’t solve is that all of the uploaded data could be
faked. If you want to know more, get in touch with my friend Peter Merkert. He
built retraced, a company that supports the clothing industry in supply chain
management. A big thank you also to him for proof-reading this article 🤗
https://medium.com/coinmonks/the-blockchain-473aac352e5 11/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
Real Estate: I know that in Germany we have pretty good maps of the country, of
ownership of every single piece of land. The process of buying and selling land
includes a trusted party — a notary. The notary gets 1.5% of the amount you pay for
the land. A square meter of land costs about 4000 EUR in Munich. A small house
has about 300m² — so you would pay 1.2 million EUR for the land and thus 18k for
the notary. This is a pretty good incentive to get rid of the notary, isn’t it?
The other case is that you might not have such a process in all countries.
Energy can be traded using blockchain. Read When Energy Trading meets
Blockchain in Electrical Power System: The State of the Art to learn more.
A good sign that you might have a valid use case if there is no trusted middleman or if
you want to get rid of the middleman. Just look at the supply chain case. If there is an
organization that people trust, then you don’t need to store the data in the blockchain.
That organization just stores it in a traditional database they control.
What’s next
Hashing: What it is, what cryptographic hashing is, what SHA / MD5 is
Merkle Trees: What they are, how they work, and how they are used in Bitcoin
Public-Key Cryptography and RSA: Public- and private keys, Digital Signatures,
Trapdoor functions. What it is and why it’s so important
Proof of Work: How it works, how difficult it is, and what Bitcoin / Ether / Stellar
use.
Smart contracts: What they are and how they work; e.g. with Etherium as an
example
https://medium.com/coinmonks/the-blockchain-473aac352e5 12/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
Bitcoin Wallets
See also
Literature
Satoshi Nakamoto: “Bitcoin: A Peer-to-Peer Electronic Cash System”, 2008.
Videos
Bosch created an awesome introductory video:
https://medium.com/coinmonks/the-blockchain-473aac352e5 13/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
https://medium.com/coinmonks/the-blockchain-473aac352e5 14/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
3Commas Review
Pionex Review
AAX Exchange Review | Referral Code, Trading Fee, Pros and Cons
3Commas vs Cryptohopper
ledger nano s vs x
Vauld Review
https://medium.com/coinmonks/the-blockchain-473aac352e5 15/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
CoinTracking Review
YouHodler Review
Coinrule review
https://medium.com/coinmonks/the-blockchain-473aac352e5 16/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/the-blockchain-473aac352e5 17/18
2/11/23, 11:10 PM The Blockchain. An Introduction to Blockchain, Bitcoin… | by Martin Thoma | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/the-blockchain-473aac352e5 18/18
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 1/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
Bitcoin is the world’s first and most popular digital currency. It is decentralized and
controlled by no one. How does it work, and why can you trust it? After all, if
computers can copy any file, why can’t I just make copies of my bitcoins? And if it is
not controlled by any one central party, what prevents me from making forging
transactions for bitcoins I don’t own? This article will explain in layman’s terms how
Bitcoin works and provide information on how the technology backing Bitcoin can be
used for business use cases beyond simply a digital currency.
Bitcoin works by solving three record-keeping challenges without the need for a
central record keeper like a bank:
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 2/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
This opens the door for sending secret messages. Let’s use the characters from
Guardians of the Galaxy for a fun example. Suppose that Star-Lord, the hero, wants to
send a secret message “Hello Groot” to his tree-shaped friend Groot and ensure the
movie’s arch-villain Thanos can’t read it. Groot has created a pair of public/private
keys. Star-Lord takes Groot’s public key and uses it to encrypt the message. The
message while in transit looks like gibberish, but when Groot receives it, his private
key is able to decrypt it.
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 3/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
Star-Lord encrypts a message using Groot’s public key. Groot decrypts it with his private key.
Digital Signing
Using these keys in reverse can also be used to verify the authenticity of who created
the data, and that is how Bitcoin employs it. Now suppose Groot wants to send Star-
Lord the message “I am Groot.” There is no reason to encrypt it because we all know
that’s the only thing Groot says, but Groot wants to prove to Star-Lord that the message
indeed came from Groot, not some 3rd party imposter. Groot would encrypt the
message with his own private key. When Star-Lord receives the message and decrypts
it with Groot’s public key, he sees “I am Groot.” This message is not a secret, but the
fact that Groot’s public key decrypted it is proof that it was generated using Groot’s
private key. Thus it proves the authenticity of the message.
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 4/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
Since Groot’s public key decrypts the message, Star-Lord knows it truly originated from Groot.
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 5/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
All bitcoin transactions are signed by the bitcoin’s owner, authenticating the transaction.
Bitcoin is essentially just a ledger of entries saying who transferred how many bitcoins
to whom, all digitally signed by their owners. This much is like a financial ledger on
paper with handwritten signatures authorizing each entry. When you send someone
bitcoins, your signed transaction is appended to this ledger.
Hashing
A hash is an algorithm for validating the integrity of data. Any message can generate a
hash value, but small changes in the message result in radical changes in the hash
value. For example, here are two messages and their hash values:
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 6/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
Suppose you are looking at an archive of a message I wrote My name is David Mooter . If
you know in advance that this message I wrote in the past had a hash value of
FE100DDA6D28B2280B34FC228ADAB42E , you can then validate the message wasn’t tampered
with by confirming it does indeed generate that hash. If someone tampered with this
record changing it to My name is Davis Mooter , then you would get the hash value
1761420899A8F0B731A2EE56A6F71567 and know someone had tampered with it.
The “Blockchain”
Bitcoin uses hashes to validate its ledger has not been tampered with. Periodically a
collection of transactions are published together as one new record, called a block.
Each block stores the hash of the block of transactions that preceded it. For example,
take the transactions shown in this ledger of three blocks, each of which recorded
three transactions labelled tx 1 through tx 9.
Each block of transactions has a hash to validate the integrity of the previous.
If I went back to delete transaction 3 from the first block, everyone would know that’s
invalid because the hash in block 2 would prove block 1 was tampered with.
Block 2’s hash detects any tampering with block 1’s transactions.
Fine, then I will also edit block 2 to have a hash that validates my forged block 1. This
doesn’t work, either, because the hash value in block 2 that I just modified was an input
to generate block 3’s validation hash, so now block 3’s hash reveals that block 2 has
been tampered with.
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 7/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
You can’t change block 2’s hash to validate the fraudulent transaction since block 3’s hash will catch that.
In sum, modifying one piece of the ledger is impossible: tampering with one
transaction would require modifying the hash value of every block of transactions that
followed it, which means generating a whole new ledger. This is why it is called
blockchain: it is as though all the blocks are tightly chained together and cannot be
unlinked from each other.
For example, suppose our blockchain has two blocks. Then I publish three new
transactions appended to the ledger, but at the same time, I additionally publish three
alternate transactions also appended to the ledger. Now we have two competing
blockchains.
Two blockchains where the last block of each disagree on the latest transactions. Which one is correct?
Proof of Work
This is solved through a concept called proof of work. Computers convert the hash
values I described in the previous section into a sequence of zeros and ones like this:
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 8/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
0010111011110100000001000001101010010010001011101111100001001010
Suppose we imposed a constraint that a block cannot be added to the ledger unless the
hash validating the previous block starts with a zero, then we would have a 1/2 chance
of getting a hash that works.
0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Similarly, if we imposed a constraint that it must start with two zeros, then there would
be a 1/4 chance. (We’d accept 00 but reject 01 , 10 , and 11 .)
00XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This grows exponentially. For example, if the constraint is that it must start with 32
zeros, then there would be approximately a 1 in 4 billion chance.
00000000000000000000000000000000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Bitcoin imposes such a constraint. Yet the hash of the previous block will always be
constant. How do you get a hash that meets this constraint with a fixed input? By
adding a random arbitrary value to every block. This is known as a “nonce” value.
This nonce is combined with the previous block when computing the hash. Before
adding a block to the ledger, computers around the world churn through random
values searching for a nonce value that, when combined with the previous block,
results in a hash that starts with a certain number of zeros. Finding that nonce value is
the “proof of work.” (Incidentally, when a computer finds a hash that can be published,
it includes a wallet, and that wallet is awarded free bitcoins. That is how new bitcoins
are generated.)
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 9/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
This is so computationally intense that we can predict on average how long it will take.
In Bitcoin’s case, it is one block every 10 minutes on average. Computers get more
powerful as time progresses, so Bitcoin increases the difficulty to keep pace with
advancing computer speeds by requiring more zeros every time a certain number of
blocks is published.
The previous block and current block’s nonce combined produce the validation hash.
In sum, when there are competing ledgers on the Internet, all Bitcoin users recognize
the one with the most blocks as the oldest and therefore authentic ledger.
Beyond Bitcoin
So there you have an explanation of Bitcoin in three easy steps:
Hopefully, you can see that Bitcoin is simply a decentralized ledger that all users can
trust. That ledger doesn’t have to just store currency. Other blockchains can and have
been developed to allow multiple parties to share information without a central
middleman broker. Some examples include:
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 10/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 11/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
Another challenge is who bears the investment cost. Why should my company develop
a blockchain that allows everyone in my industry to cooperate better? I would bear all
the costs while the benefits would be diffused among all my competitors. This
limitation makes curated blockchains more promising, since then the company that
bears the cost of creating it can control it to ensure they reap the maximum benefits
from that investment.
Yet despite these challenges, blockchain can provide business value. What all of these
use cases, from Bitcoin to RiskStream, have in common is that they build a trusted
information exchange between parties who may not know each other and may even
compete with each other. The key to successfully leveraging blockchain for your
business is finding use cases that fit that pattern. Then design a blockchain solution
that ensures your organization reaps the value you need, that the parties you need to
participate in it are willing, and that you have proper plans in place for making
blockchain data compliant with current or future data privacy laws.
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Your email
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 12/13
2/11/23, 11:12 PM The Bitcoin Blockchain Explained. Learn how Bitcoin works and how the… | by David Mooter | The Startup | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/swlh/the-bitcoin-blockchain-explained-b4529c78e6af 13/13
2/11/23, 11:15 PM Bitcoin's Monetary Policy - GeeksforGeeks
Data Structures and Algorithms Interview Preparation Data Science Topic-wise Practice C C+
Read Discuss
1. The Halving
2. Block Frequency
1. The Halving :
The number of Bitcoins released into the system ever y 10 minutes is halved af ter ever y 4
years. Actually, the halving takes place af ter ever y 210000 Blocks which takes
minutes).
When bitcoin star ted (2009), the block reward was 50 Bitcoin ever y 10 minutes.
In November 2012, Bitcoin’s 1st Halving took place and block reward(i.e reward for
successfully mining one block into the Blockchain) reduced to half i.e., 25 Bitcoin
from 50 Bitcoin.
In July 2016 Bitcoin’s 2nd halving took place(reward reduces to 12.5 Bitcoin) and the
next halving which is Bitcoin’s 3rd will take place in May 2020. This is when the
current block reward of 12.5 Bitcoin ever y 10 minutes will be cut into half to 6.25
Bitcoin.
This also means over time mining will become more difficult. A s network difficulty
increases over time & the reward rate drop, so the actual cost of mining each Bitcoin
increases, which will then cause the trading price of each Bitcoin to increase as well.
Also, the limited supply will cause Bitcoin prices to increase, as their scarcity also
Bitcoin). Only 21 million Bitcoins can be generated. Right now there is almost 18
2. Block Frequency:
Block Frequency is defined as, how of ten the blocks come in & break the reward which is
Like 1
Previous Next
Related Articles
Ar ticle Contributed By :
imavijit
@imavijit
Company Learn
About Us DSA
Careers Algorithms
In Media Data Structures
Contact Us SDE Cheat Sheet
Privacy Policy Machine learning
Copyright Policy CS Subjects
Advertise with us Video Tutorials
Courses
News Languages
Top News
Python
Start Your Coding
Technology Journey Now!
Java
https://www.geeksforgeeks.org/bitcoins-monetary-policy/ 4/5
2/11/23, 11:15 PM Bitcoin's Monetary Policy - GeeksforGeeks
Save
What is Bitcoin?
Bitcoin is the first decentralized electronic cash payment network that enables value to
be transferred peer-to-peer. Unlike traditional payment networks, Bitcoin bypasses the
need for a centralized body of control, such as a government or a central bank.
https://medium.com/swlh/what-is-bitcoin-ffab5e2e6a1c 1/6
2/11/23, 11:17 PM What is Bitcoin?. Bitcoin is the first decentralized… | by Kyle Cheung | The Startup | Medium
Instead, activities and balances are stored on a public, shared ledger called the
blockchain, which is verified by thousands of computers (called nodes) maintaining
the network across the globe. Transactions are made with no middlemen so anyone
with access to the Internet can transfer money to anybody anywhere in the world.
I’ll be using the terms: Bitcoin (capital B) to reference Bitcoin’s protocol/network and bitcoin
(lowercase b) to reference Bitcoin’s currency
– Satoshi Nakamoto
The first Bitcoin specification was published by Satoshi Nakamoto in 2009. Little is
known about Satoshi and he mysteriously disappeared from the project in late 2010.
However, a popular belief is that Satoshi Nakamoto is a pseudonym and Bitcoin was
created in a collaborative effort by a group of people spread over different continents.
What is evident is that Satoshi wanted us to never forget about bank bailouts and the
failings of our financial institutions as he inscribed “The Times 03/Jan/2009 Chancellor
on brink of second bailout of banks” to Bitcoin’s Genesis (first) block. Bitcoin carries
on today as an open source project. Its community of developers has grown
exponentially since its inception. A non-profit known as the Bitcoin Foundation
oversees Bitcoin’s development.
to debase the currency, but the history of fiat currencies is full of breaches of that trust. Banks
must be trusted to hold our money and transfer it electronically, but they lend it out in waves
of credit bubbles with barely a fraction in reserve. We have to trust them with our privacy,
trust them not to let identity thieves drain our accounts… With e-currency based on
cryptographic proof, without the need to trust a third party middleman, money can be secure
and transactions effortless.”
– Satoshi Nakamoto
To send or receive Bitcoins, users must first have a Bitcoin “wallet” which allows them
to facilitate transactions. Bob would first provide Alice with his Bitcoin address
(similar in concept to an e-mail address) so she knows where to send her bitcoins.
Alice creates a payment with her wallet to Bob’s address, and signs her payment with a
digital signature that is the mathematical equivalent of a traditional signature that
binds Alice’s identity to the details of her transaction.
Once Alice hits send, her transaction is broadcasted to the nodes maintaining the
network. Pending transactions are grouped together into “blocks”. From there, special
nodes called miners verify that Alice has the bitcoins to spend and that her signature is
valid. Miners play the crucial role of verifying and adding blocks to the official records.
Miners spend computing resources to compete with other miners to solve a complex
mathematical puzzle to arrive at a solution called Proof-of-Work. Each block contains a
group of transactions that points to a previous set of transactions all the way to the first
set of Bitcoins called the genesis block, effectively forming a chain. The first miner
with the correct solution broadcasts their block to rest of the network. Once the
solution is verified, the block is appended to previously verified blocks, officially
updating the blockchain’s records. As a reward, the winner is compensated with newly
https://medium.com/swlh/what-is-bitcoin-ffab5e2e6a1c 3/6
2/11/23, 11:17 PM What is Bitcoin?. Bitcoin is the first decentralized… | by Kyle Cheung | The Startup | Medium
created Bitcoins and transaction fees associated with that block. At this point, Bob will
see Alice’s payment in his wallet and he can send the bicycle to Alice.
“Instant transactions, no waiting for checks to clear, no chargebacks (merchants will like
this), no account freezes (look out Paypal), no international wire transfer fee, no fees of any
kind, no minimum balance, no maximum balance, worldwide access, always open, no
waiting for business hours to make transactions, no waiting for an account to be approved
before transacting, open an account in a few seconds, as easy as email, no bank account
needed, extremely poor people can use it, extremely wealthy people can use it, no printing
press, no hyper-inflation, no debt limit votes, no bank bailouts, completely voluntary. This
sounds like the best payment system in the world!”
No middle man means lower transaction cost. Traditional wire transfers and foreign
transactions are costly and slow. On average among national banks, it costs $25 for
outgoing domestic wire transfers and $44 for outgoing international wire transfers; in
comparison, most e-Wallets and cryptocurrency exchanges charge a nominal 0.25% to
1% fee to send bitcoins that reach your recipient in hours. Fees associated with
bitcoins are negligible compared to fees of established banking institutions, credit
unions, or companies like PayPal and Venmo.
Payment Freedom
The absence of a centralized governing body means no one can tell you what you can
or cannot do with your digital cash at any time — there are no bank holidays, no
borders, no restrictions. Traditionally, sending cash internationally takes at least 3 days
of processing time plus paperwork and fees. When you send bitcoins to someone, you
transfer directly to his or her address within a day with no additional hurdles. There is
also no way for a third party to suspend or confiscate your bitcoins. Bitcoin offers a
global payment system that is fast, secure and cheap. You have complete control of
your money with Bitcoin.
https://medium.com/swlh/what-is-bitcoin-ffab5e2e6a1c 4/6
2/11/23, 11:17 PM What is Bitcoin?. Bitcoin is the first decentralized… | by Kyle Cheung | The Startup | Medium
Once a transaction has been verified and recorded on the blockchain, it cannot be
reversed. Bitcoin transactions are immutable once on the blockchain. Merchants can
have peace of mind knowing they can send out goods with no risk of “charge-backs”
where customers receive goods then reverse payment; this mechanism inhibits fraud
which lowers merchants’ risk to conduct business online. Since Bitcoin can be used by
anyone with Internet, merchants can expand to new markets by accepting bitcoins
where currency or credit cards are unavailable. Furthermore, Bitcoin’s fast settlement
time can streamline a merchant’s business operations.
Transparent Transactions
With the blockchain, the complete bitcoin transaction history is readily available for
anyone to view. The fully auditable nature as well as Bitcoin’s cryptographically secure
protocol make Bitcoin difficult to be manipulated by any individual or organization.
Originally published at crypt0bits.com (that’s Crypto with a zero) on October 19, 2017.
https://medium.com/swlh/what-is-bitcoin-ffab5e2e6a1c 5/6
2/11/23, 11:17 PM What is Bitcoin?. Bitcoin is the first decentralized… | by Kyle Cheung | The Startup | Medium
This story is published in The Startup, where 263,100+ people come together to read Medium’s
leading stories on entrepreneurship.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/swlh/what-is-bitcoin-ffab5e2e6a1c 6/6
2/11/23, 11:19 PM What will happen to Bitcoin after all 21 million are mined? | by Decrypt | Medium
Decrypt Follow
Save
There are 21 million Bitcoin. That’s it. Once they’re all mined, which should occur in
around 2140, no new Bitcoin will enter circulation.
The Bitcoin blockchain was designed around the principle of controlled supply, which
means only a fixed number of newly minted Bitcoin can be mined each year until a
total of 21 million coins have been minted.
https://medium.com/@decryptmedia/what-will-happen-to-bitcoin-after-all-21-million-are-mined-7a5e320d56f7 1/5
2/11/23, 11:19 PM What will happen to Bitcoin after all 21 million are mined? | by Decrypt | Medium
Once all 21 million BTC have been mined, the network will largely operate the same as
it does now, but with one crucial difference for miners.
In return for discovering a block, the miner receives a fixed Bitcoin block reward.
When Bitcoin first launched, the reward was set at 50 BTC-but it halves periodically,
after 210,000 new blocks have been discovered. That happens roughly every four years,
reducing the reward to 25 BTC, 12.5 BTC, 6.25 BTC, and so on. Three halvings have
been completed so far; the most recent Bitcoin halving occurred on May 11, cutting the
block reward to 6.25 BTC.
https://medium.com/@decryptmedia/what-will-happen-to-bitcoin-after-all-21-million-are-mined-7a5e320d56f7 2/5
2/11/23, 11:19 PM What will happen to Bitcoin after all 21 million are mined? | by Decrypt | Medium
Bitcoin miners are rewarded with BTC for verifying blocks of transactions
Bitcoin miners will be able to continue earning block rewards until a total of 21 million
BTC has been minted, after which no new Bitcoin will enter circulation. Currently,
around 18.4 million BTC has been produced, equivalent to minting 87.6% of the
maximum supply in just over a decade. But it will take another 120 years before the last
Bitcoin ever is minted, due to the gradual reduction that occurs every four years as a
result of the halving process.
What will miners do when all the Bitcoin has been minted?
Once all 21 million Bitcoin have been minted, Bitcoin miners will still be able to
participate in the block discovery process, but they won’t be incentivized in the form of
a Bitcoin block reward. That’s not to say they won’t be rewarded at all, though.
As well as block rewards, Bitcoin miners also receive all the fees spent on the
transactions included in each newly discovered block. Currently, transaction fees make
up a small proportion of a miner’s revenues, since miners currently mint around 900
BTC (~$8.5 million) a day, but earn between 30 to 50 BTC ($285,000 to $475,000) in
transaction fees each day. That means transaction fees currently make up as little as
3.3% of a miner’s revenue-but in 2140, that’ll shoot up to 100%.
https://medium.com/@decryptmedia/what-will-happen-to-bitcoin-after-all-21-million-are-mined-7a5e320d56f7 3/5
2/11/23, 11:19 PM What will happen to Bitcoin after all 21 million are mined? | by Decrypt | Medium
At its peak in December 2017, the total transaction fees paid per day spiked to 1,495
BTC at a time when Bitcoin was valued at $14,000. As a result, miners earned a total of
$21 million in transaction fees that day-more than miners currently earn from the
block reward, indicating that something similar could occur in the future.
Another possibility on the cards is that the reward mechanism for Bitcoin could
change some time before the final block is mined. Luka Boškin, CMO of crypto trading
platform NewsCrypto , argued that as the number of BTC produced through mining
decreases, Bitcoin will undergo “significant changes” to its protocol. “That could
eventually include a switch to a more environmentally friendly consensus mechanism
like Proof of Stake or another successor to Proof of Work ,” he told .
https://medium.com/@decryptmedia/what-will-happen-to-bitcoin-after-all-21-million-are-mined-7a5e320d56f7 4/5
2/11/23, 11:19 PM What will happen to Bitcoin after all 21 million are mined? | by Decrypt | Medium
Originally written by Daniel Phillips and published at Decrypt: What will happen to Bitcoin
after all 21 million are mined?
Search Medium
https://medium.com/@decryptmedia/what-will-happen-to-bitcoin-after-all-21-million-are-mined-7a5e320d56f7 5/5
2/11/23, 11:21 PM What is Mining & How Cryptocurrency Works? | by BangBit Technologies | Medium
Save
Ever thought how cryptocurrency works or how Bitcoins are actually made? In last few
years, cryptocurrencies like Bitcoin are growing fast in popularity. The number of
people trading them is increasing at a lightning speed. As now Bitcoin has run the
mainstream & became a sensation, more and more people are coming into the game.
However, the production of cryptocurrencies is not known to everyone. As we already
know there is no central authority that controls cryptocurrencies, (Bitcoins or Alt-
coins), a process called ‘Mining’ is behind the creation of these cryptocurrencies.
Over the past few years, mining process has significantly improved with better use of
hardware. As there are different types of cryptocurrencies, there are also different
Thus, mining is a key part of the security of the cryptocurrencies system. The idea is
that miners group a bunch of transactions into a block, then repeatedly perform a
cryptographic operation called hashing zillions of times until someone finds a special
extremely rare hash value. At this point, the block has been mined and becomes part
of the block chain.
Here, there are two things we need to understand here. Hash rate & Proof-of-Work &
Proof-of-Stake.
If you have interest in Cryptocurrencies, you must have heard the term ‘Cryptographic
Hash Function’. But ever wondered what exactly does it mean & how is this related to
cryptocurrency? The Hash Rate is the measurement unit of the processing power of
the Crypto network, and hashing is the kind of transformation process that turns a
string to some fixed alphanumeric sequence. Cryptocurrency network must have
mathematical and cryptography related operations for various security purposes.
The hash function generates a fixed-length output from any input. The output string
obtained as the result of hashing corresponds to the input data. Many blockchains use
the SHA-256 hashing algorithm generating output strings of 256 bits, or 64 characters.
Each new block contains the hashed value of the previous block, ensuring the
blockchain immutability. As soon as the data of any previous block is changed, the
hash no longer matches. While SHA-256 is currently the most popular hashing
algorithm in crypto networks, others are also used, such as SHA-2, SHA-512 or Ethash.
To provide additional security, Bitcoin applies the SHA-256 function twice, a process
known as double-SHA-256.
Currently in Bitcoin, a successful hash must start with approximately 17 zeros, so only
one out of 1.4x10²⁰ hashes will be successful. In other words, finding a successful hash
is harder than finding a particular grain of sand out of all the grains of sand on Earth.
Even before the invention of Bitcoin or any other Altcoins, there were sustainable
attempts made towards creating digital currencies. But all those attempts failed
because of the threat of using a currency value twice to perform different transactions.
Bitcoin has been able to sustain and grow because it solves the “double spending”
dilemma.
a chain of previous transactions. In order to do a double spend, a bad actor must not
only solve the puzzle first to add his bad block — he has to get others to extend the
chain that he made. But legitimate players will not do this — they will only extend a
chain made of legitimate blocks. If most miners are honest, and everyone agrees that
the longest chain is authoritative, then the longest chain will be made of blocks
contributed by honest players. The transactions in these blocks will therefore be
legitimate, and not contain double spends.
Let’s take an example. If you buy something from one merchant for $1, you can’t buy
anything from another merchant using the same $1. If you could, then there is no
value of money as everyone would have unlimited money and the scarcity, which gives
currency value, would vanish. Blockchain core network protects against double-
spending by the verification of each transaction with the use of Proof-of-Work (PoW)
mechanism. Transactions are finalized and approved by the miners after verification.
If anyone tries to duplicate a transaction, it will show in the network that it is
counterfeit and would not be accepted. You can’t double spend, once a transaction is
approved. Digital currency has become viable by solving this double spending
problem.
There are two main Blockchain systems that most of the crypto networks are using &
both of these systems oversee how transactions are verified on the decentralized
network.
A Proof-of-Work system directs its users to perform certain tasks to participate in the
block. The tasks are usually tough for the participants, but relatively easy for the server
to evaluate. In case of Bitcoin & Ethereum, PoW exists in the form of miner nodes
striving to resolve a block or group transactions together in a sequential order and
have that block accepted onto the global blockchain of that system. The only way to
have its block accepted is to accurately guess the nonce, or by a random number
generated by the network. If a miner couldn’t guess the nonce before another appears,
must start again to guess the new nonce.
Initially, mining could be done via any computer component that has processing
power and memory (ex: CPU). But with changing time, miners needed high speed and
efficiency. Old methods of mining resulted in high consumption of electricity and a lot
of effort. Then came GPU. GPUs generated more hash rate. Now miners have specially
designed hardware for mining called ASIC. There are several coins which are ASIC
resistant and can be mined using GPUs only. The basic crypto mining techniques are;
GPU & ASIC are two of the most prolific crypto mining techniques which are widely
used. These both are profitable.
ASIC Mining
Benefits
· Easy to use
· High ROI
· Compact
· ANTMINER S0 (BITCOIN)
GPU Mining
GPU stands for Graphics Processing Unit. In GPU a complex Proof of Work is solved to
legitimate a transaction to add a new block in the blockchain. Like ASCI, a miner will
get a reward in the form of crypto coin. A GPU mining rig consists of a set of GPUs
working in a computer set-up. More the GPUs, more the hash power. There are many
GPU mining currencies like Ethereum, Bitcoin, Monero, Monacoin, LBRY Credits etc.
Benefits
· Easy to purchase
· Good warranty
You have to keep various factors before going for any of the above mining processes.
Electric consumption is the foremost factor you need to keep in mind. You can start
with GPU mining & when you got sufficient ROI, you can switch to ASCI.
Save
While inspiring overall, this extreme pace also comes with a negative side: it means
that education simply cannot keep up. The absence of quality training programs
around blockchain means that many people will either miss out on opportunities in
this new and exciting field, or even worse — will make premature career choices based
on an erroneous understanding of what is possible and what isn’t.
There are lots of concepts that allow Blockchain-powered projects and ideas to exist. It
would take a whole online course to cover all of these topics (see end of this post for more
details). That’s why today we are going to laser-in on just one concept. For this article
I’ve picked perhaps the most used and, at the same time, most misunderstood topic:
Mining.
We’ve all heard about Bitcoin mining and miners. We’ve probably even used these
terms. But what exactly do these miners do? What is mining all about? Those are the
question we will be answering today and we will do this in three parts:
Note: We’re going to look at the example of Bitcoin. Other cryptocurrencies such as Ethereum
may use different ideas (e.g. a different type of hash function) and therefore the specifics will
vary, however the underlying concepts remain the same.
But what does this mean and how is this connected to mining? Let’s have a closer look.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 2/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
A hash (or cryptographic hash) is a long number which acts as a digital fingerprint of
any collection of data. In Bitcoin the SHA256 hashing function is used which generates
a 64-digit hexadecimal number. For example, the cryptographic hash of the words in
this paragraph is:
C019286295F2CDEC9958BEE25B9603B5F94C76B2CCC69A59CE54872ED26DC479
Note: in the images here hashes are shortened for illustration purposes.
Hashing algorithms have many interesting properties, however today we are most
interested in three: 1) the SHA256 function is deterministic — you will always get the
same hash output if you recalculate the function with the same input; 2) the SHA256
function is impossible to reverse-engineer. Meaning that you can never know in
advance what hash value you will get until you actually calculate it; and 3) if you feed
the SHA256 function two even slightly varying inputs (for example, you change a dot
for a comma), you will get wildly different outputs.
From our example above, we would input the current block’s number, the data stored
in the block and the hash of the previous block into the SHA256 function to get the
value of the current block’s hash:
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 3/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Now we can see how the blocks are linked — not only does each block reference the
previous block’s cryptographic hash — but, in fact, that hash directly affects the value
of the current block’s hash. Therefore, if anyone were to tamper with any given block’s
data, such action would render not only that specific block’s hash invalid — but also all
of the following blocks’ hashes invalid.
Such connection between blocks means that the Blockchain as a whole is much more
tamper-proof than standard database structures and other record-keeping methods.
And since a Blockchain is in essence a ledger of records, this tamper-proof property is
known as the “Immutable Ledger” property.
Okay, great. That’s how blockchains work. But what has this got to do with mining? The
straightforward answer is that mining is all about calculating the hash value for the
newest block which is being added to the chain. However, it’s not all that simple.
The thing is that the SHA256 function only takes a fraction of a second to calculate.
And yet, you may have heard of the numerous mining pools such as BTC.com and
AntPool, and even industrial scale mines — all competing to generate the next Bitcoin
block. So the question is — why do we need all that computing power?
Blocks in the blockchain have another field which we have not spoke about yet. This
field is called “The Nonce” which stands for number used only once:
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 4/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The Nonce is an integer number and along with the Block Number, Data and Previous
hash the Nonce serves as an input for the SHA256 function to calculate the current
block’s hash:
Unlike other components of a block, the Nonce is designed to be totally under our
control. This means that now we have a mechanism to vary the current block’s hash
while keeping the data inside it intact. Indeed, thanks to the nature of the hash
function (property #3 in our discussion above), every time we select a new Nonce for the
same block the resulting hash will be a different value.
Alright, that’s great. But what has any of this got to do with mining? This is where we
come to the fun stuff.
There is a total of 16⁶⁴ possible SHA256 cryptographic hash values (each hexadecimal
digit has 16 possible values and there are 64 of them in a hash). However, not all of
them are valid hashes. Why is that? Well, every two weeks the Bitcoin network will
define a minimal target for the hash. Anything above this target will be rejected,
anything below — accepted.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 5/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The diagram above illustrates the pool (not to be confused with ‘mining pool’) of all
possible SHA256 hashes — starting at the bottom with smallest and increasing towards
the largest at the top. Somewhere along the vertical we have the target. Note that this
diagram is for illustrative purposes only as it is not proportionate — we’ll see why in a
bit.
0000000000000000005d97dc0000000000000000000000000000000000000000
What is really important in the target is the number of leading zeroes. Just like in the
decimal system, leading zeros in a fixed-size number will determine its magnitude.
Every leading zero reduces the number’s magnitude by a factor of 16 (ten in the
decimal system, but here we’re working with hexadecimals).
There are 18 leading zeros in the current target, meaning that the number of total valid
hashes is 16⁴⁶ (only 64-18=46 non-zero digits remain). Therefore, the probability that a
randomly picked hash is valid can be calculated as:
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 6/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
In Bitcoin mining terms, this is the probability that any given Nonce value will
generate a valid hash for the current block. We can now see why the diagram is out of
proportion: the pool of valid hashes in reality is extremely small in comparison to the
complete SHA256 pool.
And that’s what the cryptographic puzzle is all about: miners compete to find a Nonce
(also called a Golden Nonce) which will generate a valid hash for the upcoming block.
Whoever finds it first is allowed to add the block to the chain and get’s their reward of
12.5 Bitcoins. At the time of writing one Bitcoin is worth around $10,000 USD making
mining a rather worthwhile activity.
How to read this diagram: the red ‘X’ marks relate to SHA256 hashes while the labels beside
them illustrate which Nonce generated which hash value.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 7/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The target is defined based on the network’s hashrate (aggregate computational power
of all Bitcoin miners). The more miners join the network — the lower the target will be,
and therefore the harder it will be to find a suitable hash. The goal of this difficulty
algorithm is to ensure that only one new block to is added every 10 minutes. This is part
of the Bitcoin monetary policy to control the total number of coins in circulation.
In a nutshell, that’s what the millions and millions of mining machines are doing day
and night — they are simply iterating different values of the Nonce in hopes of being
the first to find a valid hash for the next block. Once a valid hash if found, the block is
added to the chain and the race starts over again, this time for the next block.
The Nonce is an integer value with 32 bits of memory allocated to it. Meaning that it
has a limited range of around 4 Billion values. This poses two problems:
First, even an average mining device can calculate up to 100 million hashes per
second, and therefore will go through the Nonce range in 40 seconds. And that’s an
average miner. Mining pools and industrial scale mines are able to go through the
Nonce range in fractions of a second.
Secondly, the chance of finding a valid hash is so small that even with 4 billion tries the
probability of success is still extremely low:
For starters, the block contains… you guessed it — another field which we haven’t
spoken about yet. This field is a timestamp representing the current Unix time
(number of seconds elapsed since 1st January 1970):
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 8/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
The Timestamp is also included in the SHA256 calculation for the hash of the current
block that’s being mined:
SHA256(Block Number, Timestamp, Nonce, Data, Prev. Block’s Hash) -> Hash
And since the timestamp is constantly refreshing (until the block is successfully
mined), this effectively resets the Nonce range every second. Why? Well, as we
discussed at the very start — even if the inputs of the SHA256 function are varied
slightly, this causes the hash to change.
Therefore, if we try all 4 Billion Nonce values for a fixed combination of other inputs
(block number, timestamp, data, previous block’s hash) but have no luck finding a
valid hash, all we have to do is wait until the the timestamp increases. A change in the
timestamp will mean that the combination is now different and if we try all 4 Billion
Nonce values again, every time we will get a brand new hash value.
The timestamp solves the problem for the average miner since it will reset before they
get to the end of the Nonce range (reminder: average miner takes 40 seconds to do 4 Billion
passes). However, for a mining pool or industrial scale miner even one second is too long
— as we discussed, they would get through the Nonce range in fractions of a second. So
how do they solve the problem? This is where block transaction configuration comes
in.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 9/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Participants of the Bitcoin network transact with each other all the time. However, a
new block is only added once every ten minutes. So where do the transactions go
before they are added to a block? New entries are added to a staging area called the
mempool. It is then the miners’ job to pick up a batch of these transactions from the
mempool and add them to the new block they are mining.
Block size is limited and not all transactions from the mempool will fit into the new
block. This means that miners get to pick which transactions will go into the next
block. What this also means is that miners can change the configuration of
transactions at will (before the block has been successfully mined).
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 10/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
And this is how miners get additional control over the hash. Well… Control isn’t the
right word since the hash cannot be reverse engineered or predicted. Variability is a
better term here: changing the configuration of transactions creates additional
variability in the hash function inputs.
Similar to the timestamp situation, whenever we try out all 4 Billion possible values in
the Nonce range and have no luck, all we have to do is slightly alter the combination of
transactions which we have selected from the mempool.
The main difference here is that we don’t have to wait. By altering the selected
transactions, we can reset our Nonce range at will — therefore we can do this as many
times per second as we want. Of course, all this is done algorithmically. This way even
mining pools and industrial scale miners can test new hash values continuously without
any idle time.
Let’s sum up
We’ve covered a lot of ground. Let’s recap the Bitcoin / Blockchain mining process to
ensure we haven’t missed anything:
calculation of its own hash. Tampering with data in any one block will render its and
all following blocks’ hashes invalid.
2. The cryptographic puzzle requires miners to find a hash smaller than the set target
for it to be valid. Miners search for a valid hash by iterating through a designated
parameter within the block called the Nonce. Whoever is first to find a valid hash gets
to add the block and collect the reward.
3. The Nonce range contains 4 Billion possible values which is insufficient to find a
valid hash with a high degree of certainty. Resetting of the Nonce range is achieved by
including the current timestamp and through varying the configuration of transactions
included in the the block.
Join us
In March this year we successfully funded a Kickstarter project to create the most
comprehensive online course on blockchain the World has ever seen.
Today this course is Live on Udemy.com where over 3,000 students have already signed
up to master the concepts of Blockchain, Bitcoin, Smart Contracts and more. If you’d
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 12/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
like to become a Blockchain pioneer, then join us on this incredible adventure and take
your career to the next level:
https://www.udemy.com/build-your-blockchain-az/?couponCode=MEDIUM90
The link above already includes a special coupon for our Medium readers. Use it to get
90% OFF.
Kirill Eremenko
This story is published in The Startup, Medium’s largest entrepreneurship publication followed
by 320,924+ people.
Blockchain
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 13/14
2/11/23, 11:23 PM How does Bitcoin / Blockchain Mining work? | by Kirill Eremenko | The Startup | Medium
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/swlh/how-does-bitcoin-blockchain-mining-work-36db1c5cb55d 14/14
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
Save
What is a Nonce?
A nonce simply stands for a Number used ONCE. It’s a unique token used to add a layer
of security to your application and also to validate the intent of a user initiated action.
This Nonce is generated by a server-side application, stored on the server and sent to
the client to be part of the payload it’s going to send back to the server. This way, you
have a way to validate the payload and have a higher level of certainty that the request
was actually made by the client.
A nonce could be seen as a one time password for user initiated actions. May it be
sending a form, encrypting data or executing an action, the nonce adds a level of
security by preventing a malicious script sending forged requests to your application.
This is called Cross Site Request Forgery ( CSRF or XSRF ) and malicious scripts use
this method to send requests on your server in a way that you have not intended to.
This can have important consequences depending on what your script is used for.
An example of this is an attacker putting up a script on his website that POST to a form
on your website automatically on an authenticated user session without the user really
wanting to do that specific action. That was a mouthful! In other words, an attacker
disguising a link to your authenticated user doing something (potentially bad) that the
user never intended to do.
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 1/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
So if your form doesn’t contain a nonce, then there is not much that prevents an
attacker to flood bad data in your database, potentially bringing down your whole site
or worse, costing you or your users to lose money or to leak private information. If
your form contains a nonce, then the POST would not go through since the nonce
would not be able to be validate positively coming really coming from that user. It
would not satisfy the intent part of the request.
This example includes forms as it’s an easy target for CSRF, but really, any requests
made to a server that a script is listening for is vulnerable to CSRF if no precaution are
taken to prevent it.
Breaking down the process of a nonce, it should look something like this:
1. The server generates the unique token ( nonce ), stores it locally and passes it on to
the client.
2. The client does it’s thing, prepares the payload and includes the nonce in it.
3. When the server receives the payload, it first checks if it contains a nonce, then, it
will validate it by comparing it to the one stored locally. If a match can be made,
the payload is considered genuine. If not, the payload should not be trusted.
4. After the validation returned a match, the process should invalidate ( or destroy )
the nonce for it to be a true used ONCE number.
If you properly create your nonce, CSRF should not be a problem. Since a properly
formed nonce should contain at least a secret key ( like a secret salt securely stored on
your server ) and a unique or at least very descriptive action as a name ( maybe
including a timestamp ? ), then there is no way an attacker could recreate a valid nonce
without having access to both parameters.
So a true nonce would be destroyed after it’s been validated, effectively preventing an
action of being performed twice ( or multiple times ), may it be maliciously or
accidentally, without being validated again by a new nonce. A nonce also prevents
CSRF attacks since secret salts and other unique parameters are used to created the
nonce and are not available to an attacker to replicate a fake nonce.
Ok, so now that we explained what a nonce is, let’s see why WordPress nonces are not
true nonces.
The way WordPress implements nonces lacks the one part that makes a nonce a nonce,
it’s “used ONCE” part.
WordPress creates a nonce that will remain valid for at least 12 hours by default (can
be valid for up to 24 hours). This implementation in itself invalidates the definition of a
true nonce because a generated nonce can be used an unlimited amount of time,
within that valid period. A new one will be generated every 12 hours (UTC time), and
will remain valid for a maximum of another 12 hours depending on when it was
generated within the tick cycle (See graph below).
Tick tock
So what is a tick? It’s a value that changes a midnight (+1 second) and midday (+1
second) by 1 unit. So every 12 hours (UTC time).
You might have read that a WordPress nonces are valid for 24 hours, but that’s just not
true. At least not entirely.
A WordPress nonce is valid for a maximum of 24 hours. Or in truer terms, it is valid for
the current tick’s value and the previous one.
But since a tick changes every 12 hours, a nonce will only truly be valid for 24 hours if
it’s created at the beginning of the tick, specifically, at hour 0:00:01 or 12:00:01. The
more you advance towards the end of the current tick, the shorter the lifespan of the
nonce will be (or closer to a lifespan of 12 hours).
As you can see in the graph, a nonce created within the end of a tick, will have a
shorter lifespan than a one created towards the beginning. This is because a wp nonce
is generated with that tick’s value as one of it’s parameters. If we look at how
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 3/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
wp_verify_nonce() verifies a nonce, we’ll see that it checks the current tick value, and
the previous one (tick — 1). If the wp nonce is verified close to 24 hours later and it was
created deeper within the cycle of the tick, then the nonce would be 2 ticks behind,
failing the verification.
On the graph, only NONCE 1, 13 and 25 will be valid for close to 24 hours, assuming
they are generated at the beginning of the hours not the end of it.
I agree that in reality, this should not be that much of an issue, since nonce should be
used relatively quickly after their creation to verify actions/requests.
But it’s a misconception thinking that WordPress nonces are valid for 24 hours, when
in reality, we should say they are valid for 2 ticks or for a maximum of 24 hours.
And it’s not a good idea to rely on WordPress nonces to validate an action that could
take more than 12 hours for a user to actually request. Since the nonce will become
invalid anywhere between 12 and 24 hours, chances are that the nonce validation
would fail and results in unexpected behaviours
Creation functions
wp_create_nonce()
wp_nonce_field()
wp_nonce_url()
Verification functions
wp_verify_nonce()
check_ajax_referer()
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 4/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
Other functions
wp_nonce_ays()
wp_nonce_tick()
Filter: nonce_life
Filter: nonce_user_logged_out
Action: wp_verify_nonce_failed
Action: check_admin_referer
Action: check_ajax_referer
Like I discussed above, nonces will auto expire in maximum 24 hours after they’ve
been created.
But I prefer to say, they will auto expire 2 ticks from now.
The other way a nonce can become invalid is if a user’s session token changes. That
state change occurs when a user logs out and back in again. Since a new session token
is generated, all previous nonces won’t validate anymore.
To make things clearer, WordPress doesn’t store the nonce it creates for a user. Instead,
it stores the session token and will use it to rehash a nonce upon validation. If the
session has not changed and the nonce is still within the 2 ticks valid period, then the
submitted nonce and the rehashed one will match. Of course, like I just told you, if
either the current tick is 2 or greater than the one used to create the nonce or the
session token changes, then the nonce is invalid.
Security Concerns
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 5/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
WordPress not offering true nonces doesn’t mean you should not implement it within
your application. It’s still useful to prevent CSRF.
But you should not rely on nonces to securely allow actions that should be restricted to
specific users or users roles within your WordPress installation.
Your scripts should only allow such actions for users with the right capabilities
(permissions) to do so.
Here, your best tool to use is current_user_can() and wrap your functions within this
check.
Remember that nonces will tell you that the payload is from a genuine source (user),
but it does not tell you if that source has sufficient permission to actually execute the
payload.
This should be taken care of by another process, thus checking against capabilities.
Ok, let’s give you a few example to show you how easy it is to implement a nonce in
your code.
Like I listed above, there are 3 functions available to create a nonce wp_create_nonce(),
wp_nonce_field() and wp_nonce_url().
wp_create_nonce()
The first one is a general usage function, meaning you can use the created nonce
anywhere you would like.
The function takes 1 parameter, the $action name (optional) and returns the nonce for
you to use.
While the action name is optional, it is recommended to supply one as specific to the
action as possible. This will prevent a user having the same nonce for 2 different
actions. For instance, deleting a custom post type and sending an email.
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 6/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
So let’s say I have a plugin that sends email to my users. The user I want to send an
email to is stored in $send_to_id. I will then pass that user id value in the request so I
can used again when I’ll be verifying the nonce.
wp_nonce_field()
This function will output or return the nonce and markup for an hidden form input.
This function takes 4 optional parameters. In order with their default values: $action =
-1, $name = “_wpnonce”, $referer = true and $echo = true
The $referer parameter outputs a second hidden field with the name _wp_http_referer
containing the value of the referrer URL as found in the ‘REQUEST_URI’ element of the
$_SERVER PHP superglobal variable, unless it is set to false.
Finally, the wp_nonce_fields() function prints by default the field, but if you set $echo
to false the function will return it so you can use it within PHP.
So, reusing the same sending email example as above, creating the nonce and
outputting the nonce and referrer fields using this function is as simple as
<form method=”post”>
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 7/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
</form>
wp_nonce_url()
This third function provided by WordPress to create a nonce, outputs an escaped and
formed URL containing your nonce.
This functions takes in 3 parameters. In order, with their default value: $actionurl,
$action = -1 and $name = “_wpnonce”.
$actionurl is required and is the URL to which you should add your nonce. Here also,
providing a descriptive and unique action name and custom name for the query string
is optional, but recommended.
Using again the scenario above: sending an email to a user. Here’s what it would look
like using wp_nonce_url()
<?php
$url = add_query_arg( ‘user’, $send_to_id, $url ); // Add the id of the user we send to
?>
<a href=”<?php echo $url; ?>”><?php esc_html_e( ‘Send Email to User’, ‘textdomain’ ); ?
></a>
wp_verify_nonce()
Once you have created your nonce, and used it, you need a way to verify it. Your
general goto function to complete this will be wp_verify_nonce().
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 8/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
This function takes in 2 parameters, the first one, $nonce is required and is the actual
value of the nonce. The second one, $action is optional, but you will need to provide it
if you used an action name when creating your nonce. Remember that action names
are recommended practice.
So let’s see how to use the function, still using our send email example.
} else {
Since wp_verify_nonce() will return 1 if the nonce was generated within the current
tick value and 2 if the nonce was generated in the previous tick value. Then you could
do different stuff based on when the nonce was generated.
switch ( $nonce ) {
case 1:
break;
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 9/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
case 2:
break;
default:
check_admin_referer()
Another function you can use to verify a nonce is check_admin_referer(). While the
name is improper and may be misleading, it is still kept for backward compatibility.
Also, know that using this function without providing an $action is obsolete since
version 3.2.
So basically, this function now behaves the same as wp_verify_nonce() except it will
die calling the wp_nonce_ays() function which display the Are you sure? message.
Example of usage
check_ajax_referer()
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 10/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
As the name of the function implies, this last validation function is best used within
AJAX request to prevent processing request external to the blog.
The function takes 3 parameters. They are with they default values: $action = -1,
$query_arg = false and $die = true.
The to verify the action, you call check_ajax_referer() hooking into the dynamic wp
AJAX hook endpoint.
<?php
?>
<script type=”text/javascript”>
jQuery(document).ready(function($){
var data = {
action: ‘bn_ajax_send_email_user’,
};
alert(“Response: “ + response);
});
});
</script>
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 11/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
then you hook a custom function to the action defined in your javascript AJAX
definition.
function bn_ajax_send_email_user_callback() {
While implementing your nonce methods could be relatively easy to implement, why
reinvent the wheel when you could start of by using what’s done already!
There’s a repo on github called wp-simple-nonce that works just fine and will bring
you true nonce for you to implement in your application.
While WordPress nonces implementation is good to prevent CSRF, it is not very useful
to prevent multiple submission of the same data, which is often a reason to implement
nonces within your application. This is why you might want to take a look at WP Simple
Nonce
Wrap up
I hope you found this post constructive, if you have questions, comments or concerns,
let me know by commenting below!
Cheers!
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 12/13
2/11/23, 11:25 PM What is a Nonce?. A nonce simply stands for a Number used… | by Vu Nam Hung | Vu Nam Hung | Medium
Security
Search Medium
https://medium.com/vunamhung/what-is-a-nonce-c1d7a840c565#:~:text=A nonce simply stands for a Number used ONCE.,of a user initiated action. 13/13
2/11/23, 11:27 PM Ethereum Series — Understanding Nonce | by Manan Patel | The Startup | Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
(source — beppegrillo.it)
The nonce is one of the most important and least understood component of an
ethereum transaction.
https://medium.com/swlh/ethereum-series-understanding-nonce-3858194b39bf 1/6
2/11/23, 11:27 PM Ethereum Series — Understanding Nonce | by Manan Patel | The Startup | Medium
{
"nonce" : 'how many confirmed transactions this account has sent
previously?',
"gasPrice" : 'price of gas (in wei) the originator is willing to pay
for this transaction',
"to": 'recipient of this transaction(either smart contract or EOA)',
"value": 'how much ether this transaction pays',
"data": 'any binary data payload',
"v,r,s": 'three components of ECDSA signature of originating account
holder'
}
https://medium.com/swlh/ethereum-series-understanding-nonce-3858194b39bf 2/6
2/11/23, 11:27 PM Ethereum Series — Understanding Nonce | by Manan Patel | The Startup | Medium
Now without nonce, it would be impossible for miners to know your intent of
maintaining the order of transactions. However with nonce, if your first transaction
(10 ETH) has nonce 0 (assuming its a new account) then 14 ETH transaction will have
nonce 1. Now, transaction with 14 ETH won’t be mined unless previous transaction of
10 ETH (with lower nonce) is mined. Hence, maintaining the sequence of transactions.
Say you want to swap 10 ETH for 2000 DAI in Uniswap. Currently, your account balance
is 200 ETH (wow!!). To swap 10 ETH, you signed a transaction sending 10 ETH to the
ETH/DAI Uniswap Exchange and broadcasted into the blockchain.
In absence of nonce, your above transaction structure would look something like this
{
"gasPrice" : "10000000000",
"to": "0xdaeb8d6348e30677955f8127759a66443a99fe1f,
"value": "10000000000000000000",
"data": "",
https://medium.com/swlh/ethereum-series-understanding-nonce-3858194b39bf 3/6
2/11/23, 11:27 PM Ethereum Series — Understanding Nonce | by Manan Patel | The Startup | Medium
25de0d5a1693d4e45ce0305d42774b5bf73cbd9e14230194c35545e0f01ee45ce0305d
42774b5bf73cbd9e0d5a1693d4e45ce0305d427
Then this transaction is sent to blockchain and mined. Once, transaction is mined, you
receive your 2000 DAI. This data is visible on blockchain to anyone. So, anyone can
copy and paste this transaction data and send to the network, thus executing what is
called ‘replay’ attack on your account. Thus draining your ETH reserves.
By including the nonce in the transaction data, each transaction data output is unique
even if all other variable remains same. So, if someone tries to carry out ‘replay’ attack,
miners reject that transaction as ‘duplicate’ transaction (since the nonce has been used
before for previous transaction). Hence, this way, nonce helps prevent such replay
attacks.
Practically, nonce is the count of all confirmed transactions from an EOA (externally-
owned account) on the ethereum blockchain. Usually, your chosen wallet app takes
care of nonce management for you. And this works almost perfect as long as that
wallet app is the single source of your account’s interface to the blockchain. As soon as
you start using other wallets to use with the same account, things gets complicated,
since all wallets have their own state of nonces for that account.
Tracking nonces
Consider another scenario where you are tasked with airdropping ERC20 tokens to
1000 survey participants. Doing it manually using Metamask or other wallets is not
feasible and inconvenient.
Ideally, you would write some script or develop some application to do that. Thus, you
would need to maintain your own nonce tracker (piece of code that sequentially and
incrementally generates next nonce for a given account for a new transaction) or use
some third party nonce tracking library like that provided by Metamask (see below).
MetaMask/nonce-tracker
https://medium.com/swlh/ethereum-series-understanding-nonce-3858194b39bf 4/6
2/11/23, 11:27 PM Ethereum Series — Understanding Nonce | by Manan Patel | The Startup | Medium
You can't perform that action at this time. You signed in with another tab or window. You signed
out in another tab or…
github.com
Gaps in nonces
If there are gaps in nonces, all next transactions sits in the mempool waiting for the
gap to be filled. (e.g.) if total transaction confirmation count for account X is 8 (nonce =
8), and transaction with nonce 10 from account X is broadcasted to network, it will sit
in mempool till another transaction from account X with nonce 9 is broadcasted and
mined. Thus, filling the gap.
In conclusion, nonce is very powerful component that provides lots of benefits and
helps maintain proper functioning of Ethereum network. As an ethereum Dapp
developer it is important to understand and acknowledge its importance to create great
user experiences and avoid troubles discussed above.
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Your email
https://medium.com/swlh/ethereum-series-understanding-nonce-3858194b39bf 5/6
2/11/23, 11:27 PM Ethereum Series — Understanding Nonce | by Manan Patel | The Startup | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/swlh/ethereum-series-understanding-nonce-3858194b39bf 6/6
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
Published in @blockchain
Blockchain.com Follow
Save
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 1/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
What if we told you the answer to all three questions was the same: Bitcoin mining.
If you’re new to Bitcoin, you’ll want to read our article “Bitcoin, Explained” first to get a
better understanding of the original cryptocurrency.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 2/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
The bitcoin network is a blockchain, a linked series of data “blocks” with each block
containing a set of bitcoin transactions. All over the world, thousands of Bitcoin
miners race to be the first to complete a complex cryptographic “puzzle” using
specialized computer equipment.
The math problems the miners solve during each puzzle period (or “block”) enable the
release of new bitcoins and the confirmation of transactions on the network.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 3/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
1. When a new transaction is made on the Bitcoin network, it is broadcast to all nodes
in the network.
3. Other nodes in the network check the solution to verify that it is correct. If it is,
they add the transaction to their own copy of the blockchain and move on to the
next puzzle.
4. As a reward for their efforts, the miner who solved the puzzle is awarded a certain
number of bitcoins. This helps to incentivize miners to contribute their
computational power to the network.
5. The difficulty of the puzzles is adjusted over time to ensure that it takes an average
of about 10 minutes to add a new block of transactions to the blockchain. This
helps keep the rate at which new bitcoins are created steady and makes it more
difficult for attackers to manipulate the network.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 4/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
ASIC stands for Application-Specific Integrated Circuit, and while there are a variety of
ASICs created for different purposes, these are made just to mine bitcoin.
While standard consumer devices like CPUs and GPUs were used in the past to mine
bitcoin, those systems don’t offer the computational power needed to solve the hashing
puzzle at the current level of mining difficulty.
Block rewards. When a miner is the first to solve the validation riddle, they earn
BTC and add the next block of data to the chain.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 5/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
Listen to the full podcast with Jaime Leverton, CEO of Hut 8 Mining
The final bitcoin is expected to be mined in 2140, and this scarcity is where the
comparison to gold comes from. Once the last bitcoin is mined, that’s all there will
ever be, making bitcoin a deflationary asset.
The very first Bitcoin miners received 50 BTC as a block reward. However, the next
halving will be in 2024, further reducing the block reward to 3.125 BTC.
As you can imagine, Bitcoin mining has become big business. There are mining
“farms,” also known as hashing facilities, all over the world, and a quick online image
search will show the scale of these operations.
Gone are the days of a single Bitcoin user mining on their PC; computational power is
king, and more is better when it comes to processing transactions, winning the block
reward, and securing the blockchain.
Mining pools offer an alternative for regular users to participate in mining, without
needing to purchase warehouses full of ASIC mining rigs. In a mining pool, individual
miners lend their computing power to a mining farm through a shared server.
In exchange for their computing power, miners in the pool receive a proportional
share of the block reward when their pool solves the hash.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 6/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
This is how the Bitcoin blockchain is secured. If a hacker tries to manipulate the
blockchain, the data they try to enter into the ledger won’t match up with the data that
other nodes have, flagging it as a fraud.
Even if a hacker had enough computing power to go back far enough in the blockchain
to rewrite a transaction, it would be so costly and time consuming that it likely
wouldn’t be profitable.
This type of attack is called a 51% attack, and it would cost billions of dollars to
attempt. Even if successful, an attack of this type would essentially destroy the
blockchain by eroding the trust in the ledger, and the price of bitcoin would likely fall
to zero, making the entire thing pointless.
This is the superpower of the Proof of Work consensus mechanism–it takes a lot of
time, money and energy to validate transactions, and this work is self-protecting since
it’s almost impossible to undo.
The security of the blockchain increases as more miners join the network, since more
transactions can be processed and there are more nodes available to share greater
consensus.
The more transactions that are processed and validated, the larger the amount of data
that a criminal would have to “rewind” to hack the network.
At the time of this writing (November 2022), Bitcoin operations expend just over 100
Terawatt hours (TWh) of energy each year. As a point of reference, that’s about the
same amount of energy that is required to power all of the refrigerators in the United
States.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 7/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
For a global comparison, air conditioning alone uses 2,199 TWh per year.
The need for greater computing power, and the hefty price tag that comes with the
equipment and electricity needed to run these operations, has resulted in innovative
expansions into crypto mining.
For example, many mining operations have moved to countries with an abundance of
electricity, such as Canada and Iceland, that would otherwise go unused.
The oil and gas industry has become involved in mining, since they often have power
that would be wasted, and the cryptocurrency mining industry gets more than half of
its power from sustainable energy sources.
In this way, miners could potentially make the power grid more efficient by harnessing
non-traditional energy sources.
Many critics ask why Bitcoin doesn’t just move to a more energy efficient consensus
mechanism like Proof of Stake. This is a complex question, but in short, Proof of Work
has some distinct advantages over Proof of Stake with regard to the purpose of bitcoin.
BTC is a store of value and part of what maintains this value is the difficulty in creating
new bitcoins and the inability of malicious actors to hack or even game the system in
an effort to monopolize control of the currency.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 8/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
The Proof of Work consensus mechanism provides unique benefits in this regard,
making it optimal for a cryptocurrency like bitcoin that could be a long-term store of
value.
As you’ve read, miners are responsible for a lot more than just creating new bitcoins.
They’ll still validate transactions, and collectively secure the entire Bitcoin network.
Miners won’t receive block rewards anymore, but they will still receive transaction
fees. The validation of the network will continue to be an extremely important
function.
If there weren’t miners to validate new copies of the ledger, the blockchain would likely
fall under attack, rendering bitcoin as a store of value useless.
Even after all bitcoins are created, mining is still necessary to maintain the value of the
bitcoin cryptocurrency and process ongoing transactions on the network.
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 9/11
2/11/23, 11:29 PM What is Bitcoin mining, and how does it work? | @blockchain
Mining is essential to the Proof of Work consensus mechanism, and miners have
proven that they are committed to finding new ways to power their operations, and
subsequently, Bitcoin.
There’s another way to get bitcoin though, and it doesn’t involve setting up a mining
rig.
Buying BTC may be a more straightforward way of adding it to your holdings, and if
you choose to use a dollar cost averaging method, you can buy bitcoin incrementally,
over a long period of time, instead of trying to time the market.
If you’ve never bought BTC before, you’d need what’s called an “on-ramp” — a way of
exchanging fiat currency for crypto. Then, you can transfer your crypto to a non-
custodial wallet, so you have complete control over your funds.
Blockchain.com is the only place you can find both of these wallet types in one place,
and you can create your free account in just a few minutes.
Get Started
Important Note:
This information is provided for informational purposes only and is not intended to substitute
for obtaining accounting, tax or financial advice from a professional advisor.
The purchase of crypto entails risk. The value of crypto can fluctuate and capital involved in a
crypto transaction is subject to market volatility and loss.
Digital currencies are not bank deposits, are not legal tender, and are not backed by the
government. Blockchain.com’s products and services are not subject to any governmental or
government-backed deposit protection schemes.
Search Medium
https://medium.com/blockchain/bitcoin-mining-explained-e03356bba148 11/11
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Published in DataDrivenInvestor
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
GreekDataGuy Follow
Save
BITCOIN
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 1/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Disclaimer: This is not advice — financial, investment, or otherwise. Consult your financial
advisor before investing in or trading cryptocurrencies.
Bitcoin is like gold. Mining creates bitcoins. And like gold, the more that is mined, the harder
it becomes to mine more.
It completely misses the fact that without mining, there could be no Bitcoin
transactions at all.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 2/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Technically we’re talking wallets, not users. But it’s a subtle distinction.
Credit: bitinfocharts. Yes. There’s a wallet containing $11 trillion USD in Bitcoin.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 3/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
You only have as much money as the blockchain ledger says you do. Money is officially
“sent” when miners update their ledgers to reflect changes. All miners update their
ledgers in the same way.
But while a bank has the final say over it’s ledger, enabling it to resolve disputes as it
sees fit, Bitcoin does not not. No single party decides the truth.
A decentralized system with no single source of truth comes with risks and challenges:
1. What happens when a Bitcoin user sends the same Bitcoin token to 2 different
parties (aka. double spend)?
2. How do miners stay stay in sync about the current state of the blockchain (aka.
how much money each wallet has)?
First, Sally’s wallet announces to all miners that she is transferring the funds.
At this point, the transaction is unverified and is not yet added to the blockchain.
Sally and Carlos are now in limbo, waiting for the transaction to be processed.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 5/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
While requirements for correct answers change over time, Bitcoin currently requires
miners to find inputs to it’s hash function that result in an output which begins with 19
zeros.
The first miner to discover a correct solution broadcasts their answer. They win the
round.
All other miners then add the winning miners block to their ledgers. The transactions
of the winner miner now exist in the blockchain and can no longer be worked on by
other miners.
For example, a simple fictional hash function could do something like this.
Input | Output
---------------------------------------------
'hello world' | hd72kf97x
'hello world 2' | l9ancg478
'123' | nfhyeiv00
'I like pasta on rainy days' | x913gzmaw
Recognize that a similar input does NOT result in a similar output. So there’s no
incentive to do anything other than guess random inputs.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 6/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
But that doesn’t mean each user uses the same inputs.
1. Block version number. Indicates the current rule set for validating blocks.
Currently this is 0x20000004 but changes periodically. Everyone uses the same
version as a hash input.
2. Previous block header hash. This is the output hash associated with the previous
block in the blockchain. This ensures the ledger is an unbroken chain with each
block referencing the block before it. This will be the same for all miners at a given
time.
A recent example:
1b9affbba072ba2e923797d3b2050b9b9c8baacf696f84ac9940282b5568c547 .
3. Current block transactions hash. A hash based on transactions that the miner has
included in the current block. This is different for each miner because each miner
is likely working on a different block of transactions.
A recent example:
11a510d7adcde1ad5c8b33c35f5902f08cdb1d9800161f8af3874258f935ecea
4. Current time. A unix timestamp representing the time the miner started hashing
inputs for the current block. The miner sets this time so it will be different between
miners.
5. Target nBits. An encoded version of the criteria that successful hash outputs must
meet (aka. begin with at least 19 zeros). The threshold is revised every 2,016 blocks
so that the blockchain continues growing at it’s planned rate of 1 block every 10
minutes.
6. Nonce (aka. random positive integer). A random number that’s incremented every
time inputs are hashed. A 1 integer change in this number completely changes the
hash output.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 7/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Credit: en.bitcoin.it/wiki
#################
# Pseudo code #
#################
block_header = version + prevHash + curHash + time + diff + nonce
Because changing a single input completely changes the output, it’s unlikely that any 2
miners are generating the same outputs.
#################
# Pseudo code #
#################
block_header = version + prevHash + curHash + time + diff + nonce
sha_function( sha_function( block_header ) )
Let’s try hashing something with the same algorithm Bitcoin uses. We’ll start with a
string and hash it twice.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 8/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Output 1: 5f5255f01f4d7196484869c824266fbe5c2fa0fad9485dd911d507d2812fab7f
Output 2:
8aa2a47234e9c320bbe3248b6a03fb5c68546ad0988b3faa6d0731805b19ad16
If you hash this yourself, you will get exactly the same output. That’s the nature of hash
functions. Cool, no?
Miners choose which transactions to include in their blocks. Blocks have a maximum
size of 1MB and each transaction is about 0.5kb.
While miners make money from earning Bitcoin on successfully mined blocks. They
also make money on transaction fees. These vary by transaction.
When a miner finds a solution to the hash problem, they announce it to all miners.
Miners then add the mined block to each of their ledgers. Because of this, miners
continue to stay in sync.
Well. It’s easy for all other blocks to check. They simply pass the announcing miner’s
header into the hash function and confirm if the same output is generated.
That’s the beauty of Proof of Work. Hard to solve but easy to verify.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 9/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
1. Double spend
2. Staying in sync
Nowadays, non-Bitcoin transactions are also often electronic. But because they’re
controlled by Visa or Bank of America, disputs can be investigated and resolved by the
institution.
In a decentralized digital currency, nothing stops Boris from transmitting the same
token to 2 different parties to buy 2 different things with the same money.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 10/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Credit: en.bitcoinwiki.org
1. Mining a block takes a long time. Adding blocks to the blockchain is slow.
Money spent in one transaction cannot be used in another. The second “overlapping”
transactions in is simply cancelled after the first is accepted.
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 11/13
2/11/23, 11:31 PM Everything You Should Know About Bitcoin Mining | by GreekDataGuy | DataDrivenInvestor
Conclusion
You now understand how mining works, and why it’s necessary.
Equipped with this knowledge, you can also begin to make sense of conversations
around mining.
Like, “Can I make money mining?”. Probably not. It’s literally a function of the cost of
your processing power. You can’t compete with companies operating their own dirty
power plants to mine bitcoin.
And, “Why does bitcoin use so much energy”. Well, Proof of Work is literally designed
to use a lot of energy.
But if you leave with any more understand than you came with, I’m happy.
Was this helpful? Do you have questions? Let me know in the comments.
Subscribe
https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a 13/13
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
Published in Coinmonks
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
In my post, Making Money Using Bitcoin Halving Cycles, I analyzed pricing targets for
Bitcoin based on its historical price movements during Bitcoin’s halving cycles. We are
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 1/9
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
in the midst of the third Bitcoin halving cycle and the ultimate question is what will
happen next for Bitcoin’s price? In my post Bitcoin: When to Cash Out or Crash Out, I
mentioned some possible extension targets (such as $57k which it ran to quickly) but
ultimately advised one to de-risk a bit on Bitcoin since it was getting so high in price
that there was more risk at that point (which it preceded to dip about 25% in this most
recent dip from $58k to $43k where it appears the price will hold for now).
As we get closer to the end of this halving cycle (which at the 12 month mark is May
2021 or 18 month mark is November 2021), it’s time to work on the “end game” for this
cycle. One major important stat we should know about the Bitcoin halving cycle is:
During each of the last two halving cycles, Bitcoin lost 80–83% of its value from it’s
halving cycle HIGH to the post-halving cycle LOW (as seen below)
Looking at the past two halving cycle lows, we see that the pre-cycle low to post-cycle
low in 2012 increased by a factor of 21.427x (from $10.35 to $221.77) and in 2016
increased by a factor of 5.584x (from $578.97 to $3,232.93). If the 2020 pre-cycle to post-
cycle low decreases at the same rate (decrease factor of 3.837x) from 2016 to 2020, then
the 2020 post-cycle low should have an increase factor of 1.455x meaning the 2020
post-cycle low from the pre-cycle low of $8,465.45 should be $12,318.79. If Bitcoin
copies it’s previous halving cycles and loses 80%-83% of its value and $12,318.79 is the
post-cycle bottom, then we should expect Bitcoin cycle high targets from $61,593.95
to $72,463.47.
Is $12,318.79 going to be the post-cycle bottom? This is very possible as before the
2020–2021 cycle run-up, the $10k-$12k area acted as a very strong resistance area from
2019–2020 (and the longer term the resistance, the more bullish and powerful the
break above as we saw Bitcoin go straight up from $12k to $20k from October 2020 to
December 2020.)
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 2/9
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
We saw another powerful move when Bitcoin broke above $20k. Once that 2017 cycle
high was breached, it moved straight to $42k and then another high of $58k.
Looking at the charts and price action during this cycle from a technical analysis
standpoint (or even a basic chart view), one could reasonably expect the $20k price
level to hold and never dip below again. If you followed Bitcoin during its epic rise,
you would have noticed that Bitcoin whales were accumulating and HODLing at the
following levels:
$23k-$24k
$28k-$30k
$38k-$40k
$43k-$44k
These price levels could very well be areas Bitcoin never dips below again. If we work
backwards using these price levels as the post halving cycle low, we get much higher
estimates for what this cycle high could be if we follow the 80% drop rule (for example,
if we say the post cycle low is $43k and that represented an 80% drop from the Bitcoin
halving cycle high, then we could expect the Bitcoin halving cycle high to go as high as
$215k). Here are some price targets based on these supposed price level supports and
assuming the Bitcoin post-cycle drop percentage to that support area.
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 3/9
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
Besides the expected 80%-83% drop, I added other possible percentages that Bitcoin
could drop instead. As Bitcoin becomes more and more institutionalized and
mainstream, it should become less volatile, perhaps more like the stock market. In
recent history, the worst S&P 500 drops were:
Based on those metrics, we could see Bitcoin drop “only” 50% this halving cycle from
the cycle high. Using that as a guide, we could see price targets of $60k-$100k if we
estimate Bitcoin only dropping 50%-83% (as highlighted in blue above). Going more
extreme and still expecting an 83% drop and there are upside targets of $117k-$250k as
seen in the table above.
Looking at the common stock market declines as compared to Bitcoin’s halving cycle
declines, we can guess that Bitcoin will end up losing 60%-70% (the percentage
between the common stock market declines of 50% and previous Bitcoin cycle decline
of 80%) from it’s top this halving cycle if it follows previous cycles. Using this as our
guide, I believe it is highly likely (90%) that Bitcoin will reach a halving cycle high of
at least $58k-$65k, somewhat likely it could be at least $80k, and less likely it reaches
$95k during this cycle. Max Keiser recently stated in the near term Bitcoin should hit
$77k within the next couple of months due to his analysis of the Bitcoin hash rate. With
every small 25%-30% correction we get in Bitcoin, we actually get a more solid support
area for Bitcoin. These dips then could be interpreted as miners are selling Bitcoin in
order to raise enough capital to improve their systems (and thus raising the hash rate)
so they can continue to reap the mining rewards associated with Bitcoin. Miners would
not continue to mine and invest in their systems unless they believed the price of
Bitcoin would continue higher.
For one just trying to figure out Bitcoin’s pricing action to when it is at a top will be to
watch if Bitcoin makes a very parabolic move that would lead to an even bigger crash.
As mentioned in Bitcoin: When to Cash Out or Crash Out, you will need to see and find
where this many trillions of dollars can come from to continue the bull case but from a
moderate estimate, we should be able to reach a $1.5 trillion market cap for Bitcoin
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 4/9
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
this cycle. That would translate to about an $80k price target if this halving cycle’s bull
run continues to the end of 2021 (for an 18 month halving cycle instead of 12 month).
As mentioned in my last article, it’s important to manage one’s risk and I will most
likely de-risk and sell off half of my position at these levels ($58k, $65k, $80k, &
$100k) with the idea of holding some Bitcoin until the next halving cycle where it
could reach those even higher estimates that match the price targets of $146k by JP
Morgan, $220k by Max Keiser, or even $400k by Guggenheim Partners. Either way, if it
doesn’t reach these targets this halving cycle, if you can HODL until the next halving
cycle 3 years from now, you could be much better off. Will you be able to HODL for 3
years after losing 60–70% of the value from your Bitcoins to the next halving cycle? Or
will you do some wise “sell half” strategies, as my investment guru cousin “Joe Money”
has taught me, to make sure you always have some skin in the game while locking in
profit. The easiest thing to do is to HODL until the institutions are all in the game, but
everyone has to size their risk and their opportunity (cost). Only time will tell what was
best but it’s a good idea to have at least one horse on this Bitcoin race always.
If you liked this article, I would appreciate a Clap. Don’t forget to follow and if you think any
of your friends would enjoy this article, please share it with them. Thanks for reading.
Disclaimer: This material should not be considered investment advice. I am not a registered
investment advisor. Under no circumstances should any content from my content be used or
interpreted as a recommendation to buy or sell any type of security or commodity contract.
This material is not a solicitation for a trading approach to financial markets or
cryptocurrencies. Any investment decisions must in all cases be made by the reader or by his
or her registered investment advisor. This information is for educational purposes only.
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 7/9
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 8/9
2/11/23, 11:34 PM Working Backwards to Find Bitcoin’s Ultimate Target Price This Halving Cycle | by Sense and Cents | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/working-backwards-to-find-bitcoins-ultimate-target-price-this-halving-cycle-389bc60011a8 9/9
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
RJ Rybarczyk Follow
Save
The version number provides means for network softfork upgrades. The previous block hash
links the current block to its parent, creating the chain in “blockchain”. The Merkle root
cryptographically ties all the transactions in a block to their associated header. The timestamp
acts as a verifiable timestamping system, which is useful in many applications outside of
Bitcoin. The encoded target difficulty lets the miner know what the network will accept as
valid. And finally, the nonce provides a dedicated search space for the miners to mine,
propelling the network forward.
This post aims to provide a technical overview of each of these fields with the intention of
being a technical reference for the Bitcoin block header.
Introduction
Bitcoin’s blockchain is comprised of blocks. Blocks (and transactions) are versioned
binary data structures. There are two parts to a block, the transaction block (where all
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 1/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
the block’s transactions reside in their entirety), and the block header. The block
header is a short and strictly formatted data field that prepends every block. It includes
six fields, all with differing functionalities, and the SHA256d hash of these fields acts
as the block’s identifier. The block header is the focus of this post and we will continue
to dive into it in depth, but first let’s briefly touch on the transaction block.
The miner performs a large number of hashes in search of a valid block hash that
meets the target requirement. In order to create new hashes from the same block data,
a field in the header called the nonce field is dedicated for the miner to quickly change
in order to generate unique hashes in the processes of finding a valid block. As will be
further discussed, the nonce field only provides four bytes (2³² bits) that can be
changed. Therefore, the search space is 2³² bits, meaning that up to 4,294,967,296
unique hashes can be generated for the block if nothing except for the nonce value is
changed. While this may seem like plenty of search space, it is actually quite small
given the Bitcoin ASIC hardware available today. For example, Bitmain’s Antminer S19
Pro ASIC miner performs at 110 Th/s. That is ~2⁴⁶ hashes per second. So, this machine
completely exhausts the search space provided by the nonce field in under one
millisecond.
Once the search space is exhausted, the miner must create a new block from a new set
of transactions. Constructing this new block can be computationally expensive and
bandwidth intensive. Therefore, miners have an incentive to find ways to expand the
search space outside of the dedicated four-byte nonce. There are multiple ways of
expanding the search space: miners can use (1) unused version field bits, (2) a portion
of the time field bits, and (3) a few extra bits in the script signature of the coinbase
transaction. The latter is generally referred to as the extranonce, although it is not a
formally defined field in the Bitcoin protocol.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 2/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Like all data, transactions boil down to series of bytes. It is undesirable to have blocks
that have too many bytes or are too “heavy” because of different resource constraints.
The two more common constraints are (1) uplink related (bandwidth/latency), and (2)
verification related (how fast the CPU can verify transactions). Storage related
constraints are not as much of an issue now since storage has become rather cheap
and nodes can prune. But larger blocks can deter space constrained individuals from
running a full node, thus damaging network decentralization. Furthermore, without a
block size limit, the network becomes susceptible to DDoS attacks from bad actors
spamming low value transactions to the network. To combat these things, there is a
consensus-imposed cap on the block size constraint called the block weight.
What motivates miners to mine blocks? They have two sources of revenue: the block
subsidy (which will be discussed next), and transaction fees. It is a delicate balance for
a miner to maximize their transaction fee profit by including as many transactions in
the candidate block as possible, while also keeping the block weight under 4MB. This
type of problem is akin to the knapsack problem, and it is of this author’s opinion that
transaction selection is a fascinating problem, just not a glamorous one.
There is one special type of transaction called the coinbase transaction that is
pertinent to the discussion of the block header. The coinbase transaction is included as
the first transaction in every block and is responsible for minting new bitcoins (the
block subsidy) and paying out the miner’s reward. As alluded to earlier, the malleable
bits in the coinbase transaction are leveraged to increase a miner’s search space.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 3/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Integers are very commonly expressed with the base 10 number system, commonly
called the decimal system. They can be equivalently expressed in any other base,
however. The two other number systems that are useful in understanding these lower
level Bitcoin concepts are binary numbers (base 2) and hexadecimal numbers (base
16). Changing the base from 10 to 2 or 16 (or any number for that matter) does not
change the integer’s value, only how it is expressed.
Binary numbers are base 2, therefore only two values are needed to express the full
range of integers. These values are 0 and 1. For example, considering the u8 type
numbers (each number is 8 bits long):
Note how much more verbose binary numbers are in comparison to the decimal
numbers.
You may be wondering why four digits are used to express, for instance, the binary
number b0000 0001 . Why not just b1 ? This is because in computer memory, you must
choose the number of bits required for an integer ahead of time. So, if the integer may
have to represent any number up to b1111 1111 , then in memory the integer must
always take up eight digits, even if it isn’t using all of the digits all of the time.
Putting an optional space in between every four zeros of a binary number makes it
easier to read but holds no other significance.
Hexadecimal numbers are base 16, therefore 16 values are needed to express the full
range of numbers. These values are 0–9 and A — F.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 4/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Note how in this case, the decimal system is more verbose than that of the
hexadecimal.
For the sake of completeness, the decimal number 3,735,928,559 binary equivalent is
b1101 1110 1010 1101 1011 1110 1110 1111 .
To give a taste for the concept of endianness, in English we say “23”, but in the German
language they say “3 and 20”. It is the same number, just expressed differently.
Endianness is a similar concept, big endianness orders the most significant digits first,
and little endian orders the least significant digits first. The terms “big endian” and
“little endian” is a reference to the book Gulliver’s Travels by Jonathon Swift. In the
story, there were two groups of people, Big
Endian and Little Endian. The Big Endian group broke their eggs from the top, the
Little Endian group from the bottom. Chaos ensues over this preposterous and
insignificant difference in egg-breaking methodology.
At a lower level, endianness has to do with how a computer’s processor loads a value
into its registers (memory). Namely, how the bytes are ordered.
In big endian format, the most significant bytes are read first. This is how we
intuitively read numbers. The decimal number 3,735,928,559 written in big endian
hexadecimal format is 0xDEADBEEF , exactly what one would expect. In a big endian
formatted system, this number is stored in computer memory in binary as follows (the
hexadecimal values are also presented for clarity):
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 5/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
When comparing the big endian and little endian formats, it is (hopefully) clear that
the only difference is the byte order. In big endian, the hexadecimal equivalent of
3,735,928,559 is 0xDEADBEEF . In little endian, the hexadecimal equivalent is
0xefbeadde. It is important to be aware of endianness because the little endian
formatted number 0xEFBEADDE is still representing the decimal number 3,735,928,559 ,
Remember, all of these numbers are equivalent, just expressed in different ways. For
the most part, it does not matter if a system or program uses big or little endian, what
matters is consistency.
Bitcoin (mostly) uses little endian format, and it is important to keep that in mind
moving forward.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 6/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
This block header is from the block at height 645,536 and was mined by Slushpool. It
will be used as an example throughout this post.
Each field, its data type, and a very brief description is detailed in the following table.
1. Select a suitable version number and current epoch time. From the network,
retrieve the previous block hash of the latest block on the
longest chain and the target.
4. Calculate the Merkle root from the coinbase transaction and selected transactions.
6. Select a number for the nonce and append it to the block message, creating the full
candidate block header.
7. Perform the SHA256 hash on the block header (twice) and compare the result to the
network target.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 7/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
8. If the block header hash is less than or equal to the target, the
block is valid, and the miner propagates it to the network for
confirmation by their peers. They then return to step 1 and commence
mining on the next candidate block.
9. If the block header hash does not satisfy the target, the block is invalid and the
miner returns to step 6, incrementing the nonce and trying their luck again.
Now that the block header has been defined and the important role it plays in Bitcoin
has been expressed, each parameter can be explored in more detail.
Version
The version field is usually treated as a four-byte big endian number interpreted as
type int32 and contains extra bits that miners can use to signal readiness for softfork
proposals and for an additional search space of 2¹⁶.
For such an unassuming field, there is a lot to unpack when it comes to the version
number of a block. The version number provides the means in which miners can
signal their readiness for network softfork upgrades. The success or failure of a miner-
activated softfork proposal is dependent upon if enough incoming blocks have
signaled their readiness. Here, “readiness” means that the miner has updated their
software to be compatible with the Bitcoin client release containing the proposed
changes. An example of a softfork proposal is the segwit softfork.
The three most significant bits of the version fields are reserved for future possible
mechanism upgrades. Currently, the three most significant bits must be set to b001.
This means that the minimum allowed version number in big endian is 0x2000000
( b0010 0000 0000 0000 0000 0000 0000 0000 ). And the maximum version number in big
endian is 0x3FFFFFF ( b0011 1111 1111 1111 1111 1111 1111 1111 ).
At the time of writing this post, the version number behaves in accordance with the
BIP9 specification. Before diving into BIP9, let’s take a look at how the version number
has evolved since the birth of the network.
In September 2012, Bitcoin Core v0.7.0 introduced BIP34 which rendered version 1
blocks to be non-standard. Specifically, this BIP did two things:
1. Give miners a structured way to signal readiness to accept a softfork proposal. This
was achieved by the double-threshold switchover mechanism, also called
IsSuperMajority() , which consists of two thresholds called the 75% rule and the 95%
rule. The 75% rule states that once 750 out of the last 1,000 blocks signal readiness by
setting their version 2 or greater, then any new blocks that specify version 2 in the
block header must comply with the softfork proposal specification. Otherwise the
block would be rejected by the network even if it was valid by version 1 standards.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 9/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
After this occurs, the 95% rule states that once 950 out of the last 1,000 blocks are
version 2 or greater, then all version 1 blocks will be rejected.
2. Specify the actual soft fork proposal which requires all version 2 or higher blocks to
include the block height as the first item in the script signature of the coinbase
transaction.
It took around six months until version 2 blocks were the standard, with the last
version 1 block at height 227,835 timestamped at 2013–03–24 15:49:13 GMT.
The softfork proposal defining version 3 is specified in BIP66 and was introduced in
February 2015 in Bitcoin Core v0.10.0. Version 3 blocks restrict signatures to strict DER
encoding. The method to signal readiness followed BIP34.
The softfork proposal defining version 4 is specified in BIP65 and was introduced in
November 2015 in Bitcoin Core v0.11.2. Version 4 blocks recognized a new op code for
the Bitcoin scripting system, OP_CHECKLOCKTIMEVERIFY , that allows UTXOs to be
unspendable for a certain amount of time.
While the IsSuperMajority() signaling method specified in BIP34 worked, it did have
some problems. Namely, (1) the lack of a timeout and (2) the use of integer values
rather than bits for signaling (explained further below). BIP9 solved both of these
issues.
1. A distinguishing name.
2. A bit in the version field that when flipped signifies miner readiness. The number of
the bit location is denoted by N.
3. A starttime that specifies when the selected bit gains its meaning.
4. A timeout, such that if the proposal has not been locked in by X date, it is deemed to
be failed.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 10/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
By flipping a single bit in the version field rather than setting the field to a specific
integer number (as in BIP34), multiple proposals can be active at once.
Rusty Russell’s “BIP9: versionbits In a Nutshell” blog post does an exceptional job of
explaining the development and significance of the version field. We will build off this
post and continue to explore the version field in detail. Let’s start by examining exactly
how the bit flipping specified in BIP9 works.
The full 32-bit binary representation of the typical big endian version number of
0x20000000 is expressed as
This follows the rule set in BIP9 that the topmost bits must be b001 or greater.
Now, let’s say there is a new soft fork proposal called BIPN₀ that sets the readiness bit
location to 0 (N = 0), requiring that the 0ᵗʰ bit be set to 1 for the miner to signify
readiness. The version number in big endian would then be 0x20000001 , or
Now, let’s say there are simultaneously two additional soft fork proposals active. BIPN₁
(N = 1) and BIPN₂ (N = 2). Perhaps this miner is only ready for BIPN₀ and BIPN₂, not
BIPN₁. With the BIP9 mechanism, this is not an issue. The miner would signify
readiness for only BIPN₀ and BIPN₂ by setting the 0ᵗʰ and 2ⁿᵈ bits to 1 and leaving the
1ˢᵗ bit as 0. The version number in big endian would then be 0x20000005 , or
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 11/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
The ability to have multiple soft fork proposals active at any given time makes this
mechanism superior to BIP34’s use of integer values.
Miners can and do use this the version field to gain extra search space. This is called
overt ASIC boost via version rolling. Initially after BIP9 was introduced, miners were
still using all the version bits to perform an overt ASIC boost. However, this resulted in
nodes generating warnings as they were trying to interpret the bits as a signaling for a
non-existent softfork proposal. BIP320 solved this issue by designating 16 bits for overt
ASIC boosts, and by leaving 13 bits open for softfork proposal signaling. This gives the
miner a search space of 2¹⁶ and leaves room for 13 simultaneous softfork proposals.
The previous block hash field is a little-endian formatted 32-byte value interpreted as
type char[32] that is the hash of the previous block. This field is what provides the link
between the current and previous block in the network.
Merkle Root
The Merkle root field is a little-endian formatted 32-byte value interpreted as type
char[32] . The Merkle tree structure is used throughout the field of computer science
for numerous purposes. In Bitcoin, a Merkle tree is used to cryptographically tie each
transaction that is in the transaction block to the block header in a succinct 32 bytes.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 12/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Each transaction is a leaf of the Merkle tree. The transactions must be included in
topological order. Meaning, when txₙ₊₁ spends an output of txₙ, txₙ₊₁ must be sorted to
a later position in the block than txₙ.The very first leaf in the Merkle tree. This first
leaf, tx₀, is reserved for the coinbase transaction.
2. The concatenated transaction pair is hashed via the SHA256d hashing algorithm.
The digest of this hash becomes a new branch in the tree.
3. Again, in pairs of two, the digests are concatenated together and hashed via the
SHA256d algorithm producing a new branch in the tree.
Step 3 is repeated until only one hash remains, the Merkle root hash, which is the value
stored in the block header.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 13/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Time
The time field is a little-endian formatted four-byte value interpreted as type uint32
that is the epoch timestamp of the current block. The job of the timestamp is to
provide means for the network to determine how fast blocks are being confirmed so it
can adjust the difficulty every 2,016 blocks (about 2 weeks). Consensus rules constrain
the range of accepted timestamp values to about a three-hour window, leaving 2¹³ bits
that can be used for extra search space.
A valid timestamp must be greater than the median timestamp of the previous 11
blocks. At a confirmation rate of 10 minutes per block, this is one hour from the
submission time of the candidate block. The timestamp must also be less than the
network-adjusted time plus two hours. This three-hour window is 10,800 seconds
which yields 2¹³ extra bits of search space by
2ˣ = 10,800
x = ln(10,800) / ln(2)
x = 13.3987 => 13
The network-adjusted time is the node-local UTC plus the median offset from all
connected nodes. Network time is never adjusted more than 70 minutes from local
system time.
An unintended but useful consequence of including the timestamp field in the block
header of a healthy decentralized network is that the Bitcoin blockchain can be used as
an effective time stamping tool.
Bits
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 14/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
The bits field is a little endian formatted four-byte value interpreted as type int32 that
encodes the current target threshold in a compact four-byte field. The resultant block
hash must be under the target in order to be considered a valid solution by the
network. The target is updated every 2,016 blocks (roughly two weeks), so every block
header submitted during the 2,016-block time frame will have the same target value
encoded in the header.
As we know, to find a block hash, the block header data fields (the version, previous
block hash, Merkle root, target, time, and nonce) are all concatenated and hashed
together via the SHA256d hashing operation. The resultant hash is the candidate
block’s header hash and acts as a unique identifier for this block. In order to be
considered valid, the hash must be less than or equal to the current network target
which reflects how easy or difficult it is for a miner to mine a valid block. Without the
target, it would be effortless to create a valid block and the network would fracture and
fall apart.
9,215 . This is a very big number. Bitcoin stores the target as a floating-point type, so the
truncated form used is
0x00000000FFFF0000000000000000000000000000000000000000000000000000 , which again in
base 10 is
26,959,535,291,011,309,493,156,476,344,723,991,336,010,898,738,574,164,086,137,773,09
In order to fit this large number into a four-byte space it uses a compact format. This
format sacrifices granularity for byte space. The following steps detail how to retrieve
the target from the bits value.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 15/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
1. Swap endianness from little endian format in the block header, to big endian,
0x2F931D1A → 0x1A1D932F . Ultimately it does not matter the endianness used as long as
everything stays consistent.
2. Separate the first byte, 0x1A , from the remaining bytes, 0x1D932F . This first byte is
called the mantissa (also called significand). The mantissa is the part of a floating-
point number that represents the number of significant digits. It is then multiplied by
the base, which in this case is 2, and raised to the exponent to give the value of the
number.
Therefore, the target threshold is extracted from the bits field by:
Using this equation, the target threshold for this block is found by:
Note that the difference between the exponent and the length of the mantissa is
multiplied by 8 in the above equation. This is a slight short cut, leveraging the fact that
there are eight bits in one byte. So instead of writing each of the parameters out in
binary, which would be much more verbose, each byte is taken in its entirety.
3. The result of step 2 can now be compared to the header hash. If the header hash is
equal to or below the target threshold, it satisfies the Bitcoin consensus rules and can
be confirmed on chain.
0x0000000000001D932F0000000000000000000000000000000000000000000000
0x00000000000016BF116FC90CF45AEC2DA4D13349358159D8B4EDDCB37EAB295B
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 16/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
47525089675259291211422247200069659468817014361857087365971968
36551990950853533658225321687497789580066641734434828845787483
Therefore, since the header hash value is less than the target, this is a valid header.
Let’s explore a little deeper as to why this formula was chosen and how it works. The
format itself originates from the IEEE 754 standard for floating-point arithmetic which
just details how computers store floating-point numbers.
A 16-bit register only has space for, you guessed it, 16 bits. If we shift the bits over by
the number of available bits (16), we encounter an overflow and lose our number 11:
To prevent this from happening we impose that we can only shift by our available bits
minus the number of bits we want to make sure we keep. In this case, 16 – 4 = 12 ,
So, that is why we subtract the number of bytes from the exponent when calculating
the target: to prevent against edge cases where the exponent would cause an overflow
and we would lose significant digits of our mantissa.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 17/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Nonce
The nonce field is a little endian formatted four-byte value interpreted as type int32
that is incremented in order to create a new hash of the current block with the
intention of finding one that meets the current target. It provides 2³² bits of search
space.
The nonce parameter plays an essential role in finding a valid block. Without the
nonce, every single time a miner constructs a block that did not meet the network
difficulty, they would have to modify the transaction set, recalculate the Merkle root,
rebuild the block header, and rehash. This requires a non-negligible amount of
computational work. The nonce makes it such that the miner only needs to construct
the block header candidate once, keeping all the variables constant except for the
nonce. The miner will increment the nonce and then rehash the block until (1) the
block header hash either meets the difficulty target (they found a valid block header),
(2) the block becomes stale (a competing miner found a valid block header), or (3) they
run out of
nonce search space.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 18/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
Each field, its datatype, and a very brief description is detailed in the following Table.
For the purposes of this post, the script signature is the field of importance because it
is where the miner gains extra search space and also where the miner can put in their
identifier.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 19/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
The script signature, also called the unlocking script, is of variable byte length which
is capped by consensus. Typically, the unlocking script contains conditions that allow
the consumption of the previous transaction’s UTXO. In the coinbase transaction,
however, there is no UTXO being consumed, only new UTXOs being minted. Instead,
the script signature contains the block height (as specified by BIP34) and any other
information the miner chooses to put here. Very commonly this includes any
extranonce parameters and any identifying “signatures” that the miner may optionally
include.
The extranonce parameter is not a strict field defined by the Bitcoin protocol, but
rather some bits that the miner can optionally use to increase their search space. Many
pools support the extranonce parameter and put restrictions on its length. It is
common to see an eight byte extranonce.
Breaking down the script signature, the first 1–9 bytes indicates the length of the
unlocking script which is of variable. In this case, the length is 0x4B (decimal 75 )
bytes.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 20/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
The next byte indicates the length of the next portion of the coinbase transaction. In
this case, it is 0x03 , which indicates that the next three bytes, 0xA0D909 , are of
significance. These bytes are the block height of 645,536 in little endian hexadecimal
format in accordance with BIP34. The next 64 bytes contain the extranonce
parameter(s) and any other information the miner chooses to put there. The size of the
extranonce parameter typically varies from pool to pool.
Finally, the last seven bytes, 0x2F736C7573682F is the optional identifier that Slushpool
uses for their blocks, /slush/ . By providing this identifier, Slush is making it publicly
known that this block came from their pool.
Of course, any entity could put this same text in the coinbase transaction and pretend
to be Slushpool (or any other miner). And, conversely, Slush (or any other miner) could
exclude their typical identifier from the coinbase script signature and anonymously
mine the block.
This identifier is optional for any miner to put in their designed characters. Most of
them normally put their name to show they are mining blocks (which makes sense
from marketing perspective to show how successful your pool is) but a miner can put
whatever they want or leave it empty. To get a feel for how many miners include an
identifier in the script signature of the coinbase transaction, 77.7% of blocks included
an identifier over the four-day time span from September 25ᵗʰ, 2020 through
September 28ᵗʰ, 2020.
Conclusion
Understanding the block header is essential to understanding mining and Bitcoin as a
whole. The block header plays many important roles in the Bitcoin protocol, each of its
six fields working together to form the backbone of the network.
The block header is the avenue by which all the transactions in a block are linked
together via the Merkle root, and further link that block to its parent with the previous
block hash, creating the chain. The version number is used by miners for protocol
upgrade support and readiness signaling. The encoded target difficulty lets the miners
know what the network will accept as valid, and the nonce provides them with a
dedicated search space for the valid hash.
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 21/22
2/11/23, 11:36 PM Understanding the Bitcoin Blockchain Header | by RJ Rybarczyk | FCAT Blockchain Incubator | Medium
The block header is exceptional in its simplicity, yet full of applications and use cases.
While its format has held up for over a decade now, it still is flexible enough to adapt as
the network changes and grows. How fields operate can and does change for the
better, as seen with the softfork upgrading mechanism defined by the version field.
How fields are used changes as well, as seen with how miners can use nontraditional
fields to accommodate more search space via the version, timestamp, and coinbase
transaction. The creativity of the bitcoin developers and users in leveraging the block
header and its associated fields to accomplish more and enable new use cases, is
astonishing, and we cannot wait to see what the next decade of innovation brings us.
But whatever it is, we are certain that the block header will be the backbone of this
beautiful system.
957560.1.0
Special Thanks
I would like to give a special thanks to Amanda Fabiano, Juri Bulovic, Brian Wright, Val
Open in app Sign up
Wallace, Carl Dong, Rusty Russell, Sam Abbassi, Mark (Murch) Erhardt, and NicoleSign In
Dodes for all their feedback and help.
Search Medium
https://medium.com/fcats-blockchain-incubator/understanding-the-bitcoin-blockchain-header-a2b0db06b515 22/22
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
Save
via: unslpash.com
The first cryptocurrency mining was done on the common chip at the center of every
computer — the CPU — so the original Bitcoin mining machines were PCs. The first
Bitcoins were created on Jan 3rd, 2009, mined by Satoshi Nakamoto on his personal
computer.
Many crypto assets, like BTC, LTC, and DOGE, use a PoW(Proof of Work)algorithm
in their consensus. This work is sometimes referred to as a “puzzle,” but it really refers
to a brute-force effort. It’s just a matter of trying a computation over and over until a
qualifying answer is found — so the faster we can find potential answers, the sooner a
qualifying answer can be found.
To be clear: the PoW algorithm asks miners to repeatedly increase a “nonce” number
(just any number they can only use once) and perform the same hashing algorithm on it,
trying over and over until stumbling across a nonce that leads to a hash which qualifies
as a solution.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 2/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
1. It creates a unique hash for each block of transactions. The Consensus rules of the
bitcoin system require specific qualities in the hash, making it “difficult” to find, as
well as making the block contents verifiable, unfalsifiable, and trackable.
2. The Consensus rules require that each block include the previous block’s hash,
forming a chain. But if two miners each produce a different block as the “next”
block, they will disagree and the system needs a way to choose which of these new
blocks will continue the true chain, so
3. The rules also dictate that the chain with the most cumulative work in the hashes is
the true chain, settling any disagreement. This also means that any attempt to re-
write the last few blocks of the chain would require an enormous amount of work
to produce valid hashes: more than all the work already spent for all those blocks
combined. The combination of these Consensus rules forms the fundamental basis
of the bitcoin’s decentralized security model: the cumulative work performed to
create the hashes of a chain of blocks is presumed to be more work than anyone
else could perform, which secures the chain against changes without resorting to
any “authority” to dictate things.
4. Lastly, the Consensus rules allow the miner who finds a qualifying hash to earn
some new bitcoin for itself. This reward simultaneously provides incentives for
miners to mine, and provides for the issuance of new bitcoin over time.
This fourth point explains why miners mine — for the earnings! But their work is
needed to address the first three points above.
To put it all together, a PoW Consensus system inextricably links the work to the
security of the network: the work which secures the blockchain is the work which
earns the cryptocurrency.
But this work is simply computations made to pick up the fitting hash, which one could
argue is wasteful, given the amount of compute resources dedicated to it.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 3/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
via: unslpash.com
It turns out that certain kinds of computations are more efficient on GPUs (Graphics
Processing Units) than on CPUs, and this applies to the specific kinds of computation
used for bitcoin mining (SHA256 hashing). A single GPU could outpace dozens of CPUs.
Miners talked about this in the first year of bitcoin mining, and when the first GPU
mining software was published on Sep 18th, 2010, many early bitcoiners became GPU
miners. Soon, mining rigs consisting of several high-end graphic cards became
common. GPUs quickly out-competed CPUs by such wide margins that CPU miners
would lose more money on electricity than they could earn in BTC.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 4/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
Remember that in PoW miners need to repeat the same hashing computation on
numbers they can only use once (nonces) over and over until the stumble upon a nonce
that produces a hash that satisfies the difficulty condition?
Knowing this about PoW algorithms, we can now compare CPUs to GPUs and see why
one works better.
A CPU chip has a branch prediction unit, storage units, and a few branch modules. A
CPU can run a very wide variety of tasks based on varying logic, often running a few
tasks in parallel. Of course, in PoW mining, there’s never a change in logic. We need to
run the exact same task as quickly as possible, and its ideal is to run the same task
many, many, many times in parallel — effectively testing many nonces at the same
time.
A GPU chip is much better designed for this. Instead of linear thread management and
careful control of scheduling branches, the GPU is tailor-made to run hundreds and
even thousands of simultaneous calculations of the same type at the same time. This
is also what makes a GPU excellent for geometry while a CPU excels in logic. For
example, a GPU may receive a command like “draw a rectangle of this size at these
coordinates,” and the GPU will simultaneously compute hundreds of pixels (using the
same formula many times at once) to create the rectangle almost instantly. This kind of
ability is a great match for a PoW’s processing needs!
This made the graphics card far more efficient for PoW mining and it quickly replaced
the CPU as BTC miners learned this. An interesting side note: when Etherum’s miners
adopted GPUs for the Ethereum style of PoW mining, there was a long period when
regular PC gamers could hardly find NVIDIA RTX30 graphics cards because miners
snapped them up!
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 5/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
via: unslpash.com
For example, a mainstream ASIC miner called the Ant S9 is equipped with 189 ASIC
chips with a combined computing speed of up to 13.5 TH/s, which is over 10 thousand
times the performance of a contemporary flagship graphics card like the GTX 1080Ti.
At the same time, the Ant S9 consumes only 1,350 watts of power, which is closer to 10
times the power draw of the graphics card. Since the operating expense for miners is
the cost of power, consuming 10X the power to produce 10,000X the work is a huge
gain.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 6/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
In the race to perform more hashes to find a solution more quickly, ASICs will
eventually win.
But this leads to another problem: access to ASIC miners is a major up-front hurdle.
They are high in cost and low in supply. Not everyone can afford the expense, and even
if they can, the hardware is sometimes only available to those with connections (or
subject to government controls). In 2017, estimates were that 70% of Bitcoin hashing
power came from ASIC miners made by Bitmain, the biggest supplier worldwide.
Moreover, Bitmain were, themselves, involved in mining: around 51% of total blocks
were mined through BTC.com and Antpool, both of which belong to Bitmain. These
facts worried many in the Bitcoin industry because when a single entity controls 51%
of the hashpower, it becomes possible to perform a 51% attack to take over the
network. Others simply worried that with a huge fraction of the world’s Bitcoin mining
machines housed in one place (China), there could be a risk to the Bitcoin mining
world if authorities intervened (which, as we know today, actually happened recently. This
piece is written in June of 2021.)
Another big problem with ASICs is that they are single-purpose. You cannot even
repurpose a BTC ASIC into an LTC-mining one because the hashing algorithms are
different. So if a BTC ASIC becomes unprofitable due to improvements in newer
models, it becomes useless — all the while being orders of magnitude more powerful
than general CPUs or GPUs, but only for this one single purpose, which is hashing the
SHA256 algorithm. The problem is that in order to be competitive, these ASICS
consume the best silicone chips and require significant engineering effort, which
tends to become obsolete once a newer generation of ASICs is out. One could
consider this wasteful.
These concerns led to the development of algorithms that make it harder to make an
ASIC. Some are more complex, others change frequently, still others are built to
require more memory than can be easily built into an ASIC chip: Scrypt, Ethash,
Equihash, X17, X13, X16r, and other algorithms showed up over time, used by cryptos
like LTC, ETH, ZEC, DASH, BTG, RVN.
As the technology to build more complexity and memory into an ASIC chip progresses,
however, many of these “GPU-only” algorithms eventually got replaced by ASICs.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 7/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
Satoshi Nakamoto saw this coming. Bitcoin’s original design called for miners to “vote
with their CPU power” as a way to enforce the rules of consensus. It’s clear that he
foresaw the advent of ASICs when he wrote that “as the network grows beyond a certain
point, it would be left more and more to specialists with server farms of specialized
hardware”. The seems to refer to ASICs; if Bitcoin became valuable enough to mine,
manufacturers would inevitably have an incentive to produce custom machines to
mine it.
via: unslpash.com
It boils down to technology and economics. Whether focused on GPU or CPU, any
“ASIC-resistant” algorithm will delay rather than prevent the appearance of ASIC mining
machines. Any high-quality crypto-asset ecosystem with the value being mined on a
PoW algorithm will attract professional miners; this is an economic market
inevitability. And the market will always develop more efficient tools using the latest
technology available. This is an inevitable path to ASICs.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 8/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
An ASIC-resistant PoW algorithm may also be more vulnerable to attack. The most
heavily-mined coin that can be mined by a particular kind of ASIC — for example,
Bitcoin is the most heavily-mined coin using SHA256 ASIC miners — has a level of
safety against a 51% attack. This is because it’s simply not possible to suddenly find
enough additional ASIC mining hardware in the world to produce more hash power
than is already being used by honest miners to mine Bitcoin. This safety does not
extend to other coins mined with SHA256, because one would only need a small
fraction of the world’s SHA256 ASIC miners to perform an attack.
Similarly, Ethereum is the most heavily-mined coin using the Ethash algorithm, which
runs on GPUs… but as big as it is, Ethereum is still mined on a minority of the world’s
total GPUs. Because it is theoretically possible to acquire enough GPUs to over-power
the honest miners, Ethereum is theoretically less safe against this kind of attack than
Bitcoin. In this sense, the ASIC can be argued to make Bitcoin safer — but as we
discussed above, the centralization created by ASICs or their single-purpose nature can
lead to different vulnerabilities.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 9/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
But another way to look at the externalities produced by PoW is the fact that ASIC
production requires significant manufacturing efforts and contributes to global chip
and engineering talent shortage in hardware — requiring materials and labor to be
drawn into a single-purpose product, which has no other use in the world. This is a
much bigger problem long-term in our view. Currently, the Bitcoin network is
sufficiently secure for the foreseeable future and yet the race to build even better
ASICS and for miners to join the network never stops — so all of this computation
resource is overproduced while taking away from areas where it could have been used
more productively.
It seems that any PoW-based crypto asset, once it has value and is well-known, will be
on an inevitable path from CPU mining to GPU mining to ASIC mining. This appears to
be a forgone conclusion when using PoW in the Consensus algorithm to secure a
chain. This has multiple externalities that can be summarized as significant
inefficiencies and waste, as well as risking the network to become more centralized or
vulnerable to governments trying to shut it down due to those externalities.
So, what happens to the early Bitcoin dream, where anyone can join the network with
their computer, do work, and earn — “mine” — cryptocurrency? Is this model lost to
the world?
No.
For Consensus, Phala relies on NPoS (Nominated Proof of Stake), leveraging Polkadot’s
security system. This allows a tremendous level of security without relying on the work
from the miners.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 10/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
For Computation, Phala Network issues PHA tokens to miners as payment in return for
doing work. The beauty here is that since the work being done is not providing security
to the Consensus model, the work can be any sort of computation desired. Instead of
racing to find a random answer (as in Proof of Work), miners on Phala’s network can
perform whatever useful computations people want.
To protect the data and computations, Phala makes use of TEEs — Trusted Execution
Environments, a technology built into most modern CPUs. Jobs can be sent to miners
in encrypted form, which nobody can view. The jobs are taken by the miner and
dropped into the CPU’s internal TEE, inside which it is decrypted, the computation is
completed, and then the results are encrypted and sent back.
Notably, even the owner of the CPU cannot readily see what jobs or work are being
done inside the TEE, and neither the jobs nor the results are visible to anyone on the
network! This simultaneously protects the user and their data while ensuring that
miners can’t try to refuse certain kinds of jobs, or refuse jobs from certain users.
Miners have no idea what work their CPUs are doing, or for whom — all they know is
that they will be paid for doing the work (or they will lose money if they don’t do the
assigned jobs.)
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 11/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
Since the miners are blind to the work, and the network is blind to the data, all jobs are
simultaneously secure from prying eyes and secure against censorship.
Lastly, the whole Phala network is secured and maintained by a set of Gatekeepers,
which are similar to validators on Polkadot or Ethereum 2.0. They perform the NPoS
Consensus, receive jobs from users, dispatch the jobs to the miners, and then pay the
miners for their work. This creates a system where users sending jobs don’t know
where the work is done, miners don’t know what work they’re doing or for whom, and
the Gatekeepers acting as brokers in the middle are incapable of seeing any of it, apart
from “miner X did job Y for user Z and got paid”, or affecting this workflow due to
cryptoeconomic security guarantees.
This is how Phala Network tackles the issue of trust in the computation cloud. Because
the system does not require us to trust any piece of the system, it becomes trustless: a
system where trust is not necessary.
But most importantly any computation capacity Phala acquires is never redundant or
wasted, as it linearly scales the network’s throughput in terms of tasks it can perform
for multiple users with the growth of the mining community. CPUs used by the
network can be found in most general-purpose computers and don’t require excessive
energy consumption or industrial grade setups. There is no economic pressure on
miners to reduce costs in order to compete for network’s tasks, so there is no explicit
need to seek the cheapest electricity or create specialized hardware.
Thus, Phala’s mining, to the contrary of traditional PoW where computations and
consensus aren’t separated, is ESG-friendly as it improves the overall availability of
compute resources to the world and security of all its customers, makes the resources
more efficient in terms of use and maintenance by requiring general purpose
computers and reducing the need for centralized party that builds and maintains large
datacenters and, finally, doesn’t require excessive energy consumption or wasteful use
of single-purpose hardware.
All of these factors combined should significantly reduce the carbon footprint of
crypto and cloud industries when Phala grows and takes up significant portions of
those.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 12/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
But how does Phala bootstrap a network and grow fast enough to out-compete less
ESG-friendly but larger networks? The answer is: by aligning network participants’
incentives with a token.
In addition, users submitting jobs will pay market-based Fees in PHA. The Fees and the
Rewards should, together, incentivize enough people to dedicate their CPUs to mining
often enough so that there is always a sufficient cloud of CPUs to meet processing
demands.
The Mining Reward amounts paid will be large at first, in order to attract a large
number of miners to the network while it’s still new and the value per PHA is relatively
low. As time passes, the Mining Reward will steadily decline, but increased utilization
will mean more in Fees. Over time, the Fee market will comprise a larger and larger
proportion of the payments to the miners, and the cloud of miners offering up their
CPUs will grow in proportion to the demand created by users.
This will create a similar effect as Bitcoin’s gradually decreasing reward emissions over
time: initially, bitcoin miners mostly received Rewards, but over time, more and more
of their payment will come from fees. The difference is that Phala Network will push
this process along more rapidly — taking years instead of decades to move from
“mostly Reward” to “mostly Fees” — and Phala Miners will be doing only as much
useful work as people are willing to pay for. The developer team behind Phala is going
to build a cloud platform to abstract away the complexities of having to deal with a
decentralized network and digital token payments — so that the user experience is
similar to Amazon’s AWS or Microsoft’s Azure. Combined with cheaper prices (as
miners are subsidized by the network) and enhanced security and privacy, this will help
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 13/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
boost use of the network in the mid-term. Additionally, while Bitcoin still needs to
solve the fee payment problem in the future as the network’s utility is still being
worked out by the world, Phala won’t have to deal with this as the utility of cloud
compute services is already well established and growing.
But Phala’s mining differs in a critical way: PoW miners are always racing to be the first
to find the solution, either for themselves or for their pool of miners. Finding a
solution first brings more rewards, so the number of miners will always grow in
proportion to the value being mind — in proportion to the price of bitcoin.
But in Phala’s TEE Mining there is no race. Miners get paid a small amount for being
online and available, and a larger amount if they are assigned work, but the work is
randomly distributed. There’s no race. And since the system will quickly transition
from Rewards to Fees, in just a few years the size of the cloud of miners will clearly be
a function of actual demand for computing resources, instead of work wasted in a race.
Phala TEE mining, therefore, counteracts both of the forces that push PoW systems
towards ASICs:
1. Because there is no race, there is less incentive to produce the very fastest
processor to “win”.
2. The nature of a job’s work is neither repetitive nor predictable; it can be for any
application a user submits! You can’t build Application-Specific Integrated Circuit
without knowing the Application.
3. In the Phala system, the computing power of the TEE miners is used for running
the world’s Computing tasks trustlessly. The users, jobs, and miners are managed
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 14/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
As a side benefit, if someone decides to stop mining, they still have a useful device: a
computer with a CPU. If they want, they can even have their computer do mining when
they’re not using it. An ASIC miner serves no other purpose to society; if it isn’t mining,
it is just a waste of silicon, metal, and production energy.
* Technical Notes
Phala’s emissions will follow this exponential decline function:
Where t is the block time in Epoch, Iro is the initial release amount, and k is the
attenuation decay coefficient factor of each Epoch, which satisfies:
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 15/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
The incentivized roles and their reward share ratio in Phala Network are shown in the
following table:
About Phala
Phala Network tackles the issue of trust in the computation cloud.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 16/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
119 1
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 17/18
2/11/23, 11:39 PM Reading | The Evolution of Mining: CPU, GPU, ASIC… Phala | by Phala Network | Phala Network | Medium
Search Medium
https://medium.com/phala-network/reading-the-evolution-of-mining-cpu-gpu-asic-phala-87337d88aebd 18/18
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 1/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
But what exactly is proof-of-stake, and why did Ethereum making the switch?
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 2/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
energy and computing power, and has led to concerns about the environmental impact
of proof-of-work systems.
There are several benefits to using proof-of-stake over proof-of-work. One of the most
significant advantages is that proof-of-stake systems are more energy efficient because
they do not require miners to use high-powered computers to solve complex
equations. This makes proof-of-stake systems more environmentally friendly.
In addition, proof-of-stake systems can also be more secure because validators have a
financial incentive to act honestly and follow the rules of the network. This can make
proof-of-stake systems less vulnerable to attack than proof-of-work systems, which
rely on the sheer computational power of miners to secure the network.
Ethereum made the switch to proof-of-stake with the launch of Ethereum 2.0, also
known as Serenity. Ethereum 2.0 is a major upgrade to the Ethereum network that
includes the implementation of proof-of-stake, as well as other features such as
sharding and eWASM (Ethereum WebAssembly).
The transition to Ethereum 2.0 and proof-of-stake has been a long and complex
process, with the first phase of the upgrade, known as the Beacon Chain, launching in
December 2020.
While the transition to proof-of-stake has the potential to bring significant benefits to
the Ethereum network, it also comes with some challenges. One of the biggest
challenges was the need to transition existing Ethereum users and developers to the
new system. This process required education and support from the Ethereum
community to ensure a smooth transition.
The switch to proof-of-stake is an exciting development for the Ethereum network and
its users. It has the potential to significantly improve the scalability, security, and
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 3/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
environmental impact of the network, positioning Ethereum for continued growth and
success in the future.
Unfortunately for many Ethereum miners, however, is that a stream of crypto revenue
is now gone, or at least changed. Miners will have to find other coins to mine to use
their expensive mining hardware.
And, as it turns out, the Bitcoin mining system is proving to be a good fit for many
miners.
Graphics cards: also known as graphics processing units (GPUs), these are
specialized chips designed to process large amounts of data quickly. They are
commonly used in gaming and professional graphics applications, but are also
popular for mining cryptocurrency because of their ability to handle complex
mathematical calculations.
CPUs: central processing units (CPUs) are the brains of a computer, responsible for
executing instructions and performing basic tasks. While they are not as powerful
as GPUs, they can still be used to mine cryptocurrency, especially in the early days
of a new coin when difficulty is low.
Now, let’s compare the differences between mining Ethereum and Bitcoin using these
different types of hardware:
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 4/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
Bitcoin: Bitcoin can be mined using either GPUs, CPUs, or ASICs. In the early days
of Bitcoin, it was possible to mine using a CPU, but as the network has grown and
difficulty has increased, this is no longer profitable. Today, most Bitcoin mining is
done using specialized ASICs, which are significantly more efficient and powerful
than CPUs or GPUs. However, ASICs are also much more expensive, and their use
has been controversial due to concerns about centralization.
The type of hardware used for mining cryptocurrency can greatly impact the
efficiency and profitability of the operation. Ethereum was mined using either GPUs
or CPUs, while Bitcoin can be mined using GPUs, CPUs, or ASICs. However, the most
efficient and powerful hardware for mining Bitcoin are ASICs. It’s important to keep in
mind that the use of ASICs has been controversial due to concerns about
centralization.
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 5/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
Note, the crosshair is on September 6, 2022, the date of the Ethereum Merge.
On September 6, 2022, the Bitcoin hashrate was 224 million TH/s (Total Hashrate per
Second). On December 15, 2022, the Bitcoin hashrate was 261 million TH/s, a growth of
over 10%.
The Bitcoin network automatically adjusts the mining difficulty level every 2016
blocks, or approximately every two weeks. The difficulty level is adjusted based on the
overall computing power of the network, with the goal of keeping the average time to
mine a block at around 10 minutes. If the average time to mine a block falls below this
target, the difficulty level is increased to make it harder to mine new blocks. If the
average time to mine a block exceeds this target, the difficulty level is decreased to
make it easier to mine new blocks.
This automatic adjustment mechanism ensures that the Bitcoin network remains
secure and decentralized, even as the overall computing power of the network
changes. It also ensures that the rate of new Bitcoin released into circulation remains
constant, despite fluctuations in the overall computing power of the network.
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 6/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
The Bitcoin mining difficulty has increased since September 6 (the crosshair above).
But, a recent decrease in difficulty has produced the first profitable mining scenario in
quite a while, shown below. The green is profitable, and the red is not profitable.
It had been over 2 years since Bitcoin was profitable, even amidst the bull run of 2021!
Conclusions
The bitcoin mining world is constantly changing. Since the Ethereum merge, a slurry
of miners have shifted to Bitcoin. What will the future of Bitcoin mining bring,
especially when the next bull market brings new miners and higher Bitcoin prices?
Time will tell!
If you have enjoyed this article, please follow me on Medium, leave a clap, or a response.
Better yet, do all three!
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 7/8
2/11/23, 11:40 PM Bitcoin Hashrate is exploding! GPU Farms vs. ASIC | by CryptoTechJester a.k.a MarcB | Blockchain Biz | Dec, 2022 | Medium
Search Medium
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/blockchain-biz/bitcoin-hashrate-is-exploding-gpu-farms-vs-asic-106980a98637 8/8
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
Save
For the uninitiated: mining pools are software providers who enable many mining
machines to pool together their mining power and share rewards. Mining pools are
essential in PoW mining on two levels: first, because earnings for individual miners are
highly volatile, and second, because setting up the software infrastructure around
mining is increasingly complex. By pooling resources, individual miners can lower
variance and have a more predictable business.
But with this power comes great responsibility, and mining pools hold a lot of power.
This is because mining pools ultimately decide which blocks get worked on by their
miners and which transactions are included in those blocks. Mining pools decide on
what MEV gets extracted and who gets to extract it, they vote on the gas limit, and they
take part in major political battles. That’s why it’s essential to Ethereum culture that
the barrier to entry for mining pools be as low as possible, to maximize
decentralization.
When MiningDAO set out to build our own independent pool, we were surprised to
find that it was incredibly challenging! There’s very little open and publicly shared info
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 1/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
on how to run a competitive mining pool, and a lot of the open-source software is out
of date. So we figured: let’s fix that by releasing an open-source, step-by-step guide.
Building a pool consists of two parts: (1) setting up a full node client with good peer-to-
peer networking and fast processing speed, and (2) connecting the full node to pool
software that manages hashrate and distributes workload across all the miners. Here,
we’ll cover both.
This guide comes from our first-hand experience building the MiningDAO.io pool,
and outlines how we brought our uncle rates from 10%-14% down to approximately
4%-5%, on par or better than some top-10 pools.
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 2/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
forever).
Here --cache=21000 means to allocate 21GB for in-RAM state storage (the most Geth
can handle), and the remaining flags will be explained below.
More importantly, the modifications to the Geth code we will describe below can be
found here as a repo to download, or here as a patch to apply.
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 4/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
Two things destroy value for miners: mining uncle blocks, and mining empty blocks.
In fact, the two are almost equally bad: uncle block rewards are 1.75 ETH , and empty
block rewards are 2 ETH , with no transaction fee surplus in both cases. For
comparison, full blocks with transaction fees typically bring 3-4 ETH in total rewards,
and sometimes a lot more. So why do mining pools sometimes produce empty blocks,
and how can one minimize their frequency?
When another pool mines a fresh block (say at height N ), any other blocks at height N
are likely to become uncles. So whenever a new block is found, Geth instantly switches
the miners' jobs to mine an empty block at height N+1 . This empty block does not have
transaction fees, but that is still better than mining blocks destined to become uncles.
Subsequently, geth constructs a "real" block at height N+1 , and switches the miners'
jobs once again. Constructing such a "real" block takes time (0.1-0.3 seconds), hence
the two-step process. But in that interim 0.1-0.3 seconds-long period miners are
working on an empty block.
It might be tempting to collect all the pending transactions to maximize fees, but
getting greedy with --txpool.globalslots substantially increases the amount of
processing Geth has to do to construct a "real" block (up to 1 second and more). We
recommend values no larger than 1000 or 2000 .
1. when other pools produce new blocks, learn about it as quickly as possible
2. when your pool produces a new block, propagate it as widely as possible (so others
start mining on top of it)
The first step to good p2p is, as explained earlier, running your full node on a cloud
server with good bandwidth next to other nodes.
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 5/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
Second, good bandwidth allows the node to handle more direct peers, thus reducing
the number of p2p hops necessary to receive new information. The Geth flag for the
number of peers is --maxpeers .
Below we will explain a few more nuanced and powerful tricks to maximize block
import speed and block propagation speed.
After following the bloXroute setup tutorial, don’t forget to add the bloXroute node into
the “trusted peers” set for your Geth, we will need that later. Trusted peers are pre-set
nodes that Geth will always connect to, irrespective of the random peer initialization
process. Trusted peers also do not count against the connections limit. Adding the
bloXroute gateway to trusted peers ensures Geth will not accidentally drop that
connection.
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 6/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
detrimental when some peers are more powerful than others and these peers end up
not being included in the subset.
In particular, the first thing to do upon mining a new block is to send it to bloXroute, so
that it will be forwarded to all the other participating mining pools. If the bloXroute
gateway doesn’t end up in that random sqrt(n_peers) subset, your chances of getting
uncled go way up!
Next, you’d want to send the block to the highest-quality peers, and then to all the
remaining peers.
We have open-sourced the following Geth patch and recommend applying it to your
client. It propagates all newly mined blocks to all trusted nodes (including bloXroute),
and then to all remaining peers.
In reality, not all peers are equally useful. Some have slow connections and will
neither supply new blocks nor help your blocks propagate. Others, especially the
nodes of other mining pools, will produce a constant stream of new block data.
Following advice from Sparkpool, we tweaked our Geth to log which peers were the
first to send us a new block. Collecting that data for several months allowed us to
figure out the best peers to always keep connected to (via the “static”/”trusted” node
settings in Geth). Here is a Python script we used to process that data and convert it
into a trusted_nodes.json list that Geth can ingest.
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 7/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
We had a great experience with Miningcore for two reasons. First, it keeps all past data
on disk in an SQL database, unlike open-ethereum-pool, which keeps data only in RAM
via Redis. Disk storage offers stability against reboots and ability to analyze historical
data. Second, we enjoyed the highly readable, object-oriented code of Miningcore.
For context, there is an easy way to calculate the increase in uncle rates from any
processing delay. Block times are Poisson-distributed, which means that no matter
how long it has been since the last mined block, the probability of finding the next
block in the next second (or millisecond or whatever) is always the same. For example,
Ethereum targets 13-second block times, which means the probability of a block being
mined in the next second is always 1 sec / 13 sec ~= 7.7% . So if your mining pool has
a 0.1 sec delay anywhere in the pipeline for any reason, it will have 0.1 sec / 13 sec
~= 0.77% extra uncle blocks as a result of that delay. The uncle blocks will come from
that 0.1 sec period of time that your miners are working on an outdated job.
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 8/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
Back to Miningcore. Using the formula above, a 0.5 second delay in updating the
miners’ job will lead to 0.5 sec / 13 sec ~= 4% extra uncle blocks (absolute, not
relative percentage). Naturally, such a high rate of unforced errors is unacceptable. We
have experimented extensively with lowering the update frequency from 0.5 seconds
down to 50 milliseconds and below, but found that setting rather unreliable: the
updates were still significantly delayed.
A better solution is to make use of Geth’s notifyWork feature, so that Geth proactively
sends job updates to the mining pool software as soon as they appear. We patched
Miningcore to support this option, and released the modification. After transitioning
to notifyWork , we found the communication delays between Geth and Miningcore to
become practically negligible, and thus our uncle rates significantly improved.
Conclusion
Hopefully this post proves useful and leads to more people running Ethereum mining
pools or solo-mining, helping keep Ethereum open and decentralized. To summarize,
we started with vanilla Geth on default settings and vanilla Miningcore
implementation. This default setup produced uncles at a rate of approximately
10%-14%. Progressively applying the modifications outlined here brought our uncle
rate down to 4%-5%, comparable or better than some existing top-10 pools (the
Etherscan uncle rate is a bit higher because we sometimes experiment in prod).
Our Geth modifications can be found here as a repo and here as a patch. Our
Miningcore modifications can be found here, and a corresponding pool config file can
be found here.
If you have further ideas on how to improve this setup, please send us a pull request or
an email!
Miningcore speedup developed by Alexander Melnikov. Many thanks for the suggestions and
ideas that came from Alex Obadia (Flashbots), Eyal Markovich and Shen Chen (bloXroute),
Xin Xu and Dr. Yang Ze (Sparkpool), Chris (Flexpool) and Haseeb Qureshi (Dragonfly
Capital).
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 9/10
2/11/23, 11:43 PM How to build an Ethereum mining pool | by Ivan Bogatyy | Dragonfly Research | Medium
https://medium.com/dragonfly-research/how-to-build-an-ethereum-mining-pool-6be356520b7a 10/10
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
Published in Coinmonks
Save
Introduction
The use of physical documents is cumbersome, and the world is moving towards the
use of digital documents. Digital documents are convenient to use, but proving their
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 1/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
authenticity is often a problem. Can it be proved that the document has not been
altered? Is it possible to prove the document you received is identical to the one you
viewed earlier? Since there is no common protocol to validate and verify digitized
documents, the process of analyzing the documents in private and government
institutions is difficult. If there were a mechanism to verify the authenticity of
documents and validate the authenticity and content of the documents, it would
facilitate users to manage their digital documents. The proposed solution for the
mentioned problems using Blockchain technology.
Secure storage, easy retrieval, and protected access to government documents hinder
efficient operations and increases costs for many governments. A blockchain-based
system can serve as a verification clearinghouse for these documents by providing
public and private proof of the veracity of a document or certification. A blockchain-
based document verification system can also be used to issue digital certificates that
are impossible to counterfeit. This helps eliminate reputational risks for an
organization as well as improve trust and transparency by its stakeholders.
Blockchain can solve the existing problem of verifying the validity of digital assets such
as a picture of a birth certificate, a pdf document stating any contract, or a signed legal
document specifying a business deal very efficiently and at a very low implementation
cost. Due to the characteristics of the Blockchain (the permanent decentralized ledger
of information), these digital signatures can be accessed by anyone. Hence anyone
with access to the Blockchain can now verify the authenticity of a digital asset without
having to rely on trusted intermediaries.
Decentralized Ledger
Related work
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 2/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
One of the major issues of the usage of digital documents is the blurred and non-
transparent process of verification. Digital documents are more prone to changes,
both intentional changes, and mistakes. To overcome this issue, people have been
trying various methods and schemes.
One of the well-known schemes is digital signatures with a public key infrastructure
(PKI). A valid digital signature ensures three major security requirements for a digital
document namely authenticity (the document was created by a known sender),
nonrepudiation (the sender cannot deny having sent the document), and integrity (the
document has not got altered in transit). But PKI based solution is not very popular in
terms of cost and usability. Moreover, the digital signature cannot identify the
existence of the document for a certain time or the provenance of a digital document
e.g. the prime owner of the document.
Nowadays many standalone document viewing and editing applications such as Adobe
Acrobat Reader, Microsoft Word facilities users to attach digital signatures to
documents. Plenty of digital signing services like Docusign and Echosign already exist
that can help to sign legal documents. All such document signing platforms allow their
users to sign documents securely and also provide cloud storage for the signed
documents. Since you need to blind trust third-party for storing your documents, these
services appeal more to enterprises than the average users.
The question is how can we create digital proof that a digital asset (soft copy of birth
certificate, business contract, educational certificate) has been certified (signed) by an
authorized organization or government institution and secondly, how can anybody
around the world verify the authenticity of a particular digital asset without having to
rely on a 3rd party or intermediary?
With Blockchain Document Signing, there is no need to blindly trust third parties,
neither for timestamping nor for storing signatures. It can be possible to replace the
third party and prevent anyone from going back and track records in case of
manipulation or disputes by building a blockchain document signing platform.
Blockchain provides integrity, to achieve authenticity, the blockchain-based document
verification solution. And currently, there is no digital document verification system
using Blockchain in Bangladesh.
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 3/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
Background
In this section, we provide some background on digital signature, document
timestamping, and trusted timestamping authority-
1. A key generation algorithm that selects a private key uniformly at random from a set of
possible private keys. The algorithm outputs the private key and a corresponding public
key.
2. A signing algorithm that, given a message and a private key, produces a signature.
3. A signature verifying algorithm that, given the message, public key, and signature, either
accepts or rejects the message’s claim to authenticity.
1. First, the authenticity of a signature generated from a fixed message and fixed private
key can be verified by using the corresponding public key.
Because if a document was disputed, it can be difficult to provide proof that the digital
signature was valid at the time of signing without a timestamp. This is because most
signing certificates expire after one or two years, making it difficult to prove the
document’s validity several years into the future. Without a timestamp for legally
binding documents such as business contracts, someone could alter the clock on their
computer and then alter and resign a document, which in turn could lead to costly
legal battles as different parties can dispute each other’s claims. That’s why a trusted
timestamp has to be issued by a trusted third-party — that’s why a Timestamp
Authority is needed. A Timestamping Authority who is trusted and permitted to time-
stamp information on request.
This authority can also be the verification body for the time-stamped information in
the future. In trusted timestamping services, time-stamped information may be
verified only if it is timestamped by an authentic TSA .e.g. GlobalSign.com. Most users
have to pay to use the service. But this service can be free of cost too
(https://www.freetsa.org).
It can also ensure the provenance and duplication of a digital document as digital
fingerprint is unique for each document. With a blockchain-based timestamping
service, the objectives of PKI, as well as a timestamping authority, can be achieved.
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 5/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
the original file is shared publicly with every node. Instead, it only stores the proof that
a digital asset has been certified (or signed) by an institution on the Blockchain. If
anybody would want to verify the legitimacy of a digital asset they can simply verify
the digital asset by vetting it using the proof provided. Hence, the Blockchain’s role in
this solution is to provide an immutable storage container for these proofs.
3. Validation of the digital asset using the digital fingerprint stored on the Blockchain and
vetting of the institution that issued the asset.
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 6/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
System overview
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 7/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
Stakeholders who can be involved in the blockchain document signing ecosystem can
be categorized into two types:-
Signer: Signers are those who want to digitally sign and create a digital timestamp
of their digital documents in the blockchain
Verifier: Anyone who wants to verify the documents shared by the signers.
𝐻𝑎𝑠ℎ = 𝑆𝐻𝐴-256(𝐷𝑎𝑡𝑎)
[SHA-256] is the SHA-256 hashing function [Data] represents contentsof the document
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 8/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
Using our existing ways of sharing information with tools such as email, online forms,
file-sharing platforms, etc., the digital asset can now be distributed to any party since
it is a file like any other one.
Note: There is no need to share the digital asset’s fingerprints as they are stored on the
Blockchain. Only the digital asset that is the digital document itself should be shared.
The process for the recipient to verify the authenticity of a digital asset is similar to the
steps performed earlier starting with re-creating the digital fingerprint from the file
that has been received. Next, a request is launched to the Blockchain to retrieve the
fingerprint. Any verifier can verify the integrity and existence of the document from
the transaction time by simply uploading the same document in the system.
Prototype Implemention
A demo nodejs application has been developed based on this Proof-of-concept (POC).
In this demo, Ropsten blockchain network (test) has been used to store hash and meta-
data of any document in the blockchain. The app is currently hosted in Azure cloud
platform having following features-
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 9/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
Prototype of an online time-stamping and verification service with all possible rich
text documents ensuring data privacy.
Implementation of a web portal where users can register and upload digital
documents.
Conclusion
Blockchain offers enormous opportunities to the document signing industry with its
features like trust and traceability. The proof of signature in the blockchain is not
controlled by any single entity. Members of the blockchain document signing platform
instead act as public notaries or witnesses to attest to the signature. A blockchain-
based signing platform also provides users with access to the document and with the
ability to quickly confirm the authenticity of a signature.
Feedback: [email protected]
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 10/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
PS: If you liked the article, please support it with claps 👏. Cheers
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 11/12
2/11/23, 11:48 PM Blockchain-Based Document Timestamping and Verification | by Md Shariful Islam | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
Open in app Sign up Sign In
practices.
Search Medium
https://medium.com/coinmonks/blockchain-based-document-timestamping-and-verification-1bafd36b6c1f 12/12
2/11/23, 11:50 PM The Bitcoin whitepaper, explained and commented — section 3: timestamp server | by Raphael M. | Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Raphael M. Follow
Save
https://meyer-raph.medium.com/the-bitcoin-whitepaper-explained-and-comment-section-3-timestamp-server-d5ceb84368a4 1/4
2/11/23, 11:50 PM The Bitcoin whitepaper, explained and commented — section 3: timestamp server | by Raphael M. | Medium
context. This time: section 3 — Timestamp server. As previously, quotes are from the
whitepaper.
You may remember from the previous parts that Bitcoin attempts to solve a common
problem of digital cash systems — namely, avoiding digital coins being spent twice —
without requiring a centralized authority. Instead, Nakamoto proposes to make the
record of transactions public and distribute it to all participants of a peer-to-peer
network. Problem: how to make everybody agree on a single history of transactions?
The solution we propose begins with a timestamp server. A timestamp server works by taking
a hash of a block of items to be timestamped and widely publishing the hash, such as in a
newspaper or Usenet post [2–5]. The timestamp proves that the data must have existed at the
time, obviously, in order to get into the hash. Each timestamp includes the previous
timestamp in its hash, forming a chain, with each additional timestamp reinforcing the ones
before it.
first, we group transactions that appear more or less at the same time in bundles
called blocks. This is just done for efficiency: better timestamp a bunch of non-
competing transactions together than timestamp each of them individually!
then, we compute the hash of the transactions and publish it to an external outlet
with a wide audience like a newspaper. The hash, a tool borrowed from
cryptography, is a short digital number that can be computed quickly but cannot be
reversed. It’s a sort of digital digest of the data. This digest IS the timestamp: since
the hash was published, the data (that the hash sums up) must have existed at the
time of publication.
finally, as more transactions are recorded, and thus more blocks are added, each
new hash/digest will be computed from the current block AND the previous
hash/digest. Since hashes cannot be reversed, if block B’s hash can be computed
from block A’s hash, it proves that block A came before block B.
https://meyer-raph.medium.com/the-bitcoin-whitepaper-explained-and-comment-section-3-timestamp-server-d5ceb84368a4 2/4
2/11/23, 11:50 PM The Bitcoin whitepaper, explained and commented — section 3: timestamp server | by Raphael M. | Medium
Note that using cryptographic hashes to timestamp data wasn’t a new idea, even in
2008: Surety, a Florida based company, had been using these tools to create a public
record of timestamps by buying small ads every week in the New York Times since
1995! These were found in the “Notices & Lost and Found” section. The wide
distribution of the New York Times made it almost impossible for anyone to alter the
timestamps already published: you would have to find and replace all possible copies
of the particular edition you’re trying to modify.
The following figure from the whitepaper (with my coloring) illustrates how each new
timestamp is computed from the new transactions and the previous timestamp.
notice how each new timestamp is computed from 1) the previous block’s timestamp and 2) the current block of
transactions
Because hashes/timestamps are published widely, everyone can check when they were
published and that they indeed form a linear chain. In other words, everyone can
check that block B’s hash can be computed from block A’s hash (by redoing the
computation), thus establishing that transactions included in block A had to be
recorded before transactions from block B. It’s the kind of verification that miners
(peers that add blocks) do constantly in Bitcoin: always verifying that new blocks are
valid, and that old blocks have not been tampered with.
The chain of timestamps, computed recursively (each new one depends on the
previous ones), translates into a chain of recursively linked blocks… the blockchain
(although Nakamoto doesn’t use this terminology).
https://meyer-raph.medium.com/the-bitcoin-whitepaper-explained-and-comment-section-3-timestamp-server-d5ceb84368a4 3/4
2/11/23, 11:50 PM The Bitcoin whitepaper, explained and commented — section 3: timestamp server | by Raphael M. | Medium
It’s interesting to note, that, in this section, Nakamoto refers to an external media, such
as Usenet (internet forums popular in the 1990s) or a newspaper, to publicly broadcast
the timestamps. It’s just a temporary step to get us focused on the chain of timestamps
rather than the publishing mechanism itself.
In the next section, we’ll see how Nakamoto uses previous works such as Adam Back’s
Hashcash (1997), a mechanism originally proposed to combat junk emails, to provide a
publishing protocol that does not require an external media. See you then!
Give this story some claps if you learned anything and follow me to get new articles about all
Open in app Sign up Sign In
things crypto explained clearly. Thanks for reading!
Search Medium
https://meyer-raph.medium.com/the-bitcoin-whitepaper-explained-and-comment-section-3-timestamp-server-d5ceb84368a4 4/4
2/11/23, 11:53 PM Bitcoin Mempool — Simply explained | by TheLuWizz | Coinmonks | Medium
Published in Coinmonks
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
TheLuWizz Follow
Save
In 2020, 11 years after Bitcoin's official birth, we hardly deal with Bitcoin's fundamental
technology but often talk about fourth and fifth-generation blockchains, sharding,
https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85 1/7
2/11/23, 11:53 PM Bitcoin Mempool — Simply explained | by TheLuWizz | Coinmonks | Medium
The Bitcoin Memory Pool, or Bitcoin Mempool for short, is the ‘waiting room’ for all
unconfirmed transactions on the Bitcoin network before they are (sequentially)
aggregated into blocks.
Transactions made on the Bitcoin network are not directly added to the blockchain in
the form of a block. They are first collected in the Bitcoin mempool and then
‘processed.’
So much for the simple explanation. To delve a little deeper, let’s take a look at how
transactions are propagated on the Bitcoin network. We also look at the role miners
play in this.
The collection of individual transactions is what we generally call a block. And the
miner or mining pool that solves this mathematical problem first adds the collection of
transactions (i.e., the block) to the Bitcoin blockchain. This now corresponds to the
first confirmation of the block.
For a miner node/miner, the mempool is crucial for profitability and profit.
Those who send bitcoin on the network themselves may have noticed that their own
transaction gets ‘stuck’ on the network or takes a little longer. The explanation for this
is that the mempool plays a crucial role for miners (and thus confirms your
transaction).
Miners now have ‘the privilege’ to decide for themselves and freely which transactions
they choose from the mempool. They do this for economic reasons: they sort the
transactions from the mempool according to their fee rate. The fee rate is nothing
more than the transaction fee divided by the transaction size, whereby the transactions
with the highest fee rate are at the top. The aim is to maximize one’s profit and, thus,
profitability. Each transaction has a certain size, and the maximum block size is only 1
MB, the miner's sort according to profit maximization. And this is how the
transactions flow from the mempool into the Bitcoin blockchain. Voilá!
https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85 3/7
2/11/23, 11:53 PM Bitcoin Mempool — Simply explained | by TheLuWizz | Coinmonks | Medium
The Bitcoin mempool — the waiting room for unconfirmed transactions on the Bitcoin
network.
I share more intimate thoughts in a monthly newsletter that you can check out here.
Please let me know in a comment and join me on various social media platforms:
Also, Read
Crypto Trading Bot
AAX Exchange Review | Referral Code, Trading Fee, Pros and Cons
https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85 4/7
2/11/23, 11:53 PM Bitcoin Mempool — Simply explained | by TheLuWizz | Coinmonks | Medium
Altrady review
https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85 5/7
2/11/23, 11:53 PM Bitcoin Mempool — Simply explained | by TheLuWizz | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85 6/7
2/11/23, 11:53 PM Bitcoin Mempool — Simply explained | by TheLuWizz | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/bitcoin-mempool-simply-explained-7f76be235e85 7/7
2/11/23, 11:54 PM What is a mempool?. On the bitcoin blockchain, blocks… | by Tara Annison | Medium
Save
What is a mempool?
This transaction must be created and signed by Bob (to prove he has the associated
private key to send the funds from the address to Alice’s address). It must then be
broadcast to nodes in the network so it can be validated and included in a block. Only
once it has been included in a block and there have been a number of other blocks
built on top of it, is it seen as confirmed. In general, a transaction with 6 block
confirmations is seen as ‘certain’ and a transaction with less than 3 block
confirmations is seen as potentially risky. This is due to the risk of block re-orgs,
orphaned blocks or network forks.
https://tara-annison.medium.com/what-is-a-mempool-f6a403d4871e 1/3
2/11/23, 11:54 PM What is a mempool?. On the bitcoin blockchain, blocks… | by Tara Annison | Medium
However, each block on the bitcoin blockchain can include only 1MB worth of
transactions — this is c2,500 transactions per block, and therefore there are many
transactions which are waiting to be included within a block. They wait in something
called a ‘mempool’ — short for ‘memory pool’.
When a miner is looking to build her next block, she selects transactions from this
mempool and puts them into her candidate block — the block she’s hoping will be
added to the blockchain if she can solve the cryptographic hash puzzle first. If Bob has
added a suitably attractive transaction fee to his transaction then it is more likely to be
selected by the miner from the mempool, if not then it may sit in the mempool until
the blockchain becomes less busy or the going fee decreases towards it. If the miner is
successful in having her block added to the blockchain then she gets to keep the
transaction fees associated with all transactions in her block, as well as the 6.25 newly
mined bitcoins.
Once a node receives a new transaction, it validates it and stores it within its local
mempool. It can then be selected to be included within a candidate block, left in the
mempool, or removed from the mempool if it’s included in another node’s confirmed
block. It is very rare that two nodes have the exact same mempool since they will be
receiving transaction broadcasts only from the nodes they are connected with,
however, many mempools are broadly similar.
To view someSearch
mempoolMedium
statistics from the Blockchain.com nodes check here:
https://www.blockchain.com/en/charts/mempool-size
https://tara-annison.medium.com/what-is-a-mempool-f6a403d4871e 2/3
2/11/23, 11:54 PM What is a mempool?. On the bitcoin blockchain, blocks… | by Tara Annison | Medium
10
https://tara-annison.medium.com/what-is-a-mempool-f6a403d4871e 3/3
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
Published in Coinmonks
Save
Nodes forming the ethereum network keep a copy of the blockchain, and are the ones
in charge of adding new transactions to it and assuring its consistency and validity.
The question is, how are transactions added to the blockchain by the nodes?
The process can be explained very easily : Nodes receive signed transactions from
wallets/users, and if the transactions are valid they add them to the blockchain.
Problem is, nodes might receive thousands of transactions, and blocks are added to the
blockchain at a quasi-constant rate (every few seconds), nodes might also receive
different transactions from different users and other nodes they are connected to….
We need to be able to have some kind of buffer to store all those incoming, yet to be
validated transactions… This is where the memory pool “MemPool” comes into play, I
will try to describe what it is and how it works from a generic point of view and what
“side effects” they might have.
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 1/8
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
The amount of fees that he or she is willing to pay for the transaction
The transaction signature (signed with a private key using a wallet for example).
Once the transaction is ready, it only needs to be included in a future block in order to
be accepted by the network.
The way to do that is to broadcast the signed transactions to one (or many) nodes
forming the blockchain network.
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 2/8
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
Nodes will receive your transaction and check its validity and authenticity before
forwarding it to other nodes in the network(they will check that the sender has enough
funds and more importantly that the signature is correct).
After checking the transaction, nodes will add it to their memory pool. Nodes will re-
check all their mempool transactions after each block gets added to the network since
it might contain transactions that invalidate some of the transactions they are keeping
in their mempool.
The mempool is basically RAM memory within nodes, where they keep all the “so-far”
validated transactions they have received but could not yet add to the blockchain.
Indeed blocks are generated every few seconds or minutes depending on the
blockchain, and they have a maximum size, meaning that they can only host a limited
number of transactions.
If the rate at which users are sending transactions to the blockchain is higher than the
rate at which blocks can be added to the blockchains, many transactions will have to
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 3/8
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
It is important to note that because of its decentralized nature, nodes memory pools
might be different at any point in time, they might hold different transactions.
It is also important to note that your transaction might also exist in multiple nodes
mem pool at any point in time.
Nodes will pick transactions from their memory pool in order to build blocks to add to
the blockchain, but they will not follow a First in First Out strategy, they will pick what
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 4/8
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
they will consider the most convenient transactions for them, basically those that pay
the highest fees since they will be the ones to collect them.
Once a transaction is finally picked by a miner from its mempool and added to a block,
all the other nodes that contained the same transaction in their mem pool will proceed
to remove it since the same transaction can not be added twice into the blockchain.
The memory pool of each node is then like the waiting area of a train station, where
passengers wait for the next train to arrive and only those willing to pay the most will get in.
With the particularity that a single passenger could be at multiple train stations at the same
time, and the moment he or she gets into a train, he or she disappears from all the other train
stations!
Cancelling Transactions
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 5/8
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
Nodes are untrusted agents, in the sense that they will always act in their best interest,
like we already described before, they will pick first those transactions that pay the
most, this is actually a behavior that we can use to our advantage since it will give us
the possibility to cancel transactions if required (transactions that have not yet been
added to the blockchain of course!!!).
Nodes will receive your new transaction and, since it pays a higher fee than the
previous one, they will add it to the blockchain first. Ethereum transaction nonces can
only be used once for a specific account, meaning that the moment they add the new
transaction to the blockchain, the old one becomes invalid and gets removed from the
mempools.
Front Running
Since Nodes keep transactions in their mempools before adding them to the
blockchain, they have access to their content and can check the output (state change)
they will cause to the blockchain in advance….
This can potentially be an issue for your dapp, let’s suppose that you are offering a
certain reward to the first account that submits a certain value (that hashes into a value
that you stored on your Smart contract). If someone submits the right answer to a
node, the node will have access to that value and can very easily generate its own
transaction, copy paste the content, and add it to the blockchain first, effectively
“stealing” the reward from the honest user.
This is just one example of front running but there are many more situations in which
the “speed” or “order” in which transactions are added to the blockchain can have an
impact on your dapp logic, you should always keep in mind that this can potentially
disrupt it.
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 6/8
2/11/23, 11:57 PM Ethereum Memory pool. How does it work? | by Alberto Molina | Coinmonks | Medium
Also, Read
Bookmap Review | 5 Best Crypto Exchanges in the USA
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/ethereum-memory-pool-how-does-it-work-6b6d8edfa0eb 8/8
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
Published in BitHyve
Save
---------Kernel-----------
* Details of the Blockchain structure
* Details of the Transaction structure
* UTXO
* UTXO vs Account-Balanace Model
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 1/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
Many words and idioms surrounding Bitcoin doesn’t always make obvious sense. Some
words mean something else than what they might suggest at first glance. Some don’t
create any impression on the reader’s mind when they first hear about it, precisely
because they never existed before in the English dictionary. They are purely
constructed from the design terminologies of the Bitcoin system. Sometimes rather
technical word sticks around in common lingo due to lack of better alternatives.
One such word is “UTXO”, which is almost as commonly used in the Bitcoin world as
“money” is used in the real world. Yet nobody knows what to think about, when they
first hear it. UTXO doesn’t have any previous precedence in the English language. It
means “Unspent Transaction Output”, which is a mouthful technical term and came
pretty much straight out of the Bitcoin codebase. Yet, its probably the most important
concept someone wanna wrap their head around if they plan to use Bitcoin effectively.
So in this article, we will dissect this term piece by piece, and hopefully, by the end, the
reader will have a graspable mental model to think about UTXOs, and be an efficient
Bitcoin user.
In order to imagine UTXOs, we need to look at the gears of the Bitcoin machine,
starting from the biggest structure of the system, the Blockchain.
The Blockchain
The Bitcoin machine is constructed out of mathematical structures. When I say
structure, think about abstract mathematical objects, which have semantical
meanings. A structure can contain raw data or more smaller structures within itself.
Depending upon the semantics of these structures (suggested by its name) the data
within them are interpreted by the protocol.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 2/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
Let us start with the most glorified data structure of this decade, A Blockchain. As the
name suggests, its a chain of Blocks. Its the largest of all the structures in the protocol
and as of writing sized about 310 GB for Bitcoin, which is a long list of Blocks (blocks
are also structures).
Each block contains two types of structures, a Header, and a Transaction List. The
header contains all metadata regarding a particular block, and among them is the
previous block hash that points to an earlier block (aka parent block). In this way, each
block points to its parent, which points to its parent, so on and so forth, all the way
back to the first block ever created (aka the genesis block). This pointing back into the
past creates this chain-like structure of the blocks, and thus appropriately named as a
Blockchain. A blockchain is nothing more than a linked list.
Block #10
The above figure shows the data contained in the 10th block of the Bitcoin blockchain.
The summary section specifies the Header data, and the section below specifies the
list of transactions. This block was mined on 9th Jan 2009 (see the time stamp field)
probably by Satoshi himself. In the transaction list there is only a single transaction of
50 BTC going to an address. This is the coinbase transaction, the first transaction in
every block where miners get their block reward. There was nobody else in the
network to transact with back then, so the only transaction in the list was the coinbase
transaction where the block creator claimed 50BTC for solving the Proof of Work.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 3/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
Now that we got the basic idea of blocks, let’s go one step deeper and look inside a
transaction.
The Transaction
Peeling down a single transaction, we can find many different structures, which all
have their separate semantic meanings.
First is a Structure called Transaction Version, which is a version number specifying the
type of this particular transaction to the network. By reading the version number, a
node can determine the set of rules to be used to verify this particular transaction.
The last structure is Lock Time, which specifies whether a transaction can be included
in the blockchain right away or after some specified time.
In between them comes a list of Inputs and Outputs. These two are the most important
field for our discussion here.
A transaction Output consists of a cryptographic lock and a value. The details of the lock
will be described in a separate blog post (this is where the smart contract comes in).
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 4/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
For now, you can simply imagine that the outputs are somehow locked and the input
provides a key to unlock them. The value is simply the amount in satoshis (sats) that is
locked inside the output.
Every Transaction input consists of a pointer and an unlocking key. The pointer points
back to a previous transaction output. And the key is used to unlock the previous
output it points to. Every time an output is successfully unlocked by an input, it is
marked inside the blockchain database as “spent”. Thus you can think of a transaction
as an abstract “action” that defines unlocking some previous outputs, and creating new
outputs.
These new outputs can again be referred by a new transaction input. A UTXO or
“Unspent Transaction Output” is simply all those outputs, which are yet to be unlocked
by an input.
Once an output is unlocked, imagine they are removed from circulating supply and
new outputs take their place. Thus the sum of the value of unlocked outputs will be
always equal to the sum of values of newly created outputs (ignoring transaction fees
for now) and the total circulating supply of bitcoins remains constant.
The below figure shows the transaction “action” schematic. A transaction consumes
some past UTXOs and spits out new UTXOs.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 5/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
A UTXO is nothing more than locked up bitcoins. You can think of UTXOs as a box that
contains the coins and they can hold any amounts. Once you have some bitcoins, in the
Blockchain all you have is a bunch of UTXOs. For all practical purposes, you can think
of your UTXOs as your box full of sats.
The blockchain is a canonical list of all the transactions that were ever recorded by the
network. By tracing through them, we can construct what is known as a transaction
history graph. Every output can be traced in this way all the back to the instant where
it was first created by a coinbase transaction.
The figure below demonstrates the schematic of the Bitcoin transaction history graph.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 6/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
For example, in TX4 above, the input0 points back to output0 of TX2. The Outputs at
the last transactions namely TX6 and TX3, the one with 10K and 20K values are the
UTXOs. Because they have not yet been referred to by a transaction input. Once an
input points at them and provides the correct key to open them, they are spent and are
not considered UTXO anymore. They will be replaced by new UTXOs that will be
created by that future transaction.
One small detail to notice here is, for example, in TX1 the input0 points to an output
that had value 40K, but it creates a new output that has value 30K. The missing 10K is
the transaction fee. This is the fee paid to the miners for the inclusion of the particular
transaction in a new block. Higher the transaction fee, higher is the probability of
miners picking it up for inclusion in the next block.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 7/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
list of latest transactions, which defines which of the previous UTXOs are spent and
which new UTXOs are created. Every Bitcoin node in the network will always have the
exact same copy the UTXO set in their local storage.
As of writing, the size of this UTXO set is 4.1GB. And yes, if you own some bitcoin, your
UTXOs are also present inside my Bitcoin full node. But don’t worry, I cannot open
them.
As we have already mentioned, UTXOs are bitcoins, and they are represented in
different ways by different wallets for user information. When you query a wallet for
your bitcoin balance, the wallet in the backend gathers up all the UTXOs that you own,
and show you the sum of the value of these UTXOs. That sum is your final wallet
balance. These calculations happen in the background and are abstracted away from
users.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 8/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
In the real-world, the UTXOs are almost similar to physical cash/coins. When one tries
to spend cash in a shop, he gives up the entire note, takes the goods, and takes back the
remaining change. If one has a cash note of 10 bucks and wants to buy good priced 5
bucks, he doesn’t divide the note in half for the payment. Rather he gives up the full
note, and takes a new 5 bucks note as a change along with the goods.
UTXOs work in similar fashion. In a transaction, UTXOs are always consumed in full,
even if the required payment is of the partial value of the original UTXO. For example,
referring to the figure above, suppose Alice wants to pay Bob for some goods/services
which cost 6 BTC. But Alice only has a single UTXO of 10 BTC. She will create a
transaction that will consume up this whole UTXO of 10 BTC and create two new
UTXOs, one for Bob with 6 BTC and one for herself with 4 BTC value. The UTXO Alice
pays to herself is known as the change UTXO, and her wallet software automatically
tracks this UTXO to give her the final balance of 4 BTC. Every time a payment is made
for a smaller value than the available UTXOs, the wallet automatically creates the
change UTXO for the user.
Every UTXO is associated with a bitcoin address, and there are many types of
addresses (P2PKH, P2SH, Bech32, etc). Different addresses provide different
functionality for these UTXOs. For example, if one creates a multisignature UTXO, i.e.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 9/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
a UTXO that needs keys from 2 or more people to be spent, it is associated with an
address that starts with a 3… and looks like below:
3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
If you have a bitcoin wallet with some balance, you can always try looking up for your
individual UTXOs.
Even though these two models achieve similar goals, i.e. pay money to people, they
both have some advantages and disadvantages.
UTXO models are better for scalability and privacy. The transaction logic is simplified
as each UTXO can only be consumed once and as a whole. Because the logic is simpler,
transaction verifications can be made parallel. Different schemes of privacy-
enhancing techniques can be developed using the UTXO model, like coin-join, etc. In
exchange for these benefits, the tradeoffs are in usability. UTXO model is inherently
unintuitive thus most of the wallets had to abstract away the UTXOs and simulate
normal account like UI for users. UTXOs are limited in terms of more exotic smart
contracts that executes based on the user’s total account balance.
Because of these reasons, Ethereum rejected the UTXO model and they went for a
simple and more flexible account-balance model.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 10/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
Conclusion
It’s entirely possible that all the above details regarding UTXO has made you more
confused than before. That’s alright, we all had our weird moments with Bitcoin. To
gist it up, abstract the entire concept as follows and you should be alright.
When you spend some bitcoin, you create a transaction (or the wallet does it for
you) that consumes some old UTXOs and creates a bunch of new UTXOs.
UTXOs are always consumed as a whole, and change UTXO is created automatically
by your wallet to get back the balance.
You should always be aware of your keys to open up the lock in your UTXO. Not
Your Keys, Not Your Coins.
So next time you use a wallet, see if you can figure out your individual UTXOs. Hint:
Figure out the transaction ID, and look it up on a block explorer.
Happy Bitcoining.
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 11/12
2/11/23, 11:59 PM What The Heck is UTXO. Peeking into the Bitcoin Transaction… | by Rajarshi Maitra | BitHyve | Medium
https://medium.com/bitbees/what-the-heck-is-utxo-ca68f2651819 12/12
2/12/23, 12:01 AM UTXO (Unspent Transaction Output) and Account Model Comparison v. 2 | by Dmitry Mishunin | HackerNoon.com | Medium
Published in HackerNoon.com
Save
The basis of any financial system is the asset management method. It is impossible to
work with assets without a clear understanding of available balance. Double-entry
bookkeeping, as applied in classic accounting, or triple-entry bookkeeping, favored in
decentralized systems accounting, would not be applicable to blockchain platforms, if
platforms did not allow tracking the user balance.
https://medium.com/hackernoon/utxo-and-account-model-comparison-v-2-cdf9669c6c0d 1/6
2/12/23, 12:01 AM UTXO (Unspent Transaction Output) and Account Model Comparison v. 2 | by Dmitry Mishunin | HackerNoon.com | Medium
Currently, two popular balance models are: Unspent Transaction Output (UTXO) and
the Account Model. The first model is a directed graph of assets moving between
users, the second is a database with the current network state.
+----------+---------------+-----------+-----------------+
| | Balance Model | Consensus | Smart Contracts |
+----------+---------------+-----------+-----------------+
| Bitcoin | UTXO | PoW | - |
| Ethereum | Account | PoW/PoS | + |
| EOS | Account | DPoS | + |
| Tron | UTXO+Account | DPoS | + |
| Qtum | UTXO+AAL | PoS | + |
| ICON | Account+? | LFT (BFT) | + |
+----------+---------------+-----------+-----------------+
It should be noted, that nearly all new systems have a hybrid balance model, while
Ethereum and EOS use a pure account model.
Higher degree of privacy for new addresses, the coin does not have an owner
Account Model
To prevent the state machine from storing nonce, unused addresses are deleted
UTXOs pros
1. Higher degree of privacy. If user utilizes a new address for each transaction they
receive, it will often be difficult to link accounts to each other. This greatly affects
currencies, and less the arbitrary DApps, as the latter are often required to keep
track of complex bundled state of users. Therefore, user state partitioning scheme
is not as straightforward as with currencies.
2. Feasible scalability paradigms. In theory, UTXOs are more compatible with certain
kinds of scalability paradigms, as it’s possible for only the owner of some coins can
maintain a Merkle proof of ownership. This means that even if everyone (including
the owner) decides to discard this data, then only the owner himself is at harm. In
an Account paradigm, losing the portion of a Merkle tree corresponding to an
account would make it impossible to process messages that refer to that account,
including even incoming transactions. However, there are other non-UTXO-
dependent scalability paradigms.
https://medium.com/hackernoon/utxo-and-account-model-comparison-v-2-cdf9669c6c0d 3/6
2/12/23, 12:01 AM UTXO (Unspent Transaction Output) and Account Model Comparison v. 2 | by Dmitry Mishunin | HackerNoon.com | Medium
1. Large storage economy. For example, if an account has 5 UTXO, then switching
from a UTXO model to an Account model would reduce the space requirements
from (20 + 32 + 8) * 5 = 300 bytes (20 for the address, 32 for the txid and 8 for the
value) to 20 + 8 + 2 = 30 bytes (20 for the address, 8 for the value, 2 for a nonce (see
below)). In reality, savings are nowhere near this massive since accounts need to be
stored in a Patricia tree (see below), but they are remarkable nonetheless.
Additionally, transactions can be smaller (e.g. 100 bytes in Ethereum vs. 200–250
bytes in Bitcoin) because every transaction requires to make only a single
reference, signature and to produce just one output.
4. Constant light client reference. Light clients can at any point access all data related
to an account by traversing the state tree in a specific direction. In a UTXO
paradigm, the references change with each transaction, which is a particularly
burdensome issue for long-running DApps that try to use the above mentioned
state-root-in-UTXO propagation mechanism.
One weakness of the account paradigm is that in order to prevent replay attacks, every
transaction must have a “nonce”. The account keeps track of nonces used and only
accepts a transaction if its nonce is sequential to the last nonce used. This means that
https://medium.com/hackernoon/utxo-and-account-model-comparison-v-2-cdf9669c6c0d 4/6
2/12/23, 12:01 AM UTXO (Unspent Transaction Output) and Account Model Comparison v. 2 | by Dmitry Mishunin | HackerNoon.com | Medium
even no-longer-used accounts can never be pruned from the account state. A simple
solution to this problem is to require transactions to contain a block number, making
them un-replayable after some period of time, and reset nonces periodically. Miners or
other users will need to “ping” the unused accounts in order to remove them from the
state, as it would be too expensive otherwise with a full sweep as part of the blockchain
protocol itself.
Conclusions
It is observed that both models are roughly identical. Each one has its clear pros and
cons. This is once again proved by the community opinion demonstrating even
preference to both types. However, a popular trend nowadays is to use a hybrid
paradigm. It is reasonable to consider a hybrid model with UTXO being used for
balances and States for contracts. We also suggest learning the AVL+ tree from
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurrencies
[https://eprint.iacr.org/2016/994.pdf] in regards to using the optimized model of proof.
90
how hackers start their afternoons. the real shit is on hackernoon.com. Take a look.
https://medium.com/hackernoon/utxo-and-account-model-comparison-v-2-cdf9669c6c0d 5/6
2/12/23, 12:01 AM UTXO (Unspent Transaction Output) and Account Model Comparison v. 2 | by Dmitry Mishunin | HackerNoon.com | Medium
Your email
https://medium.com/hackernoon/utxo-and-account-model-comparison-v-2-cdf9669c6c0d 6/6
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Read Discuss
to Peer) network, where par ticipants present on the network are called nodes. The
ledger stores data about transactions. It is a chain of blocks, where its most significant
Each block in the blockchain except the first block (known as the genesis block)
contains a field called a previous hash. It is the hash of the previous block in the
If an attacker attempts to change the data of a block, the hash of the block will
Login Register
HIDE AD
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 1/12
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
if the hash changes the chain will get destroyed. Or, the attacker has to mine all the
What is a Block?
A block in blockchain stores transactions. In the case of bitcoin, blocks are added to the
blockchain ever y 10 minutes, this might var y as a time to mine a new block depending on
the complexity of the target hash, and it might take more time to mine one block,
When the block successfully gets mined by the miner, it gets added to the blockchain.
When the block gets added to the chain, the status of all the transactions inside the
HIDE AD
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 2/12
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
In the case of bitcoin, the number of transactions that can be stored inside a block
isn’t fixed, but the maximum size of the block is set to roughly 1 MB, the block size can
Empty blocks are valid, which means an empty block can be mined and added to the
chain.
Transaction
that have different semantic meanings. The following are the different structures
1. Transaction version number: It is a version number specif ying the type of transaction
to the network. Through the transaction number, a node can determine the set of
3. Input : Transaction input consists of a pointer and an unlocking key. The pointer points
to the previous transaction output. The unlocking key is used to unlock the previous
output the input points to. Ever y time output is unlocked by an input, it is marked in
4. Lock Time : It specifies whether a transaction can be included in the blockchain right
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 3/12
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Once an output is unlocked, they are removed from the circulating supply. The new
outputs take their place. Thus, the sum of the unlocked outputs will always be equal to
What is a UT XO?
In bitcoin, the transaction lives until it has been executed till the time another
transaction is done out of that UT XO. UT XO stands for Unspent Transaction Output.
It is the amount of digital currency someone has lef t remaining af ter executing a
transaction.
When a transaction is completed, the unspent output is deposited back into the
How is a UT XO created?
UT XOs are created through the consumption of existing UT XOs. Ever y Bitcoin
transaction is composed of inputs and outputs. Inputs consume an existing UT XO, while
UT XO Model
The UT XO model does not incorporate wallets at the protocol level. It is based on
individual transactions that are grouped in blocks. The UT XO model is a design common
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 4/12
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Cr yptocurrencies that use the UT XO model do not use accounts or balances. Instead,
Each transaction in the UT XO model can transition the system to a new state, but
The network par ticipants must stay in sync with the current state.
1. Suppose the following bitcoins are received from the transactions. Each one of these
transactions is a UT XO.
3. In order to transfer 0.5 BTC, there is a need to choose one or multiple transactions as
input.
4. This is why, a transaction in bitcoin is different from banks, in the case of banks, one
would have entered an amount of 0.5 BTC, pressed transfer and it would have gone to
the seller, but this is not the case in bitcoin, here there is a need to choose one or more
account.
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 5/12
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
7. In the case of UT XO, the input amount can’t be lef t unspent, one can’t say that do
8. The remaining 0.2 BTC, has to be used in one of the following 3 ways-
Send the remaining amount back to your account, as we did in the above image.
Use the remaining amount as the transaction fee. Remember, that there should be
some transaction fee other wise no miner will add your transaction to block, and it
9. Now that 0.5 BTC has been sent to the seller but no fee has been added, the
transaction didn’t get confirmed, and af ter 72 hours, 0.7 BTC will be refunded back.
10. So in order to send money to the seller, let ’s put those 0.2 BTC as fees for this
transaction.
11. In order to provide a transaction fee, nothing needs to be mentioned, if you don’t
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 6/12
2/12/23, 12:02 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
12. Now that the transaction fee has been added, a miner included this transaction in the
14. The UT XO from Sarah is no longer there, the UT XO only lived till another transaction
was not done from it, but now it has been used in another transaction, i.e. to purchase
the car.
15. Transaction is stored inside a block, also it is one of four factors that changes the
hash of a block. This means if a miner chooses a different transaction keeping the other
HIDE AD
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 7/12
2/12/23, 12:03 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Timestamp
Block Number: It is the serial number of the current block in the chain.
Nonce
17. If any one of these four factors changes even by 1 bit, the hash changes completely,
UT XO Set
The total UT XOs present in a blockchain represents a set and is being constantly
Each transaction consumes elements from this set and creates new ones that get
Thus, the set represents all of the coins in a par ticular cr yptocurrency system.
Ever y Bitcoin node in the network will have the exact copy of the UT XO set in their
local storage.
In the case of a valid blockchain transaction, only unspent outputs can be used to
The condition that only unspent outputs may be used in fur ther transactions is
mechanisms.
Suppor t for Decentralized Exchanges and Atomic Swap: The UT XO model could
suppor t atomic swaps, hence enabling peer-to-peer cr ypto trades without the
involvement of a third par ty. The atomic swap feature of UT XOs offers a better facility
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 8/12
2/12/23, 12:03 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Privacy and Security: With new addresses used for ever y UT XO transaction, it is
Prevents Double Spending : A UT XO can only be used once, this is fundamental within
the operation of the blockchain technology that guarantees that the currencies are
smar t contracts.
UT XO vs Accounting Model
Below are some of the differences between the UT XO model and the Accounting model:
1. The transaction requires more storage The transaction requires less storage
space. space.
simpler. calculations.
4. Bulk transactions are less efficient. Bulk transactions are more efficient.
HIDE AD
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 9/12
2/12/23, 12:03 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Previous Next
Related Articles
Ar ticle Contributed By :
mohitgfg0901
@mohitgfg0901
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 10/12
2/12/23, 12:03 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
Company Learn
About Us DSA
Careers Algorithms
In Media Data Structures
Contact Us SDE Cheat Sheet
Privacy Policy Machine learning
Copyright Policy CS Subjects
Advertise with us Video Tutorials
Courses
News Languages
Top News
Python
Start Your Coding
Technology Journey Now!
Java HIDE AD
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 11/12
2/12/23, 12:03 AM What is Unspent Transaction Output (UTXO)? - GeeksforGeeks
https://www.geeksforgeeks.org/what-is-unspent-transaction-output-utxo/ 12/12
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 1/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
We all know that when you send any amount of Bitcoin on the network or spend it in a
shop, a fee of some sort is usually added automatically to the transaction you are
making. But who gets it, how is it calculated and why is it there in the first place?
All good questions and, as Bitcoin usage continues to increase steadily around the
world, it’s one that will inevitably become more pertinent. This article will provide all
the answers you need in one place, now and (in theory) forevermore unless something
fundamental changes in the network itself.
First, attaching a value to transactions prevents spamming. Without it, anyone could
send Satoshis (that’s the fractional denomination of Bitcoin in the same way that cents
is the fractional denomination of the dollar) continuously across the network jamming
it up and bringing to a crawl relatively easily.
In theory, this still could be achieved by even a relatively small number of saboteurs,
but the addition of the fee now makes this a very expensive proposition with no real
benefit to those doing it. After all, it would not affect the blockchain, undo any
previous transactions or create more Bitcoin. In practical terms, it stops this
happening very efficiently.
Second, to put it bluntly, nothing in life is free. Someone has to pay for the electricity
and computing power than carries your Bitcoin transaction. The easiest and fairest
way to do this is to charge a fee when you’re actually using it. The fee is paid only by
the person sending the Bitcoin, not the payee, and its level depends on a lot of factors
as we’ll see.
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 2/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
Work out the size of your transaction in bytes, multiply it by the median byte size, take the
answer in Satoshis, divide it by 100 million to give you the answer in bitcoin and then
convert to your local currency.
However, that sounds like a lot of work to do when we want to do a simple transaction
and most of us wouldn’t know where to start anyway. How do I work out what the
median byte size is? Actually, how do I even work out what my transaction size is?
What the hell is a byte anyway?
Fortunately, almost all modern wallet systems work out the transaction fee
automatically when you go to make payment and often give you a couple of options.
In simple terms, the built-in calculator will take a look at how busy the network is, how
big your transaction is (in terms of bytes remember, not actual dollar amount) and
how quickly you want it sent. With Bitcoin, there is always a delay of some sort as the
transaction has to be confirmed in the network, and that can range from anywhere
from ten minutes upwards.
Here’s a screenshot from a sample transaction I’ve done from one of my wallets:
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 3/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
Sample Bitcoin transaction showing ‘normal’ fee as at the time of writing this article. (image: author)
As you can see, in this case, the network fee has been calculated at 9 pence (around 12
cents) for a £100 ($130) transaction, which is a tiny fraction of the overall value.
However, I’ll have to wait over an hour for it to confirm with the recipient as it has
been given no priority over other transactions already in the queue.
If I want to do it more quickly, I can incentivize those running the network to give it a
priority by upping my offer of payment. By using the drop-down menu I can select
‘Priority’ and increase my payment to 38 pence (around 50 cents) for the same
transaction.
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 4/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
The same transaction with a higher priority — and fee — attached to it. (Image: author)
This has the effect of bumping my transaction closer to the front of the queue and
getting it processed more quickly and you will notice that the confirmation time has
dropped to below an hour. This is an indication, but the reality, in this case, was that it
took just a few minutes.
You can reduce your fees by keeping your transactions to a minimum, for example, by
combining your payments to one person together. It is clearly more expensive to send
one cent one hundred times than it is to send one dollar once and this mirrors the real
world quite accurately. If you went onto a store and bought an item for a dollar, it
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 5/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
would take longer to count one hundred pennies at the counter than it would to count
a single one-dollar bill.
However, fees can quite often be out of your control. One of the biggest criticisms of
Bitcoin remains its inability to scale and when thousands of people are transacting at
the same time, queues can build and fees can skyrocket.
This is best explained by imagining a bus where hundreds of people are trying to bid
for only a few seats. Those with very urgent business or deep pockets will offer the
driver more money than the previous person to get on in a sort of bidding war. This
drives up prices and if those who missed this bus don’t up their bids for the second or
the third that may come along, and so on, they may never get on at all.
This is exactly what happened in late 2017 when transactions backed up so much that
fees became enormous. Going forward this is still a possible scenario, although new
systems are in place or in development to reduce the effect.
One, called Segwit, (short for Segregated Witness) is already more or less standard on
the network and automatically built into our transactions to the degree that we’re not
even aware we’re using it. A second, called the Lightning Network, is an ambitious long
term project to group transactions together and only put them through the main
network when it is required.
This second development, however, is not yet widely available and should only be
attempted by advanced users in test scenarios. There is currently no date set for the
wide-scale availability of this system.
Well, it is, but someone still has to pay for the computing power and the electricity that
is used to run the system. These people are called ‘miners’ for technical reasons
mainly, but also, I think it’s very apt as they work to be rewarded in ‘newly discovered’
Bitcoin as well as the fees for each transaction they complete.
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 6/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
This is a complex process — the very basis of Bitcoin — and I don’t propose to cover it
here, but the point is that when you send your Bitcoin from your wallet, someone
somewhere has to make the transaction work. They then need to agree with everyone
else on the network to confirm that it’s valid. In simple terms, this is how the
blockchain works and how it retains its perfect transaction record, security and value.
If you ever look into it in great detail, you’ll discover it’s a genius bit of work.
The miners can be literally anyone: you, me, your next-door neighbor and so on, but if
you want to get involved, you will need to invest in specialist equipment and pay for the
electricity to run it. If that’s the case, then you would, naturally, want to be
compensated for it, wouldn’t you? No one could afford to do it for free and, as we’ve
seen, the system would be abused by spammers if it was.
The takeaway
None of us like to pay more than we have to, but the reality is that Bitcoin fees are,
mostly, incredibly cost-efficient when compared to the traditional, centralized,
banking system and usually much faster. This is especially true when international or
large payments are made.
Recently, 44,000 Bitcoin (around $310,000,000) were transferred from one wallet to
another. To do that via the traditional banking system would have been very slow,
subject to any number of checks and very expensive, especially if it was an overseas
transaction.
Worse, doing it via something like Western Union — assuming you even could — would
cost in the region of $6,000,000. Using Bitcoin, the cost was 32 cents, demonstrating
perfectly that the fee is based on the size of the transaction in bytes, not the value.
This is also not an isolated or extreme example. In the world of Bitcoin, this is even
quite normal.
However, while there is still some way to go in terms of fee stability and network
speed, it’s reassuring to know that your fees are going only to the people working hard
to secure the network.
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 7/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
And, of course, you could even be part of that network if you wanted to, such is the
accessibility of the system.
If you enjoy reading stories like these and want to support me as a writer, consider
signing up to become a Medium member. It’s $5 a month, giving you unlimited access
to stories on Medium. If you sign up using my link, I’ll earn a small commission.
Want free access to articles, analysis, podcasts and training webinars? Why not
subscribe to the ‘Bitcoin and Global Finance’ newsletter? Subscribers over 18, resident in
Europe (see list on subscription page) & new to Bitcoin can claim £10’s worth of Bitcoin on
joining! Unsubscribe at any time.
Disclosure: The author is a long term Bitcoin investor, user, and miner. If you found this
article useful, you may wish to follow him here.
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 8/9
2/12/23, 12:05 AM The Definitive Guide to Bitcoin Fees | by Jason Deane | The Startup | Medium
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
About Help Terms Privacy
https://medium.com/swlh/the-definitive-guide-to-bitcoin-fees-9ba3c7498277 9/9
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Save
Background:
While much attention has been paid to the issue of capacity and scalability, arguably
the larger hurdle to broad adoption of cryptocurrency is the steep transaction cost.
Over the past 12 months, Bitcoin and Ethereum transaction fees have averaged more
than $5 and $0.60, respectively, with peaks exceeding more than $20. As a result, a
number of large merchants and payment service providers — Steam, Stripe, Microsoft
— dropped Bitcoin payment integrations. While cryptocurrencies were originally
envisioned as a leap forward in payments, they often cost substantially more than
conventional payments rails. Along with the unacceptably slow speeds, this cost makes
crypto a strictly inferior payment option for most use cases.
If these networks are not useful now due to cost, how can they possibly gain enough
traction to make capacity matter?
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 1/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
LTM average transaction fees exceeded $5.00 and $0.60 for Bitcoin and Ethereum, respectively.
The economically astute reader will note that, in the traditional crypto model, capacity
and cost are, in fact, one and the same. Bitcoin, Ethereum, and most legacy crypto
networks have a dynamic, market-determined network fee. That is, users sending
transactions choose the amount of fee that they wish to pay, and then, validators
(miners, in the case of proof-of-work networks) choose which transactions they wish to
include. Naturally, validators will tend to choose the transactions with the highest fees
because that maximizes their profit.¹
This results in a classic supply-demand equilibrium, where the transaction fee is the
market clearing rate where supply meets demand. There is a scarce resource — the
space in the next block, or, more generally, the “slots” in the next set of transactions to
be processed — and as demand for that resource increases, so does its price.
As this logic suggests, the increases in fees in Ethereum and Bitcoin occurred during
periods of high transaction demand where capacity constraints were binding. Every
big ICO or DApp launch (CryptoKitties being the most notable example) saw a
commensurate spike in Ethereum transactions, and thus transaction fees, while the
Bitcoin mempool spiked massively during high excitement periods. The result was
highly congested networks where transactions with “normal” fees often waited days or
weeks for their transactions to be processed.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 2/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Alarmingly, this rise in prices occurred at effectively zero adoption of either Bitcoin or
Ethereum. The fact that these networks cost so much with such small volume
highlights their severe technical limitations vis-à-vis both capacity and cost. The fact
that other networks have not seen a similar spike in fees is a testament to their utter
lack of adoption, beneath even that of Bitcoin or Ethereum.
The issue of fees has not gone unnoticed. A number of newer networks have proposed
a variety of alternative fee structures, each claiming to “solve” the fee problem at
capacity. Most tantalizing, several networks, including EOS, IOTA, and Nano, claim to
have no fees by design. At first blush, this sounds great — if the protocol prohibits fees,
then they can’t rise! Like many claims in crypto, unfortunately, “zero fees” turns out to
be too good to be true.
There has been some sparse academic research into fees — see, for example, section
7.3 of this paper for a good review. Unfortunately, most research makes assumptions
about conditions to optimize around, such as some concept of “fairness” or
predictability, without justifying their objective functions. While such results may
sound good at first blush, how can we know which outcome, among many plausibly
good outcomes, is indeed the best? A more deductive and analytical approach is
needed.
What then, is the answer to the existential problem of fees? And how can we go about
thinking through the pros of cons of the various proposed fee models to figure out
which one is optimal? Luckily, these questions are relatively straightforward to answer
with basic economics.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 3/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
The way economics analyzes this type of simple market is through supply and demand
curves. I won’t review the basics, but I will note several interesting considerations for
crypto fee markets. I’ll assume you know how supply and demand curves are used to
find market prices and what consumer and producer surplus and net welfare mean —
if you don’t, you should review the Wikipedia article.
The standard crypto fee market involves a set of producers (validators) supplying
validation slots that are bid for by consumers (the users of the network).
Interestingly, the crypto market differs from a simple supply-demand market in that
not everyone gets the good at the same price. If you submit a transaction with a fee of
$1 and the market clearing rate is $0.50, you will still pay $1. This ends up having no
impact on the actual market dynamics — it just shifts consumer surplus to producer
surplus.
The primary wrinkle for the crypto fee market is that supply is typically fixed —
Bitcoin, for example, has one block of roughly 2,000 transactions every 10 minutes, or
about 3 transactions per second. In general, there are only so many transactions per
second that a given network can process. Typically, crypto observers assume this
means that supply is perfectly inelastic — it can never increase or decrease.³
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 4/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
However, supply is only perfectly inelastic after a certain point. That is, supply is capped,
but the producers in the market won’t necessarily supply up to that cap for zero cost.
Specifically, the supply curve is upward sloping until it hits the cap (variable costs of
validation, typically quite small) and has an initial jump (fixed costs of validation,
often quite large). In Bitcoin, for example, fixed validation cost is very high, so
validators would not process transactions for free.
In reality, fixed costs do not impact the marginal production but rather the decision
whether to produce (validate) at all. The below chart roughly (but, strictly speaking,
inaccurately) accounts for the effect of fixed costs by shifting up the supply curve. It
does accurately show the net social welfare, which is our chief concern. As we will see
below, due to a variety of other factors, these fixed costs can be abstracted away into a
pure decision of whether or not to validate.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 5/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 6/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Updated supply and demand curves reflecting approximate fixed and variable costs of validation
The longtime Bitcoin enthusiast will object to this statement — for many years,
transactions with no fee were processed quite regularly in Bitcoin. There are a couple
of factors that impact this simple supply curve and explain this discrepancy.
Second is the more nebulous concept of crypto enthusiasm and benevolence. Many
people derive utility or some uneconomic benefit from participating in and supporting
the network. This is seen in the people who run full nodes on Bitcoin and Ethereum,
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 7/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
incurring the cost of running a node without any economic benefit.⁴ Sometimes, they
can actually derive some direct economic benefit — for example, a blockchain explorer
might run a full node and serve ads on the site, or a merchant might run a full node to
accept crypto payments and save on transaction fees. Regardless, the “enthusiasm”
factor has the same effect of the inflation subsidy of shifting the supply curve down.⁵
There is a limit though — once the cost exceeds their utility, these “benevolent”
participants will stop running their nodes.
This variable cost manifests itself as an upward slope in the supply curve. In a well-
designed crypto network, the slope of the supply curve until it hits the capacity limit
should be quite shallow, reflecting the low marginal cost of validation. That is, as long
as you are already set up to validate, the incremental cost of validating one more
transaction is quite low. However, the aggregate cost of processing a large number of
transactions is non-negligible.
There are a few offsetting effects that shift the supply curve up. These include the
upfront costs of both staking and mining, such as buying network tokens or mining
equipment or the time and dollar cost of securing your operation, preventing DDoS
attacks, and so on. Validators will demand a certain minimum payment to supply their
service, which is reflected in the fixed costs mentioned previously.
Nevertheless, the net effect of these factors is that the entirety of the sloping part of
the supply curve is well below zero in a network like Bitcoin or Ethereum.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 8/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Net effect of inflation subsidy plus general enthusiasm shifts the supply curve down. Typically, this means we
can use the basic perfectly inelastic model since the upward sloping part of the curve is all below zero.
All this applies to traditional crypto networks where there is a true fixed capacity. In a
better-designed network where capacity is determined by validator hardware rather
than by network limitations, there will actually be a somewhat upward sloping supply
curve, since validators can upgrade their hardware if the fees rise commensurately.
The upward sloping curve also can reflect the differing costs of the various validators
— some may have cheaper access to electricity or hardware, for example.⁷
We’ll assume the fixed supply market in this article for simplicity. In general, though,
the fixed supply is a conservative assumption in that it makes the arguments for the
alternative (non-dynamic) fee models look better than under a variable supply
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 9/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
assumption.⁸ That is, all the conclusions in this article will apply equally or more to a
variable supply market.
Also, for simplicity, we will assume that transaction finality occurs concurrently with
consensus. This is not the case with proof-of-work and other probabilistic consensus
algorithms — in Bitcoin, for example, there is always a small chance that the
transaction can be reversed, which declines exponentially with number of blocks since
it was processed (at least probabilistically). There are several perverse dynamics in the
fee market under a probabilistic consensus, such as those detailed in a recent BIS
paper, that significantly complicate this analysis. Since these issues are primarily
security rather than economic considerations, and more robust non-probabilistic
consensus models offer strict improvements over the probabilistic ones, it is sufficient
here to note that they do not materially impact the broader conclusions.
This simple fixed supply model provides a basis that now allows us to dig into the
various models for fees.
Fee models:
There are four main basic fee models:
1. No fees
2. Fixed fees
3. Inflation fees
All other fee models boil down to either one or a combination of the four basic models.
From an economics standpoint, it is easiest to think of the dynamic market fees as the
“base case” that matches the standard supply-demand analysis outlined above. The
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 10/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
other three cases correspond to various shifts or changes in the supply and demand
curves, with implications for overall efficiency and global utility or welfare.
We’ll start with the no-fee model, which will also serve to illustrate as the most
extreme example of several problems that affect both the fixed and inflation fee
models.
Zero
The fee model that has made the biggest splash recently is the zero-fee model, with
IOTA, Nano, and others claiming to have no fees. The supposed value proposition is, of
course, compelling: if there are no fees, then anyone can use the network, no matter
the transaction size, and never have to worry about fees. Unfortunately, there are
several flaws with the no-fee model that make it unviable in a long-term, healthy
network.
While dynamic fees are represented in the demand curve itself, these hidden fees can
be represented by a downward shift in the demand curve since they decrease the net
utility a consumer gets from sending a transaction. Regardless, from a consumer’s
perspective, they can be viewed as equivalent costs to transacting, and all popular
zero-fee networks are just direct fee networks with a different name. There is a
significant difference from the validator’s perspective, however, since they are not
receiving any compensation.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 11/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
IOTA answers this by forcing end users to validate other transactions in their own
transaction, which effectively ends up being an additional hidden fee. More
importantly, the resulting consensus model is insecure,⁹ so it is not a valid example of
a viable decentralized network fee model.
Other networks, notably Nano, claim that “Average Joe” network participants will run
full validator nodes since they use the network and would like to maintain it, rather
than simply relying on light wallets and third-party nodes. While this may seem
plausible on the surface, this argument has long been refuted by the Tragedy of the
Commons result.
The Tragedy of the Commons is a simple economic phenomenon that illustrates the
issues with common ownership of an asset or good that needs to be maintained. In its
classic formulation, a town has a common pasture area where its residents can let
their animals graze. This is a good outcome for everyone involved as it is much more
efficient than everyone keeping their own grazing grounds. However, the individual
townspeople have little incentive to contribute to the upkeep of the commons,
resulting in free riders. These people observe that they can pay nothing to maintain the
commons (and treat it more roughly than they would their own property) and still
enjoy the benefits of the common resource.
Each person who decides to free ride increases the cost of upkeep for everyone who
does pay since the same fixed upkeep cost must be met, resulting in a positive
feedback loop. Of course, the logical end result is virtually no one pays for the upkeep,
(anyone who does decide to pay is effectively left “holding the bag”) and the commons
becomes unusable for everyone. Like in the related Prisoner’s Dilemma, the game
theoretically dominant individual strategy of not paying leads to a worse outcome for
everyone involved.
More generally, given economically rational actors and the absence of an enforcement
mechanism, any common, shared resource will logically be abused by free riders. The
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 12/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
key lesson of the Tragedy of the Commons is that altruism or enthusiasm alone is not
enough to maintain a common good.
There are a few mitigations to such an outcome. Often, a tax is levied on the entire
community to pay for upkeep. Alternatively, a toll or fee is charged for use of the
resource. Both of these approaches are inherently contrary to a zero-fee network.
Social pressures play an important role in preventing the worst abuses, as free riders
can be labeled as such and will have to deal with the consequent stigma, but this too is
contrary to a pseudo-anonymous, open network.
There are some trivial cases where a Tragedy of the Commons may not be the end
outcome, particularly when the network is immature, as there are users who generally
derive utility from participating in the network, even for free. A network probably is
able to rely on enthusiasts if it only processes a few transactions per second, but once
it starts processing thousands of transactions per second, the large cost of running a
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 13/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
full node will likely soon outweigh the “soft” benefit those users get from running the
node. How many people are willing to pay hundreds of dollars per month to run a
node when they can free ride off others?
In existing crypto networks, the vast majority of users use light wallets that rely on
other nodes. In a network with a well-designed consensus, this does not increase their
risk of being a victim of a double spend or other attacks,¹⁰ so free riding is a dominant
strategy.
As with all aspects of network design, the focus should not be on what works now but
what will work at maturity. The zero fee approach boils down to relying on user’s
altruism or enthusiasm, which is not a sustainable growth model.
The fact that many networks do not have the basic protections that result in this
complexity is not a signal that they are unneeded but rather a reflection that those
networks are poorly designed, not significant enough, or not sufficiently decentralized
to bother attacking. A poorly set up node that is subject to DDoS attacks and frequent
downtime does not contribute to the network and may, in fact, decrease its efficiency.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 14/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
The recent Econ 101 student will object by pointing out that the transaction market
differs from normal markets due to having a perfectly inelastic (fixed) supply (by our
previously stated assumption), which means that there would be no deadweight loss —
only a transfer of surplus from producer to consumer.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 15/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
In a classic economic model, there is no deadweight loss due to a price ceiling in a market with perfectly
inelastic supply. However, this fails to recognize the “lottery effect,” where those that value the good the most
are not necessarily the ones that receive the good. Source.
Once the “lottery effect” is taken into account, there are many consumers who receive the good who value it
lower than the consumers without the price ceiling. This results in deadweight loss, which has practical usability
issues in the zero-fee model. Source.
However, this common economics result has a key flaw — it assumes that the
consumers that get the good are those that value it most. In reality, price ceiling
markets typically act as a lottery amongst all consumers whose reservation price
exceeds the price ceiling. The result is that the consumers that actually receive the
good have, as a whole, lower aggregate consumer surplus than the consumers that
receive the good in a free market. Thus, there is a true, overall deadweight loss even if
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 16/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
By way of example, imagine that the network can process 10 transactions per second,
but there is demand for 100 transactions per second. In a zero-fee network, none of the
demand will be priced out by a fee, so all 100 transactions will be competing for 10
slots each second. Some of these transactions may be very important and thus highly
valued, such as paying a highway toll (a long delay could cause a huge traffic jam).
Other transactions will have barely any value at all to the participants, such as a
$0.0001 transfer. And yet, under the zero-fee system, both transactions will be equally
valued and likely to get one of the slots. If all of the slots are taken by low utility
transactions and many high utility transactions are excluded or delayed, then the
network will fail to maximize overall utility. And since any distribution of transactions
is almost certainly to have a large right tail, there are many more low utility
transactions than high utility transactions, all equally likely to get a spot.
This deadweight loss has real, practical implications — participants need a network
that will reliably prioritize their most important transactions, and one that cannot
reliably process your transaction due to this “lottery effect” will not be very useful.
For example, a merchant whose transaction may or may not be processed and who has
no discretion to increase the fee to prioritize the transaction may be left pending
indefinitely — hardly an acceptable outcome!
Note that high utility/value should not be confused with high amount. It is very possible,
for example, for a $1,000 transaction to only result in a $1 economic surplus between
the participants, as is very common in low-margin businesses. Conversely, a $10
transaction might result in $9 of surplus. Any prioritization rule, such as give
preference to larger transactions, is, at best, a first-order approximation with non-
trivial loss.
In the best case, the system will result in an obfuscated, back-room fee market where
validators are paid under the table for prioritizing specific users’ transactions. While
this would prevent the “lottery effect,” it is a strictly worse version of the transparent,
dynamic fee market and subject to abuse.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 17/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
This is the essence of deadweight loss — a few lucky people benefit while everyone else
has a suboptimal outcome.
As a result of these issues, the zero-fee model is critically flawed and cannot support a
viable, long-term crypto network.
Inflation subsidy
A couple of the issues introduced by zero-fees boil down to the validators having no
incentive to run and maintain the network. Several networks, most notably EOS, have
tried to maintain the benefits of zero-fees to consumers while paying the validators
with newly-minted, inflationary tokens. Superficially, this seems to enable
transactions of any size and provide a legitimate incentive to validators.
While it does help solve the free rider and Tragedy of the Commons issues, the
inflation model too has several issues that make it unattractive for a sustainable
network.
The first issue again is one of deadweight loss and the “lottery effect.” Since the entire
cost of transacting is covered by the inflation subsidy, there is no ability for the market
to differentiate between high and low utility transactions. Just as in the zero-fee model,
this results in low utility transactions being given equal weight as high utility
transactions in competing for limited spots that are lotteried off by the validators.
This “lottery effect” severely hampers the overall usefulness of the network at
maturity. In the absence of any filter, extreme low-value transactions will dominate
and take most of the available slots, leaving legitimate, higher value transactions
waiting potentially indefinitely. As seen in Bitcoin and Ethereum over various points in
2017 when mempools ballooned, this effectively renders the network unusable to
average users. Although they allow dynamic fees, their capacity is so constrained that
these periods were equivalent to a lottery between high fee transactions.
The deadweight loss imposed by the inflation model can be viewed alternatively as
subsidy deadweight loss. While our idealized fee market is different due to the fixed
(perfectly inelastic) supply, the implication is the same: the market is being externally
subsidized, and those funds have to come from somewhere.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 18/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Deadweight loss from a subsidy in a standard market (without perfectly inelastic supply). A subsidy costs the
ecosystem as a whole more than it receives as benefit. Source
In a decentralized crypto network, the subsidy is not coming from the government but
rather inflation in the token supply. This inflation subsidy is like a government subsidy
in that the cost is ultimately borne by “society” as a whole — the holders of the tokens.
Each additional token created erodes the value of the existing tokens since there is no
change in total network value.
Thus, the inflation subsidy can be viewed as a proportional tax on existing token
holders that is redistributed to the validators on the network. If a network is worth
$1bn in aggregate, for example, a 10% inflation is equivalent to a 9.1% tax on token
holders that distributes $91mm to validators.¹² This tax is independent of the actual
utility the user derived from the network. In fact, a user who sends comparatively few
but high-value transactions may even derive less overall utility from the network than a
user with many low value (think a fraction of a cent) transactions who is able to grab
the vast majority of available transaction slots. This perverse dynamic discourages
users from holding tokens, with significant implications for network security and
growth.
So while the inflation-only model fixes several of the issues with the zero-fee model, it
still results in a suboptimal outcome that severely impairs network usefulness at
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 19/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
maturity.
Fixed
The third major alternative fee model that new networks have adopted is fixed fees,
where every transaction pays the same fee that is set by the protocol. This has notably
been implemented by Stellar, in which each network version fixes the fee and
upgrades are required to modify that fee.
The reasoning behind fixed fees is admirable but ultimately flawed. At the surface,
fixed fees appear to be more equitable than dynamic fees, which ostensibly allow a
wealthier person to pay more fees to get their transaction confirmed faster.
Unfortunately, this logic does not quite hold, since it makes all transactions rather than
all users equitable. For example, a wealthy user who wants to send many small, low
utility transactions is advantaged versus a poorer user who has a few but relatively
higher utility transactions. Instead, fixed fees result in a worse outcome for the
network users as a whole compared to dynamic fees.
Under the economic framework, fixed fees can be viewed as a “top down”
management approach that results in deadweight loss relative to the “bottoms
up”/”invisible hand” of the dynamic fee model.
There are three possible outcomes for the fee charged under the fixed fee model, all of
which are strictly worse than the dynamic fee model.
First, the fee may be higher than the market clearing rate. This corresponds to a price
floor, which results in a deadweight loss. Practically speaking, it means that users of
the network are paying too much for the service provided, to the benefit of the
validators. Many socially valuable transactions that could use the network at the
dynamic market rate are unable to use the network under the higher fixed rate,
reducing overall social welfare. This is analogous to the purported impacts of
minimum wage, where the people who hold on to their jobs benefit but a
proportionally greater number of people lose their jobs, resulting in an overall
negative outcome. While the minimum wage case is controversial due to confounding
factors and complexity, the fee market, as we have observed previously, is extremely
simple and self-contained, and thus, the conclusions are straightforward.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 20/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Alternatively, the fee may be lower than the market clearing rate. This corresponds to a
price ceiling, also with deadweight loss. The zero-fee model is merely the most
extreme version of this price ceiling, and the same issues carry through with a non-
zero price ceiling. If the fixed fee is below the cost of validation, the network will likely
fail or become significantly impaired due to free riders causing a Tragedy of the
Commons.¹³ Regardless of the level of fixed price, treating all transactions equally
results in an adverse “lottery effect” that inefficiently allocates the scarce, valuable
resource of a transaction space. As with both the zero-fee and inflation-only models,
this effect at its most extreme can render the network unusable for many high-value
users like merchants.
The third possible outcome is that the fixed fee happens to exactly equal the market
clearing rate. In this case, the result is identical to the dynamic fee market. However, it
is objectively worse since exact equality is a degenerate case that is unlikely to hold for
long. Demand for transaction space naturally varies over time. One might expect, for
example, higher demand during the normal 9 to 5 business hours than on a Sunday at
5am. As demand shifts, the dynamic fee that optimizes overall social welfare will shift,
while the fixed fee, by definition, remains constant. At best, the “top down” upgrade
system would dynamically shift the fixed fee to match the market clearing rate, but
this of course just results in a more centralized version of dynamic fees.
There are a few points that supporters of fixed fees might raise to push back on this
logic. One potential benefit is that everyone pays the same rate, which may be more
equitable provided that the fixed fee is close to the dynamic fee. However, this does not
improve overall social welfare — it merely shifts surplus from producers to consumers.
Since users will not pay higher fees than the utility they derive from their transactions,
variations in transaction fees do not reflect any true economic inequality in the
system. Confusion on this point often arises over conflating transactions with users. A
quick counterexample is a poor user who wishes to pay many bills on the network
versus a rich user who only needs to send a single network transaction. In this case,
the poor user ends up unfairly paying more in the fixed fee market than the rich user.
Incidentally, there are some cognitive costs of forcing everyone to choose their own
fee. It is simple, however, to instead have everyone choose their maximum fee, and
then set the fee for everyone to the minimum fee paid in the batch of transactions,
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 21/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
which is the market-clearing fee. This largely eliminates the game played by users, and
thus the cognitive costs, when selecting fees.¹⁴
Second, fixed fees could help avoid short-term spikes in fees that have been observed
in both Bitcoin and Ethereum. While this is true by definition, this is actually not a
desirable outcome. The spikes in fees represent genuine spikes in demand for high-
value transactions. Why should a substantially lower value transaction be artificially
advantaged (relative to the dynamic fee outcome)? Forcing the fees to be consistent
and smooth does not eliminate these swings in demand — it merely makes it so
transaction confirmation behavior is a lot less certain and well behaved. Opaqueness is
a far cry from equity.
The third and most plausible, but still ultimately unconvincing, argument for fixed
fees is it simplifies the user experience and eliminates the possibility of “fat finger”
fees. This phenomenon appears to be relatively rare even in the remarkably user-
unfriendly world of crypto and is much better solved at the user application level
rather than at the protocol level. Simple checks like limits on fees, suggested fees, and
additional abstraction of the user away from the underlying protocol can eliminate the
vast majority of these occurrences. Levying the requirement on the base protocol to
make up for poorly designed user experiences at the expense of network efficiency is a
poor development approach.
Dynamic
The best basic fee model is dynamic fees. As stated in the model definition, allowing
users to set their own fee and letting validators select the transactions with the highest
fees for processing results in an efficient market for fees. This market incurs no
deadweight loss and maximizes overall social utility and network efficiency.
The dynamic fee market automatically adjusts to changes in capacity and demand and
efficiently allocates space to the highest utility transactions. This is a far better
outcome than the effective lottery imposed by the other models, where many low-
value transactions will take space from higher-value transactions.
The merits of this model have been touched on in the discussion of the other fee
models, but there are a few additional features that are worth mentioning.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 22/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Dynamic user defined fees allow users to effectively place “limit orders,” where they
can submit a low value transaction with a commensurately low fee. If the current
market clearing fee exceeds this set fee, the transaction can wait until a period of less
demand, when it will automatically be processed.
Most of the benefits of dynamic fees are observable at capacity. Before capacity is
reached, the equilibrium fee level should be less than or equal to the fixed fees or
implied inflationary fees (assuming that the latter two fees exceed the cost of
validation; otherwise the network is not sustainable). This means that the user of the
dynamic fee network is never worse off than users of other networks in the long run.
To the extent that the network capacity can vary with validator hardware, the rise in
fees when capacity is reached will encourage existing validators to upgrade their
hardware and better validators to join the network. The result is a higher performance
network that benefits all users.
A common critique of non-zero direct fee models is that they complicate token
transactions. For example, a stablecoin token user on Ethereum must buy Ether in
addition to the stablecoin to pay the gas fees. Once again, this is a user experience
rather than protocol issue, and making a quick fix at the protocol layer that erodes its
efficiency and overall usefulness is the wrong approach. As user experience continues
to improve, many of these issues can be easily abstracted away. Few users have
difficulties navigating the use of credits in mobile games or online services, and
network tokens held to pay fees can be viewed much the same way.
Ultimately, increasing capacity, rather than fiddling with fee models, is the best
approach to making fees equitable and accessible. Of the four basic fee models, only
dynamic fees do not have any serious long-term drawbacks.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 23/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
self-contained fee market. This would seem to suggest that there is no place for
inflation in an economically rational design.
However, there are some additional macro considerations that impact this analysis and
suggest that there is a place for inflation in conjunction with a direct fee.
Inflation can help bootstrap an immature network to broader adoption in several ways.
First, it subsidizes early adopters at the expense of existing token holders. This is
equivalent to the founders and early investors in the network providing an incentive to
early adopters, which is a very common business strategy.
Second, inflation that exceeds the cost of validation can enable early users to transact
with zero fees for themselves, which can streamline the user experience. While it is a
poor long-term strategy to bend the protocol to deal with UX issues, the reality is that
the state of crypto infrastructure remains quite poor and justifies accommodating
initial users to get the network off the ground.
Third, inflation can help distribute tokens to early adopters who are meaningfully
contributing to the network. By providing a compelling value proposition at an early
stage, the network can attract strong validators that increase network decentralization
and robustness. Note that all of these benefits are short-term; at maturity, inflation for
the sake of users is harder to justify.
Nevertheless, there are compelling reasons to keep some inflation in the network long-
term: macroeconomic stability. The consensus in central bank monetary policy is that
optimal inflation in an economy is around 2% per annum. While antithetical to the
early crypto ethos that is highly critical of inflationary policy, a low amount of inflation
has clear benefits to an economic system by reducing frictions and promoting overall
growth.
The dangers of the alternative — deflation due to a growing economy with constant
monetary supply, like Bitcoin — are incontrovertible. By promoting hoarding of
money, deflation introduces frictions into the economy, which can result in a severely
adverse positive feedback loop called a deflationary spiral.
Before the introduction of modern central bank policy, deflation was at the center of
many of the most severe economic crashes. By maintaining some modest inflation, a
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 24/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
crypto network can grease the wheels of its economy and mitigate several existential
risks.
Finally, there is a plausible reason to broadly tax the token holders on a network via
inflation. All users of the network derive a genuine benefit from the network’s
existence, whether they are currently using it or not. The very option of being able to
use an efficient, cheap, secure, and decentralized network going forward is a positive
externality — for example, as a hedge against potential censorship or infrastructure to
build a future business. While it is imperfect in its impact, an inflation tax does
accurately represent that not only the direct users of the network benefit from its
existence.
At Logos, we have concluded that the best approach is dynamic, user-paid fees plus
modest inflation. This combines the lessons of both the microeconomic and
macroeconomic models to promote sustainable growth across Logos’ life cycle.
By permitting users to choose their own fees and validators to prioritize transactions
accordingly, we can maximize overall network effectiveness and usefulness. The
dynamic fee model yields the best microeconomic outcome by responding instantly to
changes in demand and encouraging sustainable network growth.
The inflation component helps jumpstart the initial growth of the network in the short
term. In the long term, a reasonable level of inflation keeps the network economy
running smoothly and avoids major macroeconomic risks. By design, Logos
concentrates the most expensive validation tasks in the hands of a relatively small
number of delegates (while ensuring that these delegates are strictly accountable to
the rest of the network, and, thus, that the network has a high level of security). As a
result, a small amount of inflation can be a very large reward for the delegates,
ensuring healthy competition that maximizes network performance. Such a level of
inflation imparts very little deadweight loss on the overall network (provided that
there is a dynamic fee to eliminate the “lottery effect”), making this a good
compromise.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 25/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Conclusion
Ultimately, there is no single right economic fee model, and even top economists will
disagree over what is the proper level of inflation. Economic models are inherently
simplifying and can bely much of the complexity present in a market. While simple in
most respects, crypto has several unique properties that confuse this analysis in the
short term, particularly the emotionally charged ideologies that are inseparable from
the users of many networks.
Nevertheless, this does not invalidate the model conclusions. By applying simple
principles that are logically true at a mature, rational economic equilibrium, we are
able to see that the biggest buzz fee models — zero fees, fixed fees, and inflation only —
have severe limitations that will significantly impair networks that use them. While
alternative models may promote short-term growth, it is critical for projects and
communities to be realistic about what will work in the long term if they wish to
succeed.
[1] Note that this isn’t strictly consistent with the empirical evidence from Bitcoin, but
uneconomic choice of transactions is declining as miners improve and legacy selection
rules that emphasized other traits are phased out. See Section 3.3 of this paper for
more info.
[2] This simplicity contrasts with the relative complexity of the payment interchange
fee market, where multiple intermediaries must be induced to participate in the
network.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 26/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
[3] We are ignoring big changes in hash power in a PoW network for simplicity.
[4] A related phenomenon is when people accept a lower salary to work in a field that
they are passionate about or strongly believe in.
[5] In reality, each participant will have a different “enthusiasm” utility, but we can
assume a constant shift down in the supply curve for simplicity.
[6] An interesting exception to this rule is sharding, but sharding itself is limited, and
the prevailing wisdom that sharding can scale a network without limit is provably
false. In general, sharding just pushes out this scaling problem to each shard.
[7] The fixed capacity should not be confused with the ability of the development team
to increase that capacity. The fixed capacity results in a vertical supply curve, and an
increase in that capacity would shift that curve right. This is very different than an
upward sloping supply curve, as the former requires an exogenous network upgrade,
while the latter occurs dynamically at a given network configuration.
[8] Spoiler alert — the dynamic fee model is the economically best fee model.
[9] Without getting too technical, IOTA lacks any Byzantine fault tolerance and is
susceptible to double spend attacks.
[10] This is not true in proof-of-work networks where simple payment verification is a
non-trivial problem, but more advanced consensus models make SPV simple and
secure.
[11] for a good discussion of this issue, see the comments of this article.
[12] There is no endogenous increase in total network value with inflation. The
previous holders now own 90% of the total token supply, while the validators now own
10%.
[13] This logic also holds for an inflation only model that does not sufficiently reward
validators.
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 27/28
2/12/23, 12:07 AM Crypto Transaction Fee Economics Primer | by Michael Zochowski | Logos Network | Medium
Decentralization Fintech
Search Medium Cryptocurrency Blockchain Blockchain Technology
https://medium.com/logos-network/crypto-transaction-fee-economics-primer-948d1d93a4f5 28/28
2/12/23, 12:09 AM Crypto Wallets, Explained. What is a crypto wallet? | by Blockchain.com | @blockchain | Medium
Published in @blockchain
Blockchain.com Follow
Save
Unlike a regular wallet, a crypto wallet doesn’t actually hold your assets. Instead, it
stores credentials called private keys that give you access to your assets on the
blockchain.
https://medium.com/blockchain/crypto-wallets-explained-f9199e621366#:~:text=A crypto wallet is a,your assets on the blockchain. 1/8
2/12/23, 12:09 AM Crypto Wallets, Explained. What is a crypto wallet? | by Blockchain.com | @blockchain | Medium
Store crypto
Interact with web3 applications that let you lend and borrow against your crypto
To recap: crypto wallets store your public and private keys as well as a linked receiving
address so you can send and receive crypto securely
Whenever someone sends crypto from their wallet, they must use their private key to
“sign,” or confirm, the transaction. This digital signature is like a fingerprint, unique to
each individual and their private key, proving that the transaction is coming from the
legitimate owner of the wallet and hasn’t been tampered with.
Crypto wallets all begin with a private key, a long, randomized string of letters and
numbers. These private keys can also take the form of a QR code or mnemonic phrase.
This private key is used to generate a public key through an encryption process. While
it’s easy to verify that a specific private and public key fit together as a pair, you can’t
“work backwards” and figure out a private key from its public key.
Next, the public key undergoes a mathematical function that “compresses” it into a
receiving address (either a QR code or a shorter string of numbers and letters) where
you can actually send crypto.
You can generate many public keys — each with their own separate receiving address
— from one private key.
Most of the time, you don’t interact directly with these digital keys. Instead, they get
stored in wallet files or managed by crypto wallet apps.
When you use your private key to sign a transaction, the network can verify that the
private and public keys represent a pair — while still maintaining the privacy of the
information.
Since anyone can remove funds from an address with that address’s matching private
key, it’s critical to protect your private key information.
Again, crypto wallets usually manage your private and public keys for you, but it’s
important to know that they exist and what they do.
Arguably, though, the greatest benefit is the ability to custody your own funds, or “be
your own bank.”
When you hold assets at a traditional financial institution, like a bank or broker, you
entrust them with your private information and rely on them to keep your funds safe.
They may also charge fees for their services.
With any cryptocurrency wallet that lets you remain in control of your private keys,
you are in complete control of your assets. No one can access your funds without your
permission, and you don’t have to pay anyone to custody your funds.
This gives you full control of your cryptocurrency and helps keep it safe from hacks,
scams, and theft. In countries facing high levels of inflation or capital controls, crypto
wallets give people a way to store value that can’t be confiscated by their governments.
To recap: Crypto wallets that let users hold their private keys make self-custody possible for
everyone.
That said, not all crypto wallets are created equal. Read on to discover the different
kinds of crypto wallets you can select.
There are two main types of crypto wallets: custodial and non-custodial.
Custodial wallets
Custodial wallets are like bank accounts.
They are managed by a third party, which could be an exchange, a company, or even
just another crypto user. These wallets are convenient because you don’t have to worry
about losing your private keys or managing them yourself.
However, custodial wallets come with risks. Because a third party manages your
crypto, they also control your crypto keys. This means that if the company goes out of
business or is hacked, your crypto could be at risk.
Non-custodial wallets
Non-custodial wallets are the opposite of custodial wallets.
With a non-custodial wallet, you are the only one who has access to your private keys.
This might sound like a recipe for disaster (after all, if you lose your keys, you lose your
crypto), but non-custodial wallets actually offer two big advantages.
First, because you are the only one who has access to your private keys, non-custodial
wallets are much more secure than custodial wallets. If a non-custodial wallet is
hacked, your crypto is safe because the hacker does not have your private keys.
Second, non-custodial wallets give you full control of your crypto. This means that you
can use your crypto however you want, without having to worry about third-party
restrictions.
If you are new to crypto or just want to dip your toe in the water, a custodial wallet
might be a good choice. These wallets are easy to use and require no special expertise.
If you want total control over your crypto or plan on using web3 applications, a non-
custodial wallet is the way to go. These wallets might be slightly more complicated to
use, but they offer greater security and flexibility.
The Blockchain.com Wallet gives you custodial and non-custodial wallet options in the
same app, making it easy to buy, sell, store, and secure your crypto with less effort than
managing multiple wallets or apps.
We call our custodial wallet a ‘Trading Account’ and our non-custodial wallet a ‘Private
Key Wallet’.
Published in Coinmonks
Save
Overview
Hi all! It has been a while since I wrote the previous article as the DeFi space keeps
people busy every day. As a heavy user myself, I want to write this post to share my
insights on choosing crypto wallets. I will mainly focus on Mobile and Non-Custodial
wallets (meaning that you have full control of your private key), as I think this is the
safest and most convenient way to interact with the blockchain on a day-to-day basis.
Let’s get started! :)
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 1/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
Comparison Metrics
Here is a list of important points I will be considering when choosing wallets:
1. Safety: Are my funds safe in the wallet? Can I have full control of my funds by
holding my private key? Can the wallet provider do malicious things with my
private key?
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 2/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
2. Usability: Is the wallet easy to use intuitively? so that I won’t accidentally press a
weird button and lose all my funds?
4. Compatibility: Can I use the wallet to interact with any blockchain I want? Or I will
need to download many different wallets just to interact with a specific
blockchain?
5. Functionalities: Are there additional cool features exclusive to the wallet? For
example, some wallets offer better staking rates to keep growing your crypto while
locking it in the wallet. Some wallets also offer direct fiat-to-crypto purchasing and
a one-pager to invest in different DeFi products.
The Comparison
1. MetaMask
One the most well-known and popular wallets that offers any customization
Safety: ★★★★★
Seed phrases and private keys are encrypted with your password. You have full control
of all your private keys. Your funds are at risk only when a hacker has full access to
your computer AND password.
Usability: ★★☆☆☆
This wallet is not designed for newbies and would require users to have a medium level
of knowledge to make the best use of it. For example, users have to know how to
properly control their private key and be sure not to connect wallet on malicious
websites. Also, a lot of custom assets are not displayed automatically in the wallet until
you manually add the token address here.
Conveniency: ★★☆☆☆
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 3/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
Although it has DApp browser in the wallet, it requires you to have the native currency
to interact with the blockchain. For example, if you want to interact with Ethereum,
Polygon, Solana, BSC, and Tron at the same time, you will have to hold a small amount
of ETH, MATIC, SOL, BNB, TRX in your wallet.
Compatibility: ★★★★☆
It is my favorite wallet because it has the best compatibility! You can interact with ANY
EVM compatible blockchain on MetaMask as long as you have the Network RPC URL
(See this guide to add custom networks here). Best of all, you can add ANY assets,
including NFTs you issued yourself, to be shown in the wallet. However, other non-
EVM compatible blockchains like Flow and Solana cannot be added to MetaMask.
Functionalities: ★★☆☆☆
Users can purchase crypto with fiat in the app (Apple Pay / Wyre / Bank). In addition,
there is a swap feature released recently to get the best price from decentralized
exchanges (charging 0.743% fee). Except these, there are only basic features like
transfer, receive, browse DApps, and display assets.
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 4/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
2. Blocto
One of the most user-friendly wallets that require zero transaction fee and the main
mobile wallet to interact with the Flow Blockchain.
Safety: ★★★★★
Both custodial and non-custodial options are available, so the security is the same as
MetaMask if you opt-in the non-custodial mode.
Usability: ★★★★★
This wallet is designed especially for crypto newbies. When you enter the DApp
browser, it shows a list of commonly used DApps so that users don’t need to memorize
website URLs and potentially navigate to the wrong ones. On the tokens page, you also
don’t need to know how to “switch networks” to receive tokens on different
blockchains. You can view all assets on one screen.
Conveniency: ★★★★★
Besides having DApp browser, it pays the transaction fee for you for all blockchain with
Blocto points! Once registered, you will receive 3000 FREE points to send transactions,
meaning that you can try out DApps at zero cost! Blockchain newbies don’t have to
understand the use of native currencies.
Compatibility: ★★☆☆☆
As it is not designed for advanced crypto users, you cannot add other blockchains
freely to the app. Currently they support Ethereum, Binance Smart Chain, Tron, Flow,
and Solana (soon). You also cannot add customized assets. All tokens and NFTs can only
be listed by the Blocto team. This is to prevent newbies from accidentally touching
unknown tokens or blockchains. Also noted that it is very expensive to create
Ethereum account as it is a smart contract wallet.
Functionalities: ★★★★★
This is the ONLY software wallet for the Flow blockchain to stake tokens (earn FLOW
by locking tokens in the app), swap (exchange FLOW & tUSDT), and display NFTs
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 5/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
(showcase your NFTs on Versus and maybe NBA Top Shot in the future)! So there is no
second option if you want to interact with Flow. In the meantime, it allows purchasing
crypto with fiat (Moonpay).
3. imToken
The wallets that have the most monthly active users (maybe more than MetaMask!),
Asian users (has WeChat support), and rich functionalities.
Safety: ★★★★★
Similar to MetaMask, it allows you to take full control of your private keys.
Usability: ★★★☆☆
As this app is not designed for newbies, it has more advanced settings which may seem
confusing. For example, you need to switch to different blockchains using the sidebar
to interact with them. However, it’s better than MetaMask in that it automatically
detects and shows any type of assets you have, which you can choose whether to
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 6/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
display in the app or not. It also has a rich DApp browser home screen showing many
common apps by category.
Conveniency: ★★☆☆☆
Compatibility: ★★★★★
They offer great compatibility which users can add customized network RPCs just like
in Metamask. Best of all, they have over 10 blockchain networks available for use by
default without requiring users to add these RPC networks themselves. (See this guide
to add custom networks)
Functionalities: ★★★★★
This wallet contains one of the richest functionalities in one single app. Not only can
you stake and swap tokens (Tokenlon) directly in the app, but also see the latest market
price of each asset!
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 7/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
4. Math Wallet
The wallet that supports most blockchains (more than 65 types) by default.
Safety: ★★★★★
Similar to MetaMask, it allows you to take full control of your private keys.
Usability: ★★★★☆
Again, this wallet is for more advanced users who want to be able to interact with all
kinds of blockchains. It’s better than MetaMask in that you don’t need to manually add
many blockchains RPC URLs by yourself. It’s one click away! Similar to imToken, it
shows a long list of command DApps in their browser.
Conveniency: ★★☆☆☆
Compatibility: ★★★★☆
It supports most types of blockchains I’ve ever heard of (except Flow, Flow is only on
Blocto). However, you cannot add customized networks as well.
Functionalities: ★★★★★
They have a very interesting and useful feature — Cross-chain Swap, where you can
exchange tokens between different blockchains directly. Other than this, they have a
news tab showing the latest trend in the crypto world.
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 8/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
5. Zerion
The app to manage your entire DeFi portfolio on different chains in one place.
Safety: ★★★★★
Similar to MetaMask, it allows you to take full control of your private keys.
Usability: ★★★★★
This app comes to the top of my mind when I want to view all my DeFi positions! I have
used InstaDApp, ApeBoard, etc, and found that this app and Zappar (no app yet)
support the most types of DeFi assets on different blockchains. It also shows real-time
prices, profit and loss, price line charts to give you an overview of how your portfolio is
going.
Conveniency: ★★☆☆☆
There is no DApp browser inside the app. When you click on features such as swap
token, it will redirect you to imToken to confirm and execute the transaction. Thus,
you will have to hold native currencies in imToken.
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 9/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
Compatibility: ★★★☆☆
Functionalities: ★★★★★
It has the most comprehensive dashboard of DeFi products and tokens to invest in! For
example, you can get an overview of how each token grows recently, buy DeFi indexes
(such as DPI), and deposit in Curve pools using the shortcut in the app (later redirected
to imToken to finish the transaction)!
6. Trust Wallet
The wallet with the best UI for the minimalist lifestyle
Safety: ★★★★★
Similar to MetaMask, it allows you to take full control of your private keys.
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 10/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
Usability: ★★☆☆☆
Conveniency: ★★☆☆☆
DApp browser is in the app. However, you still need to have native currencies.
Compatibility: ★★★☆☆
Over 35 types of blockchains are supported. However, you cannot add additional
blockchain networks to the app.
Functionalities: ★★☆☆☆
Similar to Blocto, it allows crypto purchasing with Moonpay. It also offers token
swapping and BNB staking (for some reason I can’t stake on iOS app) feature directly in
the app. Other than these, only basic functions are provided
(Screenshots from the Trust Wallet app :D It also has light mode)
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 11/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
Wrap up
Now you have an overview of 6 different mobile wallets and their comparison in terms
of safety, usability, conveniency, compatibility, and functionalities. One side note is
that although all wallets are ranked 5 stars in safety, all of the above are “hot”
(software) wallets and they are not as secure as “cold” (hardware) wallets such as
Ledger. You should only keep the assets that you’ll be using frequently in hot wallets.
In the next post, I will cover 5 more wallets, including Argent, Crypto.com,
TokenPocket, Coin98, and 1inch. Feel free to suggest your favorite wallet for me to
review!
Thank you for your time reading. Any suggestions are welcomed and feel free to point
me out if anything is unclear. See you next time! :)
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 12/13
2/12/23, 12:11 AM The Ultimate Guide to Cryptocurrency Wallets (1) | by 李婷婷 Lee Ting Ting | Coinmonks | Medium
Search Medium
https://medium.com/coinmonks/the-ultimate-guide-in-choosing-cryptocurrency-wallets-1-d8ae5b49a957 13/13
2/12/23, 12:13 AM How To Generate Public and Private Keys for the Blockchain | by Artiom Baloian | Medium
Save
Introduction
Public Key Cryptography, or Asymmetric Cryptography, is a cryptographic system
that uses two pairs of keys: Public Key and Private Key. This is one of the most
important part of cryptocurrency protocols, and it is used in several places: crypto
wallet creation, to ensure that crypto coins can only be spent by owners, signing of
transactions (digital signature).These are the core components of cryptocurrency
protocols. In short, if you send cryptocurrencies to others you sign that transaction
using your private key (or signature key generated from using a private key) and the
transaction is verified using your public key. So, if hackers obtain your private key, they
would be able to send your cryptocurrencies to themselves.
https://baloian.medium.com/how-to-generate-public-and-private-keys-for-the-blockchain-db6d057432fb 1/4
2/12/23, 12:13 AM How To Generate Public and Private Keys for the Blockchain | by Artiom Baloian | Medium
There are a couple of algorithms to generate public and private keys. For example,
Bitcoin protocol uses Elliptic-Curve Cryptography (ECC) and Elliptic Curve Digital
Signature Algorithm (ECDSA) for digital signature. In this article I am going to explain
Rivest–Shamir–Adleman (RSA) and compare it with ECC. RSA is one of the first and
most widely used public key cryptosystems. It is named after its founders, Ron Rivest,
Adi Shamir, and Leonard Adleman and it has become almost synonymous with public
key cryptography.
RSA Algorithm
RSA makes extensive use of arithmetic operations using modulo-n (mod n) arithmetic.
x mod n simply means the remainder of x when divided by n.
For example, 17 mod 5 = 2.
In general, RSA consists of three major parts (sometimes it makes sense to add public
key sharing):
To generate the public and private RSA keys, Alice or/and Bob (two fictional characters
who have become the industry standard for discussions about cryptography) would
perform the following steps:
1. Choose two large prime numbers, p and q. The larger the values, the more difficult
it is to break RSA, but the longer it takes to perform the encoding and decoding.
3. Choose a number e, less than n, that has no common factors, other than 1, with z
or their greatest common divisor (gcd) equals 1, gcd(e, z) = 1. In this case, e and z
are said to be relatively prime. e will be used in encryption.
5. The public key that Bob or Alice makes available to the world is the pair of
numbers (n, e) and the private, which must be secret, is the pair of numbers (n, d).
Suppose Alice wants to send Bob a message, which is represented by bit pattern
integer number m (plaintext message), where m < n. The encrypted value c (ciphertext)
of plaintext message m is c = m^e mod n
Ciphertext c will be sent to Bob. Note that Alice encrypts the message using Bob’s
public key.
To decrypt received ciphertext c Bob computes m = c^d mod n which requires use of his
private key (n, d).
The security of RSA relies on the fact that there are no known algorithms for quickly
factoring (prime factorization) a number. In this case the public value n into p and q.
RSA vs ECC
In ECC a private key is a randomly generated integer number. In Bitcoin protocol it is
256 bit
(32 bytes) integer number. A public key is calculated/derived from a private key using
elliptic curve cryptography, but not vice versa and compressed public key size is 33
bytes. ECC can use the same algorithm but with different elliptic curves to generate a
public key. Bitcoin protocol uses Secp256k1 and public keys are either compressed or
uncompressed.
RSA keys (public, private and signature) are big and key generation is slow.
On the other hand, RSA is easy to implement, while ECC is difficult to properly
implement. In December 2010, PlayStation 3 was hacked, because Sony did not
properly implement the algorithm. This is why it is recommended to use already tested
libraries like OpenSSL to generate ECC key pairs.
About a year ago I implemented an open source library called eccpem and put it on
GitHub, which generates ECC key pairs and stores them on the .pem files using
https://baloian.medium.com/how-to-generate-public-and-private-keys-for-the-blockchain-db6d057432fb 3/4
2/12/23, 12:13 AM How To Generate Public and Private Keys for the Blockchain | by Artiom Baloian | Medium
OpenSSL library.
Conclusion
Most cryptocurrency protocols use ECC & ECDSA instead of RSA. There are at least two
reasons:
1. ECC uses much less memory than RSA, which is important in crypto protocols.
Open in app
Bitcoin Blockchain Blockchain Development Cryptography Crypto Sign up Sign In
Search Medium
https://baloian.medium.com/how-to-generate-public-and-private-keys-for-the-blockchain-db6d057432fb 4/4
2/12/23, 12:15 AM Public and Private Keys in Cryptocurrency | by Blockchain Tech | Coinmonks | Medium
Published in Coinmonks
Save
Well,
https://medium.com/coinmonks/public-and-private-keys-in-cryptocurrency-c0910d6a1c20 1/5
2/12/23, 12:15 AM Public and Private Keys in Cryptocurrency | by Blockchain Tech | Coinmonks | Medium
Today, we are going to discuss public and private key, and how it is a very crucial part
of cryptocurrency.
Cool!
You all know what is a key right? In our daily life, we are using it for locking purposes,
let’s say, you have a key for your luggage, or you may have a key for your bag, etc. Like
this, we will use this key in cryptocurrencies.
You may have heard that bitcoin is based on cryptography, which is a branch of
mathematics used extensively in computer security. Cryptography means “secret
writing” in Greek, but the science of cryptography is more than just secret writing.
Ownership of bitcoin is established through digital keys, bitcoin addresses, and digital
signatures. The digital keys are not actually stored in the network but are instead
created and stored by users in a file, or simple database called a wallet. Keys enable
many of the interesting properties of bitcoin, including decentralized trust and
control, ownership, and a cryptographic-proof security model.
So, here keys come into the picture. let’s explore them.
Private Key
A private key is simply a number, picked at random. Ownership and control over the
private key is the root of user control over all funds associated with the corresponding
bitcoin address. The private key is used to create signatures that are required to spend
bitcoin y providing ownership of funds used in a transaction. The private key must
remain secret at all times because revealing it to third parties is the same as giving
them control over the bitcoins secured by that key.
https://medium.com/coinmonks/public-and-private-keys-in-cryptocurrency-c0910d6a1c20 2/5
2/12/23, 12:15 AM Public and Private Keys in Cryptocurrency | by Blockchain Tech | Coinmonks | Medium
You can pick your private keys randomly using just a coin, pencil, and paper: toss a
coin 256 times and you have the binary digits of a random private key you can use in a
bitcoin wallet. The public key can then be generated from the private key.
Example:
1E99423A4ED27608A15A261A2B0E9E52CED330AC530EDEC322C8FFC6A32S5EFYYCD0D
D
Public Key
The public key is calculated from the private key using elliptic curve multiplication,
which is irreversible: K = k*G, where k is the private key, G is a constant point called
the generator point, and K is the resulting public key. We can generate multiple public
keys from a private key, but it is impossible to generate the private key, from a public
key.
Elliptic curve multiplication is a type of function that cryptographers call a “trap door”
function: it is easy to do in one direction and impossible to do in the reverse direction.
The owner of the private key can easily create the public key and then share it with the
world knowing that no one can reverse the function and calculate the private key from
the public key. This mathematics trick becomes the basis of an unforgettable and
secure digital signature that proves ownership of bitcoin funds.
This is the basic idea about public and private keys. I am sure you got some idea of
how these work inside a cryptocurrency.
https://medium.com/coinmonks/public-and-private-keys-in-cryptocurrency-c0910d6a1c20 3/5
2/12/23, 12:15 AM Public and Private Keys in Cryptocurrency | by Blockchain Tech | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
Search Medium
https://medium.com/coinmonks/public-and-private-keys-in-cryptocurrency-c0910d6a1c20 4/5
2/12/23, 12:15 AM Public and Private Keys in Cryptocurrency | by Blockchain Tech | Coinmonks | Medium
https://medium.com/coinmonks/public-and-private-keys-in-cryptocurrency-c0910d6a1c20 5/5
2/12/23, 12:17 AM Understanding SegWit. The First layer scaling solution is… | by Ruma Das | Coinmonks | Medium
Published in Coinmonks
Save
Understanding SegWit
· Sharding
· Hard fork
· SegWit
In my last two articles, I have already covered Hard Fork and Sharding. So here in this
article, I will focus on the last scaling solution i.e SegWit.
What is SegWit?
SegWit stands for Segregating Witness
In this process, certain parts of a transaction are removed, which will free up space so
that more transactions can be added to the chain. The idea behind using this method is
to overcome the block size limit of blockchain transactions. In simple terms, SegWit
changed the way data are stored, therefore helping the Bitcoin network to run faster
and more smoothly.
It was suggested as a soft fork change in the transaction format of Bitcoin in the Bitcoin
Improvement Proposal number BIP141.
Problem Statement
In the Bitcoin platform, Blocks are getting generated every 10 minutes and are
constrained to a maximum size of 1 megabyte (MB). As the number of transactions is
increasing, more blocks need to be added to the chain. But due to the block size
constraint, only a certain number of transactions can be added to a block. The weight
of the transactions can cause delays in processing and verifying transactions.
Sometimes, it takes hours to confirm a transaction as valid. This can slow down
further when the network is busy.
The Solution
To overcome the block size limit issue and to enhance the transaction speed, the
transaction is divided into two segments. Removing the unlocking signature (witness)
from the original portion and appending it as a separate structure at the end. The
original portion will still have the sender and receiver data, and the new “witness”
structure would contain scripts and signatures. The original data segment would be
counted normally, but the new “witness” segment becomes one-fourth of its original
size.
SegWit is backward compatible, which means nodes that are updated with the SegWit
Bitcoin protocol can still work with nodes that haven’t been updated.
Since segregated witness creates a sidechain where witness data is stored, it prevents
transaction IDs from being altered by dishonest users. It also addresses signature
malleability, by serializing signatures separately from the rest of the transaction data,
so that the transaction ID is no longer malleable.
History
Pieter Wuille, a bitcoin developer, first proposed the concept of SegWit.
On 24 July 2017 as a part of the software upgrade process i.e Bitcoin Improvement
Proposal (BIP) 91, the concept of Segregated Witness is activated at block 477,120.
Within one week of implementation, the bitcoin price seen a spike of 50%. The
transaction usage rate using SegWit further increased from 7% to 10% in the first week
of October. As of February 2018, SegWit transactions exceed 30%.
SegWit acts as a base component for the Lightning Network. By implementing SegWit,
the transaction malleability issue can be prevented which will allow this secure
payment system to process millions of transactions per second in the Bitcoin network.
Advantages of SegWit:
· Prevents transaction malleability problem.
Conclusion
There is no doubt that Bitcoin technology is very revolutionary but like any other
technology, it has certain drawbacks as well as challenges. Scaling is one of them
which has restricted in large scale applications adopted. It is capable of processing
only 7–10 transactions per second on the base layer. Many developers, researchers
from the Bitcoin community are working hard to overcome the problem. SegWit along
with the Lightning Network together aiming to allow Bitcoin to process millions (or
more) transactions per second. But the real scenario will depend on the success of
future projects.
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
Search Medium
Published in Coinmonks
Save
Before we look at the definition of Segregated Witness, let’s go back to the Bitcoin
History for a better understanding of SegWit.
Blockchain:
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 1/7
2/12/23, 12:20 AM Segregated Witness Simplified.. The Cryptocurrency world is abuzz with… | by Geet Sameer | Coinmonks | Medium
For a regular fiat currency (paper money) online transaction, A should have an
account number, transaction password( or PIN) to send the money and of course
money in his bank account. And also A needs B’s bank account number.
Similarly to send Bitcoins A needs an address( which is similar to the bank account), a
private key(identical to transaction password or PIN) to sign the transaction data
digitally, and also A needs the address of B( similar to the bank account).
Verification of transaction:
As we learned earlier bitcoin is not centrally regulated. Then Who verifies the
transactions? The answer is bitcoin miners. Who are miners? Miners can be anyone. It
can be you or I who verifies the bitcoin transactions using powerful computers. What
do miners get in return? Miners are rewarded with Bitcoins for successful verification
of each transaction.
Let’s look how the verification of the transaction is done on the blockchain.
So first the miners check whether A has sufficient funds that is 1 bitcoin( As told
earlier all the information of bitcoin data and bitcoin itself is stored in Blockchain
network.)
Now the question arises, how do the miners know how many bitcoins A have?
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 2/7
2/12/23, 12:20 AM Segregated Witness Simplified.. The Cryptocurrency world is abuzz with… | by Geet Sameer | Coinmonks | Medium
Simple. Using the digital signature on the transaction data and the Address of A, the
miners run different algorithms on their computer to connect to the place where A’s
bitcoins are stored in the blockchain network. If A has the required bitcoins then
based on the transaction data (send 1 bitcoin to B), the bitcoin is transferred to B.
Now that we are clear on what constitutes a transaction and how it is verified let’s
understand Segregated Witness.
As seen earlier any transaction contain digital signature plus original data that is the
address of both sender and receiver and the transaction data. The segwit process
separates the digital signature from data and moves it to a structure towards the end of
the transaction to reduce the size of the transaction, as the digital signature occupies
65% of the transaction space.
Why SegWit:
Ok, now let’s understand why SegWit is implemented in blockchain to increase the
block size.
The increased usage of bitcoins for payments due to its popularity has resulted in
substantial transactions piling up for verification(As told earlier for any transaction to
be verified, first it needs to be added to a block).
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 3/7
2/12/23, 12:20 AM Segregated Witness Simplified.. The Cryptocurrency world is abuzz with… | by Geet Sameer | Coinmonks | Medium
As you see A’s transaction is put in waiting line (also known as Mempool in
cryptocurrency dictionary). And there is only one more transaction that can be entered
into the present block. If A wants his transaction to be verified fast, he has to pay
higher transaction fee than others before him in the waiting line. That way his
transaction gets recorded in the block before the other two and gets verified.
These cut in lines resulted in higher transaction fees which profited the miners and
exchanges with the actual bitcoin user at a loss.
To address this scalability issue, Segregated Witness process increases the block size
limit(the number of transactions added to a block)without actually increasing the
block size (1Mb) by removing the digital signature (which occupies 65 % of the
transaction volume) and adding it to the end of the transaction.
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 4/7
2/12/23, 12:20 AM Segregated Witness Simplified.. The Cryptocurrency world is abuzz with… | by Geet Sameer | Coinmonks | Medium
Scalability — Increase in block size limit increases the number of transactions that
get verified per second.
Malleability- Since the digital signature is detached from the input, the hacker
can’t change the transaction without also nullifying the digital signature which
makes it impossible to alter the data and steal bitcoins.
The segwit process increases the block size limit without increasing the actual size of
the block (1Mb). Whereas proposed SegWit2X increases the block size from the present
1Mb to 2 Mb.
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 5/7
2/12/23, 12:20 AM Segregated Witness Simplified.. The Cryptocurrency world is abuzz with… | by Geet Sameer | Coinmonks | Medium
SegWit was implemented as a soft fork in the bitcoin blockchain on 24th August 2017.
Proposed SegWit2x is the hard fork in the bitcoin blockchain. SegWit2x could not be
implemented as there are no backers.
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 6/7
2/12/23, 12:20 AM Segregated Witness Simplified.. The Cryptocurrency world is abuzz with… | by Geet Sameer | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/segregated-witness-simplified-b0e56103750f 7/7
2/12/23, 12:22 AM Ch6: Something on Private Key, Public Key & Bitcoin Address | by Khor Aik Cheow, PhD | Medium
Save
A wallet can contain multiple sets of private & public key pair and bitcoin address. A
private key is private, and you do not share it. You can however share your public key
and bitcoin address with others. However, the public key is very long. Most people
prefer to share bitcoin address, which is a shorter version of the public key. Private key
https://medium.com/@ackhor/something-on-private-key-public-key-bitcoin-address-6b0c18bb7374 1/6
2/12/23, 12:22 AM Ch6: Something on Private Key, Public Key & Bitcoin Address | by Khor Aik Cheow, PhD | Medium
is like a password for the email address where you need to keep it confidential. Bitcoin
address is similar to the email address you share with others so you can receive emails.
If you look at any of the bitcoin transactions on the blockchain explorer, you can see
the bitcoin address (highlighted in red below) on the input and output part of the
transaction.
When you click any of the bitcoin addresses, you will be shown the details of that
particular bitcoin address (such as address, format, number of transactions made,
amount of bitcoins received/sent, final bitcoins balance, and past transactions record).
https://medium.com/@ackhor/something-on-private-key-public-key-bitcoin-address-6b0c18bb7374 2/6
2/12/23, 12:22 AM Ch6: Something on Private Key, Public Key & Bitcoin Address | by Khor Aik Cheow, PhD | Medium
Wallet generates the private key, the corresponding public key and the corresponding
bitcoin address. The relationship between the private key, the public key and the
bitcoin address is shown below. The diagram might look daunting. Don’t worry about
it! Just know that the bitcoin address is generated from the public key; The public key
is generated from the private key.
https://medium.com/@ackhor/something-on-private-key-public-key-bitcoin-address-6b0c18bb7374 3/6
2/12/23, 12:22 AM Ch6: Something on Private Key, Public Key & Bitcoin Address | by Khor Aik Cheow, PhD | Medium
On the other hand, a public key is a 33/65 bytes number of 66 or 130 characters. Public
key hash is a 20 bytes number of 40 characters. Bitcoin address is 25 bytes number
with 26 to 35 characters, starting with ‘1’, or ‘3’ or ‘bc1’.
Below is a summary table comparing the size of the private key, the public key, the
public key hash and the bitcoin address.
https://medium.com/@ackhor/something-on-private-key-public-key-bitcoin-address-6b0c18bb7374 4/6
2/12/23, 12:22 AM Ch6: Something on Private Key, Public Key & Bitcoin Address | by Khor Aik Cheow, PhD | Medium
Visually, you can see that the public key is the longest string. The bitcoin address is
therefore more ‘share-friendly’ than the public key.
When a receiver gives his/her bitcoin address to a sender, the wallet of the sender will
decode the receiver’s bitcoin address back to public key hash.
Sender’s wallet can then ‘lock’ receiver’s public key hash in a P2PKH (Pay-To-Public-
Key-Hash) payment to receiver. Some articles use ‘bitcoin address’ and ‘public key
hash’ interchangeably. This article separates the two terms to avoid confusion.
https://medium.com/@ackhor/something-on-private-key-public-key-bitcoin-address-6b0c18bb7374 5/6
2/12/23, 12:22 AM Ch6: Something on Private Key, Public Key & Bitcoin Address | by Khor Aik Cheow, PhD | Medium
Beside bitcoin address, receiver’s wallet can also send public key and script hash to
sender’s wallet, so that sender can make a P2PK (Pay-To-Public-Key) and P2SH (Pay-To-
Script-Hash) payment respectively.
Remember
Open in app Sign up Sign In
· Bitcoin address is generated from public key; Public key is generated from private
key.
Blockchain Bitcoin Bitcoin Private Key Bitcoin Addresses Bitcoin Public Key
https://medium.com/@ackhor/something-on-private-key-public-key-bitcoin-address-6b0c18bb7374 6/6
2/12/23, 12:24 AM Public Keys, Private Keys and Bitcoin Address | by Karthik Margabandu | Medium
Save
Like any currency, Bitcoins have a controlled supply. The bitcoin generation algorithm
has been defined in such a manner that it takes care of how the coins will be created
and at what rate. There is no centralized party in this process.
Newer coins are generated as and when blocks are added to the chain. This is called
mining. Hence peer-to-peer transactions play a huge part in this as they are indirectly
the trigger.
Public Key is the ‘To Address’ in the transaction. It is a pair of two 256 bit numbers (512
binary digits) with a possibility of 2256 combinations. Earlier, the bitcoin Blockchain
followed ‘Pay to Public Key’ transaction method where the ‘To Address’ was the
person’s Public Key.
Both the Private and Public keys are part of the Elliptic Curve Digital Signature
Algorithm (ECDSA). This is a cryptographic algorithm that Bitcoin has adopted to
https://medium.com/@karthikmargabandu7/public-keys-private-keys-and-bitcoin-address-bf26125addf7 1/4
2/12/23, 12:24 AM Public Keys, Private Keys and Bitcoin Address | by Karthik Margabandu | Medium
ensure funds can be accessed and spent only by rightful owners and this can easily be
verified by anybody with access to the books (Blockchain).
1. Private Key is a randomly generated 256 bit integer that is similar to a password and
is advisable not to share this with others
2. ECDSA helps in deriving the Public key from the Private key
3. The Public Key Hash or more commonly called Bitcoin Address is obtained by
hashing the Public key using RIPMED160 (cryptographic function)
https://medium.com/@karthikmargabandu7/public-keys-private-keys-and-bitcoin-address-bf26125addf7 2/4
2/12/23, 12:24 AM Public Keys, Private Keys and Bitcoin Address | by Karthik Margabandu | Medium
Currently, there are different types of transactions systems that are possible — Pay to
Public Key, Pay to Public Key Hash, Multi-sig (two or more parties are required to sign
the transaction) etc.
These different systems ensure different levels of security and it’s purely up to the user
to determine the kind of transaction system preferred.
Exchanges like Coinbase have a hosted wallet service. This means that the private keys
are not given to the customers. These exchanges manage the private keys through
passwords, 2 step verification, device confirmation etc. This is part of their secure cold
storage technology. Customers only have access to their bitcoin address and the rest is
taken care of by these exchanges.
Bitcoin Blockchain network uses scripts which serve as list of instructions for each
transaction to describe how the person receiving the bitcoin can possibly gain access
to it and spend it.
These scripts are part of the ECDSA and help in locking and unlocking the transaction
input and output so that people are able to transact securely.
Eg. The output of a transaction would contain a column ‘Script Public Key’. This is pretty
much the lock for a transaction.
These scripts function well for peer-to-peer transactions but is very limited when it
comes to broader applications which led to the foundation of Ethereum Blokchain.
https://medium.com/@karthikmargabandu7/public-keys-private-keys-and-bitcoin-address-bf26125addf7 3/4
2/12/23, 12:24 AM Public Keys, Private Keys and Bitcoin Address | by Karthik Margabandu | Medium
80 2
https://medium.com/@karthikmargabandu7/public-keys-private-keys-and-bitcoin-address-bf26125addf7 4/4
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Save
Wallets are something that always stays closer and pampered. Be it the wallet we carry in our
bags or the payment wallets we use for exchanges. They are incredibly dear as they maintain
our assets. Similar is the case of a blockchain wallet. A blockchain wallet allows users to
manage different cryptocurrencies — for example, Bitcoin or Ethereum. It is software that
helps someone exchange funds quickly. Here, the transactions are cryptographically signed;
the user’s privacy and identity are preserved. Blockchain wallets do not store coins, unlike our
traditional wallets. Instead, they keep the keys of the cryptocurrency user. The coins are stored
in the blockchain. The relationship between keys-coins is similar to that between debit/credit
card- fiat currency managed by banks. Like, we conduct transactions using debit/credit cards,
cryptocurrency transactions are conducted using a pair of keys: public key & private key.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 1/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
In a blockchain wallet, the user’s account address is derived from the public key, and
anyone who knows the public key can transfer the funds quickly. However, the private
key acts like a PIN kept secret as it’s used to transfer funds from an account.
Wallets are classified based on how their keys are generated. They can be non-
deterministic(random) wallets or deterministic (seeded) wallets. In random wallets, the
keys are randomly generated values. However, maintaining a random wallet is
problematic since a user should keep a backup copy of all the keys.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 2/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Here comes the seeded wallet as aide. Here, the keys are mathematically generated
from a seed, which is a random alphanumeric number. The seed will have an alternate
representation of 12–24 English words called the seed phrase, which is user-friendly
compared to the alphanumeric representation. An example is shown below
Under seeded wallets, only seed needs to be backed up since the remaining keys can
be retrieved from it. So a single value can represent thousands of keys stored in a
wallet.
HD Wallets generate keys from the master key in a hierarchical manner, following a
tree-like pattern.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 3/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Now let us see how keys are generated in HD wallets. For that, we are taking
MetaMask. MetaMask is the commonly used HD wallet to interact with the Ethereum
blockchain.
Let’s go ahead and understand HD keys based on creating a MetaMask Wallet using its
browser extension. Detailed installation procedures and settings are omitted as we
discuss steps related to key generation alone. Check this link for the MetaMask
installation demo video.
Download the MetaMask from here. Complete the signup process. You will be
redirected to a page that has the seed phrase.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 4/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Well, How did you get the seed phrase ?. When you sign up, let’s see what MetaMask
does at the back end.
Initially, a random number will be selected as the root seed. The root seed will undergo
certain mathematical transformations, including hashing. The resulting value is used
to construct the seed phrase by choosing a sequence of 12–24 words from a BIP39 word
list. The number of words in the seed phrase depends on the size of the root seed. The
user should keep the Seed phrase secret since the wallet can be recovered using it.
Once the seed phrase is generated, MetaMask will prompt the user to re-enter the seed
phrase.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 5/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Next, is the generation of the master key. The root seed is fed as input to a hash
function and, the resulting hash is used to create a master private key and a master
chain code. The hash function consists of multiple stages of mathematical operations.
The concept of hashing is explained here.
The master public key is derived from the master private key, and the account address is
generated from the public key.
The master key is used to generate a sequence of child keys. Each of these child keys
can act as a parent key and generate a series of keys, calling grandchildren of the
master key. This can be repeated any number of times, expanding the tree structure by
increasing the number of levels. Here chain code is a value used for generating child
keys (not to be confused with chain code in Hyperledger Fabric, which refers to a
program).
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 6/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Changing the index value allows creating the other children in the sequence. In
Bitcoin, each parent key can have 2 billion children keys.
Only the seed phrase, account address and private key will be revealed to the user. The
rest of the values are used for back-end processing alone.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 7/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
There is an option to export private key, which shows the private key after confirming
the password. The private key will be required if an account needs to be imported to
another wallet.
Further accounts can be created using the options provided in the interface.
You can either create a new account using MetaMask or import an existing account by
specifying the private key.
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 8/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
If anyone tries to create a wallet in another system using your seed phrase, all your
keys can be retrieved using that seed phrase. So do not reveal the seed phrase to
anyone.
There are various types of deterministic wallets. So what is the benefit of using HD
Wallets ? Let us analyze it based on the concepts discussed.
The key generation’s tree structure can reflect the organizational structure in HD
wallets. Each branch or account can be assigned to specific departments or purposes.
It also allows a user to create multiple public keys.
The public-key, private-key, and account addresses are indistinguishable since all
follow alphanumeric format. HD wallets also provide options for creating public keys
without accessing their corresponding private keys. It is, therefore, useful in e-
Open in app Sign up Sign In
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 9/10
2/12/23, 12:27 AM Hierarchical Deterministic (HD) Wallet | by Kerala Blockchain Academy | Medium
Open in app Sign up Sign In
commerce applications like online shopping websites, where a separate address is
required for every transaction. Also, HD wallets can be used in secure servers which
Search Medium
use account addresses to read or receive funds, without providing an option to send
funds from an account. But if an adversary manages to leak a child-private key, it can
be combined with chain code to generate all the private keys of child nodes and the
parent-private key. This situation can be avoided by using the private key to derive the
chain code, which does not reveal any child’s private keys.
HD wallets provide robust privacy as separate keys can be generated for each
transaction. Since you have multiple addresses, others in the network will not be able
to figure out which addresses are linked to you. Your accounts remain secure as long as
the master key is kept secret. If you lose your recovery phrase, your coins may get lost
forever.
Some examples of HD wallets are Electrum, Trezor etc. If you are interested in trying
the key generation, check out this link.
71 1
https://kbaiiitmk.medium.com/hierarchical-deterministic-hd-wallet-4b883faab955 10/10
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
Published in Vault0x
Vault0x Follow
Save
A wallet is a system which allows the end-user to send and receive cryptocurrency
transactions by using a pair of keys and a deterministic wallet is a system of master
and child keys which are derived from a single starting point known as a seed. The
seed can be used to regenerate a wallet without the need for any other information. It
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 1/8
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
is even possible to create public addresses without using private keys. Seeds are
typically serialized into human-readable words in a Mnemonic phrase.
The Bitcoin wallets use randomly generated keys. Early wallets introduced the concept
of backing up the keys. To avoid the necessity for a backup after every transaction, 100
keys are cached in a pool of reserve keys. These wallets should not be shared or used
on multiple systems. They support hiding their private keys by using the wallet
encryption feature and not sharing the password, but such emasculated wallets can no
more generate public keys.
These shortcomings are not found in Deterministic wallets. There is no need for
frequent backups. Elliptic curve mathematics allow schemes where one can calculate
the public keys without revealing the private keys. For example, an e-commerce
business can use web server to create new public addresses for each order or customer
without knowledge of private keys.
However, still deterministic wallets typically consist of a single “chain” of key pairs.
Since, there is only one chain; wallet cannot be shared partially. However, in some
cases one only wants some (public) keys to be shared and recoverable. In the example
of e-commerce, the web server needs access to only the wallets which will be used to
receive payments. Hierarchical deterministic wallets described under BIP-0032 allow
such selective sharing by supporting multiple key pair chains, derived from a single
root.
Key Derivation
Conventions
Bitcoin uses elliptic curve cryptography with the field and curve parameters defined
by secp256k1. As standard conversion functions, we assume:
point(p): returns the coordinate pair resulting from EC point multiplication of the
secp256k1 base point with the integer p.
ser256(p): serializes the integer p as a 32-byte sequence, most significant byte first.
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 2/8
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
serP(P): serializes the coordinate pair P = (x,y) as a byte sequence using SEC1’s
compressed form: (0x02 or 0x03) || ser256(x), where the header byte depends on
the parity of the omitted y coordinate in the public key.
Extended Keys
Extended Keys are the major building principles behind the Heuristic Deterministic
wallets. Let’s see how to derive many child keys from a parent key. First of all, we
extend both public and private keys with an extra 256 bits of entropy known as chain
code. This code consists of 32 bytes and is identical for corresponding private and
public keys.
Extended private key: (k, c), with k the normal private key, and c the chain code.
Extended public key: (K, c), where K = point(k) and c the chain code.
Each extended key has 231 normal child keys and 231 hardened child keys. All child
keys have an index. Indices used by the normal child keys are from 0 through 231–1.
The hardened child keys use indices 231 through 232–1. Hardened key indices are also
written as iH representing i+231.
Before we move ahead let’s understand the normal and hardened child keys.
Hardened child key = hash(parent private key + index)
Non-hardened child key = hash(parent public key + index)
When we use an extended public key, we can derive non-hardened child public keys.
This is useful in situations where we want to accept payments without immediately
being able to spend them. For example, if we had a website selling clothes, our web
server could create an extended public key and accept payments. This will prevent any
loss of money in case server gets hacked. So that’s a reason we need non-hardened
derivation.
When we extend a private key, we can also derive hardened keys but with the risk of
putting a hash of our private key on the server.
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 3/8
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
Non-hardened public keys also have some limitations and are weaker when an attacker
has:
In this circumstance, it’s possible to work out the private key of the extended public
key. Then we can get every key that can be derived from it, hardened and non-
hardened.
To compute the corresponding child extended key, we need parent extended key and
an index i. Depending on child key being hardened or non-hardened and parent key
being private or public keys, a different algorithm is used.
The function CKDpriv((kpar, cpar), i) → (ki, ci) computes a child extended private key
from the parent extended private key:
Check whether i ≥ 2³¹ (whether the child is a hardened key). If so (hardened child):
let I = HMAC-SHA512(Key = cpar, Data = 0x00 || ser256(kpar) || ser32(i)). (Note: The
0x00 pads the private key to make it 33 bytes long). If not (normal child): let I =
HMAC-SHA512(Key = cpar, Data = serP(point(kpar)) || ser32(i))
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 4/8
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
The function CKDpub((Kpar, cpar), i) → (Ki, ci) computes a child extended public key
from the parent extended public key. It is only defined for non-hardened child keys.
Check whether i ≥ 2³¹ (whether the child is a hardened key). If so (hardened child):
return failure. If not (normal child): let I = HMAC-SHA512(Key = cpar, Data =
serP(Kpar) || ser32(i)).
To formulate the public child key from private parent key. The functions defined above
can directly be used:
This is not possible as the public key doesn’t hold the required information.
We build the tree up with one root, the master extended key m. By evaluating
CKDpriv(m,i), which is defined above for several values of i, we get a number of level-1
derived nodes. As each of these is again an extended key, CKDpriv can be applied to
those as well.
source: https://github.com/bitcoin/bips/blob/master/bip-0032/derivation.png
The total number of possible extended key pairs is almost 2512, but produced keys are
only 256 bits long. Master keys are generated from potentially short seed value and not
directly.
Generate a seed byte sequence S of a chosen length (between 128 and 512 bits; 256
bits is advised) from a (P)RNG.
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 6/8
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
Serialization of Keys
1 byte: depth: 0x00 for master nodes, 0x01 for level-1 derived keys, ….
4 bytes: child number. This is ser32(i) for i in xi = xpar/i, with xi the key being
serialized. (0x00000000 if master key)
33 bytes: the public key or private key data (serP(K) for public keys, 0x00 || ser256(k)
for private keys)
This 78 byte structure can be encoded like other Bitcoin data in Base58, by first adding
32 checksum bits (derived from the double SHA-256 checksum), and then converting to
the Base58 representation. This results in a Base58-encoded string of up to 112
characters. Because of the choice of the version bytes, the Base58 representation will
start with “xprv” or “xpub” on mainnet, “tprv” or “tpub” on testnet.
This section specified key trees and their nodes. The next step is to create a wallet
structure on this tree. The clients are encouraged to use this layout as a guide, though
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 7/8
2/12/23, 12:29 AM Hierarchically Deterministic Wallets — The Concepts | by Vault0x | Vault0x | Medium
the layout defined in this section is a default only. In the next section we will discuss
how this concept can be used to apply to different types of wallets? And how this
makes a more secure wallet?
Search Medium
https://medium.com/vault0x/hierarchically-deterministic-wallets-the-concepts-3aa487e71235 8/8
2/12/23, 12:43 AM What is Ethereum?. The ultimate guide to understand… | by Michele D'Aliessi | Medium
Save
What is Ethereum?
The ultimate guide to understand Ethereum in simple words.
Why is it so interesting?
Well, first of all it is “decentralised”: this global computer runs on a network of
machines (nodes) distributed around the world (more specifically, it runs on a
blockchain). This means that it cannot be stopped, you can’t just unplug it or halt its
operations. In fact, anyone who wants to run a node of the network can do so from any
computer connected to the internet, without asking for permission. Also, being
decentralised, it cannot be easily hacked¹ because there is no central point of failure.
Who actually runs Ethereum then? It doesn’t belong to anyone. There is no single
entity who controls it, as of today it is governed by a community of software developers
that write code and run the nodes of the network using their computers. With no single
entity managing it, Ethereum is a truly decentralised project which is being built by
the crowdsourced work of many skilled computer programmers. The efforts for
improving Ethereum technology are coordinated by the Ethereum Foundation, a non
for profit organisation who’s mission is to “[…] build a more globally accessible, more
free and more trustworthy Internet”.
It’s an open project, in fact anyone can make use of this global computer. It can have as
many users as we want, and anyone can both read the code that such computer is
running or write new code that the computer can run. This means you can run your
own applications on it, or just use applications developed by others. Ethereum code is
open source and available on github.com/ethereum.
There is no middleman, users can interact directly with other users with no third party
involved. And when you decide to interact via an application built on Ethereum by a
third party you can read the code directly to make sure the application does what it
says it does. No middleman, no surprises².
The code running on Ethereum is immutable. The transactions, the data stored, the
programs written are permanent. Once deployed on the global computer they cannot
be changed. This means that not only you can verify the code of any application and
understand what it does, but it also means once you’ve verified it you can be sure
nobody will be able to change it ex-post. Written, running code cannot be changed³.
The interactions with this computer are extremely secure. In fact, any interaction with
the computer (being it deploying new code, interacting with existing applications or
exchanging value) is cryptographically signed - which in simple words means that it
can not be altered or replicated⁴.
You own your data, you keep your value. On Ethereum each user will be able to decide
which data to share and which data to keep, so you will be in full control of who uses
your data and what for. Moreover, should your data generate value (i.e. like all the data
you share on Facebook, that is a goldmine for advertisers) you will be able to retain
(and profit from) that value too.
As you can see from the chart below, Ethereum attracted a lot of attention lately and its
adoption rate is growing exponentially.
Let me give you an example. Imagine Jack has solar panels installed on his roof and his
neighbour Alice would like to use Jack’s renewable energy to recharge her electric bike
during peak time at midday. However, each charge is worth just a few cents and they
don’t want to deal with exchanging a few pennies every day after each charge. If Jack
and Alice would like to automate the payment in a smooth, seamless fashion they
could just write a smart contract on Ethereum (nothing crazy, it’s just some code) that
checks how much energy Alice’s bike is using from Jack’s solar panels, multiplies it by
the current electricity market price (at the time of the charge) and transfers the correct
amount from Alice’s account to Jack’s one automatically. Done. No third party. No extra
fees charged.
Is the technology ready to be used? Yes, so much so that the United Nations are using
it to provide food to thousands of refugees.
Identity management. Since each user on the Ethereum platform signs digitally all
his/her interactions with smart contracts or other users, it is possible to associate
an identity to a user and all actions performed by that user will be connected to
his/her identity. - Civic and Blockstack are two projects that aim at managing identity
on the blockchain.
Crowdfunding. Ethereum smart contracts allow you to generate tokens that can be
sold in exchange for “real money”, effectively funding your new project or new
venture. Very much like Kickstarter or Indiegogo, but without the need to rely on a
third party. - Read more about Initial Coin Offering (ICO).
Marketplaces. Imagine building an Airbnb where guests can interact directly with
hosts and that has no service charges, or a Facebook where users interact directly
own all their data and get a share of the payment advertisers do to gain their
If you would like to learn more about how Ethereum works behind the scenes, the
short article below covers the logic and mechanics of how Ethereum works.
Useful links
Learn more about Ethereum project - link
How to get your own Ethereum online wallet - 10$ free on Coinbase
How to install and run your own Ethereum node - link (pro)
If you found this article useful please hit the “Clap” button👏 on the left as many times as
you feel like or donate some Ether (ETH) to my address below:
0x7cf57FE1310f832B16bE1f38c2710bDfD2f820D5
Notes:
1. In order to “hack” the network, a potential hacker would need to control 51% of the
computing power of the whole network and forge malicious blocks. This is really
hard to do because the mechanics of how blockchain works. Follow this link if you
want to learn more.
2. Surprises can still happen if hackers mess up with the code. While it’s hard to hack
the blockchain which runs Ethereum, it’s fairly easy to identify bugs in the smart
contracts used to run applications on top of this platform. Therefore, proof testing
the code of smart contracts becomes essential to avoid major hacks.
3. The deployed code cannot be changed unless the community running the whole
network agrees to do so with a “hard fork” or “soft fork”. These forks are hard to
implement and rewrite part of the blockchain database behind Ethereum. You can
learn more about blockchain forks on Wikipedia.
Published in DataDrivenInvestor
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 1/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
By 2011, many individuals became interested in earning Bitcoin and one of them was a
17-year-old named Vitalik Buterin. To earn Bitcoin, he started writing for Bitcoin Weekly
— the owner of which offered 5 Bitcoins per article. When that site closed down due to
insufficient funds, Mihai Alisie reached out to Vitalik to start a new publication. They
formed the Bitcoin Magazine — later dubbed as the first serious publication on
cryptocurrencies.
Fast forward to 2013, Vitalik published a white paper arguing that “Bitcoin needed a
scripting language for application development”. When that thought failed to gain
traction, he proposed the development of a new platform. From there, along with
Gavin Wood, Joseph Lubin, and Charles Hoskinson, he co-founded Ethereum.
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 2/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
The main intention of Ethereum is to provide a decentralized network that can be used
to build and run applications. Similarly, Ether’s main purpose is to power this network.
Ethereum is also powering NFTs because of ERC-721 NFT Token Standard. This token
allows a person to permanently link a digital asset to the token.
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 3/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
In addition, EVM enables the environment for building, deploying, and operating
Smart Contracts. These Smart Contracts are essential in building Decentralized Apps
(dApps).
EVM is the bridge that creates the user interface for Blockchain
technology. Like Shopify uses the web to enable end users, EVM (in a
more robust way) uses Blockchain to make it accessible to end users.
Ether
However, running EVM is not cheap.
Ether is the cryptocurrency that pays for the operations within the Ethereum network.
Every program, action, and service in the Ethereum network requires computing
power. Ether is the payment method network participants use to complete operations.
If you are familiar with how Blockchain works, you know that to
establish a block, miners have to complete a complex mathematical
equation. After completing an equation in Blockchain, miners get
Bitcoin as a reward. Ether serves the same purpose for Ethereum.
In addition to that, Ether is required for every transaction and using or building any
dApp. The user who requests the transaction can set the amount of Ether they’re
willing to pay. However, higher payment guarantees faster processing time. Crypto
wallets like Metamask allow users to see how much time is required to complete a transaction
and show a recommended fee.
Gas
The same way a car needs fuel, gas powers the Ethereum network. It is the unit that
refers to the amount of computational effort required for completing operations on the
Ethereum network.
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 4/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
To purchase gas, users need to spend Ether. The unit used for Gas is Gwei (Giga Wei)
which equals 0.000000001 ETH. Gas price is usually a multiple of Gwei.
After the London Upgrade in September 2021, a base fee has been set for each block.
Users can add a tip (priority fee) with the base fee if they want to reward the miner
more.
For example, John wants to send 1 Ether to Edith. That transaction has
a gas limit (requirement) of 10,000. The base price of gas is 100 Gwei
and John adds 10 Gwei as the tip. Total transaction fee would be = Gas
Limit * (Base Price + Tip) = 10,000 * (100 + 10) = 1100000 Gwei. That
equates to 0.0011 ETH. In total, John will pay 1.0011 ETH, Edith will
receive 1 ETH and the miner will get 0.0011 ETH.
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 5/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
Identity verification
Currency exchange
E-commerce
Documenta notarization
Social Network
Message Platform
While most cryptocurrencies are used as a payment method or a tool of trading, Ether
is more than that. It also has multiple uses — thanks to the main purpose of Ethereum.
They are —
Because of these additional usages, Ether’s price may have more stability than other
cryptocurrencies. Although the jury is still out on that, it’s obvious that with more
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 6/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
widespread use, there would always be a steady demand for Ether. That might also
mean that Ether’s price will not go as high as Bitcoin as the other operations will likely
get hampered then.
Limited Bitcoin causes fewer rewards: Bitcoin has a hard cap of 21 million
meaning in total there can’t be more than 21 million Bitcoins. Currently, over 18
million are in circulation. It’s getting harder to get rewarded for Bitcoin mining.
Ethereum, on the other hand, has an annual cap of 18 million which allows miners
to get rewards consistently. ~120 million Ethers are in circulation right now.
Partial reward: If two miners solve the equation at the same time but one of them
gets ahead because of lag time, that miner will become the winner of the reward.
Bitcoin doesn’t reward the second miner. For smaller-scale miners, that can be a
problem. Ethereum partially rewards the second miner to keep the pool
competitive.
There’s not much room for experimentation as users have to pay for each
transaction. The paywall is likely to discourage users to explore usages beyond
existing ones. For developers, Ethereum has test networks that provide dummy
ETH for testing. A similar method needs to be incorporated for end-users to ensure they
don’t have to spend (at least not much) in the learning period.
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 7/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
The transaction speed is faster than Bitcoin but much slower than an optimized
centralized network. Ethereum is planning to move from the “Proof of Work” to the
“Proof of Stake” concept. That might improve the transaction speed.
To summarize
Blockchain technology has taken the world by storm. In just a decade, it has created a
new dimension of tech with significant financial value.
While this guide may work as an entry to the world of Ethereum, it’s important to stay
abreast with the latest changes. This is a fast-moving tech that has been changing
substantially every year.
Since becoming a Medium Paid Member in September 2020, I learned a boatload about
marketing strategy & data-driven marketing — resulting in better performance at my work.
Articles on personal growth also helped me in my personal growth. If you are not a member,
become one by clicking the link below. It’s only $5 a month and the content you’d get is
incredibly good.
A portion of your membership will go to support the author & other Medium
contributors at no extra cost to you.
Source:
1. Vitalik Buterin
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 8/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
2. https://ethereum.org/en/developers/docs/evm/
3. https://coinmarketcap.com/alexandria/glossary/ethereum-virtual-machine-evm
4. https://www.investopedia.com/terms/e/ether-cryptocurrency.asp
5. https://www.techrepublic.com/article/ethereum-a-cheat-sheet-for-professionals-
everything-you-need-to-
know/#:~:text=In%20short%2C%20Ethereum%20is%20a,mining%20done%20by%2
0other%20users.
6. https://ethereum.org/en/history/
7. https://ethereum.org/en/developers/docs/smart-contracts/
8. https://www.investopedia.com/terms/p/proof-stake-pos.asp
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 9/10
2/12/23, 12:45 AM Everything You Need To Know About Ethereum — For Beginners | by Mofrad Muntasir | DataDrivenInvestor
Subscribe
https://medium.datadriveninvestor.com/everything-you-need-to-know-about-ethereum-for-beginners-3f8790a5bed9 10/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
Published in Coinmonks
Save
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 1/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
Igor Artamonov
@splix · Follow
2 Reply Share
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 2/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
I’ve been tracking online Ethereum nodes for some time now, so I have all this data for
further analysis. I publish some of the results for the Ethereum Classic network on the
Gastracker page, though I have more detailed data, with deeper insights about all
Ethereum based networks.
So what is the problem with crawling the Ethereum network? First and the most obvious
obstacle is the existence of Ethereum and Ethereum Classic because both share the
same protocol, same identifiers, and same initial history, including genesis block.
Nodes from both networks sporadically connect to each other, exchanging new
transactions and data from a shared history. By connecting to an ETH node, you can’t
be sure that all of its peers are ETH nodes as well. Initial Handshake doesn’t provide
enough information, so a node keeps connections even with a peer from another
network, telling other ETH nodes about that node, and so on.
The only way to distinguish them is to connect to them and download part of the
blockchain history, as it has different blocks for different forks. From my experience,
less than ~70% of such nodes are actual Ethereum nodes.
Here is a distribution of nodes per chain with network id = 1, i.e., all of them are in the
same bucket on the Ethernodes page.
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 3/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
Unique nodes for the past 7 days; unknown — nodes here are nodes that respond with network_id 1, but their
genesis block doesn’t match any of well-known blockchains; eth_or_etc — are nodes just shares commons
history of ETC and ETH; usually, those nodes are just doing the initial sync
In total there are ~10,000 nodes, with only ~6000 ETH nodes, 1000 of ETC nodes, and
2000+ of other networks.
Compare to distribution of all Ethereum based networks (i.e. not only network_id = 1):
One thing that may be misleading here is that not all 6000 of such nodes are always
available. The data above is based on the past 7 days, and it includes all nodes that
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 4/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
showed up at least once. Though during a typical day less than half of them are online:
Geth vs Parity
The other thing is the difference between Geth and Parity behavior. These two are
leading node implementations, and they share most of the market. However, it’s tough
to measure the exact numbers of their shares, and any mistake in bot logic leads to
distortion of resulting numbers.
Why is that? It seems that Parity and Geth have different usage scenarios; first is
prevailing on servers, and second is more common on desktop. Ethereum official
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 5/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
wallet Mist was coming with Geth, and the same was for Classic Geth, which was used
by Emerald Wallet for desktop on ETC.
This difference in an environment (desktop vs. server) leads to a situation when Geth is
harder to catch. One problem is that online time for Geth is short. Another problem,
which probably makes a substantial impact, is that home internet is usually
misconfigured for port forwarding and firewalls and less stable than the Internet in a
datacenter. Because of that, you cannot connect to such Geth instance but should
expect an incoming connection from it. For this case, the bot needs to make sure that
all possible Geth instances somehow learn about the bot and connects to it to
introduce itself.
To illustrate that, take a look at the distribution of nodes which allowed incoming
connection by different software.
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 6/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
discovery of other nodes, which may be explained that such nodes are running on a
server, and actively discover for peers only in the first few minutes after launch.
Countries
Distribution by a country could be interesting as well:
Please note the number for China. I’m sure the real amount of nodes in China is at
least twice as larger, but the bot can’t connect to them because of the Great Firewall.
The only way to measure everything correctly would be running a bot instance in
China mainland, though I’m not sure how, but I certainly want to do in some future.
Watching forks
One of the main reasons why I created my scraper bot is to watch hard forks, to track
the progress of network upgrade, i.e., which versions of the software are online.
Sometimes it shows fascinating artifacts, like one I posted before Constantinople
upgrade:
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 7/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
Notice how the share of compatible Parity nodes is growing organically over time, but
Geth makes a huge spike in one day. It probably means that there is a way to control
the distribution of the majority of Geth nodes, and therefore the network itself.
Another example is a recent ETC upgrade, which was made even without the majority
of node consensus. Risky, but fortunately, it didn’t damage the network. It took about a
week after the fork to reach 50% of nodes upgrades, though the upgrade is not finalized
yet, nodes are still in the process of upgrade. Even worse, some of the old nodes are still
actively mining the old unforked chain.
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 8/10
2/12/23, 12:48 AM Measuring Ethereum Nodes. There was a post recently comparing… | by Igor Artamonov | Coinmonks | Medium
ETC Atlantis upgrade progress; vertical line is the date of the fork, horizontal lines are 50% (acceptable for pre-
fork) and 80% (acceptable for post-fork); notice the spike of Geth nodes on September 29, most of them were
just fresh nodes launched in different regions of Asia, most were shot down in a few days
It’s hard to measure the Ethereum network, though there is undoubtedly a lot of
interesting data and insights. I still work on improving the bot, trying to gather more
details with better precision, and hope to crawl other blockchains as well.
If you use data from the article, please put a link back to this page. Thank you. For further
questions, you can reach me by [email protected]
Search Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/measuring-ethereum-nodes-530bfff08e9c 10/10
2/12/23, 12:50 AM Ethereum Node Types: An Introduction | by Jon Law | Coinmonks | Medium
Published in Coinmonks
Save
The Ethereum network recognizes three types of nodes used by individuals to support
the network.
1) Full node: A full node stores the complete blockchain, and participates in block
validation and verification, and provides full service to the network and clients on the
https://medium.com/coinmonks/ethereum-nodes-types-an-introduction-11313f25f962 1/4
2/12/23, 12:50 AM Ethereum Node Types: An Introduction | by Jon Law | Coinmonks | Medium
2) Light node: A light node stores only the blockchain headers, which is sufficient to
provide validation of data, but not to participate in the network in the same way a full
node can. This type of node is most useful on resource-constrained devices such a
smartphones or low power systems.
3) Archive node: An archive node stores the full blockchain, as with the full node, and
can perform the same network services. However, the archive node also maintains
data on the state of the blockchain at each block level. This additional data allows for
lookups of transactions and balances without needing to rescan the entire chain from
the genesis block. This is useful for block explorers or other tools that access snapshots
of the chain at points in time. Providing this additional data requires more substantial
resources, with storage needs potentially of multiple terabytes.
Search
Best Bitcoin Medium
Margin Trading | Lolli Review | Bityard Margin Trading
Give a tip
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/ethereum-nodes-types-an-introduction-11313f25f962 3/4
2/12/23, 12:50 AM Ethereum Node Types: An Introduction | by Jon Law | Coinmonks | Medium
https://medium.com/coinmonks/ethereum-nodes-types-an-introduction-11313f25f962 4/4
2/12/23, 12:52 AM Types of Accounts in Ethereum. Disclaimer: I don’t consider myself to… | by P10 | Coinmonks | Medium
Published in Coinmonks
P10 Follow
Save
Smart Contracts lives on an address like a normal ethereum account. But there are few
differences
Types of accounts
https://medium.com/coinmonks/types-of-accounts-in-ethereum-5a004f60c79a 1/5
2/12/23, 12:52 AM Types of Accounts in Ethereum. Disclaimer: I don’t consider myself to… | by P10 | Coinmonks | Medium
The private key is 32 bytes (64 hex characters), usually randomly generated by the
wallet.
The public key is derived from the private key using ECDSA.
The address is the last 20 bytes (40 hex characters) of the public key, with a 0x prefix.
The private key is used to sign a transaction to prevent forgery. As long as the private
keys are secure, it is impossible to fake a transaction as long as 50%+ miners are not
acting maliciously, in the current (PoW) consensus model.
Smart Contracts
Smart contracts accounts have code and storage associated with them they are not
controlled by a private key, but by the code associated with it.
They cost some gas to deploy as they use storage as soon as they are created.
They are usually written in solidity although other options like Vyper are also there.
Their USP is that once deployed they can not be edited. While this may sound like a
drawback, it is the reason smart contracts are so powerful.
Once deployed all the parties concerned knows how it will execute, it cannot be
tampered with. This removes the requirement of trust among the parties and also
increases transparency.
Creating a smart contract costs gas as code and storage is being deposited.
NOTE
https://medium.com/coinmonks/types-of-accounts-in-ethereum-5a004f60c79a 2/5
2/12/23, 12:52 AM Types of Accounts in Ethereum. Disclaimer: I don’t consider myself to… | by P10 | Coinmonks | Medium
Smart contracts cannot initiate a transaction, They solely act on external messages
but once a transaction is started a smart contract can trigger other contracts or
transfer ether.
Common properties
CodeHash — (IMMUTABLE field) Hash for the code associated with smart contracts.
For an EOA it is an empty string.
Storage Hash — the Merkle root hash of the entire state tree for contracts, empty for
EOA.
The solidity code is converted to byte code which can be deployed to the network and
can be understood by the EVM.
ABI (Application Binary Interface) — is important for interacting with smart contracts,
it list functions, their expected return types and parameters.
However, any function that changes the state of the contract gas is required.
https://medium.com/coinmonks/types-of-accounts-in-ethereum-5a004f60c79a 3/5
2/12/23, 12:52 AM Types of Accounts in Ethereum. Disclaimer: I don’t consider myself to… | by P10 | Coinmonks | Medium
References
https://ethereum.org/en/developers/docs/accounts/ (MUST READ)
https://hackernoon.com/getting-deep-into-evm-how-ethereum-works-backstage-
ac7efa1f0015
https://medium.com/coinmonks/types-of-accounts-in-ethereum-5a004f60c79a 4/5
2/12/23, 12:52 AM Types of Accounts in Ethereum. Disclaimer: I don’t consider myself to… | by P10 | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/types-of-accounts-in-ethereum-5a004f60c79a 5/5
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
Published in Coinmonks
Save
Ethereum account
This post is a reference to “How does Ethereum work, anyway?” which written by “
Preethi Kasireddy” and can be found here.
Account state
The account state consists of four components, which are present regardless of the
type of account:
nonce: If the account is an externally owned account, this number represents the
number of transactions sent from the account’s address. If the account is a contract
account, the nonce is the number of contracts created by the account.
balance: The number of Wei owned by this address. There are 1e+18 Wei per Ether.
storageRoot: A 256-bit hash of the root node of a Merkle Patricia tree that encodes
the storage contents of the account (a mapping between 256-bit integer values),
encoded into the trie as a mapping from the Keccak 256-bit hash of the 256-bit
integer keys to the RLP-encoded 256-bit integer values. This tree encodes the hash
of the storage contents of this account, and is empty by default.
codeHash: The hash of the EVM (Ethereum Virtual Machine) code of this account
— this is the code that gets executed should this address receive a message call; it is
immutable and thus, unlike all other fields, cannot be changed after construction.
All such code fragments are contained in the state database under their
corresponding hashes for later retrieval. For contract accounts, this is the code that
gets hashed and stored as the codeHash. For externally owned accounts, the
codeHash field is the hash of the empty string.
Contract accounts in Exchange Send Ether (ETH) to a user account has a fee of 21000
gas but sending ETH to a contract has a higher fee, which depends on the contract
code and data being sent in the transaction.
A Multisig Account can be structured such that it has a daily limit which you
specify, and only if the daily limit is exceeded will multiple signatures be required
https://medium.com/coinmonks/ethereum-account-212feb9c4154 3/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
Creating user accounts does not cost any gas but creating contract accounts does. You
pay to create and use Contract accounts because they use the valuable computational
and storage resource of the network.
Another point is that an externally owned account can send message to other
externally owned accounts OR to other contract accounts by creating and signing a
transaction using its private key. A message between two externally owned accounts is
simply a value transfer. But a message from an externally owned account to a contract
account activates the contract account’s code, allowing it to perform various actions
(e.g. transfer tokens, write to internal storage, mint new tokens, perform some
calculation, create new contracts, etc.).
Unlike externally owned accounts, contract accounts can’t initiate new transactions on
their own. Instead, contract accounts can only fire transactions in response to other
transactions they have received (from an externally owned account or from another
contract account). We’ll learn more about contract-to-contract calls in the
“Transactions and Messages” section.
Tools :
MetaMask
https://medium.com/coinmonks/ethereum-account-212feb9c4154 4/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
There are two type of contract account — Simple account & Multisig( Multisignature)
account
Simple account & Multisig account are created and owned by Accounts.
Simplet account : Only one account bother creates and owns the account.
Multisig account : A Multisig Wallet has several owner Accounts one of which will
also be the creator Account.
3. Click on CREATE. Then enter the password of the current account you used in
https://medium.com/coinmonks/ethereum-account-212feb9c4154 5/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
3. Set up how many owner owns this wallet. The default is 3 owners. In my case, I
change it to 2.
5. Click on CREATE. Then enter the password of the current account you used.
6. Copy and paste the addresses of the other two owner Accounts.
IMPORTANT: Do not add a Contract Wallet as the owner of a Multisig Wallet. Only
Accounts can be owners.
The default settings for Multisig accounts is displayed. In this example, we are going
with the default 2-of-3 setting, but we have reduced the daily limit to 10 ether.
https://medium.com/coinmonks/ethereum-account-212feb9c4154 6/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
https://medium.com/coinmonks/ethereum-account-212feb9c4154 7/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
https://medium.com/coinmonks/ethereum-account-212feb9c4154 8/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
Search Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/ethereum-account-212feb9c4154 9/10
2/12/23, 12:55 AM Ethereum account. This post is a reference to “How does… | by 胡家維 Hu Kenneth | Coinmonks | Medium
https://medium.com/coinmonks/ethereum-account-212feb9c4154 10/10
2/12/23, 12:59 AM Smart Contracts On The Blockchain: A deep dive in to Smart Contracts | by ABHISHEK KUMAR | Medium
Save
Many multinational companies have already jumped onto the blockchain bandwagon
and are working on their own projects to stay ahead of the competition.
According to Accenture research published at the start of 2017, investment banks alone
could save up to $12 billion per year by adopting blockchain and smart contracts,
effectively a program code that automatically performs some actions when pre-
defined conditions occur (i.e. if X does Y, then execute Z).
Gartner has estimated that by 2022, smart contracts will be in use by more than 25% of
global organizations.
Major technology providers like IBM ,Microsoft ,TCS ,Accenture are offering
blockchain solutions to enterprise clients. Tech start-ups too are aggressively
capitalizing on the boom by building new products and services that depend on the
technology.
For other businesses, however, the big question is how blockchain adoption can
benefit them. There is no question that modern business environments require
companies to make technology integral to their strategy.
Cost Reduction & Efficiencies: Cutting out middleman means savings for the business.
According to a McKinsey report it is estimated that blockchain could save businesses at
least $50 billion in B2B transactions by 2021.
Proponents of smart contracts claim that many kinds of contractual clauses may be
made partially or fully self-executing, self-enforcing, or both. The aim of smart
contracts is to provide security that is superior to traditional contract law and to reduce
other transaction costs associated with contracting. Various cryptocurrencies have
implemented types of smart contracts.
‘Smart contracts’, are programs that are written on the underlying distributed ledger
and are executed automatically by nodes on the network. Smart contract have to be
verifiable by each node on the network, it means that all nodes on the network must
see the same data. Smart contracts are complex and their potential goes beyond the
simple transfer of assets, being able to execute transactions in a wide range of fields.
Such as insurance, crowdfunding , logistics, medicine, gaming industry, entertainment
industry, etc.
Blockchain was initially designed for P2P money only. But it soon showed the potential
to be used for any kind of P2P value transaction on top of the Internet. The Ethereum
project thus introduced the idea of decoupling the contract layer from the blockchain
layer, where the ledger itself is used by smart contracts that trigger transactions
automatically when certain pre-defined conditions are met. By decoupling the smart
contract layer from the blockchain layer, Blockchains like Ethereum aim to provide a
more flexible development environment than the Bitcoin Blockchain.
It is a mechanism involving digital assets and two or more parties, where some or all of
the parties deposit assets into the smart contract and the assets automatically get
redistributed among those parties according to a formula based on certain data, which
is not known at the time of contract initiation.
If and when all parties to the smart contract fulfill the pre-defined arbitrary rules, the
smart contract will auto execute the transaction. These smart contracts aim to provide
transaction security superior to traditional contract law and reduce transaction costs of
coordination and enforcement.
The term smart contract is a bit unfortunate since a smart contract is neither smart
nor are they to be confused with a legal contract.
•A smart contract can only be as smart as the people coding taking into account all
available information at the time of coding.
•While smart contracts have the potential to become legal contracts if certain
conditions are met, they should not be confused with legal contracts accepted by
courts and or law enforcement. However, we will probably see a fusion of legal
contracts and smart contracts emerge over the next few years as the technology
becomes more mature and widespread and legal standards are adopted.
Many people are critical of the name “smart contract”. One reason being that a smart
contract is not necessarily smart. It is just a set of instructions that anyone can write,
and people are very capable of creating some pretty dumb smart contracts.
The name smart contract is also misleading because it is not really a contract, at least
not in the sense that it’s anything that needs to be complied with or upheld. A normal
contract has legal consequences in the ‘real world’. If the counterparty of a contract
does not uphold their part of the agreement, the legal system can be used to hold them
accountable. On the contrary, a smart contract does not have to be upheld by anyone,
it’s a set of instructions that self-executes. A smart contact does not have much
precedence in the ‘real world’. It is only able to send transactions to other accounts on
the blockchain, any other precedence must be acquired by creating a legal wrapper
around the blockchain agreement.
Just like with normal contracts, it´s important to understand the actual content of a
smart contract when interacting with it. But unlike a normal contract, which is written
in legalese and interpreted by the legal system, the content of the smart contract is
written in computer code and interpreted by computers. So what does smart contract
code actually look like.
Below is an example, an extract of a smart contract (don’t worry if you are not a
technical person you’re not expected to understand it):
throw;
if (_recipient.call.value(_amount)()) {
PayOut(_recipient, _amount);
return true;
} else {
return false;
The smart contract code is the terms and conditions that you are signing up for when
interacting with a smart contract. As long as you trust the blockchain that the smart
contract resides on, you know that the code will execute exactly as programmed — so
no breach of agreement can exist. It is important to note however, that working as
programmed does not mean that it will work as intended if there are errors in the
code.
Smart contracts can be used for simple economic transactions like sending money
from A to B. They can also be used for registering any kind of ownership and property
rights like land registries and intellectual property, or managing smart access control
for the sharing economy, just to name a few. Furthermore, smart contracts can be used
for more complex transactions like governing a group of people that share the same
interests and goals. Decentralized Autonomous Organizations (DAOs) , are such an
example for more complex smart contracts.
a) Subject of the contract:The program must have access to goods or services under
contract to lock and unlock them automatically.
b) Digital signatures: All the participants initiate an agreement by signing the contract
with their private keys.
https://abhibvp003.medium.com/smart-contracts-on-the-blockchain-a-deep-dive-in-to-smart-contracts-9616ad26428c#:~:text='Smart contracts'%2C a… 5/13
2/12/23, 12:59 AM Smart Contracts On The Blockchain: A deep dive in to Smart Contracts | by ABHISHEK KUMAR | Medium
c) Contract terms: Terms of a smart contract take the form of an exact sequence of
operations. All participants must sign these terms.
Smart contracts use all the benefits of Blockchain technology & provide:
a) Security: The smart contract is encrypted and distributed among nodes. This
guarantees that it will not be lost or changed without your permission.
b) Economy and speed:Most processes are automated, and most intermediaries are
eliminated.
This means that you don’t have to trust people and organizations, you trust code, which
is open source and provides transparent processes.
With blockchains and smart contracts we can now imagine a world in which contracts
are embedded in digital code and stored in transparent, shared databases, where they
are protected from deletion, tampering, and revision.
In this world every agreement, every process, task and payment would have a digital
record and signature that could be identified, validated, stored, and shared
Intermediaries like lawyers, brokers, and bankers, and public administrators might no
longer be necessary. Individuals, organizations, machines, and algorithms would
freely transact and interact with one another with little friction and a fraction of
current transaction costs.
https://abhibvp003.medium.com/smart-contracts-on-the-blockchain-a-deep-dive-in-to-smart-contracts-9616ad26428c#:~:text='Smart contracts'%2C a… 6/13
2/12/23, 12:59 AM Smart Contracts On The Blockchain: A deep dive in to Smart Contracts | by ABHISHEK KUMAR | Medium
A smart contract can formalize the relationships between people, institutions and the
assets they own.
The transaction rulesets (agreement) of the smart contract define the conditions —
rights and obligations to which the parties of a protocol or smart contract consent.
Although the concept of smart contracts is not new, blockchain technologies seem to
be the catalyst for smart contract implementation.
If A and B don’t know and don’t trust each other, they usually need a trusted third party
to serve as an intermediary to verify transactions and enforce them. With smart
contracts & blockchains, you don’t need those trusted intermediaries anymore for
clearing or settlement of your transactions. Take the example of buying and selling a
car:
Below Diagram explains the working a Traditional Contract for the Smart Contract
Example
On the Blockchain, once all involved authorities and companies are on a blockchain, a
smart contract couldbe used to define all the rules of a valid care sale. If Alice wanted
to buy the car from Bob usinga smart contract on the blockchain, the transaction
would be verified by each node in the BlockchainNetwork to see if Bob is the owner of
the car and if Alice has enough money to pay Bob.
If the network agrees that both conditions are true, Alice automatically gets the access
code to the smart lock for the garage. The blockchain registers Alice as the new owner
of the car. Bob has € 20,000 more on his account, and Alice € 20,000 less. No
middlemen required. On the Blockchain, who owns what is transparent and at the
same time anonymous or pseudonymous. This means that every computer running the
blockchain protocol could check whether a certain person is the rightful owner of the
car or not.Stealing cars won’t be as easy as today, especially once we have smart keys
granting access control verified on the blockchain, to unlock our future vehicles. As
the owner of the car, you could authorize other people to drive it (stating the public key
of the respective individual). In such cases opening the car would only be possible with
a smart key on the Blockchain.
Blockchain and smart contracts have the potential to disrupt many industries. Use
cases can be found in banking, insurance, energy, e-government, telecommunication,
music & film industry, art world, mobility, education and many more. Smart contract
use cases range from simple to complex.
Below are the list of usecases where Blockchain & Smartcontracts can disrupt the the
industries
Given the fact that Blockchain is still a new technology, some industries might adopt
smart contracts later than others, especially if they are subject to heavy government
regulation or if the uses cases require high network effects — like widespread
technology adoption along the supply chain, standardization, etc. In general, it’s
advisable to start out with a small pilot project of a less complex use case to build
expertize and understand the technology better and move on to more complex use
case at a later stage.
Furthe reading
http://internetofagreements.com/files/WorldGovernmentSummit-Dubai2017.pdf
OpenLaw, Consensys
https://solidity.readthedocs.io/en/latest/
2) Solidity Tutorial
https://abhibvp003.medium.com/smart-contracts-on-the-blockchain-a-deep-dive-in-to-smart-contracts-9616ad26428c#:~:text='Smart contracts'%2C … 11/13
2/12/23, 12:59 AM Smart Contracts On The Blockchain: A deep dive in to Smart Contracts | by ABHISHEK KUMAR | Medium
https://medium.com/@ConsenSys/solidity-integration-with-visual-studio-8bdab2ff8a74
3) Standardized_Contract_APIs
https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
http://ethdocs.org/en/latest/contracts-and-transactions/accessing-contracts-and-
transactions.html#interacting-with-smart-contracts
5) Remix Ethereum
https://github.com/ethereum/remix
https://blog.zeppelin.solutions/the-hitchhikers-guide-to-smart-contracts-in-ethereum-
848f08001f05
7) trufflesuite/truffle
https://github.com/trufflesuite/truffle
Sources:
1.https://bitcoinmagazine.com/articles/smart-contracts-described-by-nick-szabo-years-
ago-now-becoming-reality-1461693751/
2.https://en.wikipedia.org/wiki/Smart_contract
3.https://blockgeeks.com/guides/smart-contracts/
4.https://www.ethereum.org/token
5) PWC
6) Forbes
7) BlockchainHub
https://abhibvp003.medium.com/smart-contracts-on-the-blockchain-a-deep-dive-in-to-smart-contracts-9616ad26428c#:~:text='Smart contracts'%2C … 12/13
2/12/23, 12:59 AM Smart Contracts On The Blockchain: A deep dive in to Smart Contracts | by ABHISHEK KUMAR | Medium
Please note: The material has been reproduced from various sources & is strictly for
educational ,illustrative purposes & for promotion of Blockchain Technology.
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 1/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
The facts are undeniable, blockchains are here, cryptocurrencies are taking the
financial world by storm, the world is embracing Ethereum and Bitcoin like never
before. More articles than ever before are being published by mainstream news
networks bringing these ideas more mainstream source. Large banks are leading the
charge into crypto assets through multi-billion dollar investments source.
Lets take a dive together and learn more about this new world we are being thrust into!
Ethereum Vs Bitcoin
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 2/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
Ill skip the explanation of bitcoin considering its been done to death at this point, if
you want more info, here is a good explanation. Unlike bitcoin though, Ethereum is not
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 3/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
a digital currency, but rather a platform for smart contracts. ETH, the coin associated
with Ethereum, can be traded like bitcoin but it can also be used for so much more!
Smart contracts are a way to allow decentralized networks to securely execute code
without any central authority. This concept is revolutionizing many industries as we
speak, none more than the financial sector.
Smart Contracts
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 4/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
In Ethereum, smart contracts are blocks of code, that can come complete with internal
states, users, and even their own tokens. They are deployed to a blockchain network
and fully managed by the network in a decentralized way.
Put more simply, a smart contract is a decentralized singleton (over simplified, but a
good start). An example we will walk through is below:
This is an example of a basic smart contract that can be created and then deployed to
the Ethereum network. When deployed, this contract will be given its own Ethereum
address that can be referenced to talk to the contract.
This is a rather simple example and for those familiar with coding the functionality
above is not too hard to grasp, but since this is a smart contract there are few key
differences.
Internal States
In this example, we declare a contract called Parrot that maintains an internal state of
a string. Smart contracts are validated by the entire blockchain network, so this
contract will have many copies spread across all the nodes of the network, each of
which will calculate and record the internal state separately. Each node on the network
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 5/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
will run effectively run every transaction the contract sees and validate it against all
the other nodes on the network for security. Many copies of the same data.
A key thing to note is that transactions are not free! They are run on what is called
“gas”. Miners on the network are solving hashed to create blocks, validating them, and
adding them to the network. As a reward for this process, they are given a small
amount of tokens for each transaction called ‘gas’. Think of it as a tip for processing
and validating a transaction. This price is not fixed, but rather fluctuates with the
market. Miners have free choice in what transactions they want to validate, if you want
your done quickly, or done at all, you have to chip in some gas.
An request for the above function could look like this: source
params: [{
// From what Ethereum address (your personal wallet)
"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
// To what Ethereum address (the address of the contract)
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
// The gas (or tip) to the miner that processed this request
"gas": "0x76c0",
// Encoded data representing the function name and parameters to
call
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 6/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f"
}]
Imagine a more practical example of an insurance contract for train ticket insurance.
Instead of the internal state being a simple string, we can create structs as well with
solidity.
struct Customer {
bool hasPolicy;
uint256 lastPayment;
}
Then, we can use a feature of solidity that lets us set up a mapping across all Ethereum
wallets. This functions like a hash map where the keys are every Ethereum wallet on
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 7/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
Effectively this is setting up a hash table where the keys are every possible Ethereum
wallet and the values are Customer objects as we defined above. It is initially empty. If
you ask for a given key that does not exist, an 0 value is returned ( meaning hasPolicy
will be 0 or false ). When the contract is run and transactions are recorded, any new
additions to this table will be saved, and when looked up their new data can be found.
Then, to sign up for insurance on our smart contract, we can do something like this:
Signing up uses the require keyword to make sure a given value is true before the
contract is allowed to continue. If the validation fails, the contract is not executed. In
this case, lets assume the user did infact transfer 0.01 ETH to the contract with their
call to the signUp function. In that case, the contract keeps the ETH ( the contract itself
is a wallet as well ), and registers that the sender is now insured and just paid.
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 8/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
To pay again, the user can call payPremium again and have the same process happen.
This time their lastPayment is updated to be the current time, extending their
insurance period.
Then, to check if a given account is insured, we can check the public record for the
contract to make sure their insurance it listed there
This function is listed as pure which is very similar to view as neither requires gas.
View simply will return the internal state, pure can do computations against that state
but will not edit that state. Here we check if the last payment was within some
payment period and if so, they are insured.
Finally, to claim insurance its simply a matter of looking up the policy and allocating
funds to anyone who needs it.
In total, the problems with the above approach to insurance are vast as it is missing
vital protections for abuse, but those protections can be added securely while staying
within the limits of a smart contract. The goal wasn’t to pitch a new approach to
insurance, but rather to illustrate how simple it can be to do distributed management
of tokens and assets on a blockchain. I hope it is clear how these contracts can be used
to security and publicly setup systems of financial transactions without any central
authority required for validation.
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 9/11
2/12/23, 1:01 AM Quick dive into Smart Contracts and Ethereum. | by Eric Lastname | Geek Culture | Medium
The insurance code is loosly basted on this repo, give it some love!
I’m new to medium and would love feedback! Leave a comment! Give a clap! Would
love any help along my journey here!
Subscribe to receive top 10 most read stories of Geek Culture — delivered straight into your inbox, once a week. Take a
look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/geekculture/hands-on-technical-introduction-to-smart-contracts-and-ethereum-10b264cc65f4 11/11
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
Save
Turing Machines
Turing machines are theoretical computers defined by Alan Turing in his highly
influential paper titled On Computable Numbers, with an application to the
Entscheidungsproblem, published 1936. Turing machines are abstract mathematical
constructs that help us describe in a rigorous fashion what we mean by computation.
There are countless in-depth tutorials on how a Turing machine works, and you can
watch any of them! I can pretty much guarantee that they’re going to be better at
explaining how a Turing machine works than me, but in case you don’t want to watch
any of those, I’ll throw my description in as well.
symbol can be written or erased. The Turing machine recognizes and can write down a
finite set of symbols, called the Turing machine’s alphabet.
The Turing machine is only ‘aware’ of one square on the tape at a time — namely the
square the head of the Turing machine is currently on.
The machine decides which of these operations to do on any given step through a finite
state machine. Different Turing machines have different state machines that define
their operation.
A finite state machine consists of a finite number of states (which Turing calls m-
configurations) which it switches between on every iteration. The machine can only be
in one state at a time, but transitions between them based on the current state and the
symbol that the machine is currently scanning. The Turing machine takes the current
state and the symbol and looks up what to do in a big table.
A Turing Machine also has a set of accept states that tell the Turing machine to stop
executing. If the Turing machine enters any of these accept states, the machine is said
to halt and suspends execution forever. That’s all there is to Turing Machines!
…well maybe it’s not inherently obvious what exactly that means and how that can be
expressive enough to capture all computation. I almost always see Turing Machines
described with a state diagram, which I’ll provide a description for in later versions of
this article.
Let’s construct a Turing machine that never halts with a state diagram!
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 2/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
We’ll start out with creating a very simple Turing machine with an alphabet of {0, 1}.
We start in state S1, and decide what to do. For any symbol (denoted *) on the tape, the
Turing machine writes the symbol 1, moves one space to the right, and switches to S2.
Now in state S2, for any symbol on the tape, the machine writes 0 and moves one space
to the right, switching to S1. Back in S1, the loop repeats itself, continuing forever. As
you might guess, this writes out 1010101[…] in a never ending loop. The machine has
no accept states so it will never halt.
Description Numbers
It turns out we can number all Turing machines uniquely. A Turing machine which
doubles a number might be numbered:
31332531173113353111731113322531111731111335317
3133253117311335311173111332253111173111133531731323253117
As you can tell, they’re huge and weirdly repetitive numbers, but they are still
nonetheless numbers.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 3/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
We call these the description number for a given Turing machine. We don’t need to
specify exactly how to number the Turing machines, it’s sufficient for our purposes to
simply note that you can fully encode a Turing machine within an integer.
Spoilers: we’ll pass a Turing machine’s description number as the input to another
Turing machine later on, but forget you heard anything…
In particular, we want to turn Turing machines into partial functions, functions for
which there can be undefined outputs. We’ll want these functions to be ℕ⁽ⁿ⁾→ℕ,
meaning they take any number n natural numbers as input, and output one natural
number (or are undefined for that input, since they are partial).
All we have to do to turn a Turing machine into a partial function is to equip it with an
input and output schema. Turing himself doesn’t provide an unambiguous ‘input’
format, but as we get into programming languages, it’ll be useful to make this step of
defining input vs. output explicit. I’m choosing a monadic notation as given in
Computability and Logic.¹
Precise Formulation
(a) The arguments m1...mk of the function will be represented in
monadic notation by blocks of those numbers of strokes, each separated
from the next by a single blank, on an otherwise blank tape. Thus at
the beginning of the computation of, say, 3 + 2, the tape will look
like this: 111B11
(b) Initially, the machine will be scanning the leftmost 1 on the
tape, and will be in its initial state, state 1. Thus in the
computation of 3 + 2, the initial configuration will be 1₁11B11. A
configuration as described by (a) and (b) is called a standard initial
configuration.
(c) If the function that is to be computed assigns a value n to the
arguments that are represented initially on the tape, then the machine
will eventually halt on a tape containing a block of that number of
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 4/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
strokes, and otherwise blank. Thus in the computation of 3+2, the tape
will look like this: 11111.
(d) In this case, the machine will halt scanning the leftmost 1 on the
tape. Thus in the computation of 3 + 2, the final configuration will
be 1ₐ1111, where the ath state is one for which there is no
instruction what to do if scanning a stroke, so that in this
configuration the machine will be halted. A configuration as described
by (c) and (d) is called a standard final configuration (or position)
(e) If the function that is to be computed assigns no value to the
arguments that are represented initially on the tape, then the machine
will either never halt, or halt in some nonstandard configuration such
as Bₐ11111 or B111ₐ11 or B11111ₐ.
The set of functions that you can express with Turing machines in this manner are
called the computable functions.
The exact definition we choose for input and output isn’t that important: As long as
translation between different input and output formats is computable (which it almost
certainly is for any sane definition), we will get an equivalent set of computable
functions.
This is why the oft-heard description “A Turing-complete language is one that can
simulate a Turing machine” is absolutely correct, but just a tad misleading. If you can
simulate a Turing machine, then you can compute every function that any Turing
machine can compute, but the thing that actually makes the system Turing complete is
that it can compute the whole set of Turing computable functions.
Computable Numbers
Now, given that we have a solid definition for computable functions, we can sort of
‘bootstrap’ off of that to define the computable numbers. But given that a number can
have an infinite number of nonrepeating digits (e.g. something like pi), we have to be
just a tad clever in how we define them. Some smart people came up with this:
A computable number a is a number for which there exists some computable function f such
that f(n) yields the nth digit of a.
Whoops, Wikipedia tells me that’s not quite right. Let’s swap it out:
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 5/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
A computable number a is a number for which there exists some computable function f such
that f(n) satisfies this one weird inequality.
The intuitive sense is the same either way: If you can calculate a number to arbitrary
precision, that number is computable.
It turns out a whole host of numbers are computable. Here’s a quick taste:
The point is we can do a heck of a lot of math using only the computable numbers.
Computable numbers make up most numbers we think about on a daily basis —
enough so that it’s actually kind of hard to think of numbers that aren’t computable.
Turing dedicated a fair number of pages to spelling out the whole state transition table
for such a Turing machine, presumably because it’s not inherently obvious that a
Turing machine should be able to simulate other Turing machines. The duality of a
program as data is likely a lot more comfortable to us today than it was to
mathematicians back then. Today, we have few qualms with treating a program as data
— especially if we’re used to programming languages with first-class functions.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 6/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
Incomputability
As the term computable functions implies, there are also incomputable functions:
functions we can define for which no Turing machine can possibly exist.
And, despite them being hard to construct, there are a LOT of incomputable functions.
In fact, almost all functions are incomputable. There are just that many more possible
functions than there ever could be Turing machines, so there must be some that
Turing machines miss. In the mathematical language, the set of Turing machines is
countable, whereas the set of real numbers is uncountably large.
Halting Problem: Given a computer program and an input for said program, does that
program ever finish execution?
It’s easy to imagine examples of programs where it’s possible to figure out whether or
not the program finishes: If a state repeats itself exactly, or if the program immediately
halts, it’s easy to tell whether or not those programs will halt. But try to come up with
an algorithm to decide for ANY program, and you’ll find that the problem becomes
impossibly hard, quite literally.
Davis proves that this function is incomputable, that no Turing machine can exist that
can compute the correct answer. Because this specific problem yields a yes/no answer,
it is considered a decision problem, and since it’s incomputable, the problem is deemed
undecidable.
You can get more information about incomputability from this charmingly helpful
Buzzfeed community post.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 7/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
I mean, just look at the term circle-free! Circle-free’s easy, it reaches it’s final state in a
finite amount of time, like lots of explanations of Turing’s original paper on the
internet suggests! Just look at the defi…
If a computing machine never writes down more than a finite number of [the symbols 1 and
0], it will be called circular. Otherwise it is said to be circle-free.
[…]
Wait, that feels backwards. The machine that prints out an infinite number of 1s and
0s, never halting, computes computable numbers? Isn’t that contrary to how we outlined
it before, wherein the only defined output was when the Turing machine halted in a
standard configuration?”
Unfortunately for my past self, the mapping from the modern definitions to Turing’s
original paper isn’t quite so clean, and so requires a fair amount of modification. Let’s
throw away all the definitions for computable functions and computable numbers that we
spent so much time learning, so that we’re left with the just the Turing machine itself.
Computable Sequences
In fact, Turing’s primary focus was on this idea of computable sequences, which we will
use to define computable numbers shortly.
Under Turing’s original construction, these sorts of infinite sequences are exactly what
we’re going for — we want to print out a bunch of 1s and 0s forever and ever. We’d call
Turing machines that end up printing an infinite sequence like this circle-free, and
anything else circular.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 8/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
Just like we have decimals in base 10, we can have ‘decimals’ in base 2 as well! They’re
not called ‘decimals’, rather ‘binary fractions’, but they operate pretty much exactly the
same, except in base 2 rather than base 10. For example, the number 0.75 converted to
binary becomes 0.11, or 2.8125 converted to binary becomes 10.1101. The exact
conversion between decimal fractions and binary fractions isn’t really important, but
you can watch a tutorial if you really want.
We can interpret a computable sequence as the fractional part of a binary number. The
sequence 101010… would therefore becomes 0.101010…, giving us a number to work
with. Anything that’s off by an integer from this fractional component is itself
computable.
It turns out, the set of computable numbers defined by the modern construction and
by Turing’s construction are the same!
If you get nothing else out of this article, get this: Being pedantic about Turing
machines’ definitions doesn’t get you very far. It doesn’t generally make you more
correct mathematically. Most sane definitions of Turing’s initial definition will be
equivalent. Unless we’re solving problems within the specific domain of computability,
we shouldn’t be arguing about this stuff in any meaningful capacity — it’s not worth it.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 9/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
So, as I mentioned earlier, there are a fair number of equivalent models of Turing
machines. Google these away to your heart’s content.
Post-Turing Machines
μ-recursive functions
We can prove that in each of these cases, these computational systems can compute
the exact same set of functions as any other. And boy, that’s a lot of different Turing
equivalent systems. Abaci, recursive functions, the lambda calculus, a bunch of rocks?
They’re all exactly equivalent? Huh, weird…
Pragmatically, all we have to do to get our programming language into the throes of
beautiful formalism is to equip it with an input and output format, just like we did for
Turing machines above. Like before, we have some play with exactly how we define
our input and outputs, but most reasonable choices should give us all the power we
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 10/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
need. We’re not trying to make waves with this choice, we’re just trying to bootstrap to
the point where “input” and “output” make sense mathematically.
For a quick example of how dead simple I’m thinking, we’ll do a quick one for
javascript:
I’m gonna return to this particular definition later, but for right now, just note that it is
one of many possible definitions we could choose.
Boundedness
Turing machines can hold an unbounded amount of state, whereas computers cannot.
Any program running on a computer isn’t going to be fully Turing complete; there
exists a limit. No computer ever is going to be able to compute Graham’s Number * 2,
ever — there’s just not enough space in the universe for a computer that large. Yet, to a
Turing machine which doubles numbers, the practical boundedness of the universe
isn’t an issue. A Turing machine is just as capable of computing Graham’s Number * 2
as it is computing the 2 * 2, it just takes a few more steps. This gap implies that real
world computers can’t compute Turing Computable functions for all inputs, and are
therefore not Turing Complete.
We have a separate name for these — they’re not quite equivalent to full-blown Turing
machines but they can do everything that a Turing machine can, up to a certain limit.
These are called Linear Bounded Automations. Linear Bounded Automations are
nearly identical to Turing machines, except they impose a left and right boundary to
the tape.
So if computers aren’t fully Turing complete, how can a programming language, which
runs on a computer, ever hope to be Turing complete?
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 11/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
The trick is that languages don’t necessarily imply limits within their specifications
and instead push this problem to the lower level. A language can either be Turing
complete or Turing incomplete, based solely on its specification, and independently of
any implementation on a real-world computer. The difference might be more subtle
than you think, which I can demonstrate using Brainfuck.²
Original Definition
A Brainfuck program has an implicit byte pointer, called “the
pointer”, which is free to move around within an array of 30000 bytes,
initially all set to zero. The pointer itself is initialized to point
to the beginning of this array.
Modified Definition
A Brainfuck program has an implicit byte pointer, called “the
pointer”, which is free to move around within an infinite array,
initially all set to zero. The pointer itself is initialized to point
to the beginning of this array.
Spot the difference? It’s that bound on the tape length. In the former case, the language
itself has a finite bound, making it equivalent to a linearly bound automata,
independent of any machine it runs on. On a theoretical computer without bounds, the
functions expressible by the original definition is NOT Turing complete.
So when someone says “language [x] is Turing complete” and doesn’t prove that the
language itself can theoretically support unbounded memory, you can out-pedant
them and tell them that you won’t believe them until they show it does!
…speaking of which, let’s go back to the definition for input and output we chose for
Javascript. We’ll do a sanity check to see whether or not our input and output allow for
ANY size number, up to and beyond Graham’s Number. Here’s what we laid out before:
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 12/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
So does that work with mind-bogglingly huge numbers like Graham’s number?
Unfortunately, no. In Javascript, primitive integers are only guaranteed exact to 2⁵³, so
it looks like this specific input/output schema wasn’t sufficient.
Let’s move to a different data structure, away from primitives for input, and consider
using instead a linked list of various objects in JS. Remember, we’re just looking for a
viable way to represent natural numbers:
This schema should work⁴. The only limit to how deeply this structure can nest are
limits in the interpreter and computer themselves — not within the spec. We can, as
far as the Javascript specification is concerned, represent numbers as large as
Graham’s number using this recursive pattern.⁶
Does this mean Javascript is Turing complete? We should avoid jumping to conclusions
too early: There might be some critical roadblock to handling extremely large
recursive structures, but for JavaScript, I doubt there’s any such roadblock.⁵
For example, imagine something called JS-Hyper. JS-Hyper is equivalent to JS, with the
addition of a new builtin function willHalt(dn, args), where willHalt is an oracle that
determines whether the Turing machine with description number dn will halt for
arguments args. Since a Turing machine can’t compute that function, JS-Hyper is
Super-Turing complete
This serves to show that even though we expect computers to be able to execute
programming languages, nothing stops us from defining a programming language
unconstrained by such silly notions such as computability. We can do anything we
want! The power is ours! Haha!
What Turing and Alonzo Church claim is that humans are bound by these rules just
like machines are; that any process a human can use to calculate a number can also be
done by a computer, and vice versa. The Church-Turing thesis, in essence, claims that
human beings are (computationally at least) Turing Equivalent.
Turing calls the numbers that humans can algorithmically compute in finite time the
effectively calculable numbers. In essence, the effectively calculable numbers are all the
numbers we’d ever have hope of computing — any number wherein we can think of a
method to compute that number is considered to be effectively calculable.
Church-Turing Thesis: The sets of effectively calculable numbers and computable numbers
are equivalent.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 14/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
Turing’s argument provides three pieces of evidence to make his case for the
equivalence of the effectively calculable numbers and the computable numbers.
We’ve already brought up equivalent systems before, and we’ve also brought up large
classes of computable numbers as well (neither of which we’re bothering to prove
here). So that just leaves the direct appeal to intuition to complete Turing’s argument.
In essence, Turing argues that the process a computer (as in the old school human
occupation) executes to compute a number essentially boils down to an infinite tape
paired with a finite state machine. A human can focus on only at a finite number of
symbols at a time, and a human only has a finite number of possible head-states (due
to a finite number of neurons). Given that a certain head-state defines what action you
take next, you can imagine a massive, massive transition table, encompassing every
possible mental transition.
Obviously, this is a very rough sketch argument. But at least you can sort of see how a
combination of infinite paper and finite mental capacity hints towards the Church-
Turing thesis.
Broader implications
What’s so interesting about the Church-Turing thesis philosophically is that it points
towards Turing completeness as being ‘it’, in a sense. It points towards no
deterministic system being able to compute more than what a Turing machine can
compute. In this sense, incomputable means not only incomputable for Turing
machines, but for ANY type of deterministic machine.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 15/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
Given how many systems are Turing equivalent, how simple a system can be to be
Turing equivalent, and how prevalent Turing equivalence is, does it still make sense to
think of Turing completeness in terms of Turing machines? Maybe pragmatically, but
in my opinion, these machines shouldn’t form the essence of Turing computability,
rather merely the origin of Turing computability.
Well, our edge against these problems lies in not solving the general problems that are
proven incomputable, but tackling specific sub-problems that it might be useful to solve
anyways. If we had a program that verified whether a certain program would
terminate or not for most programs (but not all), that’s something we can use to help
us write algorithms and proofs. Pathological cases need not stop us from providing
answers in straightforward cases.
In software engineering, we solve specific subproblems like this all the time. So often,
in fact, we might not realize what we’re doing. For example, does this JS program ever
finish execution?
function run(){
for(let i = 0; i !== -1; i++);
}
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 16/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
The answer is “No, of course not. i will never equal -1, so this program will run
forever.” Well, you just performed a little subproblem of the great and undecidable
halting problem, and it wasn’t even difficult! Yay!
Hypercomputation
There is, however, a field of study called hypercomputation that deals with the
calculation of incomputable numbers. Like actual, real, manifestable incomputable
numbers in the real world. Hypercomputation as a subject requires either:
1. That the Church-Turing thesis is false, such that there exists some mechanical
process that humans can do to compute numbers that can’t be performed by
computers.
3. That there are physically realizable incomputable numbers, such that there are
instances wherein we can measure incomputable numbers physically rather than
compute them.
Philosophically, if any of these things are true, then that says something very profound
about the nature of the universe: that the universe explicitly does NOT operate like a
Turing machine. This might be really interesting to know.
For potentially unsurprising reasons, studying something that relies on one of those
three unproven assumptions has led to a number of skeptics. Notably, Martin Davis
(the fellow who as mentioned earlier popularized the modern definition of Turing
machines), wrote a paper with the wonderfully sassy title The Myth of
Hypercomputation. Davis argues that 1: many ‘results’ in hypercomputation either
implicitly or explicitly presume having access to incomputable numbers to begin with,
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 17/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
This controversy ended up prompting one of the better lines in academia, written by
Davis in Vol. 178 of Applied Mathematics and Computation:
The editors have kindly invited me to write an introduction to this special issue devoted to
‘‘hypercomputation’’ despite their perfect awareness of my belief that there is no such subject.
I had no other reason to include this mention of hypercomputation except that I find
the above quote hilarious and wanted a reason to share it.
Does this field exist? Tell us what you think in the comment section below. Don’t forget
to rate, comment, and subscribe for more videos like this!
It’s not a high bar. You wouldn’t differentiate a programming language as being
Turing complete, given that practically every other programming language for
which Turing completeness matters is itself Turing complete.
Whether a language is fully Turing complete vs. linearly bounded isn’t a very useful
distinction, because we run our programs on computers of finite size and speed,
not within the boundless logic-sphere of mathematics, and most language-
specified bounds are going to be large enough for any purpose.
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 18/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
So if it ever is useful in arguments about software engineering, it’s rarely useful at best.
Any argument in software engineering hinging on Turing completeness either
misunderstands Turing completeness or forms a particularly weak claim.
Fortunately, people don’t care purely about the immediate utility of information. That
would be fairly annoying.
Sources include Computability and Logic, The Annotated Turing, lots of Wikipedia, all
papers mentioned (and a few others now long gone in my browser history), assorted
blog posts, conversations about computability with friends, a few of my own
arguments, and hopefully comments from Viewers Like You. Thank you.
If I’m wrong about ANYTHING, regardless how pedantic, feel free to comment and tell
me about why. I have no formal background in theory of computation, so it’s very
likely I got something wrong here, just hoping it wasn’t anything too major.
Footnotes
(1): The definition I chose to use here differs only minimally from Kleene and Martin’s
description of the partial function, which requires an extra tally for each input, such
that an input of 3 would be encoded 1111, rather than 111. I’m not sure why
Computability and Logic chose to stray from that, but this isn’t a wildly important
difference.
(2): If you haven’t encountered Brainfuck before and you’re a big enough nerd to have
made it this far into an article about Turing completeness, you’re in for a treat: It’s a
hilariously minimalistic and hard to use programming language. Seriously, try it out!)
(3) I believe this is the definition implicitly used in Brainfuck is Turing Complete
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 19/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
(4) It might have been more convenient to use nested arrays, such as [] to represent 0,
[[]] to represent 1, so on and so forth. I thought objects would capture the nature a bit
better.
(5) In this case, we can paint some strong intuition why we likely don’t have such an
issue. Remember the untyped lambda calculus I mentioned earlier? It uses a recursive
structure to represent unary numbers in a very similar fashion, and one could easily
define a translation between the above linked list representation and the Church
Numerals that the untyped lambda calculus uses. Since the operations on the lambda
calculus are defined recursively, and (I don’t think) there is any spec-defined limit on
recursion depth, this format should be sufficient. Javascript is almost certainly Turing
complete.
(6) To me, it seems like our looser sense of “Is this system Turing Complete” implicitly
asks “Does there exist an input/output strategy such that the resulting system is Turing
Complete?” I’m not going to dig into this problem, because doing so opens up the can
of worms in terms of “well what defines an input/output schema? Could that alone be
Turing-complete?” and I’m not yet equipped to tackle those questions. We’ll just have to
plug our ears and close our eyes and pretend we haven’t thought of this minor
complication.
(7) I believe this is what Microsoft’s Terminator research project was trying to tackle,
but I don’t know what’s up with that or where the current state of the art is.
Software Engineering
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 20/21
2/12/23, 1:03 AM What exactly is Turing Completeness? | by Evin Sellin | Medium
https://evinsellin.medium.com/what-exactly-is-turing-completeness-a08cc36b26e2 21/21
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Published in HackerNoon.com
Save
Let me delineate the scope of this article so that you know what you’re in for.
I’ll start off by giving a gentle introduction to the Turing machine followed by a
discussion on the Church-Turing thesis. I’ll touch the Chomsky hierarchy. (Just a bit)
I’ll discuss the fundamentals of an I/O Turing Machine by taking an example,
accompanied with some basic mathematics.
After this, we will see how the Ethereum blockchain is not completely Turing complete
and why it is rudimentary in the present-day. We will see what implications Turing
completeness can have on the Ethereum blockchain with respect to the concept of
Ethereum gas. We will go over the fundamentals of the Vyper language. We will then
see in what scenarios a true Turing machine can transform smart contracts (this
section contains futuristic talk).
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 1/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
This article is best enjoyed with a cup of strong filter coffee. If you don’t know what is filter
coffee then you are missing out on life, my friend.
Source: https://simple.wikipedia.org/
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 2/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
The Turing machine is a theoretical, abstract idea which can simulate any algorithm
that can be logically constructed. This means that a Turing machine can solve any
problem if it can be coded out. There’s special emphasis on the word any. It certainly
doesn’t guarantee how much time it will take to solve the problem, but it is certain that
it will solve the problem. So it can take a second, a minute, a lifetime, or an entire
generation to solve a problem.
Everything that is to be deleted from the tape and everything that is to be added to the
tape is governed by user-described instructions.
When a Turing machine starts, anything written on the tape is the input. When the
Turing machine halts after completion of the problem, anything written on the tape is
the output.
To compute the solution for a given problem, the Turing machine may read and write
on the tape for infinite amount of time. There is no boundary on any resource like
time, memory whatsoever.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 3/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Where,
𝛿 is a function.
There are some functions which can’t even be calculated by a Turing machine. For
instance, quantum computers can simulate procedures in less amount of time as
compared to modern computers. In contrast, there exist problems such as halting
problem which an ordinary computer cannot answer. And according to Church-Turing
thesis, no computational device can answer such a question.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 4/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Chomsky Hierarchy
According to Chomsky, there are 4 types of languages which are differentiated based
on the freedom of usability. Type 0 is the most flexible, free language and Type 3 is the
most restricted language.
The language used in a Turing machine falls under Type 0 classification because the
programmer has all the flexibility in the world to write whatever program they wish to
write. Most of the languages today are Turing complete or Type 0 languages like C++,
Java, JavaScript, Solidty, Pascal etc. Almost all languages today are Turing complete.
The only languages that are not Turing complete are markup languages.
Let’s take an infinitely long tape with a random string on it. Let the string be
The Turing machine should print ‘o’ if the number of 1s is odd and should print ‘e’ if
the number of 1s is even.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 5/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Since the head is on the start of the string, the mapping would be as follows:
This is because the data on the first cell was 0. The state will change only when the
machine head will encounter 1.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 6/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Next mapping:
Next mapping:
Next mapping:
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 7/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Next mapping:
Next mapping:
Next mapping:
H is the halting state. This means the machine has stopped since it encountered a
blank. The head won’t move left or right so there is a — .
Since the machine halted at q1 state, there are odd number of 1s. If the machine halted
at q0 state, there would be even number of 1s.
I hope this gave you a gist of what a Turing machine really is. In the next section, we
will explore the consequences of Turing machine with respect to the Ethereum
blockchain.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 9/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
On 14th Feb 2019, 3:10 PM, the gas limit was 8000029 gas and the gas price was 5.1
gwei. This information can be easily found at ethstats.net. It’s a really cool site.
Such limits are imposed to protect the blockchain from DDoS attacks.
If you want to translate gas spent per unit time, you can check out ethgasstation.info
for the conversion.
So effectively, there are 2 limits imposed on any I/O on the Ethereum blockchain.
These are gas cost and block gas limit.
And, we know that a true Turing machine works with unlimited resources and the
concept of Gas prevents the Ethereum blockchain to be truly Turing complete.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 10/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Fancy is:
1. Powering solar panel using electricity purchased from a decentralized grid to power
your water heater.
2. Your smart car interacts with other smart cars on the road and when your car pays
the other smart car in crypto, those cars will clear the way for you.
3. Your smart car will not ignite if you consume too much alcohol. Alcohol
consumption can be recorded using smart sensors.
Let your imagination run wild. The things you would imagine; they are classified as
fancy.
This stuff is fancy because it deals with autonomous intelligence. For such things, we
need very sophisticated smart contracts which will run for a higher gas than the
current block gas limit. This is the future. The future is not P2P, rather it is M2M. This
is where we need Turing completeness.
A hacker can run any algorithm on EVM written in solidity to create an unauthorized
effect. Most of it will be prevented due to the gas limit, but still, the damage cannot be
undone. Of course, running arbitrary code is dangerous! For instance, there can be a
buffer overflow in a banking application that allows the hacker to change their
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 11/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
balance. This kind of vulnerability arises due to the fact that Solidity gave the hacker
such freedom.
The current ERC20 token cannot securely and cheaply handle hyper-efficient, high
throughput processing for carrying out sophisticated M2M interactions devoid of
human intervention and oversight.
This is why some folks say that Solidity is not the right choice for the smart contract.
We need something more secure, auditable. This is where Vyper comes in. A basic
example of this would be to store health data on Ethereum blockchain. Solidity may
not be the best language for that. Vyper surely is.
Don’t get me wrong, the language Solidity is Turing complete but the “world-
computer” EVM is not.
The language Vyper is NOT Turing complete, Solidity is. At the same time, a program
written in Vyper will always have a predictable output. A program written in Solidity
will not have a predictable output until and unless it is deployed and executed.
2. Class inheritance
3. Inline assembly
4. Function overloading
5. Operator overloading
6. Recursive calling
7. Infinite-length loops
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 12/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Coming back…
So, there’s a tradeoff between security and freedom here. Fewer features, more
auditability, and more security. More features, less auditability and less security.
Since we are talking about blockchain, let’s take a while to remember the Bitcoin
blockchain. The Bitcoin scripting language is NOT Turing complete. The script only
performs one function: transfer funds from one account to another. So there is no
need for Turing completeness. So the behavior space of bitcoin script is predictable, as
opposed to Solidity.
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 13/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
I’d like to take this final opportunity to re-emphasise on the future of smart contracts.
Some of us might call autonomous machines interacting with each other ‘too fancy’.
But I kid you not, probably by the time you are a grandparent, you’d be surprised to see
that this, in fact, will become a reality. Do you want to be one of those old people who
don’t understand technology anymore? I am guessing the answer here is no. So, don’t
tag such ideas as ‘fancy’ and start contributing to these futuristic thoughts! Who cares
if we sound crazy? If crazy people love to ideate, call me crazy!
That’s enough of me ranting there, lol. In the next article, I’d probably show you how to
write smart contracts in Vyper language.
I really hope you enjoyed this. If you did, please applaud and support these ‘crazy’ ideas!
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 14/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
Sign Up
Terms of Service
Powered by Upscribe
I agree to leave medium.com and submit this information,
which will be collected and used according to Upscribe's
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 15/16
2/12/23, 1:05 AM Turing Completeness and the Ethereum Blockchain | by Niharika Singh | HackerNoon.com | Medium
how hackers start their afternoons. the real shit is on hackernoon.com. Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
About Help Terms Privacy
https://medium.com/hackernoon/turing-completeness-and-the-ethereum-blockchain-c5a93b865c1a 16/16
2/12/23, 1:07 AM What is Meant By Turing-Complete in Ethereum? - GeeksforGeeks
Data Structures and Algorithms Interview Preparation Data Science Topic-wise Practice C C+
Read Discuss
Turing complete refers to the idea that given infinite time, any program in one language
Turing-completeness is a word defined by Alan Turing which it describes the idea that
some computing machines are capable of per forming any task a computer can per form.
The concept of Turing-completeness is one at the hear t of sof tware and application
In other words, one can write your program without worr ying about what else is
sof tware. It is also impor tant to know what “ Turing-complete” means and how it
relates to Ethereum.
For instance, whether a machine can eventually imitate the behaviors of a human. In
It is necessar y for introducing new techniques and ideas into sof tware programming
One of the main obstacles that cr yptocurrency runs into is reliance on a third par ty,
These companies are responsible for ensuring that a cr yptocurrency can be used in
means that an appropriately designed program can solve any problem that a
In order for this to be feasible, programs must be free from restrictions, such as
https://www.geeksforgeeks.org/what-is-meant-by-turing-complete-in-ethereum/ 2/7
2/12/23, 1:07 AM What is Meant By Turing-Complete in Ethereum? - GeeksforGeeks
programs in one language and allows other projects or companies to create highly
Key Points
Ethereum can be built on the blockchain that has been built right now with no need to
upgrade. So, one gets a cheap and scalable Blockchain offering storage and
processing power that is almost limitless and at the same time evolving.
many more things on it. All thanks to its Turing-complete language Solidity.
The whole concept of cr yptocurrencies and smar t contracts is based on the idea of
Turing-complete languages.
Smar t contracts are being used for all kinds of applications including common
transactions like payments, buying a car, or even licensing music or sof tware. Smar t
contracts can be used in an efficient way to run state channels between users and to
ERC20 is the standard document that provides a structure for tokens (works on
Ethereum) and it is compatible with most tokens projects like City Coin, Request
Initial coin offering (ICO) which is a new way to raise money for a project – uses
ERC20 as the monetar y unit without issuing tradable ERC20 tokens before the ICO
launch.
This means that, theoretically, one could buy a house or make other major purchases
However, there are concerns regarding whether or not this is feasible due to the high
costs associated with Turing complete systems and their ability to run continuously
ideas are being brought for th constantly — many of which would not have been possible
A system has to be Turing complete in order to be useful in blockchain, but it can have
all the other desirable proper ties of a blockchain, such as decentralization and
trustless transactions.
complete systems have to be able to run any possible computation, which includes
the most complex types of computation such as those found in blockchain. This type
of system also of ten has better per formance than other systems because it can use a
set of rules which are more efficient when solving problems with many steps.
In addition to being Turing complete, a system must also be decentralized and allow
blockchain. These proper ties are necessar y for the security and consistency that a
blockchain needs in order for its data records or “blocks” to have value and meaning.
Ethereum is a ver y new technology with many possibilities that can disrupt our lives in
the future. In shor t, it is a complex network of computers that allows one to create own
Like 0
Previous Next
Related Articles
3. Ethereum 2.0
4. What is Ethereum?
Ar ticle Contributed By :
wanderlustsaxshy
@wanderlustsaxshy
Company Learn
About Us DSA
Careers Algorithms
In Media Data Structures
Start Your Coding Journey Now!
https://www.geeksforgeeks.org/what-is-meant-by-turing-complete-in-ethereum/ 6/7
2/12/23, 1:07 AM What is Meant By Turing-Complete in Ethereum? - GeeksforGeeks
News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
SQL
Knowledge
Kotlin
Published in HackerNoon.com
Save
A modern model for creating highly scalable and profit-making applications is making
its way to our regular lives these days. Bitcoin has gained popularity with features like
peer-to-peer technology and distributed storage ledger. These features provide the
building blocks for creating new type of applications which are called as decentralized
applications, or DApps.
Being a new concept in the industry, DApps are getting a lot of media coverage.
However, with their increasing implementation and emerging use cases, they are likely
to be adopted and accepted by the people. DApps are known for being distributed,
flexible, transparent along with having a better structure of incentivization than the
current software models.
In order to understand the meaning of this definition better, let’s first try to
understand how traditional web applications function and how are DApps any
different? In traditional web apps, two important elements that make the system
usable are the front end and the back end. These elements communicate with each
other in the form of coding messages through the HTTP protocol.
There are multiple issues involved with such applications when compared with DApps.
First of all, such application servers are hosted on a hosting service that uses a
centralized architecture which leads to a single point of failure in case of a malicious
attack. Moreover, taking down an application through a centralized server only
requires the hacker to interrupt with the hosting service. When we rely on centralized
servers, the data is more susceptible to attacks.
When it comes to DApps, there are again two main elements involved. While the front
end remains the same as traditional applications, the backend is formed in the form of
an Ethereum blockchain. The communication between the frontend and backend
happens in the same form as in the traditional app and the end user won’t be able to
distinguish between both. In the case of using a DApp, it is very difficult to bring any
application down as it requires to take down all the distributed hosting nodes which
are practically not possible.
Taking an example for the same standard popular web applications like Facebook,
Twitter and Instagram currently function on a centralized server model. The data of
these applications is controlled by singular authorities and can be manipulated or
changed according to need. Meaning that though there are millions of front-end users
of these applications, the backend is still controlled by the individual organization.
Contrary to this, a DApp is distributed in nature and involves the participation of all the
elements of the network in order to modify or take control of any information. DApps
can run on both, peer-to-peer as well as blockchain network. When an application like
Twitter takes a DApp based approach, no one has the authority to delete anyone’s tweet
once it is posted on the network after running through the consensus mechanism.
The nature of DApps can be summed up as distributed, flexible and transparent as they
have the potential to transform the technological landscape.
In the current times, we put our trust, data and vital information in hands of
centralized applications that function through typical servers, databanks or standalone
computers. This approach allows one single authority to have control over everything
we do on these applications thus, putting our privacy at risk. On the other hand, the
Ethereum network runs on a community-based model which operates in a distributed
model.
Decentralized applications are very useful as they can be used to connect different
people in marketplaces, sharing resources and storing them, maintaining cryptos as
well as executing smart contracts without giving ownership to one central authority.
Currently running DApps include tools for storage, security, and servers etc. Other
than these, some apps are created in the form of digital wallets that allow people to
manage their cryptocurrencies.
DApp Features
Though DApps are recently introduced with these many use cases, they have become
popular and are in demand too. Some common features that make decentralized
applications noticeable are:
Open Source
In closed-source applications, the end users need to trust the developers of the
applications in terms of decentralization as they can’t directly access their data via any
central source. Thus, closed-source applications are always subjected to risks for users
when it comes to adopting them. DApps, on the other hand, is decentralized and open
source applications. A DApp creates a new structure for business practices as it allows
all the network participants to keep track of the happenings rather than one person.
They are governed through autonomy and any changes in the DApp are decided
through the consensus (the majority of users) The code base of a DApp should be
available for scrutiny.
Decentralized Consensus
Before the introduction of Bitcoin, the validity of any transaction would always need
some kind of centralization. In order to make a payment, the transaction was pushed
ahead through a clearinghouse that monitored it. Decentralized applications work on a
peer to peer (P2P) model, meaning that the nodes are able to connect with each other
directly. In a DApp, a transaction is processed through a consensus mechanism. When
the majority of the nodes approve the transaction, it goes ahead and gets processed.
Also, the validators of the network are incentivized by rewarding them in the form of
cryptographic tokens.
DApps Classification
DApps can be classified into three different types according to the Ethereum white
paper. Let us understand them one-by-one here:
ICO DApps are easy to structure as they apply technologies like the ERC20 Token
Standard. Most of the ICOs function by having investors send funds to a smart contract
in the form of bitcoin or ether. This smart contract stores the funds and shares an
equivalent value in the form of a new token at a later point in time.
The data and records of the application’s functioning should be kept on a public
and decentralized blockchain. Also, all the information stored on the blockchain
must be cryptographically encrypted.
The application must use a crypto token such as Bitcoin or any native token of its
own. This token should be used for rewarding miners and farmers according to
their contribution in the system
The DApp must use a standard cryptographic algorithm in order to generate token
and have a fixed consensus mechanism similar to Bitcoin which uses Proof of
Work algorithm for rewarding purposes.
While on the other hand, the proof-of-stake mechanism allows any decision on the
DApp to be made on the basis of the percentage ownership of the application by the
stakeholders. For example, if a stakeholder of a decentralized application holds 25%
tokens issued by the app, he/she carries 25% weight. The Omni Protocol utilizes the
proof-of-stake mechanism.
It is not necessary to use one single algorithm among these two i.e. any application can
use both of these mechanisms in parallel. An example of such case it the Peercoin.
This kind of combination allows the DApp to consume less energy which is one of the
major drawbacks of using proof-of-work alone and it also allows the application to
become more resistant to 51% attacks.
The fundraising mechanism is nothing but a method to raise money for the initial
development of the application. This is carried out with the help of ICO, Initial Coin
Offering process. People are presented with the app idea through a white paper,
website, and proof of concepts and if they seem convinced with it, they can contribute
to the application by raising funds for it.
In the fundraising mechanism, the tokens are distributed to the people who contribute
to the initial development of the application. Consider the example of the Master
Protocol for understanding this. The app tokens, Mastercoins were initially distributed
to the people who participated in their ICO and sent their Bitcoins to a given address in
exchange for Mastercoins. These Bitcoins were then used to fund the application
development.
implemented on decentralized blockchains. These apps are fueled with the tokens that
are generated using a protocol.
The open-source nature of a DApp makes it fully decentralized and allows anyone to
view and make contributions to the code. This also ensures the quality and quantity
factors as it fastens the scalability process of product development.
Once these steps are taken care of, using blockchain to decentralize the application is
the next in line. Blockchain technology allows you to create a permanent ledger for
storing any kind of records. The next step is to add transactions and records to
blockchain ledger with the help of tokens that are mined using different protocols or
algorithms i.e PoW, PoS or both in some cases.
Golem
Golem is a DApp project that aims to create a global market for utilizing idle computing
power. The concept of the project is to utilize the power of PCs and data centers to
create a rentable supercomputer that can be used by anyone across the world.
Rather than relying on any central server farm, the project distributes the
computational load to the “Providers” who are willing to rent their machines for
computational work. These providers can share their resources in exchange for GNT
tokens. The project holds a lot of potential and scope as it allows to decentralize the
rendering process and is much faster and cheaper than the centralized options.
Augur
The Augur application has predicted many results that have been proven more
accurate than the prediction of many experts in the real world. Augur is considered to
be a prediction market prediction platform which will incentivize users when they
make correct predictions for world events. Moreover, the market creators the holders
of the platform tokens that report on events will also be paid or incentivized.
Status
Defining itself as The Mobile Ethereum Client, Status allows mobile devices to act as a
light client node. Based on the Ethereum network, it allows you to chat, browse and
make your payments safely on the decentralized web. The DApp also enables you to
access the entire Ethereum ecosystem from anywhere.
Users can send smart contracts and exchange payments with each other within the
DApps messenger system. Since the app is operated on a peer-to-peer protocol, server
downtime is not an issue.
Gnosis
Similar to Augur, Gnosis is also a prediction market platform built on the Ethereum
blockchain. The project aims to allow people to make accurate predictions about real-
world events like elections, market prices, etc. Users of the platform are rewarded for
making accurate predictions by Gnosis in the form of GNO token or other
cryptocurrencies as per the project’s preset rules.
Gnosis allows developers to create their own custom prediction market on Gnosis
through the available developer tools on the platform.
Prism
Prism is an Ethereum-hosted project by ShapeShift. It provides a trustless and
decentralized asset portfolio market. It utilizes EDCCs, executable distributed code
contracts, in order to generate custom management tools for market portfolios. With
the aid of Prism, anyone can invest ether in different cryptos and specify the holding
percentage they want.
Prism eliminates the need for third-parties and the complex process of saving and
storing wallets and multiple private keys. Since the project is based on Ethereum
Smart Contracts, the requirement of managing passwords and keys of different
Aragon
Another ambitious project in the DApp series is Aragon. The Ethereum based platform
allows people to create and manage a decentralized organization. Aragon is an open
source project and is managed by the Aragon Foundation. The concept of the project is
to eliminate the need for human trade and allows people to manage entire businesses
and organizations using the blockchain.
Aragon also assists in curbing unnecessary third parties by replacing them with
ethereum-based smart contracts. By eliminating geographical boundaries and
paperwork, the platform aims to act as an extremely convenient digital jurisdiction for
everyone.
Conclusion
Dapps have evolved with exceptional features which gives them the potential of
becoming self-sustaining resources as they provide their stakeholders with the ability
to invest in Dapp development. Observing their popularity, it can be established that in
the coming days, DApps for multiple purposes such as payments, storage, cloud
computing etc. will soon surpass the currently available traditional applications.
——————————————————————————
how hackers start their afternoons. the real shit is on hackernoon.com. Take a look.
Search Medium
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Published in CryptoWise
@pramodAIML Follow
Save
I Feel:
DApps are the true technology that harnesses the power of decentralization beautifully
to serve end-users with the required sensitivity and security. DApps are expanded as
Decentralized Applications which are built on the top of Blockchain.
Blockchain-powered decentralized apps are similar to the current mobile or web apps
we use everyday and only differ in how you transact or communicate over the
blockchain network. Here the data being transacted is no longer controlled by big any
single entity, middleman, or enterprises rather it is being distributed over the
decentralized network of millions of nodes keeping user records and identity
immutable and secure.
https://medium.com/crypto-wisdom/dapps-crypto-basics-for-all-part-1-6fc794e4d765 2/7
2/12/23, 1:12 AM DApps: Crypto Basics For All Part 1 | by @pramodAIML | CryptoWise | Medium
The main difference between conventional web or mobile apps and DApps is that DApp’s run
on distributed and immutable blockchain networks rather than a centrally controlled
operating system/server. This power of immutability makes DApps free of any censorship
Censorship Proof :
If you are using a decentralized app, as a user your profile or account can’t be blocked
by anyone in the blockchain network as it is not controlled by any central authority or
any owner.
If you are using Facebook-like dApp and publish messages in the app network. Once
posted, no one, including you, cannot delete those messages.
Open Source:
DApps needs to be open sourced and the code base must be available for the developer
community. Having said that, any updates being pushed in the open sourced DApp
https://medium.com/crypto-wisdom/dapps-crypto-basics-for-all-part-1-6fc794e4d765 3/7
2/12/23, 1:12 AM DApps: Crypto Basics For All Part 1 | by @pramodAIML | CryptoWise | Medium
code must be done through a consensus mechanism that amounts to some form of
majority vote rather than by a developer.
Decentralized:
As it is a decentralized app, DApps data which is obviously anonymous must be stored
on an immutable, public blockchain.
Secured Cryptographically :
Dapps offer Complete data integrity. Data stored on the blockchain is immutable and
indisputable, thanks to cryptographic primitives that ensures that hackers/attackers
can’t forge your transaction without your consent. You authorize dapp actions with
your DApp user account usually via your wallet, so that your credentials remain safe .
Stay Anonymous:
As dApps user your real world identity is never revealed and you can stay anonymous
while transaction in the DApp.
Get Incentivised :
Validators in the Blockchain ecosystem are incentivized through tokens generated in
DApp’s.
Here smart contracts is a set of protocols which lives on the blockchain publicly to be
viewed and executed based on those set protocols. Smart contracts facilitate
agreements and transactions as a trusted mediator. The real reason why DApps are
able to be decentralized in the given blockchain network, is the intelligent smart
contract which holds the logic to control the DApp’s transactions.
https://medium.com/crypto-wisdom/dapps-crypto-basics-for-all-part-1-6fc794e4d765 4/7
2/12/23, 1:12 AM DApps: Crypto Basics For All Part 1 | by @pramodAIML | CryptoWise | Medium
Smart Contract:
As covered above, smart contracts lie at the core of Dapps success. Let’s understand
more about smart contract
A “smart contract” is simply a code piece that runs on the Ethereum blockchain. It’s a
collection of functions and data (its state) that resides at a specific address on the blockchain
platform like Ethereum.
Smart contracts are a kind of Ethereum account. This means they have a balance and
they can send transactions over the network. However they’re not controlled by a user,
instead they are deployed to the network and run as programmed
We will learn more about Smart contracts and how it works in our upcoming piece in
this series of Crypto basics, as it is out of scope for this article.
DApps Example :
UniSwap : Decentralized Trading Protocol
Audius: Giving everyone the freedom to distribute, monetize, and stream audio
What’s Next?
We will discuss the most fundamental unit of blockchain network called “Nodes”. I feel
it is imperative that one should understand the importance and functionality of nodes
https://medium.com/crypto-wisdom/dapps-crypto-basics-for-all-part-1-6fc794e4d765 5/7
2/12/23, 1:12 AM DApps: Crypto Basics For All Part 1 | by @pramodAIML | CryptoWise | Medium
if one want to learn more about crypto basics. Also we will cover
Smart Contract
MetaMask
Yield Farming
Cloud Mining
Pool Mining
Meanwhile if you want to learn about one of the promising crypto project called
Elrond, click the given link below
https://medium.com/crypto-wisdom/dapps-crypto-basics-for-all-part-1-6fc794e4d765 6/7
2/12/23, 1:12 AM DApps: Crypto Basics For All Part 1 | by @pramodAIML | CryptoWise | Medium
Give a tip
Your email
Subscribe
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/crypto-wisdom/dapps-crypto-basics-for-all-part-1-6fc794e4d765 7/7
2/12/23, 1:16 AM Centralized vs. Decentralized Apps, Part 1: The Difference | by Maxwell Goldbas | Medium
Save
Like Big Data, or teenage sex, everyone is talking about it, yet few know what it
actually is. After my first dive into building a natural gas exchange on Ethereum, I
would like to share my insights, and blunders.
All applications are, fundamentally, logic. If I submit this form, my data is saved. If I
click the thumbs up button, I send my approval. If I swipe left, I send my disproval.
With a centralized application, a single cluster of servers contains all logic to conduct
the necessary steps. The cluster receives your request, processes it, saves what it
needs, and returns the correct response. With a decentralized application (or Dapp) all
nodes in the network receive the logic you have deployed within your contract. Once
the contract is mined, all nodes have the exact same logic, based on the contract, saved
on their copy of the blockchain. Once you interact with this contract, the same signal
must be processed with the deployed logic same way, then save the same data and
return the same signal.
The main advantage is you do not need to maintain a cluster nor keep the cluster
secure. That is taken care of by the redundancy of the nodes in the network. The
majority of logically functionality within applications is taken care of by decentralized
Ethereum applications (user authentication, get/post requests, data storage, etc.) .
However much of the existing infrastructure that applications work with is centralized
and an Ethereum contract cannot work with a centralized systems that require
common API calls. If a contract was to make a conventional API call, it would require
every node that it existed on to execute a call, which would cause irregularities in the
API call. (Although, Oraclize is gaining strength)
If you would like to discuss Caserta building a distributed application for your
company, please reach out to me at [email protected]
Search Medium
https://medium.com/@GoldbasNews/centralized-vs-decentralized-apps-part-1-the-difference-244a66e0b74d 2/3
2/12/23, 1:16 AM Centralized vs. Decentralized Apps, Part 1: The Difference | by Maxwell Goldbas | Medium
https://medium.com/@GoldbasNews/centralized-vs-decentralized-apps-part-1-the-difference-244a66e0b74d 3/3
2/12/23, 1:18 AM Centralized vs Decentralized vs Distributed: a quick overview | by Julio Marín | Medium
Save
When getting into dApps and blockchain related technologies this concepts sometimes
got confused, so here you have a quick overview,
Centralized Applications
https://medium.com/@juliomacr/centralized-vs-decentralized-vs-distributed-a-quick-overview-1f3bd17b8468 1/3
2/12/23, 1:18 AM Centralized vs Decentralized vs Distributed: a quick overview | by Julio Marín | Medium
Most of the Internet applications we use every day are centralized, they are owned by a
particular company or person that provision and maintain the source code to execute
on a computer, server or maybe even a cluster.
Centralized applications are the majority of applications that engineers are used to
building and users are used to using.
Decentralized Applications
Distributed means computation is spread across multiple nodes instead of just one.
Decentralized means no node is instructing any other node as to what to do.
The code runs on a peer-to-peer network of nodes and no single node has control over
the dApp. Depending on the functionality of the dApp, different data structures can be
used to store the application data. Bitcoin uses a blockchain decentralized ledger of
transactions.
Distributed Applications
Applications in which computation is distributed across components, communicate
and coordinate their actions by passing messages. The components interact with each
other in order to achieve a common goal.
CDN
AWS
Cloud Instances
https://medium.com/@juliomacr/centralized-vs-decentralized-vs-distributed-a-quick-overview-1f3bd17b8468 2/3
2/12/23, 1:18 AM Centralized vs Decentralized vs Distributed: a quick overview | by Julio Marín | Medium
Hopefully this will be helpful for you and if you want to know more about the
SalsaMobi education efforts on different technologies you can subscribe here and we
will notified you when we create more articles or tutorials.
SalsaMobi Logo
Julio Marin is an advocate for the research and implementation of new technologies and their
use on day to day life. Research areas include multimedia development and delivery,
cryptocurrencies, mobile development and marketing automation. Currently works in
SalsaMobi as Senior Curriculum Developer and Blockchain Development Team Lead.
Open in app Sign up Sign In
Search Medium
Blockchain Dapps
https://medium.com/@juliomacr/centralized-vs-decentralized-vs-distributed-a-quick-overview-1f3bd17b8468 3/3
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
Read Discuss
With the existence of the dApps, some confusion arises about the Apps and
dApps. Apps are the shor t form of applications and dApps are the shor t form of
decentralized applications.
Centralized Applications
Like Facebook, and YouTube in these types of applications ever ything is on one ser ver,
and ever y time whenever there is a request from the nodes these ser vers give data to
the nodes. These Centralized applications are made of two things- The back End and
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 1/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
a single organization. These apps are useful when the developer needs full control over
the apps and how it is used. It is much easier to upgrade a centralized app than a dApps.
Read Discuss
Decentralized Applications
The application that runs on our P2P network is called a decentralized application. In
this decentralized application, ever ything runs in all the nodes of the network. dApps are
of ten built on the Ethereum platform and can be used for a variety of purposes These
decentralized applications are made with two things smar t contracts and the front end.
They use a Smar t contract to complete the transaction between two anonymous par ties
and the front end to interact with the system. People interested in free speech point out
that apps can be developed as an alternative social media platform. Some concern is
that these dApps are new technology and hence it is not so user-friendly as centralized
apps.
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 2/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
Read Discuss
Comparison Applications
(dApps)
“dApp,” runs.
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 3/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
User The user interacts with a traditional program. The User interacts
Read Discuss
contract-based
blockchain.
Working The user gets the app from the app store and In the case of DApps,
ser ver processes the request and responds downloading the app
cr yptocurrency) to
download the
application’s source
contract,” which is a
collection of code,
can be used to
execute the
application.
code operates on a
peer-to-peer
network.
HIDE AD
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 4/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
are Uniswap,
Cr yptoKitties,
MakerDAO,
Cr yptoPunks,
BitTorrent, Audius,
and MetaMask
require high
computing power.
Applications (dApps)
transparent.
Cyber attack These apps are more vulnerable to cyber These apps are less
attacks.
System If any ser ver goes down system collapse. If any node goes down
normally.
End- user These apps are easy to use for end-user. These apps are
HIDE AD
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 5/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
end-user.
Read
Censorship Discuss They provide censorship. They provide
resistance to
Censorship.
Pay You pay for the ser vices of centralized apps. They pay to become
par t of dApps.
Usability and In terms of usability and scalability, they are In terms of usability
are limited.
Advantages You retain complete control over the If the ser ver goes
Data Structures and Algorithms levels. Interview Preparation Data Science Topic-wise Practice
app. C C+
Easy to update as it is sent automatically Because of
a data breach or
hacking attempt.
Disadvantages If a system error occurs, an app may shut Difficult to fix the
down and no one may use the app until the bugs and update
issue is repaired, which may cause your the sof tware due
customers to be inconvenienced. to
expenditures. cr yptocurrencies
and blockchain
aren’t currently
“popular ”
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 6/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
target audience is
limited.
term as dApp
transactions are
typically slower
and more
expensive than
centralized
transactions, you
to attract users to
shor t term.
Which one is A centralized app works for you if you want a A decentralized app
for you? system that is easier to manage. works for you if you
redundancy and
security.
Like 1
Previous Next
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 7/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
Related Articles
Read Discuss
1. Comparison - Centralized, Decentralized and Distributed Systems
Ar ticle Contributed By :
guptavivek0503
@guptavivek0503
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 8/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
Company Learn
About Us DSA
Careers Algorithms
In Media Data Structures
Contact Us SDE Cheat Sheet
Privacy Policy Machine learning
Copyright Policy CS Subjects
Advertise with us Video Tutorials
Courses
News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
Start Your Coding Journey Now! C#
HIDE AD
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 9/10
2/12/23, 1:21 AM Centralized vs Decentralized Applications - GeeksforGeeks
Lifestyle SQL
Knowledge Kotlin
Read Discuss
Web Development Contribute
Web Tutorials Write an Article
Django Tutorial Improve an Article
HTML Pick Topics to Write
JavaScript Write Interview Experience
Bootstrap Internships
ReactJS Video Internship
NodeJS
https://www.geeksforgeeks.org/centralized-vs-decentralized-applications/ 10/10
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
Published in Coinmonks
Save
The main difference between these two well known blockchains is that Ethererum
offers the possibility to deploy smart contracts which are quasi Turing complete
algorithms, meaning that you can execute practically anything on ethereum, turning
the blockchain into some sort of distributed computer.
Nodes forming the ethereum network are capable of running these smart contracts
independently of their underlying OS. The way this is achieved is very similar to how
they made it for platforms like .Net and Java, using a Virtual Machine (which behaves as
an intermediary between the compiled code and the underlying OS) and some sort of
intermediate language.
Smart contracts compile into opcodes (the Ethereum intermediate language) that runs
in the EVM (the Ethereum virtual machine). The EVM is what makes the Ethereum
blockchain a global computer and it is very useful for developers to understand how it
works, at least from a general point of view.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 1/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
Transactions that do not contain data: Used to transfer ether from account A to
account B. If sent to a smart contract account it will trigger the “receive” function if
implemented, otherwise it will trigger the “fallback” function if implemented, if
none of them exist, the transaction will fail.
Transactions that contain data: If sent to a smart contract account it will run its
code (the method indicated within the data or the “fallback” function if no
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 2/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
EOA to Smart contract transactions (with or without data). Might trigger further message calls and might fail.
There is always at least one message per transaction, the message originally submitted by the
EOA).
The only way to “activate” the EVM is to send a transaction containing data to a Smart
contract.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 3/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
EVM Components
Program Code.
The opcodes (1 byte long commands) from the compiled smart contract that is been
invoked by the transaction.
Smart contract’s program code are stored on the blockchain (persistent) and are
immutable, meaning that opcodes can only be read and never modified (ROM
memory).
Program Storage.
The storage associated to the smart contract. Every SM account has a 2**256 slot space
of 32 bytes words, acting as a Read/Write database where the contract’s state is saved.
The storage is persisted on the blockchain.
Machine State.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 4/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
Ethereum machine persistent state is the list of accounts, their balances and nonces at
a given point in time. The EVM has access to this huge list of accounts, balances and
nonces and can update it.
Balances can be updated be transferring ether from one account to another, EOA
nonces are increased after each transaction and SM nonces can also be updated if new
smart contracts are deployed onto the blockchain (every time a SM deploys another SM
using the “CREATE” opcode, its nonce is increased).
Program Counter.
The EVM keeps track of the latest executed opcode using a “volatile” program counter.
Once the Transaction is finished, the Program counter is removed, it is not persisted
on the blockchain.
Available Gas.
In order to execute smart contract’s functionality, the transaction sender must provide
some Gas. The EVM keeps track of the available gas after each opcode, if at some point
it runs out of Gas, the transaction is reverted (the Gas is not refunded though). If, on
the other hand, there is some Gas left after the transaction finishes, it gets refunded to
the transaction sender.
Gas is how Ethereum solves the “halting problem”, programs cannot run for ever,
transactions cannot consume more gas than the maximum amount of Gas allowed
within a single Block.
Stack.
The EVM is a stack based machine, what this means is that most opcodes will look for
their operands in the stack although the EVM can also read/write data from its volatile
memory and persistent program storage / state machine.
The stack is a 32 bytes word LIFO memory space, that gets deleted once the execution
terminates. The stack has a maximum depth of 1024 and stores method local variables
that are value types (all types other than arrays, mappings, structs and strings)
although it can only access the top 16 items (in order to access items beyond the 16th
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 5/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
slot it has to remove other items from the top), which means that if you declare, within
the same function 16 local variables or more, you will get an exception at compile time
“stack too deep”.
Memory.
The EVM has another storage location (besides the Stack, the Program Storage and the
calldata), the “memory”, which has a 2**256 slot space and words are 1 byte long (as
opposed to the stack and storage which are 32 bytes long). Despite been “byte-
addressable” the memory normally hold 32 bytes words.
The first four 32 bytes slots (128 bytes in total) in memory are reserved for the
following purposes:
0x40 - 0x5f (32 bytes): currently allocated memory size (aka. free memory pointer)
When assigning a memory variable to another memory variable, the EVM will not
create a copy but just a reference. When assigning a memory variable to a storage
variable, the EVM will create a copy.
The memory is volatile, at the end of the execution nothing will be persisted on the
blockchain (as opposed to the storage).
Global Variables.
Last but not least, the EVM has access to several global variables when running.
BLOCK Variables, like “block number”, “block difficulty”, … These variables are the same
for every single transaction within the same block.
TRANSACTION Variables, like “Tx origin”, “Tx gasPrice”, … These variables are the same
for every single message within the same transaction.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 6/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
MESSAGE Variables, like “msg.sender”, “msg.value”, … These variables are unique to the
message. If a smart contract invokes another smart contracts, these variables will be
updated.
Loading the smart contract opcode & storage from the Ethereum blockchain.
They will then proceed to execute the opcodes in order, update the stack, memory,
storage and machine state if necessary, reduce the amount of Gas after each opcode
execution and, if no exceptions are found (run out of Gas or stumble upon a revert
command for example), the EVM terminates, the stack and memory are wiped out, the
storage and machine state are persisted on the blockchain and the remaining gas is
refunded to the transaction sender.
If, on the contrary, an exception is found, the transaction will revert, the stack and
memory will be wiped out, the storage and machine state will NOT be persisted on the
blockchain (except for the amount of Gas already used), and the remaining gas is
refunded to the transaction sender.
Please check the second part of this blog series to see some other EVM particularities :
Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Jun,
2022 | Medium
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 7/8
2/12/23, 1:23 AM Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-1-81f65bedbe8f 8/8
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
Published in Coinmonks
Save
Ethereum Virtual Machine (EVM). How does it work? (Part 1) | by Alberto Molina | Jun,
2022 | Medium
Internal Call
The volatile Stack and Memory remain the same if a contract’s function invokes
another function within the same contract since the EVM instance will remain
unchanged.
The invoked function can define new memory variables, which will never overlap the
previous function’s memory variable, but since memory is the same, it is perfectly
possible, using assembly, for the invoked function to access the previous function
memory variables and manipulate them.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 1/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
In the above example, function1 will return “0x7b” instead of “0x05” since function2
changed the memory slot that function1 was returning.
External Call
Smart Contracts can call other (external) smart contracts. There are three types of
calls:
Call.
Regular call. The first smart contract invokes functionality in the second smart
contract and wait for a response that might contain data or not.
Delegate Call.
When a smart contract delegates a call to another smart contract, the second smart
contract’s code is executed within the first smart contract context.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 2/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
Static Call.
Just like a regular call but contracts storage cannot be changed. If contract A static calls
contract B, and contract B tries to update its own storage (or invokes contract C that
tries to update its own storage), the call will fail.
Call
When contract A calls contract B using a “regular call” nothing is shared, this is how
the EVM manages it:
1- A new EVM instance is created for contract B, with its own code, storage, a brand
new and empty stack, memory, program counter, with the remaining amount of Gas
and updated Message variables.
2- Once the new EVM instance finishes its tasks, it terminates (deletes the stack and
memory) and the original EVM instance continues (the one with contract A code and
storage) picking up where it left (retrieves the status of the Program counter, stack and
memory).
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 3/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
REGULAR CALL
Contract A stack, memory, program counter and message variables will be the same
when the call returns, however it is important to note that the machine state and
program storage might have been changed by contract B (or any other smart contract
that contract B might have invoked down the line).
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 4/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
Delegate Call
Delegate calls are special. If contract A delegates to contract B, then contract B code
will run on contract’s A context, meaning that contract B’s program storage and
message global variables will actually be contract A’s.
Contract B will have full read/write access to contract’s A state (storage) which can be
extremely dangerous.
On the other hand, contract B will have its own memory and stack, this is how the
EVM manages it:
1- A new EVM instance is created for the contract B, with its own code, but not its own
storage (keeps contract’s A storage), a brand new and empty stack, memory, program
counter, with the remaining amount of Gas and contract A’s Message variables.
2- Once the new EVM instance finishes its tasks, it terminates (deletes the stack and
memory) and the original EVM instance continues (the one with contract A code)
picking up where it left (retrieves the status of the Program counter, stack and
memory). Contract A’s storage might have been changed by the terminated EVM.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 5/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
DELEGATE CALL
Static Call
Static Calls are identical to Regular calls, the only difference is that the message will
have its “static” flag activated, disallowing any modification to the Program Storage
and Machine State.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 6/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 7/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
In both cases the transaction data will contain the contract deployment code, which
contains the contract run code (the opcodes that will be stored on the blockchain and
retrieved as “program code” every time the smart contract is executed) and the contract
constructor code (which is code that will run only once, during deployment, to
initialize the contract’s state).
Contract creation transactions are special for the EVM because they run code that is
not technically deployed on the blockchain yet. It is also the only type of transaction
that can add “program code” to the machine state.
Once the contract is created it will be assigned a unique address based on the creator
address and nonce, if the creator was using the “Create” command, or based on a salt
value if the creator was using the “CreateTo” command (only possible if the creator is
another smart contract).
Contract creation transactions can fail just like any other transaction, in which case the
contract address will not be assigned and the program code will not be stored on the
blockchain.
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 8/9
2/12/23, 1:25 AM Ethereum Virtual Machine (EVM). How does it work? (Part 2) | by Alberto Molina | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/ethereum-virtual-machine-evm-how-does-it-work-part-2-4198401d2a11 9/9
2/12/23, 1:28 AM What is Ethereum Virtual Machine (EVM)? | by Tiny Crypto Labs | Coinmonks | Medium
Published in Coinmonks
Save
Ethereum’s ability to execute smart contracts depends on the EVM. Ethereum’s smart
contracts allow for decentralized applications (dapps). Additionally, businesses can
organize so-called ICOs, or initial coin offerings, on the Ethereum blockchain to
introduce their tokens thanks to smart contracts.
The EVM is quasi-Turing complete, meaning it can perform any calculation as long
as the user initiating the calculation has enough ether to pay the fee required for
that calculation.
The EVM is a sandboxed and isolated environment, meaning that the code it runs
has no access to the network, filesystem, or other processes.
Additionally, the EVM cannot access real-world data, e.g. the current date, time or
weather. To acquire such data, it relies on so-called oracles.
The EVM is sandboxed and isolated from the real world. It means that the code
running in the EVM has no access to a network, file system, or other processes. It
makes the EVM perfect for developing and testing smart contracts without interfering
with the blockchain’s operations.
You might be asking yourself why it is a good idea to test smart contracts in a
sandboxed environment. The thing is that flawed code can be detrimental to any smart
contract, so making sure that there are no flaws in the smart contract code is a must.
It confirms whether a transaction has the correct number of values, whether the
signature is valid, and whether the transaction nonce matches the nonce of that
particular transaction account. In case of a mismatch, the transaction prompts an
error.
It calculates the fee required for the transaction and initializes the gas payment.
The transaction will fail if the EVM notices that the sender did not allocate enough gas
to the initiated transaction. The transaction charge is not reimbursed to the initiator in
this instance. Instead, the miner receives payment.
EVM is where the magic of Ethereum happens, bringing added value to blockchain
technology and the world of cryptocurrencies. Because of features such as the EVM,
the Ethereum platform has enjoyed great popularity, with ether, its native crypto,
remaining one of the largest cryptos by market cap.
But there is a limitation to the EVM, and it is a kind of safety precaution. Smart
contracts can call other contracts, potentially allowing for infinite looping.
The EVM demands a gas fee for each on-network transaction, which means infinite
computational loops are prevented by exhausting their ether. The EVM cannot be
Turing-complete; instead, it is to be quasi-Turing-complete.
https://medium.com/coinmonks/what-is-the-ethereum-virtual-machine-evm-34e55b1c410 3/5
2/12/23, 1:28 AM What is Ethereum Virtual Machine (EVM)? | by Tiny Crypto Labs | Coinmonks | Medium
Another thing worth mentioning is that the EVM cannot access even the most basic
real-world data. For example, the EVM cannot know on its own what day it is or tell the
current temperature.
The EVM relies on real-world data providers known as oracles to acquire such data,
which is required to execute smart contracts properly. An oracle can gather data from
a website, an app or elsewhere and feed it to the smart contract.
Bottomline
The EVM makes Ethereum a platform and not just a blockchain. However, the EVM
could be a better system. There are many challenges around transaction speed and
network throughput.
It is an area of focus for the development community and the roadmap for Ethereum.
If Ethereum is to fulfil its promises of revolutionizing how we transact amongst each
other, it will be on the back of improvements to the EVM.
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/what-is-the-ethereum-virtual-machine-evm-34e55b1c410 4/5
2/12/23, 1:28 AM What is Ethereum Virtual Machine (EVM)? | by Tiny Crypto Labs | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/what-is-the-ethereum-virtual-machine-evm-34e55b1c410 5/5
2/12/23, 1:30 AM What is Ethereum Gas? Simple Explanation | by eiki | Medium
eiki Follow
Save
behind the scene. A reader is expected to have basic knowledge about Ethereum such
as smart contract, Proof-of-Work, and what Ethereum is. The contents are below.
- What is Gas?
- Why do we need to the Gas system?
- How the Gas price is determined?
- Mechanism of rising of Gas price.
- How to get Gas?
What is Gas?
Gas is fuel in Ethereum blockchain and is consumed when a smart contract is
executed. Gas is a unit to measure the amount of computational effort for certain
operation. The more complex operation, more gas consumes. The gas method is
equivalent to the application of kilowatts(kW) to estimate electricity of property; the
electricity used by people is not estimated in fiat-money but kWH. Whenever user
transfers ETH or runs smart contract, they need to pay Gas as a fee.
- Gas Limit
Gas Limit is a limit of the amount of ETH the sender is willing to pay for the
transaction. Usually, when one is talking about Gas in Ethereum, they are referring to
Gas Limit. When transferring ETH, the sender needs to set Gas Limit. If Gas Limit is
not enough to transfer, the transfer will be canceled and Gas will be refunded to the
sender. On the other hand, if the sender sets excess Gas Limit, Gas left over will be
refunded to the sender.
- Gas Price
Gas Price represents the price of Gas in Gwei. For example, 1 Gas = 10 Gwei. It is
basically determined by market supply and demand. Gas Price is used to multiply Gas
Limit to determine the final price of Gas.
The high price of Gas is a big problem in Ethereum and called “Scalability Problem”. It
happens when a lot of users started to transfer money or run a smart contract at the
same time. CryptoKitty, one of the most famous and popular games on Ethereum,
launched in late 2017, users have reached in excess of 1.5 million(25% of total Ethereal
traffic in peak times). At this time, users needed to pay the exorbitant transaction fee
and badly influenced all Ethereum users. In order to solve the scalability problem,
several off-chain/side-chain projects are underway such as Plasma and Loom.
References
HOW THE SWITCH FROM POW TO POS COULD AFFECT ETHEREUM MINING
Save
<article>
<definition>
For those of you already familiar with Ether transactions, you’ve probably heard of gas.
It pops up in your MetaMask when you make a transaction, saying the “gas limit” is
something like 21000 and the “gas price” is 1. So what does that all mean?
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 1/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
Well, gas is a unit that measures the use of computational power in the Ethereum
network. That is, how much effort computers processing a certain operation will need
to put in to successfully execute the operation. Operations in Ethereum are, for
example, sending Ether to another address, publishing a contract, calling a function
on a contract, among others. When these happen, miners process that information in
the EVM (Ethereum Virtual Machine) to reach the proper outcomes, such as executing
a function and returning the right data or sending the ETH to the right address. In
doing this, these miners are using their computational power, and the more complex a
transaction is, the more power it will consume, hence using more gas.
Gas limit
Gas limit defines the maximum amount of gas an operation can use. For example,
when sending some Ether from Alice to Bob, the gas limit is usually set at a standard of
21000, assuming no more data is included in the transaction. 21000 is the minimum
amount of gas an operation on Ethereum will use. This limit is used to guarantee that
the transaction will be executed. The limit is usually provided by the clients/wallets,
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 2/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
which estimate the maximum boundary for gas use of an operation, to assure that it
will be executed properly without the user having to worry. In this case, the unused
Ether used to pay for the extra gas will be returned to your account if the operation
uses less gas than the limit. While many times the limit is set for you, it can also be set
manually, in which case the user runs the risk of the operation failing, if the limit is
not enough.
More complex operations will use up more gas. See the example list below, ordered
from lowest to highest gas requirements.
Lastly, if you want to know how the gas limit of an operation is calculated, the formula
provided by the Ethereum Yellow Paper is as follows:
Gas price
Gas price is the comparative equivalent of the miner fee in Bitcoin. In Bitcoin, you
choose how much you want to pay the miner to process your transaction, being so that
the higher the fee, the faster the transaction will be included in a block (in general,
assuming participants rationally follow the financial incentive structure).
In Ethereum, things work similarly. Once the gas limit for a transaction is set, you can
choose how much you wish to pay for each unit of gas. The more you pay, the faster
you expect your operation to execute. Gas price is most often calculated in Gwei, a
subunit/denomination of Ether, equal to 1/10⁹ ETH. Usually, when operating in the
mainnet, users will pay between 1–60 Gwei per unit of gas, depending on how
overloaded the network is.
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 3/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
Hence, the equation for how much in Ether you will pay in “network fees” is:
Important note: The gas price is not selected by the network. It is chosen by the user,
or sometimes, by the client, which shields the user from this information and sets a
standard gas price, for the sake of usability (yet often at a higher cost for the end user).
The website tells you what it calls the “SafeLow Cost for Transfer”, which is the minimum
gas price you should set to have a high chance of your transaction being included in
one of the next blocks (usually over 90% chance of it being included in the next 10
blocks).
As a rule of thumb, you should set higher gas prices for urgent transactions, and lower
prices for transactions you don’t mind taking a while to confirm.
It is also worth noting that if your gas limit is set at, for example, 300000, you choose to
pay 40 Gwei for each unit of gas, and ultimately, the transaction only uses 21000 gas,
you will be refunded:
The takeaway here is: you are refunded for unused gas, accounted for the price you
paid for it, but you are not refunded for setting the gas price too high.
</definition>
<questions>
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 4/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
Yes, you can. The problem with doing so is that you will have to pay a lot of Ether up-
front, which you may not have or that you might need while your transaction is being
processed. It is also a question of optimization.
However, you can, and should, put the gas limit slightly higher than the amount of gas
you expect the transaction to consume when dealing with gas limits manually.
Common errors
“Transaction underpriced” or “transaction fee too low”
Means that your gas price is set too low and your transaction may not confirm, or will
take too long too confirm, since it will always be at the end of the list of transactions to
be included in the next block. Wallets will often offer you the option to increase your
gas price to change this, or refuse to send the transaction.
Means that the gas limit was set too low, and the transaction ended up using more gas
than you paid for. Transactions with a lower gas limit than the gas used will never
execute. In this case, you will not be refunded the Ethers spent. That is because the
miner used valuable computational power to attempt to execute the transaction, but
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 5/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
was unable to. Regardless of the transaction confirming or not, computational power
was used, and it was paid for.
Commonly, Remix’s static analysis of contracts will return a warning regarding the
high gas requirements of a function. It is also important to watch out for loops, which
can consume excessive gas.
Publishing complex contracts will use more gas than publishing simpler contracts, and
the same applies to the execution of these contracts.
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 6/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
</questions>
</article>
Thank you for reading. Comment below if you still have any questions about Ethereum
Gas and what definition you would like to hear about next.
Additional reading:
A Guide to Gas
A guide to gas, its purpose, its nuances, and its utility on the Ethereum
blockchain.
media.consensys.net
Blockchain
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 7/8
2/12/23, 1:32 AM Simply Explained: Ethereum Gas. Just like the gas you put in your car… | by Yakko Majuri | Medium
https://yakkomajuri.medium.com/blockchain-definition-of-the-week-ethereum-gas-2f976af774ed 8/8
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
Data Structures and Algorithms Interview Preparation Data Science Topic-wise Practice C C+
Read Discuss
Ethereum Gas is a section that calculates the quantity of calculation action that it takes
to per form specific functions. Ever y function that carries position in Ethereum like
transactions and smar t contracts etc. per formance needs some par t of gas. It is
essential to the blockchain P2P network because it is the power that authorizes it to
accomplish exactly what an automobile needs fuel to drive. Gas refers to the cost
Gas prices are delivered in the form of Ethereum’s born money, the currency of
Ethereum is E TH.
Gas costs are indicated in “gwei” which is a movement of Ethereum, ever y single
For sample, rather than stating that the gas costs 0.000000001 ether, say, the gas
costs 1 “gwei”.
“ Wei” is called af ter “ Wei Dai” that is the creator of b-money (least unit of E TH).
GWEI
Gwei is a combination of “giga” and “wei”. It is a sect of the blockchain technology E TH,
this coin is operated on the Ethereum P2P network. E TH is a blockchain medium, like
Login Register
selling interests and benefits without the involvement of an intermediator.
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 1/10
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
Example
For example, Rahul needs to give 1 E TH to Shubham. During the transaction, the gas
Total fee costs = Gas units (limit) * Gas price per unit
QuickNode -
Learn.Build.Scale
A Full Suite of Blockchain APIs. Build the
Future of Web3 with the Ease of Web2
= 21000 * 200
When Rahul dispatched the funds, 1.0042 E TH would be subtracted from Rahul’s
account.
Now after upgradation, increased advantages presented by the difference contain more
profitable trade fee computation, typically more rapid trade inclusion, and canceling the
Beginning with the peer-to-peer network upgrade, each block unit has a ground fee,
the lowest price per unit of gas for inclusion in this block unit, estimated by the
Because the ground fee of the trade fee is burnt, users are also hoped to put a tip in
their dealings.
The information pays miners for managing and breeding user trades in blocks and is
Total fee after upgradation = Gas units (limit) * (Base fee + Tip)
For example, Shubham has to pay 1 E TH to Rahul. This process has a gas limit of 21000
units and a base fee of 100 gwei. Shubham includes a tip of 10 gwei.
Total fee after upgradation = Gas units (limit) * (Base fee + Tip)
When Shubham sends the funds, 1.00231 E TH will be subtracted from Shubham’s
account.
the tip.
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 3/10
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
Gas Fees
The gas fees include Base, Priority, Max, and calculating fees. Let ’s discuss these terms
in detail.
1. Base fees :
Each alliance has a ground fee which ser ves as a fund price.
The ground fee is figured alone of the existing alliance and is rather specified by the
When the block is excavated the base fee is “burned”, dragging it from regulation.
The ground fee is evaluated by instructions that compare the length of the earlier
The base fee intention rise by a max of 12.5% per block if the marked block size is
surpassed.
2. Priority fee :
Apar t from the base fee obtained, the advancement presented a priority fee i.e. tip to
Without tips, miners can see it financially possible to drill cleared blocks because
Under normal circumstances, a little tip provides miners with the slightest
For dealings that require getting preferentially conducted ahead of different trades in
the same block, a more elevated tip will be essential to endeavor to outbid
contending trades.
3. Max fee :
To conduct trade on the P2P network, users can select the greatest limit they are
For a trade to be completed, the max fee must surpass the aggregate of the base and
priority fees.
The trade sender is repaid the contrast between the max fee and the total of the
4. Calculating fees :
The main benefit of the upgrade is enhancing the user ’s knowledge when charging
trade fees.
In the wallets that sustain the upgrade rather than explicitly commenting to pay the
fee (base fee + suggested priority fee) to decrease the quantity of complexness
Below are some of the reasons why gas fess is impor tant:
By demanding a price for ever y analysis per formed on the web grid, it prevents evil
A trade organizes a boundar y and any unit of gas not utilized in trade is replaced (i.e.
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 5/10
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
Conducting any function on Ethereum needs depleting gas, and the gas area is
Prices contain measures, holding or exploiting data, and swallowing various par ts of
“gas” units.
contract achieves also develops, representing each trade brings up more additional
If the demand is quite high, users must present a more elevated tip payment to tr y
A more increased tip can construct it additional possible that your trade will convey
The E TH efficiency advancements should eventually manage some of the gas cost
points, allowing the medium to process thousands of trades globally per moment.
Second layer scaling is a direct ambition to significantly enhance gas prices, user
The recent proof-of-stake(POS) sample based on the Beacon Chain, should decrease
economic responsibility.
Strategies to decrease gas costs for E TH, Users can select a direction to display the
Miners intention per form trades that suggest a more increased tip per gas, as they
hold the tips that users spend and resolve be slightly tilted to conduct transactions
If users like to obser ve gas costs, then they can send E TH for smaller, user can utilize
Gas ” for evaluating Chrome attachment backing both Class 0 inheritance trades and
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 6/10
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
Class 2 EIP-1559 trades, and” E TH Gas Station ” which is client instructed metric s for
the Ethereum gas demand, ” Cr yptoneur Gas Fees Calculator ” is used for calculating
Gas prices assist maintain the Ethereum grid safe. By demanding a price for ever y
analysis per formed on the grid, it controls harmful attackers from spamming the
grid.
To bypass unexpected code, ever y trade needs to set a limitation to the multiple
produced to the user (i.e. max fee – (base fee + tip) is produced).
The base fee is computed by a procedure that resembles the dimensions of the last block
(the par t of gas utilized for all the trades) with the target size. The base fee will rise by a
Like 0
Previous Next
Related Articles
8. Ethereum 2.0
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 8/10
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
Ar ticle Contributed By :
shubhambhugra234
@shubhambhugra234
Company Learn
About Us DSA
Careers Algorithms
In Media Data Structures
Start Your Coding Journey Now!
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 9/10
2/12/23, 1:35 AM Ethereum - Gas and Fees - GeeksforGeeks
News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
SQL
Knowledge
Kotlin
Published in Coinmonks
Save
In this article, I will cover Ethereum gas fees in detail. For those of you who are new to
crypto, I’ve also included a practical example of how to adjust gas fees in MetaMask.
What is Gas?
(Ethereum) Gas is the fee paid for executing transactions on the Ethereum blockchain.
Want to move ETH between different addresses? That transaction requires gas. Want to
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 1/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
mint some NFTs? That requires gas too. What about exchanging ETH for different
tokens? You guessed it, more gas!
Gas fees also help keep the Ethereum network secure. Attaching cost to every
transaction prevents spamming or accidental infinity loops.
The price of gas is denoted in gwei (giga wei). Wei is the smallest fraction of an ether,
i.e. 1 ether equals 1,000,000,000,000,000,000 wei, so 1 gwei is 1,000,000,000 (1 billion)
wei or 0.000000001 ETH. This doesn’t sound too bad right? So why are people
complaining about the cost of gas fees?
There are two elements that impact the cost of any given transaction:
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 2/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
Etherum gas prices change constantly and there are a number of websites where you
can check the current price. CoinGecko is one of them, but the price isn’t always
accurate, so I prefer to use ETH Gas Station or Gas Now (my favourite), which you can
also install as a browser extension.
At various points in time, I’ve seen gas prices as low as 6 gwei and as high as 2,000
gwei. Why can they change so much? It simply depends on how busy the Ethereum
network is at a particular moment in time. The busier the network, the higher the
prices.
When checking the price of gas, you’ll often see 3 or 4 different prices based on
transaction speed: rapid, fast, standard, and slow (or other similar names).
Unsurprisingly, the faster the transaction, the more you will pay and the price
difference can be quite substantial. Generally speaking, when buying or selling tokens
you want to use the fastest option, especially when their price is moving quickly. On
the other hand, if you’re only moving tokens between wallets, or buying tokens when
the market is quiet, you can go for standard or slow speed as it doesn’t really matter if
the transaction takes a bit longer to go through.
The second factor is the amount of gas required for any given transaction. The
minimum amount needed for the simplest transaction on the Ethereum network, for
example moving ETH between two addresses, is 21,000 units. More complex
transactions involving smart contracts such as buying other tokens or staking your
tokens require a lot more gas.
It’s also worth mentioning that some transactions require multiple steps and each of
those steps will require a certain amount of gas. For example: exchanging Tether
(USDT) for Chainlink (LINK), actually requires two transactions: USDT > ETH and ETH
> LINK. If you want to process a transaction like this on (say) Uniswap, you will only
see an estimated gas fee for the first ‘step’ (USDT to ETH in this example), so don’t be
surprised by the added cost of the second ‘step’.
Gas Limit
Gas limit is the maximum amount of gas you are willing to use on any given
transaction. If the actual amount of gas used turns out to be lower than the limit you
specified, the remaining gas will be returned to you. But if your limit is too low, you
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 3/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
either won’t be able to process the transaction or the transaction will fail and you will
lose that gas. This is especially dangerous when you’re trying to purchase a token at the
time the network is busy and the price is changing rapidly (e.g. when the price is
pumping immediately after an influencer posted a video about the token you’re trying
to buy).
Examples
The explanation above may be a bit confusing so let’s look at how this works through
an example of a simple transaction of moving ETH between two addresses.
That’s not bad, right? So why are people freaking out about gas prices? Well, let’s have a
look at the same simple transaction but this time let’s imagine we’re trying to do it
when the network is completely congested. There was a large flash crash on 19th May
2021 and I remember gas prices hovering around 1,500–2,000 gwei. So….
That’s 0.042 ETH, which at this moment in time is 133.5 USD… all that just to move
your ETH, we’re not doing anything fancy here.
Now imagine a more complex transaction, which requires say 100,000 units of gas…
suddenly we’re looking at around 500 USD. This is a fair chunk of money to burn in
fees.
Do the London Hard Fork and EIP-1559 Solve the High Gas Fees Issue?
Well, not really. I will not go into the details of the EIP-1559 update in this article (I
recommend watching this video or visiting the Ethereum website) but here are a few
things to be aware of.
In the old system, gas fees are essentially using a blind auction model — if you want to
make sure your transaction goes through quickly when the network is busy, you have
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 4/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
to pay much more than you would during the quiet time, because you simply don’t
know how much gas other people are paying.
The new model is more complex but it aims to be more transparent and fair.
The first element of the new model is the base fee, which can go up or down
depending on how busy the network is at a particular point in time. This base fee is
always burned, which can make ETH a deflationary asset as time passes on. Although
ETH has infinite supply, when the network is busy, more tokens are burned than
mined and therefore the amount of ETH in circulation can decrease. You can check out
this website or this one to see how much ETH is being burned.
The second part of the fee is a tip that goes to the miner. It can be adjusted if the
sender wants to process the transaction faster, so in a way, it works similar to the
sender choosing the transaction speed in the old system.
EIP-1559 also allows doubling the block size when the network is getting congested to
make fees more predictable.
The most important takeaway is this: the new gas fee system is NOT designed to lower gas
fees but to make them more transparent and predictable.
The gas prices will be less volatile and there should be less sudden spikes than before,
but they will not necessarily be lower. For gas fees to go down, we will have to wait for
Ethereum 2.0 or Layer 2 scaling solutions (e.g. Polygon).
Now I can see the quote, which shows the Estimated Network Fee ($27.35) and Max
Network Fee ($30.08). I then click Edit (in blue text next to the Max Network Fee).
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 5/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
This takes me to a new window with Average and Fast transaction options. I can select
one of these options or go to the Advanced tab at the top.
In the Advanced tab, I can see Gas Price in GWEI and Gas Limit. The latter is auto-
populated based on the type of transaction. To check the exact current gas prices I can
go to a website such as Gas Now and adjust my gas price accordingly. I then click Save
and process the transaction.
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 6/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
I hope you found this article useful. If you’re interested in crypto tutorials and more
crypto market commentaries, please check out my YouTube channel and follow me on
Twitter.
Disclaimer
I’m NOT a financial adviser. These are only my own speculative opinions, ideas, and theories.
Do NOT trade or invest based purely upon the information presented in this article.
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 7/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
Always do your own research and due diligence before investing or trading. I’ll never tell you
what to do with your capital, trades or investments. I’ll also never recommend for you to buy,
sell, long or short any asset, commodity, security, derivative or cryptocurrency related
instrument as it’s extremely HIGH RISK!
You should always consult with a professional/licensed financial adviser before trading or
investing in any cryptocurrency related product.
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 8/9
2/12/23, 1:38 AM A short guide to Ethereum gas fees | by Crypto Badger | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Open in app Sign up Sign In
Search Medium
https://medium.com/coinmonks/a-short-guide-to-ethereum-gas-fees-5c4c53a05feb 9/9
2/12/23, 1:41 AM Ethereum - Gas and Fees - GeeksforGeeks
Data Structures and Algorithms Interview Preparation Data Science Topic-wise Practice C C+
Read Discuss
Ethereum Gas is a section that calculates the quantity of calculation action that it takes
to per form specific functions. Ever y function that carries position in Ethereum like
transactions and smar t contracts etc. per formance needs some par t of gas. It is
essential to the blockchain P2P network because it is the power that authorizes it to
accomplish exactly what an automobile needs fuel to drive. Gas refers to the cost
Gas prices are delivered in the form of Ethereum’s born money, the currency of
Ethereum is E TH.
Gas costs are indicated in “gwei” which is a movement of Ethereum, ever y single
For sample, rather than stating that the gas costs 0.000000001 ether, say, the gas
costs 1 “gwei”.
“ Wei” is called af ter “ Wei Dai” that is the creator of b-money (least unit of E TH).
GWEI
Gwei is a combination of “giga” and “wei”. It is a sect of the blockchain technology E TH,
this coin is operated on the Ethereum P2P network. E TH is a blockchain medium, like
Bitcoin and Binance, where users can make transactions with respect to buying and
Example
For example, Rahul needs to give 1 E TH to Shubham. During the transaction, the gas
Total fee costs = Gas units (limit) * Gas price per unit
= 21000 * 200
When Rahul dispatched the funds, 1.0042 E TH would be subtracted from Rahul’s
account.
Now after upgradation, increased advantages presented by the difference contain more
profitable trade fee computation, typically more rapid trade inclusion, and canceling the
Beginning with the peer-to-peer network upgrade, each block unit has a ground fee,
the lowest price per unit of gas for inclusion in this block unit, estimated by the
Because the ground fee of the trade fee is burnt, users are also hoped to put a tip in
their dealings.
The information pays miners for managing and breeding user trades in blocks and is
Total fee after upgradation = Gas units (limit) * (Base fee + Tip)
For example, Shubham has to pay 1 E TH to Rahul. This process has a gas limit of 21000
units and a base fee of 100 gwei. Shubham includes a tip of 10 gwei.
Total fee after upgradation = Gas units (limit) * (Base fee + Tip)
When Shubham sends the funds, 1.00231 E TH will be subtracted from Shubham’s
account.
the tip.
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 3/10
2/12/23, 1:41 AM Ethereum - Gas and Fees - GeeksforGeeks
Gas Fees
The gas fees include Base, Priority, Max, and calculating fees. Let ’s discuss these terms
in detail.
1. Base fees :
Each alliance has a ground fee which ser ves as a fund price.
The ground fee is figured alone of the existing alliance and is rather specified by the
When the block is excavated the base fee is “burned”, dragging it from regulation.
The ground fee is evaluated by instructions that compare the length of the earlier
The base fee intention rise by a max of 12.5% per block if the marked block size is
surpassed.
2. Priority fee :
Apar t from the base fee obtained, the advancement presented a priority fee i.e. tip to
Without tips, miners can see it financially possible to drill cleared blocks because
Under normal circumstances, a little tip provides miners with the slightest
For dealings that require getting preferentially conducted ahead of different trades in
the same block, a more elevated tip will be essential to endeavor to outbid
contending trades.
3. Max fee :
To conduct trade on the P2P network, users can select the greatest limit they are
For a trade to be completed, the max fee must surpass the aggregate of the base and
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 4/10
2/12/23, 1:41 AM Ethereum - Gas and Fees - GeeksforGeeks
The trade sender is repaid the contrast between the max fee and the total of the
4. Calculating fees :
The main benefit of the upgrade is enhancing the user ’s knowledge when charging
trade fees.
In the wallets that sustain the upgrade rather than explicitly commenting to pay the
fee (base fee + suggested priority fee) to decrease the quantity of complexness
Below are some of the reasons why gas fess is impor tant:
By demanding a price for ever y analysis per formed on the web grid, it prevents evil
A trade organizes a boundar y and any unit of gas not utilized in trade is replaced (i.e.
Conducting any function on Ethereum needs depleting gas, and the gas area is
Prices contain measures, holding or exploiting data, and swallowing various par ts of
“gas” units.
contract achieves also develops, representing each trade brings up more additional
If the demand is quite high, users must present a more elevated tip payment to tr y
A more increased tip can construct it additional possible that your trade will convey
The E TH efficiency advancements should eventually manage some of the gas cost
points, allowing the medium to process thousands of trades globally per moment.
Second layer scaling is a direct ambition to significantly enhance gas prices, user
The recent proof-of-stake(POS) sample based on the Beacon Chain, should decrease
economic responsibility.
Strategies to decrease gas costs for E TH, Users can select a direction to display the
Miners intention per form trades that suggest a more increased tip per gas, as they
hold the tips that users spend and resolve be slightly tilted to conduct transactions
If users like to obser ve gas costs, then they can send E TH for smaller, user can utilize
Gas ” for evaluating Chrome attachment backing both Class 0 inheritance trades and
Class 2 EIP-1559 trades, and” E TH Gas Station ” which is client instructed metric s for
the Ethereum gas demand, ” Cr yptoneur Gas Fees Calculator ” is used for calculating
Gas prices assist maintain the Ethereum grid safe. By demanding a price for ever y
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 6/10
2/12/23, 1:41 AM Ethereum - Gas and Fees - GeeksforGeeks
grid.
To bypass unexpected code, ever y trade needs to set a limitation to the multiple
produced to the user (i.e. max fee – (base fee + tip) is produced).
The base fee is computed by a procedure that resembles the dimensions of the last block
(the par t of gas utilized for all the trades) with the target size. The base fee will rise by a
Like 0
Previous Next
Related Articles
8. Ethereum 2.0
9. What is Ethereum?
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 8/10
2/12/23, 1:41 AM Ethereum - Gas and Fees - GeeksforGeeks
shubhambhugra234
@shubhambhugra234
Company Learn
About Us DSA
Careers Algorithms
In Media Data Structures
Contact Us SDE Cheat Sheet
Privacy Policy Machine learning
Copyright Policy CS Subjects
Advertise with us Video Tutorials
Courses
Start Your Coding Journey Now!
https://www.geeksforgeeks.org/ethereum-gas-and-fees/ 9/10
2/12/23, 1:41 AM Ethereum - Gas and Fees - GeeksforGeeks
News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
SQL
Knowledge
Kotlin
eiki Follow
Save
https://medium.com/@eiki1212/what-is-ethereum-gas-simple-explanation-2f0ae62ed69c 1/4
2/12/23, 1:43 AM What is Ethereum Gas? Simple Explanation | by eiki | Medium
behind the scene. A reader is expected to have basic knowledge about Ethereum such
as smart contract, Proof-of-Work, and what Ethereum is. The contents are below.
- What is Gas?
- Why do we need to the Gas system?
- How the Gas price is determined?
- Mechanism of rising of Gas price.
- How to get Gas?
What is Gas?
Gas is fuel in Ethereum blockchain and is consumed when a smart contract is
executed. Gas is a unit to measure the amount of computational effort for certain
operation. The more complex operation, more gas consumes. The gas method is
equivalent to the application of kilowatts(kW) to estimate electricity of property; the
electricity used by people is not estimated in fiat-money but kWH. Whenever user
transfers ETH or runs smart contract, they need to pay Gas as a fee.
- Gas Limit
Gas Limit is a limit of the amount of ETH the sender is willing to pay for the
transaction. Usually, when one is talking about Gas in Ethereum, they are referring to
https://medium.com/@eiki1212/what-is-ethereum-gas-simple-explanation-2f0ae62ed69c 2/4
2/12/23, 1:43 AM What is Ethereum Gas? Simple Explanation | by eiki | Medium
Gas Limit. When transferring ETH, the sender needs to set Gas Limit. If Gas Limit is
not enough to transfer, the transfer will be canceled and Gas will be refunded to the
sender. On the other hand, if the sender sets excess Gas Limit, Gas left over will be
refunded to the sender.
- Gas Price
Gas Price represents the price of Gas in Gwei. For example, 1 Gas = 10 Gwei. It is
basically determined by market supply and demand. Gas Price is used to multiply Gas
Limit to determine the final price of Gas.
The high price of Gas is a big problem in Ethereum and called “Scalability Problem”. It
happens when a lot of users started to transfer money or run a smart contract at the
same time. CryptoKitty, one of the most famous and popular games on Ethereum,
launched in late 2017, users have reached in excess of 1.5 million(25% of total Ethereal
traffic in peak times). At this time, users needed to pay the exorbitant transaction fee
and badly influenced all Ethereum users. In order to solve the scalability problem,
several off-chain/side-chain projects are underway such as Plasma and Loom.
References
HOW THE SWITCH FROM POW TO POS COULD AFFECT ETHEREUM MINING
https://medium.com/@eiki1212/what-is-ethereum-gas-simple-explanation-2f0ae62ed69c 3/4
2/12/23, 1:43 AM What is Ethereum Gas? Simple Explanation | by eiki | Medium
https://medium.com/@eiki1212/what-is-ethereum-gas-simple-explanation-2f0ae62ed69c 4/4
2/12/23, 1:46 AM Ethereum block structure explained | by eiki | Medium
eiki Follow
Save
Introduction
This article explains the Ethereum block structure and its related terminologies. As the
block is the heart of the Ethereum platform, It is necessary to understand what block
is. Block stores some fundamental data that constitute of a blockchain network to
ensure immutability and security.
Structure(fields) of block
Uncle block
trie mechanism such as Merkle Patricia Trie and world state trie.
I put some useful resources end of this article for a deeper understanding of other
components.
Block in Ethereum
Currently, Ethereum uses Proof-of-Work as its consensus algorithm and is gradually
shifting to Proof-of-Stake. As Proof-of-Work is not eco-friendly due to its too much
electricity consuming. Proof-of-Stake can mine blocks based on the amount of money
miner has, and faster than PoW.
Ethereum block stores several important data such as previous block hash, Merkle trie
based root hash, timestamp, difficulty, and more.
■ Gas Used
Sum of all the gas used by all transaction in the block.
■ Extra Data
An optional and free field to store extra data.
■ number
Counting number of the block. The number increments sequentially. 0 is
a genesis block.
Hash Root
As you can see, Block has three types of hash root: transaction hash root, receipt hash
root, and world state hash root. Each type of hash root is generated by “Merkle Patricia
Trie” which is Etheream original trie invented with Merkle and Patricia trie. If you
want to know more details about Merkel Patricia Trie, please refer to “Ethereum State
Trie Architecture Explained”.
Nonce
In cryptography, a nonce is a one-time code chosen randomly to transmit password
securely and prevent replay attacks. Ethereum has two types of nonce: Proof-of-
Work(block) nonce and account(transaction) nonce. Nonce in the block is Proof-of-
Work nonce that is used as a meaningless number when mining. On the other hand,
the nonce in the transaction is an account nonce that represents an order of
transaction that an account creates.
note: Ethereum has two types of Gas limit: transaction gas limit and
block gas limit. Transaction gas limit is one of the data in a
transaction that a limit of the amount of ETH the sender is willing to
pay for the transaction. If you want to see more details of
Uncle Block
Uncle block in Ethereum is equivalent to orphan block in Bitcoin. Uncle block is a
block which is mined correctly but not accepted because of network time lag. In
mining, it occasionally happens two different miners generate the same block
simultaneously and only one of them is adopted in the blockchain. Unlike orphan
block in Bitcoin, Ethereum rewards for uncle block to neutralize the effect of network
lag and decrease centralization by large miners.
Conclusion
In the article, Inside of Ethereum block is explained. As Ethereum is a blockchain
platform, it is necessary to understand what block is and its every field. The article
explained Block fields and some of them are described more deeply. If you want to
know more details of some specific fields, please refer to the “references” which I used
when writing the article. If you have any comments and question, always welcome.
Thank you.
References
What is nonce in Ethereum? How does it prevent double-spending?
Search Medium
Published in Coinmonks
Derao Follow
Save
1. Quick review
2. Blocks
3. Block Header
4. Summary
5. Onwards.
Quick Review:
We are dipping a little deeper into our journey of exploring Ethereum, but it’s good to
pause and recap what we have learned so far, I have created a public gist to refresh our
collective memories, for this overview, let us focus on Part 3 through 6.
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 1/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
Recap[ 3–6 ]
Blocks:
The block is the core of the concept of a BlockChain; a Block is a historical
recordkeeper of the list of transactions. There is a lot of information packed into that
statement. Ethereum, like it’s predecessor Bitcoin, has the concept of a Blockchain,
and to understand a Block, we will approach a Block as a Data structure.
The Ethereum Yellow paper, which defines a Block as a collection of three entities 1.
Block Header 2.Transaction(s) List 3.Ommers List, formally defined as:
Section 4.3(Block)
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 2/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
Block Header:
Block header, as the name suggests is the header of a Block, Blockheader is composed
of 15 distinct fields as per the yellow paper, I tried capturing them in a spreadsheet,
similar to the one below:
Each one of those fields needs a separate chapter by itself, we will not go into the
details of each one of those 15 fields but will focus on a few. I would recommend
having a look at Part-4( The trie ) as a refresher. Now back to the Block Header fields
ParentHash: This field, as the name refers to the Parent’s Keccak hash of this block. The
field size would be 256-bit Keccak hash function, primarily the hash value indicates the
immediate parent of this block, using this technique is how Ethereum links one block
to another, forming a chain of blocks.
StateRoot: This refers to the Keccak hash root of a collection of the state trie (post-
execution), which has occurred since the creation of this block, a { key, value }
collection. There is only one global state and is updated continuously, and each block
will have the root hash of the state trie DB.
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 3/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
TransactionRoot: Keccak Hash of the root node of Transaction Trie: This field refers to
the Keccak hash root of a collection of all the Transaction trie, which has occurred
since the creation of this block.
ReceiptsRoot: Keccak Hash of the root node of Transaction Trie: This field refers to the
Keccak hash root of a collection of all the Transaction trie, which has occurred since
the creation of this block. The Receipt (R) is a Tuple comprised of 4 fields. Ethereum
yellow paper has, in some detail, mentions about the receipts root field. The receipts
field is a collection of
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 4/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
| Description | Symbol |
| :— — — — — - - -:|: — — — — -:|
| Total Gas Spent | Ru |
| Bloom Filter Root| Rb |
| Logs of the Tran | Rl |
| Status Code | Rz |
The logs (Rl) and Bloom filter root (Rb) fields described in detail in the yellow paper;
Bloom Filters do need a separate section, and I am planning to discuss them in Part-8
but for now, let us think of Bloom filters as an algorithm that can help speed up search
time results.
Below is a codified structure of the Ethereum Block header in Elixir, I have also
provided a link to the go codebase.
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 5/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 6/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
Summary:
A Block comprises of Block Header and transactions.
State, Transactions, Receipts header fields have pointers to the root hash.
Onto:
In the next section-8, we will continue exploring Blocks, Genesis Block, and Block
verification, until then learn on.
References:
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 7/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
ethereum/go-ethereum
You can’t perform that action at this time. You signed in with another tab
or window. You signed out in another tab or…
Open in app Sign up Sign In
github.com
Search Medium
What exactly does the “m” function in the formal Bloom filter
specifications do?
Thanks for contributing an answer to Ethereum Stack Exchange! Please
be sure to answer the question. Provide details…
ethereum.stackexchange.com
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 8/9
2/12/23, 1:48 AM Ethereum under the hood- Part 7( Blocks ) | by Derao | Coinmonks | Medium
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/ethereum-under-the-hood-part-7-blocks-c8a5f57cc356 9/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
Published in RedSo
Louis Li Follow
Save
We have built a demo Decentralized App (DApps) on watches trading. You can buy
watches or post watches to sell on the website. The transactions are all made in Ether.
ALL the trading records of a particular watch are listed on the Ethereum network so
you can know how many previous owners are there and what are the previous prices.
By the transparent nature of blockchain, everybody can trust the watch actually comes
from a legitimate source by tracing the source of origin.
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 1/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
Purchasing a watch
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 2/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
If you are in the Rinkeby test network, you can see a list of watches (1 entry is 1
particular watch). There should be some watches showing with the “Buy” button. Click
on the button, and your wallet will prompt you with a notification window.
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 3/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 4/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
For detailed settings on Gas limit and Gas price, we will cover in other blog posts. Let’s
stick to the default at the moment.
You can always check out the status of your transaction on etherscan.io.
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 5/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
The demo website also allows you sell a new watch. By click on the button on the
upper right corner and you can fill in the form about the item you are going to sell. As
this action also writes a record to the blockchain, a receiver of you are paying for the
gas same as before.
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 6/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
Search Medium
This pretty much ends the demo functionality. We will talk about more on the details
of smart contracts in the next post here.
Email us at [email protected] if you want to know more about what we can do for
you in smart contracts!
9
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 7/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
Sign up
Powered by Upscribe
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 8/9
2/12/23, 1:51 AM Try our blockchain demo project on Ethereum | by Louis Li | RedSo | Medium
https://medium.com/redso/try-our-blockchain-demo-project-on-ethereum-cff8c2737ab1 9/9
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Published in Coinmonks
Jackson Ng Follow
Save
In this 2-part tutorial I will walk through my Ethereum Development toolchain using
the example of building the Freelancer Decentralized Application:
The scripts and config files that I use for this tutorial can be found in my GitHub
repository here
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 1/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Ganache
Ganache is a desktop-based personal Ethereum Blockchain. A local, self-contained
Ethereum Blockchain network is the fastest way to test your codes since transactions
get executed instantaneously.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 2/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Add a new workspace. Call it “Freelancer Contract” as we will be testing our Freelancer
contract in this self-contained local Ethereum Blockchain network. Save the workspace
and start it up.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 3/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Notice that a handful of accounts, well-loaded with 100 ETH each had been generated.
Click Show Keys to reveal the private key for the first account.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 4/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Copy the private key. We will be using this key in the next step.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 5/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
MetaMask
MetaMask is an Ethereum Wallet. Like a physical wallet where you keep your dollar
bills, MetaMask lets you save, spend and transfer ETHs between accounts. MetaMask
also allows lets you execute Ethereum transactions and run Decentralized Apps.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 6/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
By default, your new MetaMask wallet is connected to the main Ethereum network. We
will reconnect it to our local Ganache Ethereum Blockchain. To do this, visit the
settings on MetaMask. Add a network with the following settings:
Network Name: Local (you can call it Ganache, or any other names you prefer)
New RPC URL: HTTP://127.0.0.1:7545 (you can find this on Ganache under RPC
Server
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 7/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Import an account. Paste the private key that you have copied earlier into the private
key text field. This will import the corresponding Ganache account into your
MetaMask wallet. If you have done this correctly, you will see 100 ETH in this account.
You may import more accounts from Ganache to MetaMask if you wish.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 8/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Search for “Solidity Visual Developer” extension and install it. This will provide Solidity
language support when you code. I love its funky colored code highlights!
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 9/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Truffle Box
The folks who built Ganache also built “Truffle Boxes” which are boilerplates that
come with the Solidity, Web3, and other libraries that developers need to compile and
test their smart contracts and to build the front-end for your Decentralized Apps.
There are Truffle Boxes for React Apps, React Native and project samples.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 10/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Install Truffle
We are now ready to develop our Freelancer DApp project. Create a new folder
“freelancer” on your computer. Enter the following command to unbox the webpack
boilerplate into the folder:
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 11/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Edit truffle-config.js .
Change the develop settings under network to point to Ganache, since this is where we
will be testing our contract:
develop: {
host: "127.0.0.1", // Localhost (default: none)
port: 7545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 12/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Change the Solidity compiler version to 0.8.0 because the freelancer smart contract is
written in Solidity 0.8.0:
solc: {
version: "0.8.0", // Fetch exact version from solc-bin
(default: truffle's version)
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Migrations {
address public owner;
uint public last_completed_migration;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
if (msg.sender == owner) _;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
}
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 13/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
truffle compile
We are now ready to migrate the deploy the freelancer.sol smart contract.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 14/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
The migration script serves 2 purposes — as a deployment script for the freelancer
Smart Contract, and as a test script to backtest the smart contract whenever I make
code changes so that I am sure that I haven’t broken anything each time I tweak
something.
Connects to the first and second addresses on the local Ganache Blockchain. The first account
belongs to the freelancer and the second account belongs to the client:
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 15/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
}
);
Freelancer releases funds from the project to himself and then ends the project:
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 16/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
}
);
//programmer ends project
await freelancer.deployed().then(
async function(contractInstance) {
await contractInstance.endProject({from:
programmerWallet}).then(
function(v) {
console.log("Project Ended");
}
)
}
);
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 17/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Now run the following command to migrate, deploy and test the freelancer smart
contract:
truffle migrate
Observe Ganache. When run successfully, ETHs from your first wallet would be
transferred to the second wallet.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 18/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Search Medium
What’s Next?
Now that the freelancer smart contract has been developed, tested, and migrated, the
next step is to build the front-end of this Decentralized Application. We will explore
this in the 2nd part of the tutorial.
If you enjoyed this tutorial, perhaps you may also wish to read:
Freelancer Smart Contract: A payment system between a freelancer and his client
to ensure both delivery and payment.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 19/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
Ropsten Ethereum Faucet: I built an Ethereum faucet to give out ETH on the
Ropsten network.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 20/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
How to Buy Bitcoin in India? 7 Best Apps to Buy Bitcoin 2021 [Mobile
Version]
How to buy Bitcoin India using a Mobile App
medium.com
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 21/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 22/23
2/12/23, 1:54 AM Introducing the Ethereum Development Environment: Part 1 | by Jackson Ng | Coinmonks | Medium
https://medium.com/coinmonks/introducing-the-ethereum-development-environment-part-1-bed0a273e55 23/23
2/12/23, 1:57 AM Understanding DAOs: Decentralised Autonomous Organisations explained | by Monolith | Monolith | Medium
Published in Monolith
Monolith Follow
Save
enthusiasts believe that DAOs will be the next area of the space to explode. DAO stands
for “Decentralised Autonomous Organisation”. In this guide, we’ll explain how DAOs
are evolving on the blockchain, and what the development could mean for the future
of organisations around the world.
DAOs explained
A Decentralised Autonomous Organisation is an Internet-native community that
governs itself through smart contracts. Unlike organisations in the traditional world,
the rules and principles of a DAO are embedded on the blockchain, so they are not
prone to manipulation or attack.
As DAOs use smart contracts, they are mostly found in Ethereum, the world’s leading
smart contracts platform. Similar to Ethereum’s DeFi ecosystem, DAOs rely on code
rather than the trust of a third party such as a CEO.
DAO members are often rewarded based on the contributions they make to the
organisation. Rewards are determined by the smart contract code, which is open and
transparent on the blockchain.
The rules for a DAO are always open for anyone to view. Any change to the rules
requires a majority vote among the members of the DAO. Voting is recorded on-chain
so it is also public.
In the 2014 article “DAOs, DACs, DAs, and More: An Incomplete Terminology Guide”,
Vitalik Buterin described DAOs as follows:
Buterin’s description highlights two key points: DAOs are Internet-native, similar to the
rest of the blockchain and cryptocurrency space. Moreover, they require contributions
from members to fulfill their potential. Contributions to a DAO may include writing
notes for the website, offering social media support, researching in relevant topic
areas, or producing merchandise.
DAO members can make a proposal for their contribution, and they typically earn
remuneration in the form of the DAO’s governance token. If members pass vote on the
proposal, the contributor receives the remuneration from the DAO.
While smart contracts offer a way to automate and execute transactions, DAOs
complete tasks that can not be executed by code alone. Key decisions in DAOs are
made through a voting process; members can use their tokens for voting power. This
means that any updates or developments within the DAO are only made after members
of the organisation reach consensus. Where blockchains like Bitcoin and Ethereum
aim to achieve consensus for every transaction through nodes, DAOs rely on their
members to vote on updates.
DAOs are global and permissionless, which means that anyone can join from anywhere
in the world. While companies are usually closed off to only a limited number of
candidates living within a certain catchment area, DAOs do not present the same
limitations. As they are decentralised and global, they can grow at a faster rate than
traditional companies.
While DAOs are open and permissionless, they often have certain requirements for
becoming a member. SquiggleDAO, for example, is a DAO for owners of the popular
Chromie Squiggle NFT. Many other NFT projects have similar DAOs of their own.
The advent of smart contracts has greatly expanded the possibilities for DAOs. Smart
contracts paved the way for the growth of DeFi on Ethereum, which has been
foundational to the evolution of DAOs. DeFi eliminates the need for trust in
intermediaries, using cryptocurrencies to exchange value between users.
Cryptocurrencies are also key to DAOs: many of them reward users through their own
governance tokens. Ownership of tokens can be used to vote in key decisions affecting
the protocol, which is a model many DeFi projects have adopted.
DeFi projects often launch tokens as a way of attracting liquidity and bootstrapping the
network, while also decentralising the governance so that it is managed by a
community rather than a team. In many cases, tokens can also be earned for
participation in the protocol.
While one member alone may not have enough of a stake alone to sway decisions, they
could potentially collude with other members for their own financial gain.
DAOs ultimately depend on the community to drive the direction in a way that matches
the group’s ethos. As much as rules can be embedded into code, ideological values are
harder to record on the blockchain. DAOs need communities to evolve in fitting with
the organisation’s mission without being influenced by the potential financial rewards.
DAOs highlight the power of community, something that’s integral to the blockchain
movement. They create a way for online groups to gather and coordinate in a way that
didn’t exist pre-Bitcoin.
Some notable DAOs have already emerged in the Ethereum ecosystem in recent
months. PleasrDAO, a group formed to acquire an NFT by pplpleasr, has made waves in
the NFT space and even acquired a one-of-a-kind album by Wu Tang Clan.
ConstitutionDAO, meanwhile, recently raised over $45 million to buy a copy of the US
Constitution, but narrowly lost out in the Sotheby’s auction for the item. Nonetheless,
the DAO’s efforts highlighted the possibilities of human coordination at scale.
Members of PleasrDAO pictured with Wu Tang Clan’s “Once Upon a Time in Shaolin” (Source: Griffin Lotz for
Rolling Stone)
As the world moves towards an open, Internet-based financial system, DAOs will
create a way for communities to cooperate via rules that live immutably on a public
blockchain.
While Bitcoin can be described as the first DAO, smart contracts have created new
possibilities for organisations to function in a decentralised manner. Today this is
particularly true of DeFi protocols such as Maker, which have decentralised their
governance in favour of the community of token holders. Moreover, the NFT space has
spawned many groups such as PleasrDAO, which focuses on buying high quality
tokenized art. In the future, it is likely that DeFi, NFTs and DAOs will further collide as
Ethereum evolves.
However, DAOs in their current iteration are only at the beginning of a long journey.
DAOs have shown their promise within the context of decentralised crypto-native
protocols. Soon, it could be time for traditional groups and companies to see the power
of decentralised governance. In the future world of Web3, it may not be standard
practice for someone to take up a job in a company — they’ll be contributing to a DAO
instead.
Search Medium
IOSG Follow
Save
Source: Sohu
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 1/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
We often see such a plot in war movies, the defending army lead by our main character
is under the attack from crushing enemy forces. Some of their own soldiers have
surrendered or fled, the wall is about to fall. But in the Nick of time, the main
character somehow managed to cross the enemy crowd, successfully kill the enemy
leader. Even with a huge leading edge, the enemy’s soldiers immediately collapse and
retreat (in some fantasy scenarios, enemy even vanishes into ashes). Although it is
exciting and cheerful to watch, but I can’t help myself thinking, this kind of failure is
truly stupid.
In every corner of modern society, the disadvantages of a single leader also exist in
enterprises or organizations. In the recent Luckin Coffee fraud incident, the stock
price plummeted from $24 to $2.40 and was forced out of the NASDAQ; Musk pumped
one of the most expensive marijuana in history (Tesla’s market value evaporated by $4
billion) on a radio show; the Liu Qiangdong incident, despite suspected of being
framed by competitor, wiped $7.2 billion off the market value of the well-run JD.com.
From this series of events we can see that for a traditional company, the ability of
leadership, credit and even personal life of their leaders are sometimes like a time
bomb.
First of all, here, the double-entry accounting method becomes a distributed ledger
technology;
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 2/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
2. “Autonomy” is reflected in the fact that its daily operations are programmed and
automatically enforced when meeting a specific condition. So the “xxx has the
final interpretation” ” clause naturally ceases to exist.
Figure 1::The difference between DAO and traditional companies, Source: BlockchainHub
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 3/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
Vitalik defines DAO as “an entity that lives on a network and exists independently, but
also relies heavily on the human person to perform certain tasks that it cannot. “
Richard Burton even made it more clear: “DAO is a strange way, it’s a digital system
that lives on top of Ethereum.” Decentralized autonomous organizations blend
“decentralization”, “autonomy” and economic incentives, tokenized blockchain
elements, in order to maximize organizational effectiveness and value flow. If the
above-mentioned scandal-plagued organizations and enterprises adopt a decentralized
and autonomous organizational structure that is open, democratic and transparent
enough, we believe that we can avoid such unnecessary losses.
We believe the community is really a place where users come together and interact.
According to Figure 2,we broadly divide the blockchain community into three broad
categories:
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 4/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 5/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 6/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
A ragon: is a Dapp on the Ethereum blockchain that allows anyone to create and
manage any organization (companies, open source projects, NGO, hedge funds,
and so on). Aragon focuses on providing a secure and common backbone for the
formation of a general organization, rather than building products around specific
decision-making mechanisms. The biggest bright spot about Aragon’s governance
mechanism is that all of its ANT Token holders have the right to oversee all decision-
making proposals, including (the highest to lowest order): the upgradeability of smart
contracts, the court (grade, structure, trial fees),the ANT Token policy, Treasury’s fiscal
policy. In addition, Aragon is building a very complete ecosystem, including
arbitration, and recently established the Aragon Court. All Aragon-based companies,
organizations, or individuals can be reconciled through the Aragon court if a dispute
arises.
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 7/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
led DAO. Colony is based on web, therefore is more open and borderless than Aragon
which is organization based.
The most famous of all is The DAO, which is an investment fund, except that its
investment decisions are made by a collective vote, rather than entrusted to a
dedicated investment manager. It was hacked in 2016, which led to a hard fork in
Ethereum, and later announced its closure. Although The DAO is a failed project, its
innovation is unprecedented, laying the foundation for the rise of various types of
DAOs in the future. Here we focus on the Moloch project and the various forks it
derives from.
3.2.1 Moloch
Moloch is an Ethereum fund program designed to fund infrastructure projects in
Ethereum (crowdfunding).
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 8/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
Moloch DAO operates as a mechanism where interested parties can send (donate) a
certain amount of ETH to the system, and existing members vote to decide whether to
accept them as members. Members may submit funding proposals to the platform and
vote on other funding proposals. After the vote, Moloch DAO will fund certain projects.
It is worth mentioning that Moloch DAO members are anonymous; voting and
donating ETHs are all done on-chain, and voting rights are determined by the number
of donated ETHs. If one member has a large number of voting rights and makes a
wrong grant decision, the other member may opt out (Ragequit). What is new about
Moloch is that unlike traditional organizations, equity does not mean that you can
continuously control and manage the organization’s capital. Conversely, there is only
one way to gain access to the right to use capital, which is to destroy their own equity
and the corresponding right to vote to issue additional shares, which effectively
undermines the traditional separation of corporate sectors to stimulate collaboration.
2. After the proposal is passed, the assignee receives some “share”, which could be
exchanged to ETH available in the guild bank. The assignee then exchange these
shares with wETH through the “ragequit ” mechanism.
4. Queue directly into the voting session after the proposal is initiated.
5. It takes about two weeks to process the proposal, which means the value of “share”
will vary with the fluctuation of ETH.
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 9/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
M arketing DAO focuses on the promotion of Ethereum. Grants have been given
to 10 proposals, each of which is 80 DAI. In the future, they will continue to
make efforts to promote Ethereum, make it reach more audiences.
2. After proposal has passed, any assets obtained do not need to initiate the
“ragequit” mechaism, therefore avoid being affected by volatility.
3. Added GuildKick, which can be initiated by any member and force a member to
quit.
5. A transaction proposal may be initiated for DAO members to trade its underlying
assets.
6. The proposal requires a member to choose “funding” option to enter the voting
stage.
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 10/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
based visualization. Members receive the DAO equivalent share by staking RICE, which
has the right to govern and receive dividends. Members can exit through “Ragequit” at
any time.
Prior to the start of this type of project, DAO model was flawed, and under current law,
DAOs that are only subject to smart contracts are limited in terms of member
fundraising and profitability. If the DAO is for profit, then you will be bound by
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 11/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
securities law like SEC. Even if the DAO is non-profit, it still touches the gray area of
the law. This type of DAO is legally commercialized, providing a bridge between the
traditional business world and the blockchain world.
Token holders vote directly on the corresponding blockchain measures using the
network’s tokens. Protocol will then calculate vote and execute subsequent results
automatically.
D ash is the first public chain that use DAO for governance, with its code
allocating a portion of the block reward (usually used to pay for financial
rewards for validation) (10 percent) to network members. Rewarding useful technical
development and promotion activity. To date, hundreds of proposals have been
approved in DashDAO, covering areas such as funding development, marketing, and
community awareness efforts.
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 13/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
S take DAO serves Stake Capital, a Stake service provider, and distributes the value
generated by a package of DeFi services to Stake Capital representatives or
participants through Stake Capital token (SCT).
Users can put SCTs into the DAO and receive regular stake rewards. SCT tokens can
also be used to govern voting for key decisions, including the type of stake service,
modifying the earnings duration cycle, and the SCT spending rate (which will be
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 14/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
reduced after each cycle to reward early investors). At the same time, each staked asset
will generate a Liquid Token (LToken) at a ratio 1:1, which can be traded as a derivative
on the secondary market.
3.4 Summary
Of the above-mentioned DAO, the largest and most successful are DASH and
MakerDAO. I personally think the most innovative one is StakerDAO, which follows the
Maker’s dual-token model of governance, but is not limited to stable coin, with
unlimited possibilities. Funding with legal compliance DAOs like the LAO are those
most coincide to future trends. We did not go deep into every DAO to feel the
community atmosphere, so there’s no way to judge which DAO is the best. However, we
believe that a successful decentralized autonomous organization must have the
following four characteristic: (1)Diversity and inclusion; (2) Excellent code and
incentives design; (3) high levels of community consensus and (4) A strong
development team.
4.1 Advantages
1. Decentralization of governance
It provides every investor with an equal opportunity to shape the future success of
their organization and to have a say in the decision-making process. Since the
organizational structure is not limited by traditional hierarchical lines of management,
every innovative idea and suggestion can be fully considered by the entire
organization.
2. High efficiency:
3. Transparency
As a DAO built on the blockchain, every financial transaction, rule, and decision is
uploaded on a public ledger for everyone to view. Adopting a consensus system also
means that each stakeholder is involved in helping to decide how to spend the
organization’s funds and tracking the amount spent.
The immutability of smart contracts is both an advantage and a disadvantage for DAO
due to the immaturity of the technology itself and the existence of security risks. Once
the contract rules are encoded, the system will be up and running, making it difficult
to change them. In addition, any known security issues can be exploited because the
code is visible to everyone and difficult to repair. Other known smart contract security
issues include transaction ordering dependence (TOD), timestamp trading, mishandle
exceptions, and so on.
2. Legal status
While some countries have legalized the use of cryptocurrencies and blockchain
technologies, the exact legal status of using DAO as a generic structure remains
unclear. Start-ups with DAO business structures require a legal framework to operate
legally in certain jurisdictions and interact with the traditional financial system and
the intellectual property world. Otherwise, DAO participants may be held legally
responsible.
3. Decision-making level
IOSG believes that DAO is the ultimate form of the crypto economy, but still in its early
days. Many issues including protocol technology security, compliance, endogenous
problems in governance decisions still exist. At the beginning of its existence, it had
been a combination of hope and controversy. On one hand, the fall of The DAO has
called into question of its safety. On the other hand, the success of MakerDAO and
DASH has raised hopes. With more and more technological breakthroughs and the
advent of DAO service providers, we are able to predict future trends of DAO:
2. More innovations emerge to reform and upgrade all shapes of form in physical
world. Imagine if Wuhan’s incident was based on DAO to make decisions. We have
consistent goals, all information is uploaded to the blockchain, all participants
bind by smart contracts can quickly collect materials, and vote to distribute
materials in accordance to the chain information, and at the same time quickly
transported materials to the hospital. Would this be a better way of resolving the
issue?
3. More compliance. Local government will issue various laws and regulations to
restrict the legal liability of DAO. More DAOs similar to the legal form of the LAO
appear.
4. As Defi grows strong after 2019, as the best governance tool for DeFi, DAO will
receive more attention.
5. To find the balance between freedom and efficiency, relevant rules and the
incentive design would be further strengthen. Because too much decentralization
will reduce the participation rate and therefore lacks unity of goals, resulting in
low efficiency. Over-centralization will lead to the lack of listening to the opinions
of members and lost of original intention.
Finally, we believe that the concept of digital democracy not only protects the
principles of a democratic society, but also improves corruption and system
breakdown through technological development, model innovation and reasonable
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 17/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
incentive mechanism. With the emergence and upgrading of different types of DAOs in
2020, we have reason to believe that the application of DAO in the future will develop
from the bottom up, and continue to improve from the current form of governance
and financing on the chain, until it is strong enough to be adopted by the national level
or large-scale enterprises
6. Bibliography
1. Daohaus [EB/OL].https://daohaus.club/.
3. Moloch [EB/OL].https://molo.ch/.
6. 初析 MolochDAO:颠覆公司制度的一种全新的组织. [EB/OL].
http://www.lianchaguan.com/archives/6223
8. 区块佣兵:浅谈区块链自治社区的理想模式
[EB/OL].https://www.tuoluocaijing.cn/article/detail-27296.html
10. 去中心化自治组织:发展现状、分析框架与未来趋势.
[EB/OL].http://blog.sciencenet.cn/blog-951291-1198720.html
11. 数字民主和治理2.0:从比特币到DAO,区块链的创新是如何影响的?[EB/OL].
https://www.hulianmaibo.com/posts/info/35663
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 18/20
2/12/23, 2:00 AM Overview of Decentralized Autonomous Organization (DAO) | by IOSG | IOSG Ventures | Medium
https://medium.com/iosg-ventures/overview-of-decentralized-autonomous-organization-dao-f9ac47051d07 20/20
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
Save
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 1/7
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
At the beginning of May 2016, a few members of the Ethereum community announced
the inception of The DAO, which was also known as Genesis DAO. It was built as a
smart contract on the Ethereum blockchain. The coding framework was developed
open source by the Slock.It team but it was deployed under “The DAO” name by
members of the Ethereum community. The DAO had a creation period during which
anyone was allowed to send Ether to a unique wallet address in exchange for DAO
tokens on a 1–100 scale. The creation period was an unexpected success as it managed
to gather 12.7M Ether (worth around $150M at the time), making it the biggest
crowdfund ever. At some point, when Ether was trading at $20, the total Ether from
The DAO was worth over $250 million.
In essence, the platform would allow anyone with a project to pitch their idea to the
community and potentially receive funding from The DAO. Anyone with DAO tokens
could vote on plans, and would then receive rewards if the projects turned a profit.
With the financing in place, things were looking up.
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 2/7
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
However, on June 17, 2016, a hacker found a loophole in the coding that allowed him to
drain funds from The DAO. In the first few hours of the attack, 3.6 million ETH were
stolen, the equivalent of $70 million at the time. Once the hacker had done the damage
he intended, he withdrew the attack.
In this exploit, the attacker was able to “ask” the smart contract (DAO) to give the Ether
back multiple times before the smart contract could update its balance. Two main
issues made this possible: the fact that when the DAO smart contract was created the
coders did not take into account the possibility of a recursive call and the fact that the
smart contract first sent the ETH funds and then updated the internal token balance.
It’s important to understand that this bug did not come from Ethereum itself, but from
this one application that was built on Ethereum. The code written for The DAO had
multiple flaws, and the recursive call exploit was one of them. Another way to look at
this situation is to compare
However, the funds were placed into an account subject to a 28 day holding period so
the hacker couldn’t complete his getaway. To refund the lost money, Ethereum hard
forked to send the hacked funds to an account available to the original owners. The
token owners were given an exchange rate of 1 ETH to 100 DAO tokens, the same rate
as the initial offering.
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 3/7
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
Unsurprisingly, the hack was the beginning of the end for the DAO. The hack itself was
contested by many Ethereum users, who argued that the hard fork violated the basic
tenets of blockchain technology. To make matters worse, on September 5, 2016, the
cryptocurrency exchange Poloniex delisted DAO tokens, with Kraken doing the same
in December 2016.
All of these issues pale in comparison to the United States Securities and Exchange
Commision (SEC) ruling that was released on July 25, 2017. This report stated:
“Tokens offered and sold by a “virtual” organization known as “The DAO” were
securities and therefore subject to the federal securities laws. The Report confirms
that issuers of the distributed ledger or blockchain technology-based securities must
register offers and sales of such securities unless a valid exemption applies. Those
participating in unregistered offerings also may be liable for violations of the
securities laws.”
In other words, The DAO’s offering was subject to the same regulatory principles of
companies undergoing the initial public offering process. According to the SEC, The
DAO violated federal securities laws, along with all of its investors.
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 4/7
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
First, The DAO teaches a valuable lesson about the importance of establishing secure
blockchain platforms. The DAO’s hack was not due to a problem inherent on the
Ethereum blockchain; it came from a coding loophole exploited by an intelligent
hacker. Had the code been written correctly, the hack could have been avoided.
Second, the SEC’s ruling on The DAO has encouraged blockchain startups to come up
with ways of avoiding security registration and federal regulation. One of the ways
companies do this is by using the SAFT method. If tokens have legitimate utilitarian
value on a blockchain platform,
they violate a component of the Howey case, and therefore cannot be listed as
securities or regulated by the SEC.
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 5/7
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
Without the DAO, who knows what lessons would still need to be taught.
This story is published in The Startup, Medium’s largest entrepreneurship publication followed
by 298,432+ people.
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 6/7
2/12/23, 2:03 AM The Story of the DAO — Its History and Consequences | by Samuel Falkon | The Startup | Medium
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Search
We couldn't process Medium
your request. Try again, or contact our
support team.
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/swlh/the-story-of-the-dao-its-history-and-consequences-71e6a8a551ee 7/7
2/12/23, 2:05 AM What were the consequences of the DAO attack? How were these issues handled? | by Asame Zamyak | Coinmonks | Medium
Published in Coinmonks
Save
The DAO hack is one of the most important hack in Blockchain history. In this text we
will focus on its consequences and how these issues are handled.
A DAO is a Decentralized Autonomous Organization. People use it for making rules and
decisions without decentralized control. That was an organization which sits on
Ethereum Network and runs with smart contracts. People realised a bug on that smart
contract and they expressed their concerns about the vulnerability of the code to a
https://medium.com/coinmonks/what-were-the-consequences-of-the-dao-attack-how-were-these-issues-handled-6da0c60827a2 1/4
2/12/23, 2:05 AM What were the consequences of the DAO attack? How were these issues handled? | by Asame Zamyak | Coinmonks | Medium
possible attack. It is important to not confuse Ethereum Network and Smart Contracts,
the Ethereum Network has no such bugs and has been working perfectly the entire
time.The bug was about smart contract on it.
Gavin Wood expressed this bug in a Blockchain conference “it’s a classic software engineering
bug where the records updated after and not before the money was gone”
Gavin Wood on how $60M hack of DAO happened and what to do next | Dutch B
While programmers were working on fixing this and other problems, an unknown
attacker began using this approach to start draining the DAO of Ether. He / She drained
more than 3.6 million Ether.
The price of Ether dropped from over $20 to under $13. The DAO itself had 14%
percent of all Ether so a failure of the DAO had a negative impact on the Ethereum
network. The Ethereum Foundation tried to solve this problem with such proposals:
https://medium.com/coinmonks/what-were-the-consequences-of-the-dao-attack-how-were-these-issues-handled-6da0c60827a2 2/4
2/12/23, 2:05 AM What were the consequences of the DAO attack? How were these issues handled? | by Asame Zamyak | Coinmonks | Medium
Not all of the members of the community accepted this fork. So, Those who refused to
accept the hard fork supported the pre-forked version, Ethereum Classic (ETC).
Though the funds stolen from The DAO were restored to its investors, the attacker did
not lose out entirely. The pilfered tokens still remained in their possession on the
Ethereum Classic chain and were worth around $8.5 million in ETC in the months
following the attack.
The DAO hack and subsequent Ethereum hard fork shook the Ethereum community to
its core and highlighted major questions about the emerging technology. In retrospect,
it’s clear that the decisions made by Vitalik Buterin, Etheruem developers, and the
global community ensured the survival of the blockchain in its earliest days. Since The
DAO hack, Ethereum has gone on to become an essential pillar of blockchain,
cryptocurrency, and decentralized finance.
gemini.com/cryptopedia/the-dao-hack-makerdao#section-the-dao-hack-remedy-forks-
ethereum
pullnews.medium.com/understanding-the-dao-hack-for-journalists-
2312dd43e993#.kw0ufw25q
youtu.be/KaOGtH7J0WE
youtu.be/JzCGRtGyxvY
https://medium.com/coinmonks/what-were-the-consequences-of-the-dao-attack-how-were-these-issues-handled-6da0c60827a2 3/4
2/12/23, 2:05 AM What were the consequences of the DAO attack? How were these issues handled? | by Asame Zamyak | Coinmonks | Medium
Software
Open in app Engineering Blockchain Ethereum Technology Dao Sign up Sign In
Search Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/what-were-the-consequences-of-the-dao-attack-how-were-these-issues-handled-6da0c60827a2 4/4
2/12/23, 2:08 AM “Ethereum’s Blockchain Just Split in Two” — What does that mean? | by Akshay Anand | Medium
Save
Although, there were a lot of news floating here and there, still it was quite hard for
someone not from hardcore blockchain fraternity to understand what does that
actually mean and what’s the reason for worry. In this post I’ll try explaining this in
detail and probably it’ll help everyone to understand the reason of the problem behind
this. But before doing so we will have to first do a quick blockchain refresher.
Any blockchain ecosystem comprises of multiple nodes. Each node has multiple
blocks, and each block has multiple transactions. This looks something like —
https://medium.com/@akshay.anand12/ethereums-blockchain-just-split-in-two-what-does-that-mean-9342b283003f 2/6
2/12/23, 2:08 AM “Ethereum’s Blockchain Just Split in Two” — What does that mean? | by Akshay Anand | Medium
The nodes are nothing but those machines who are trying to either transact (like
the wallets) or mine (like the miners).
Mining is a process where a miner solves a certain cryptographic problem to be eligible to add
a new block to blockchain.
Now, since we have this background setup, let’s try answering the original question of
what it means when we say “Ethereum’s Blockchain Just Split in Two”?
https://medium.com/@akshay.anand12/ethereums-blockchain-just-split-in-two-what-does-that-mean-9342b283003f 3/6
2/12/23, 2:08 AM “Ethereum’s Blockchain Just Split in Two” — What does that mean? | by Akshay Anand | Medium
Recently, a public announcement was made saying that Geth v 1.10.7 and previous
versions had some vulnerability, the details were not shared but everyone was asked to
update to newer version urgently. As a result of this announcement two things
happened —
1. Not everyone updated to the latest version, so we had people/nodes on old version
with vulnerability and on the new one without vulnerability.
2. Some set of people with malicious intend started identifying the vulnerability so as
to exploit it till the time everyone migrates to the new version without
vulnerability. Since Ethereum/Geth is an open source platform. It’s never
impossible to reverse engineer the changes done in a new version and find out the
vulnerability it addresses.
https://medium.com/@akshay.anand12/ethereums-blockchain-just-split-in-two-what-does-that-mean-9342b283003f 4/6
2/12/23, 2:08 AM “Ethereum’s Blockchain Just Split in Two” — What does that mean? | by Akshay Anand | Medium
Search Medium
https://icons8.com/icon/25356/hacker
Due to the Point#1, the blockchain ecosystem got split into two (what we are calling got
forked) with some nodes being on old version of Geth and some on new. Thankfully
majority of miner nodes were updated to new version but say if they weren’t then due
to Point#2 there was a possibility of them utilising the vulnerability, mining and
getting the levels of confirmation needed for a successful transaction, which could
have been a major risk.
Hope that would have helped you in understanding the news better.
Blockchain Technology
https://medium.com/@akshay.anand12/ethereums-blockchain-just-split-in-two-what-does-that-mean-9342b283003f 5/6
2/12/23, 2:08 AM “Ethereum’s Blockchain Just Split in Two” — What does that mean? | by Akshay Anand | Medium
https://medium.com/@akshay.anand12/ethereums-blockchain-just-split-in-two-what-does-that-mean-9342b283003f 6/6
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
Published in Ankr
Save
For quite some time, the term ‘Merge’ has piqued the interest of many in the crypto
community. The Ethereum Merge has been a subject on the lips of important players in the
crypto sector, and many have given their thoughts and viewpoints on one of the most
significant moves in the short history of blockchain technology.
On September 14, 2022, the Ethereum blockchain will move from proof-of-work (PoW)
to proof-of-stake as its consensus method (PoS). Vitalik Buterin, the inventor of
Ethereum, pondered this upgrade in public blogs during Ethereum’s ICO in 2014, far
before the network’s debut in July 2015. The testnet for the upgrade went live at the
beginning of May 2019, and the new 2.0 chain began operating in parallel in December
2020. Since then, frequent delays have dimmed enthusiasm, despite the fact that
Ethereum has successfully surmounted more testing obstacles.
PoS works when validators “stake” the native cryptocurrency of the blockchain
network by depositing it into a private smart contract. Then, random validators are
chosen to verify each new block and receive the delegated reward.
Since late 2020, when a testing configuration of the Ethereum PoS blockchain called
the Beacon Chain was introduced, Ethereum has been continuously developing. Since
ETH2 is the next version of Ethereum, the transition from ETH PoW to ETH PoS was
given the term “The Merge.” with The Merge, the PoW chain and Beacon Chain will
merge to create a single blockchain.
The PoS consensus method is more eco-friendly than the PoW consensus mechanism,
in which miners fight to verify new blocks by wasting enormous computational power
and energy. In addition to the environmental effect, many feel that the conversion to
PoS will lessen the danger of over-centralization by making the validator function
accessible to everyone with Ether to stake, instead of just those with costly mining
equipment.
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 2/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
protocols, NFTs, and Web3 ecosystem are now accessible to millions (and eventually
billions) of users. For the Ether price, this is almost certainly good news.
Below, we will examine a few potential impacts of The Merge and the on-chain
indicators that observers might use to monitor these consequences.
The amount of Ethereum staked even topped the market value of the largest PoS
network at this time — Solana. However, not all of these validators are genuinely
decentralized since some are held by centralized exchanges, custodians, and staking
pools such as Lido and Rocket. The Validators’ payout may not seem appealing as of
right now, but it will climb from 4% to 10%.
However, it is not all a walk in the park for validators considering possible technical
issues with such a significant transition. A Validator’s stake may be decreased for bad
behavior. Validators, for example, may be penalized for dishonest work. They can also
potentially be expelled from the network due to duplicate proposals, competing
proposals, or double voting are examples of slashable offenses, as is downtime (offline
penalty when more than 1/3 of the nodes are offline).
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 3/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
It will reduce the inflation rate from 4% to -1%, thereby making Ether deflationary
everywhere network activity grows. This leads to the term “Ultrasound money,” which
some in the community have already nicknamed Ethereum.
To address scalability difficulties, the initial plan intended for sharding operations to
be undertaken prior to The Merge. However, with the introduction of layer 2 scaling
solutions, the focus has shifted from proof-of-work to proof-of-stake through The
Merge.
“Staking 32 ETH is required for node operation.” This is not the case. There is no
restriction on who may sync their own verified copy of Ethereum (i.e., run a node).
“Gas fees will be significantly more affordable after the merge” is also untrue. The
Merge is a change in the consensus method, not an augmentation of network capacity,
and it won’t lead to cheaper gas prices.
“You may withdraw staked ETH after The Merge happens.” This is still incorrect. The
Merge does not currently support staking withdrawals. Staking withdrawals will be
permitted in the forthcoming Shanghai update.
“Until the Shanghai upgrade, validators will not get any ETH rewards when
withdrawals will be authorized.” False. Fee tips/MEV will be credited to a validator-
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 4/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
“When withdrawals are authorized, stakers will all leave at once.” Also incorrect.
Validator exits are rate controlled for security reasons.
“There will be a threefold increase in the staked APR after The Merge.” False. More
recent estimates expect a 50% rise in APR after the Merge, rather than a 200% increase.
“The Merge will cause chain downtime.” This is false. The Merge update is intended to
allow for a seamless transition to proof-of-stake.
More than $30 billion in Ether has been staked on the PoS Beacon Chain, making it the
biggest PoS blockchain by value staked, even before it replaces the Ethereum PoW
Network. Staking requires installing specialized software and hardware, which may be
purchased from other parties. Many others have staked by adding ETH to a staking
pool. Staking pools function similarly to mining pools in that several users may pool
their resources to increase their chances of being selected to propose a new block and
divide the rewards.
After The Merge, staking will become an even more appealing option for a number of
reasons. Once PoS is formally implemented, and PoW is relegated to the past, users
will likely feel more comfortable staking. The fact that Ethereum PoS will be more
environmentally friendly might reassure investors with a dedication to sustainability.
This is particularly true for institutional investors.
The Merge also lays the groundwork for future Ethereum enhancements. ETH placed
directly on the beacon chain cannot be withdrawn from the contract. Some staking
platforms offer liquid, synthetic assets that act like a receipt to users’ staked ETH,
although these synthetics may not necessarily retain a 1:1 peg with ETH. While The
Merge will not instantly alter this, a future update called the Shanghai upgrade will let
users withdraw staked Ether, offering greater liquidity for stakers and making staking
a more appealing proposition overall. Other scalability improvements like sharding,
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 5/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
which aim to decrease gas costs and speed up transactions, are also on the horizon
after The Merge.
Collectively, these modifications, beginning with The Merge, should make ETH a more
desirable asset to have and, by extension, to stake.
We have previously discussed how the values of crypto assets such as Bitcoin have
grown more connected with those of tech stocks and other high-risk, high-reward
assets. ETH’s price may decouple from other cryptocurrencies after The Merge since its
staking incentives will make it comparable to instruments that carry a premium, like
bonds and commodities. It has been speculated that validators may anticipate yearly
yields of 10–15% in ETH from staking incentives and transaction fees without even
factoring in the possibility that the price of ETH could climb, which would raise profits
in terms of fiat currency.
These returns might make staking Ethereum an attractive alternative to bonds for
institutional investors. Although it has risen over the last 12 months, the one-year
U.S.Treasury bonds yield is 3.5% as of September 2022.
The data indicates that the number of wallets staking at least $1 million worth of ETH,
which can be referred to as institutional stakers, has been rising significantly.
Render network offers a similar service for generating 3D graphics and lets GPU
owners make money by sharing their hardware with others.
Meanwhile, as application industries flourished during the bull market of 2020–1, the
Ethereum network grew overloaded with a large transaction volume, and transaction
costs skyrocketed. This enabled other protocols, such as Binance Chain, Solana, and
Avalanche, to steal Ethereum’s market share.
Announcing the anticipated launch date for the update eliminated ambiguity and
increased anticipation that Ethereum would regain market dominance. Since then, the
price of Ether has doubled, and the volume of Ether options has overtaken that of
Bitcoin options for the first time, with the ratio of calls (bullish posture) being around 4
to 5 times that of Bitcoin.
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 7/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
Less expensive to operate since validators will not be required to make significant
hardware investments.
All you have to do is stake your assets and earn transactions fees
In light of these benefits, it’s reasonable to assume that Ether will outperform Bitcoin
in the near future. Ether’s price in BTC is now just 45% behind its all-time high and
10% below its yearly high reached in December.
If the second largest blockchain system can successfully switch to proof-of-stake, it will
have an impact on the ongoing debate over the relative merits of proof-of-stake vs.
proof-of-work methodologies. This might sway public opinion even further against
proof-of-work blockchains (including Bitcoin) due to their high energy consumption. If
Ether can “flip” Bitcoin and become the dominant cryptocurrency, Bitcoin’s
dominance will inevitably decline.
And although Ethereum’s careful approach to the update has created major delays, it
also gives confidence that the technical risks will have been substantially addressed by
the time the upgrade goes live.
After the update, there is a tiny chance that regulators may see Ether as a security.
This is improbable, considering the majority of blockchain systems are now proof-of-
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 8/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
stake. Therefore Ethereum is not the first to provide this functionality. Furthermore,
such a damaging regulatory action would be inconsistent with Western regulators’
generally accommodating and supportive stance. However, the legal justifications are
somewhat hazy, leaving the door open for arbitrary regulatory action.
The most considerable risk in the immediate future is the possibility that The Merge
will not make transactions quicker, cheaper and that this improvement will not take
full effect for at least a year. On the other hand, the medium-term potential presented
by a well-considered, complete upgrading of the (by a significant margin) most
extensively used smart contract platform is enormous.
However, it is more likely that the downtrend of Ether futures is the outcome of an
arbitrage transaction (long spot/short futures) aimed at profiting from an anticipated
fork of Ethereum’s proof-of-work version. Prominent miners want to keep the original
system and give out a new currency to Ether holders for free.
Conclusion
Finally, the Merge is equivalent to replacing the engines of a flying aircraft, which
sounds inconceivable to the human mind. However, the Merge success would be a
victory for every person, institution, and organization in the blockchain ecosystem
since it would open up even more opportunities for the good of humanity in
unimaginable ways for most people.
This Merge is regarded as one of the most meaningful and awaited occurrences in the
cryptocurrency sector. It is scheduled for September 14th. The countdown has begun,
and the anticipation is palpable. The question remains, “Are we ready for it?
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 9/10
2/12/23, 2:10 AM The Ethereum Merge: Everything You Must Know | by Renato Zamagna | Ankr | Medium
The effect of The Merge on crypto markets begins with on-chain data. The Merge
might have significant effects on ETH’s price and general desirability as an asset,
which in turn affects staking, mining, and institutional adoption of cryptocurrencies.
Although it’s hard to forecast the precise market responses or how pronounced they’ll
be, the on-chain measures outlined above may assist in tracking them after The Merge.
Search Medium
https://medium.com/ankr-network/everything-you-need-to-know-about-the-ethereum-merge-2e1e1431b77 10/10
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
Published in QuickNode
Save
Image source
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 1/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 2/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
For a Non-Reader 😶
Everyone is upgrading this time, so no split; you don’t get “free” coins
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 3/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
Upgrades in Constantinople
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 4/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
Tl;dr There are mostly opcode changes which will optimize gas usage and enable
second layer solutions like state channels, delaying difficulty bomb and reducing the
block reward from 3 to 2 ETH per block. No other significant changes to the network
are planned.
There are 5 Ethereum improvements proposals (EIPs) which are accepted in this fork:
This proposal will introduce three shift instruction — Shift Left (SHL), Logical Shift
Right(SHR), Arithmetic Shift Right(SAR). These instructions will be used for shifting
bits on EVM level, which until now has been done using arithmetic instructions.
Arithmetic instructions for shifting cost 35 gas which will be reduced to 3 gas using
new shift instructions… Read More
This EIP will introduce a new opcode EXTCODEHASH which will return keccak256 hash of
a contract’s code. Before this code, if any smart contract wanted to perform some
checks on another smart contact, it had to get whole bytecode of that smart contract
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 5/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
(using EXTCODECOPY opcode). Now, with EXTCODEHASH opcode, a smart contract can
perform these checks using a simple hash.
You can understand this as “before you needed to download the whole pdf to confirm
its contents vs. now it can be confirmed with a single hash”… Read More
State channels are similar to Bitcoin Lighting Network. This EIP introduces a new
Opcode CREATE2 . The update will allow for the main chain to reference off-chain
transactions that have not been broadcast to the main chain yet... Read More
This EIP introduces changes in SSTORE opcode. This will optimize the gas cost for
smart contract storage. This will reduce the cost of writing on the blockchain.
EIP 1283 implements a better cost analysis for contracts, by breaking down what
contract changes have been written in Ethereum’s short term storage, rather than the
blockchain itself. Read More
This EIP will affect the miners mostly, as it will reduce block reward from 3 ETH to 2
ETH, and uncle & nephew rewards also adjusted accordingly.
It also delays the difficulty bomb, which is basically the exponential increase in mining
difficulty (which makes Ethereum mining impossible and unprofitable).
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 6/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
Developers — Update your private client, or if you are using Infura or QuikNode, you
don’t need to worry as nodes will be updated by the service provider.
Bob with Wallets — If you have created wallets with any of the wallet providers
Metamask, MEW, MyCrypto, Coinbase, Hardware (e.g. Ledger/Trezor), paper wallet
etc… you don’t need to do anything.
Alice with ETH on the Exchange — If you own Ether on an exchange, you don’t need to
do anything as exchanges will automatically update to support Constantinople.
Node Service Providers — Services like QuikNode or Infura will need to update their
Ethereum clients.
Normal Joey — Normal Joey doesn’t need to care about all this. He’s keeping all of his
fiat money in the Bank. How lucky? 😃
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 7/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
Official statements (and instructions, if any) regarding the upcoming fork and client
updates will be published on Twitter, Facebook, and in Slack. QuikNode users
shouldn’t need to do anything, and the development team will keep everyone posted
through its communication channels.
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 8/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 9/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
Sign up
Your email
Subscribe
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 10/11
2/12/23, 2:12 AM Ethereum Hard Fork — Constantinople | by Gaurav Agrawal | QuickNode | Medium
https://medium.com/quiknode/ethereum-hard-fork-constantinople-cb6aa263ebc9 11/11
2/12/23, 2:15 AM Let’s talk Hard Forks: The Exciting Area of Cryptocurrency | by Katherine | Medium
Katherine Follow
Save
Cryptocurrency coins are encrypted versions of the public ledger “blockchain”. Coins
will flourish only when the code of a specific coin is upgraded and altered. These
constant changes regulate the compatibility of new coins with the older ones.
There are two types of forks: Soft forks and hard forks.
Softforks
1. They are forward-compatible. That means that nodes running an older version of
the software will accept blocks created by new nodes.
2. After a softfork, only miners have to update their software. Normal users can keep
running older nodes, which will accept the newer blocks. However, users wanting
to use new rules which haven’t been implemented before would still have to shift to
the new version.
In order for a softfork to be successful minimum 51% of the mining power has to shift
to the new version. Once that happens, transactions from older clients incompatible
with the new set of rules will simply be ignored by the network and become invalid.
Hardforks
https://medium.com/@katherine.amt2/lets-talk-hard-forks-the-exciting-area-of-cryptocurrency-4cb2ca0ec368 2/5
2/12/23, 2:15 AM Let’s talk Hard Forks: The Exciting Area of Cryptocurrency | by Katherine | Medium
Hard forks are not forward-compatible. The nodes running follows the old consensus
rules and doesn’t consider the new rules. This results in a permanent divergence in the
block chain.
If a cryptocurrency network experiences a hardfork, a new set of rules is implemented
in the most recent release. All nodes of miners (or witnesses) running the latest
version add one or more “words” (i.e. rules) to their “alphabet” (i.e. the current set of
rules). Hardforks have the following properties:
1. They are not forwards-compatible. That means that nodes running an older
version of the software will not accept blocks created by new nodes.
2. After a hardfork, every single user (normal users and miners alike) has to use the
new software version. If someone decides not to do that, he or she will be excluded
from the network.
Anybody who owned coins at the time of hard fork, will have authority on these coins
on both the blockchains. Initially, during the hard fork, the value of the coins
diminishes. But, after the split, the value of each set of coins reflects both the mining
and community support.
A hard fork undermines the entire project, which is why the majority of the
community opposes it strongly.
Results in a tremendous amount of work within a coin’s community as all the existing
software must be updated to the latest version to prevent the loss of coin.
Regular software updates and extra work results in businesses shift towards the more
stable coin type.
https://medium.com/@katherine.amt2/lets-talk-hard-forks-the-exciting-area-of-cryptocurrency-4cb2ca0ec368 3/5
2/12/23, 2:15 AM Let’s talk Hard Forks: The Exciting Area of Cryptocurrency | by Katherine | Medium
Just say, a fork is not fixed, this cause an incompatibility and results in two distinct
versions of the coin.
Currently, there is a lot of talk in the cryptocurrency scene going on about hardforks
and softforks. There is a chance Bitcoin might soon experience either a hardfork or a
softfork. Etherium experienced a hardfork last year and a planned Steemit hardfork
recently failed due to the fact that the witnesses didn’t reach consensus.
Bitcoin hasn’t had one of these yet, whereas in the case of Ethereum it was pre-decided
from the starting that the protocol would hard fork 3 times, introducing new features
each time. These involve improvements to the protocol. People using Ethereum must
https://medium.com/@katherine.amt2/lets-talk-hard-forks-the-exciting-area-of-cryptocurrency-4cb2ca0ec368 4/5
2/12/23, 2:15 AM Let’s talk Hard Forks: The Exciting Area of Cryptocurrency | by Katherine | Medium
make an upgrade of software a regular routine in order to stay on the main blockchain,
and adapt the new improvements each time.
After the occurrence of the hard fork, people still want to remain on the original chain
fearing the possibility that the community will dump their coins diminishing its value
and making mining unprofitable.
Search Medium
About Help Terms Privacy
https://medium.com/@katherine.amt2/lets-talk-hard-forks-the-exciting-area-of-cryptocurrency-4cb2ca0ec368 5/5
2/12/23, 2:18 AM I asked ChatGPT: Ethereum classic vs Ethereum. Which have more potential? | by Vremaroiu Alin | Coinmonks | Jan, 2023 | Medi…
Published in Coinmonks
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/coinmonks/i-asked-chatgpt-ethereum-classic-vs-ethereum-which-have-more-potential-aa981a8662f6 1/5
2/12/23, 2:18 AM I asked ChatGPT: Ethereum classic vs Ethereum. Which have more potential? | by Vremaroiu Alin | Coinmonks | Jan, 2023 | Medi…
https://medium.com/coinmonks/i-asked-chatgpt-ethereum-classic-vs-ethereum-which-have-more-potential-aa981a8662f6 2/5
2/12/23, 2:18 AM I asked ChatGPT: Ethereum classic vs Ethereum. Which have more potential? | by Vremaroiu Alin | Coinmonks | Jan, 2023 | Medi…
Source photo black and brown nivea cream container photo — Free Cryptocurrency Image on Unsplash
Ethereum, on the other hand, is the continuation of the original Ethereum blockchain
and has undergone several upgrades and changes since its launch. Ethereum is also a
decentralized, open-source platform that enables the creation of smart contracts and
dApps. Ethereum’s native token, Ether (ETH), is used to pay for transactions and
computational services on the network. Ethereum’s current version, Ethereum 2.0,
aims to address the scalability issues of the previous version by implementing a proof-
of-stake consensus mechanism.
https://medium.com/coinmonks/i-asked-chatgpt-ethereum-classic-vs-ethereum-which-have-more-potential-aa981a8662f6 3/5
2/12/23, 2:18 AM I asked ChatGPT: Ethereum classic vs Ethereum. Which have more potential? | by Vremaroiu Alin | Coinmonks | Jan, 2023 | Medi…
Ethereum Classic, on the other hand, is a smaller and less active ecosystem with a
smaller developer community and a smaller market capitalization. It’s not as widely
supported by exchanges and doesn’t have as much liquidity as Ethereum. However,
Ethereum Classic has a strong community of supporters and is considered by some as
a more decentralized version of Ethereum, as it has not undergone any controversial
changes and has kept the same codebase as the original Ethereum blockchain.
In conclusion, both Ethereum Classic and Ethereum have their own strengths and
weaknesses, and the choice of which one has more potential depends on the specific
use case and the user’s goals. It’s important to research and understand the differences
and similarities between the two platforms before making a decision.
Disclaimer
This Medium account strives to provide accurate and up-to-date information, but it
will not be responsible for any missing facts or inaccurate information. You comply
Open in app Sign up Sign In
and understand that you should use any of this information at your own risk.
Cryptocurrencies and
Search Stocks are volatile financial assets, so research and make your
Medium
own financial decisions.
https://medium.com/coinmonks/i-asked-chatgpt-ethereum-classic-vs-ethereum-which-have-more-potential-aa981a8662f6 4/5
2/12/23, 2:18 AM I asked ChatGPT: Ethereum classic vs Ethereum. Which have more potential? | by Vremaroiu Alin | Coinmonks | Jan, 2023 | Medi…
Your tip will go to Vremaroiu Alin through a third-party platform of their choice, letting them know you appreciate their
story.
Give a tip
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/i-asked-chatgpt-ethereum-classic-vs-ethereum-which-have-more-potential-aa981a8662f6 5/5
2/12/23, 2:21 AM Is Ethereum Classic ETC Better Than Ethereum ETH ? | by Vremaroiu Alin | Coinmonks | Medium
Published in Coinmonks
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/coinmonks/is-ethereum-classic-etcbetter-than-ethereum-eth-e85505f37e75 1/7
2/12/23, 2:21 AM Is Ethereum Classic ETC Better Than Ethereum ETH ? | by Vremaroiu Alin | Coinmonks | Medium
Pissed off investors gave engineers one month to come up with a solution before the
hackers cashed out on their stolen tokens. Developers had to make a hard fork in order
https://medium.com/coinmonks/is-ethereum-classic-etcbetter-than-ethereum-eth-e85505f37e75 2/7
2/12/23, 2:21 AM Is Ethereum Classic ETC Better Than Ethereum ETH ? | by Vremaroiu Alin | Coinmonks | Medium
to reverse the hack and return investors’ funds. Vitalik Buterin and several of the
network’s significant investors were in favor of this option, but others were against. For
the most part, they rejected it because they thought it immoral to alter the Blockchain’s
ledger. Because of this, they sought to keep the network running despite the theft.
They did not leave the network, however, and renamed it Ethereum Classic in the
process.. Vitalik Buterin, the majority of miners, developers, and users, migrated to the
forked network. “ Today, we refer to the split network as Ethereum.
https://medium.com/coinmonks/is-ethereum-classic-etcbetter-than-ethereum-eth-e85505f37e75 3/7
2/12/23, 2:21 AM Is Ethereum Classic ETC Better Than Ethereum ETH ? | by Vremaroiu Alin | Coinmonks | Medium
Although both networks are now offering smart contracts, it is important noting that
they are catering to the same market. Ethereum, on the other hand, is now the most
popular cryptocurrency. Most Defi projects are hosted on Ethereum, which provides
cryptocurrency users with a wide range of customized services. Investors’ favorite
altcoin is Ether, which continues to challenge Bitcoin in value.
Ethereum also wins the battle in terms of scalability. With just 15 transactions per
second, Ethereum Classic is one of the slowest blockchain networks. Ethereum, on the
other side, is capable of 30 transactions per second at the moment. The Ethereum 2.0
update will allow the network to process up to 100,000 transactions per second when it
is completed.
There were many “51 percent assaults” on Ethereum Classic during 2019 and 2020,
which is a restriction of the network’s security. The hacker was able to steal millions of
dollars’ worth of computer power from the network as a result of this assault. Because
Ethereum’s network is so well-protected, there have been few or no assaults on it.
In terms of market capitalization and popularity, Ether outperforms ETC. The market
valuation of Ether likewise exceeds that of ETC by almost 4,000%. At the time of this
writing, the price of Ether is about 1,000 percent more than the price of ETC. Despite
their apparent similarities, the vastness of the distance between the two networks is
evident. Unlike Ether, the total quantity of ETC tokens is capped at 210 million.
https://medium.com/coinmonks/is-ethereum-classic-etcbetter-than-ethereum-eth-e85505f37e75 4/7
2/12/23, 2:21 AM Is Ethereum Classic ETC Better Than Ethereum ETH ? | by Vremaroiu Alin | Coinmonks | Medium
Coinbase, and Kraken, offer it for purchase and trade. In addition to stablecoins, other
cryptocurrencies, and fiat currencies, there are other pair options.
However, given the existing measurements and indexes, the coin may have a terrific
year. The Ethereum Classic network is constantly being improved by its creators in
order to increase its security, speed, and scalability. As long as the upgrades are
favorable, crypto experts feel that they may expect to see an increase in their fortunes.
In the opinion of WalletInvestor, the token is on the rise and will finish the year with a
value of $67.293 at the most. Investors may expect a return on their investment of at
least 100% if this occurs. According to WalletInvestor, it will take five years for ETC to
reach its current all-time high.
Even though Digital Coin is bullish on ETC’s future, the company doesn’t expect it to hit
$100 before 2022. However, no more than $64.48 is predicted by the crypto experts for
the token in 2022. According to Digital Coin’s long-term ETC forecast, the coin will
reach $95.25 in 2025 and $219.25 in 2030.. ETC is expected to outperform forecasts in
2022 according to Gov Capital, one of the most enthusiastic experts. According to Gov
Capital, ETC will reach a high of $79 by December 2022 as a long-term investment. ETC
is expected to hit a high of $246 in 2027, according to crypto researchers. Predictions
may be accurate, but the volatility of crypto assets means that anything can happen.
Cryptocurrency investments should only be made with money that you’re willing to
lose.
Conclusion
To operate decentralized apps, smart contracts are used on the Ethereum Classic
network. In response to a dispute among certain Ethereum developers, a new network
https://medium.com/coinmonks/is-ethereum-classic-etcbetter-than-ethereum-eth-e85505f37e75 5/7
2/12/23, 2:21 AM Is Ethereum Classic ETC Better Than Ethereum ETH ? | by Vremaroiu Alin | Coinmonks | Medium
was created. Ethereum, on the other hand, is more robust than the network as a whole.
Many exchanges, including Binance and Coinbase, sell ETC, the company’s native coin.
Cryptocurrency specialists are enthusiastic about its future, but the prospects of it
hitting $100 in 2022 are limited.
Give a tip
By Coinmonks
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
Get the Medium app
https://medium.com/coinmonks/is-ethereum-classic-etcbetter-than-ethereum-eth-e85505f37e75 7/7
2/12/23, 2:24 AM Ethereum (ETH) vs Ethereum Classic (ETC) in Blockchain - GeeksforGeeks
Data Structures and Algorithms Interview Preparation Data Science Topic-wise Practice C C+
Read Discuss
platform. Ether is used to pay transaction fees and computational ser vices. Developers
can write smar t contracts that receive, hold, and send Ether.
exchanges.
Ether is given to network par ticipants randomly chosen as validators through proof-
of-stake consensus.
Ether is needed to pay for the transaction and secure the blockchain.
What is ETC?
Smar t contracts are executed on the Ethereum Classic platform, which is a blockchain-
being the oldest of the two and Ethereum being the newest, it divided the original
Ethereum blockchain into two pieces. E TC is a cr yptocurrency that was launched in 2016
E TC’s main function is as a smar t contract network, with the ability to host and
suppor t DApps.
E TC block reward decreases with time, with the next drop due at block 15,000,000 in
ETH vs ETC
Founder Vitalik Buterin and Gavin Vitalik Buterin and Gavin Wood
Wood
Technology
Total Supply It has an uncapped total The policy is changed, reducing the
supply with a fixed supply per block reward by 20% at the 5 millionth
millionths.
Hard Fork Before the hard fork, E TC was born af ter the hard fork.
Algorithm
https://www.geeksforgeeks.org/ethereum-eth-vs-ethereum-classic-etc-in-blockchain/ 2/5
2/12/23, 2:24 AM Ethereum (ETH) vs Ethereum Classic (ETC) in Blockchain - GeeksforGeeks
Like 11
Previous Next
Related Articles
3. Ethereum Blockchain - Getting Free Test Ethers For Rinkeby Test Network
7. Ethereum 2.0
8. What is Ethereum?
Ar ticle Contributed By :
kmrityunjay360
@kmrityunjay360
Company Learn
About Us DSA
Careers Algorithms
Start Your Coding Journey Now!
https://www.geeksforgeeks.org/ethereum-eth-vs-ethereum-classic-etc-in-blockchain/ 4/5
2/12/23, 2:24 AM Ethereum (ETH) vs Ethereum Classic (ETC) in Blockchain - GeeksforGeeks
News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
SQL
Knowledge
Kotlin
Save
Hard Forks and Soft Forks. What are they and what’s
their difference?
In the world of cryptocurrencies, the prospects of hard forks and soft
works are always the subject of intense debates among the experts, as
well as a source of concern and uncertainty among traders and
speculators. But what do these terms really mean?
Simply put, hard forks and soft forks are for cryptocurrencies what updates are for
common computer programs.
The software that implements a blockchain consensus protocol (for example the
software that runs the Bitcoin network) is usually curated by a community of
developers who incessantly work to define, propose and implement best practice
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 1/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
solutions and improvements to the code. When this community introduces an update
on the software, the blockchain is said to “fork”.
When it comes to updates of common computer programs, we are all familiar with the
notion of backward compatibility (or incompatibility). If the update is such that the
files created with the new version of the program can be still opened and worked on
using the old version , then we have a backward compatible update, otherwise the
update is said to be backward incompatible. For blockchain consensus protocols it works
pretty much the same way. A soft fork is an update on the blockchain protocol that is
backward compatible, i.e. it introduces some changes in the code that do not severe the
functional continuity with its previous version. On the contrary, a hard fork consists of
changing the blockchain protocol in a way that is not backward compatible, hence
introducing a discontinuity with the previous version.
Now, what does all this mean in practice? Let’s try to answer this question through
some examples.
A hard fork consists of loosing up some of the rules implemented in the non updated
version of the protocol, while a soft fork consists on tightening up some of those rules.
Let’s consider a famous example of a soft fork, the adoption of SegWit. The bitcoin
community had long debated on what was the best way to increase the bitcoin
transaction speed. Since a new block of transactions is mined every 10 minutes in
average (and this point was not up for debate), the idea was to increase the number of
transactions that could be included in each block. To do so, the community proposed a
solution called Segregated Witness (in short SegWit). The basic idea was to free up some
space in each block that could be used to include a bigger number of transactions. This
was achieved by removing from the block the public key and the signature associated
with each transaction and sending them through a different messaging channel.
Because the public key and the signature occupy about 60% of the whole transaction
size, by sending them separately it was possible to double the number of transactions
in each block. The reason why this approach was called Segregated Witness is that the
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 2/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
“witness” (another name for signature) of the transaction was segregated (i.e. sent
separately) from the transaction itself.
This change in the protocol was implemented in a way that allowed blocks forged in
the old fashion to be also correctly recognised and processed (in this sense the new
protocol is more permissive as it allows for both the new and the old block formats). In
other words the protocol update was backward compatible.
The reason why the change proposed by the Bitcoin Cash supporters is not backward
compatible is easy to understand. On the one hand any block with a size smaller or
equal to 1MB is considered valid by both the BCH updated protocol and the BTC
protocol. On the other hand any block with a size greater than 1MB is considered valid
only by the BCH protocol. This backward incompatibility is the result of loosening up
the constraint on the maximum block size in the BCH protocol. As a consequence,
from the time of implementing this change, the history of the two blockchains started
to diverge.
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 3/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
Figure 1 — A hard fork occurred on the 1st of August 2017 leading to the split between Bitcoin (BTC) and Bitcoin
Cash (BCH). The updated version of the protocol implemented by BCH allowed for a bigger size limits of the
blocks.
At this point it is important to point out that when a blockchain splits, so does its
underlying currency. If that was not the case, then any block with a size compatible
with both protocols, would be processed by both blockchains resulting in a double
spending problem. The issue is avoided by creating a new currency that shares the
same history as the old one up until the time of the split, and then becomes
independently managed and transacted. This means that at the time of the split, any
holder of bitcoins was granted the same amount of coins in BCH, which then could
(and had) be transacted independently from the original coins.
Let’s recall that a soft fork consists on tightening up some of the rules of the existing
protocol. This means that all the blocks compliant with the new protocol are also
compliant with the old one. On the contrary some of the blocks mined following the
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 4/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
old protocol won’t be valid based on the new set of rules. Now, because the majority of
the nodes in the network agreed to run on the new protocol, the blockchain created
with the tighter set of rules will elongate faster than the other one. As we know from
my article on PoF-based consensus protocols, the longest chain replaces the shorter
one whenever two different versions of the ledger are detected by the network. This
results in a number of orphaned blocks originally mined following the old protocol.
This situation forces the minority of the nodes still running the old protocol to adopt
the new one. If they don’t, they will lose money by keeping mining less blocks that will
be eventually orphaned (and for which they won’t receive any remuneration). The
picture below shows what happens in a fictitious soft fork where the protocol update
consists of reducing the block size limit from 1 MB to 0.5 MB.
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 5/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
Figure 2 — A soft fork is initiated only when the majority of the community agrees on the protocol update. This
gives the new protocol an advantage over the old one in terms of hashing power. The miners who did not update
the protocol will be able to mine less blocks — some of which will also be orphaned (like the block with the red
cross in the picture) — due to the hashing power disadvantage. This will push those miners to adopt the new
protocol so as to avoid being remunerated less for mining a fewer number of valid blocks.
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 6/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
even smart contracts. For a list of these forks, just query the web. There is an
overwhelming amount of resources you can tap into. Here are some:
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Your email
Open in app Sign up Sign In
Search Medium
Get this newsletter
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 7/8
2/12/23, 2:29 AM Hard Forks and Soft Forks. What are they and what’s their difference? | by Ettore Murabito | The Startup | Medium
https://medium.com/swlh/hard-forks-and-soft-forks-what-are-they-and-whats-their-difference-91163ac77095 8/8
2/12/23, 2:32 AM What are Soft Forks and Hard Forks? | Coinmonks
Published in Coinmonks
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
TheLuWizz Follow
Save
Like any software, the blockchain is updated. These updates are called forks in the
cryptographic world. The word fork comes from English and means fork. As will
become clear in the course of the article, this is an apt term for it.
https://medium.com/coinmonks/what-are-soft-forks-hard-forks-ffc676e98b1 1/5
2/12/23, 2:32 AM What are Soft Forks and Hard Forks? | Coinmonks
A distinction is made between the two types of forks. The Soft Fork and the Hard Fork.
As the pair of opposites already indicates, there are clear differences between these
two forks.
Soft fork
A soft fork is a change to the protocol that is backward compatible. This means that the
new rules do not exclude the protocol rules that already existed up to the time of the
soft fork. As a result, all nodes and are still capable of generating blocks and joining
the blockchain.
Since this all sounds very abstract, let’s explain the situation again with an example.
The protocol's already existing rules dictate that a block must reach 5MB, and then it is
attached to the blockchain. However, now the protocol is updated, and the blocks are
supposed to be only 3MB until they are pinned to the blockchain. Since the older nodes
can append blocks with a storage capacity of 5MB, they are now also able to append
blocks with 3MB to the blockchain. Thus, both old and new nodes can append blocks to
the blockchain.
However, if old nodes try to append a block with 5MB to the blockchain, the new nodes
will be rejected because this block does not comply with the new rules of the protocol.
Over time, the old nodes now also only follow the rules of the new protocol.
Hard Fork?
On the other hand, a hard fork is a change to the protocol that is not backward
compatible. It is the opposite of a soft fork. In a hard fork, the protocol rules are
changed so that the old nodes can no longer pack transactions into blocks of the new
regulation since the old rules contradict the new ones. Thus, miners must decide
https://medium.com/coinmonks/what-are-soft-forks-hard-forks-ffc676e98b1 2/5
2/12/23, 2:32 AM What are Soft Forks and Hard Forks? | Coinmonks
whether to update their nodes to the new protocol or keep the old protocol's nodes
running.
Up to this step, every hard fork runs the same. From here on, however, there are no
differences.
The first case is that a fork is implemented. Most users perceive that as an
improvement to the old protocol. If this is the case, most users will join the new
blockchain and continue to transact there. Hardly any participants will still follow the
old protocol, and so it will die out over time.
However, there is also a second case. Here, many users disagree on whether the update
will lead to an advantage and, therefore, whether they want to join the new protocol. If
the protocol is now updated, two blockchains will form from the previous blockchain. -
> One cryptocurrency will become two!
All blocks registered on the blockchain up to that point can now be viewed on the old
blockchain and the new blockchain. After this kind of hard fork, you have the number
of your coins of the old blockchain stored on both the old and the new blockchain.
However, from the time of the fork, transactions will only be published on the
blockchain on which they are made.
Let’s describe the situation again with an example. Suppose the protocol's pre-existing
rules prescribe 5 MB as the block size, as in the above example. However, the new
protocol specifies that a data size of 7MB per block must be reached for it to be
attached to the blockchain. In this case, the old nodes are not compatible with the new
protocol. The miner must now decide whether to continue running his node on the old
protocol or update it to the new one.
To create a hard fork, a sufficiently large community is always necessary, which also
accepts it. If there are only a few participants, transactions will hardly be confirmed.
The basic goal of this fork was to increase the block size from 1MB to 8MB. This fork
was seen as much overdue by developers as it allows more transactions to be
processed simultaneously. Due to the lower transaction time, transaction costs have
also decreased. Since as already known: The higher the transaction fee, the faster the
transaction is processed.
This smart contract (DAO) allowed all users who invested in it to decide which dApps
on the Ethereum Blockchain would be co-funded and which would not. However, there
was also the option to exchange one’s DAO tokens back into Ether. And it was precisely
in this system that there was a vulnerability, which hackers made their own. In this
way, they captured a total of 50 million US dollars.
To ensure that the blockchain's security could be guaranteed again for everyone, a
large part of the community spoke out in favor of a hard fork. This is how the new
blockchain (Ethereum) was created, and the old blockchain (Ethereum Classic)
remained.
I share more intimate thoughts in a monthly newsletter that you can check out here.
Please let me know in a comment, and let’s build your crypto universe via Patreon. Join
https://medium.com/coinmonks/what-are-soft-forks-hard-forks-ffc676e98b1 4/5
2/12/23, 2:32 AM What are Soft Forks and Hard Forks? | Coinmonks
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/coinmonks/what-are-soft-forks-hard-forks-ffc676e98b1 5/5
2/12/23, 2:34 AM A Brief Introduction to ICO Initial Coin Offering | by Blockchain Simplified | Medium
Save
Finance is an integral part of our day to day lives; money is a bare essential for any
exchange in the real world. Be it hard cash or physical checks that were the mode of
exchange earlier, or digital cash and currencies that is trending off late, money as a
ICO Initial Coin Offering is the latest big thing in the field of finance which has
grabbed everybody’s attention. Let us understand what exactly is an ICO, what are ICO
tokens or ICO coins, how does ICO work and what is its purpose?
See our blogs on Blockchain, Bitcoin, Ethereum to get a basic idea before we proceed
to know more about ICO Initial Coin Offering.
An analogy between IPO Initial Public Offering and ICO Initial Coin Offering can help
understand how both are completely different from each other but have slight
similarity. An IPO is released by a company to sell a portion of its stock/share to the
public. People interested, can purchase the shares at a certain price and later sell them
(if they want to) whenever the share price increases, as the company makes a profit. It
is a profitable engagement for both, as the company raises capital and attracts
investors whereas the general public earns more money.
ICO Initial Coin Offering, unlike IPO, does not provide any authority or ownership of
the project to the investors investing in it. Rather it is a token sale, where ICO tokens
are offered in lieu of investor crypto tokens. These ICO tokens or ICO coins don’t
necessarily have to be ICO cryptocurrencies, but can be anything like a voting right, a
stake(utility tokens) etc. If the token is, indeed, an ICO cryptocurrency (security
tokens), it can be sold later at a price higher than the buying price, if the project
succeeds and makes a profit.
-An ICO Initial Coin Offering can use a platform like Ethereum that allows
decentralized apps (dApps) to be built on its platform with the help of smart contracts.
-A company looking to raise funds for its new venture, builds a new dApp (project) on
the Ethereum platform.
-It releases an ICO with a stipulated amount of ICO tokens (in this case could be
Ether/any new token created by a dApp/utility tokens).
-Interested investors interact with the dApp to send their cryptocurrencies to the dApp
and receive ICO tokens, thereby raising funds for the project.
It also contains details of the creators of the project, already existing investors, and so
on. The whitepaper can help potential investors take an informed decision whether to
invest or not based on the history, brand status and other important considerations.
As the above image suggests, ICO Initial Coin Offerings have managed to raise funds in
millions in a very short span of time which is why more and more people are
expressing interest in ICO investments. Because there is a great deal of paperwork
involved in releasing an IPO, companies have started shifting their attention to ICOs
which involve only submitting a whitepaper for any new project to start crowdfunding.
In short, it is a beneficial agreement for both parties.
Albeit an excess of deskwork is a hassle, IPO provides a higher level of security. As ICO
lacks paperwork, it invites fraudsters and hackers to create inauthentic and counterfeit
whitepapers in order to make some quick money. Therefore, it is very important to do
thorough research on the project, outside the whitepaper, before investing, and choose
the ICO Initial Coin Offering wisely.
Blockchain based-
Multinational Bank — The company helped one of the top 3 ranking Multinational
Banks to integrate various cryptocurrencies into their banking application.
and more…
Non-Blockchain-
SHC — Built entire platform and app from scratch for a $1m funded startup led by a
team of Americans including PhD degree holders.
and more…
Expertise
Save
Disclaimer: This is not to be construed as investment or legal advice, but rather meant
as a template to show the process behind an ICO, and what a project’s stakeholders
(team, board, stakeholders) should think about when conducting an ICO.
Given the blockchain industry is relatively new, there isn’t a whole lot of information
on the topic (from a project’s perspective), and with each new ICO, teams are learning
best practices on what to do and what not to do. Below is a guide of all of the
information we collected about the ICO process, with input from people who
experienced the process first hand.
A big thank you to Linda Xie, Ankur Nandwani, and Kim Cellere for contributing and
reviewing this post.
Contents
1. Pre-Planning
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 1/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Pre-planning
The biggest two questions you need to think about first are:
Token
If your application doesn’t need to be built on top of a blockchain protocol, you should
think hard before moving forward. For example, the computational costs of building
an application on top of Ethereum is much more expensive than something like AWS.
You need to have a strong reason for why you are building a decentralized application
vs. a centralized application.
If you are unsure whether your application should be built on the blockchain or not,
you should do more research and spend more time learning about Bitcoin and
Ethereum. Building a decentralized application is fundamentally different than an
application using client-server architecture, and you’ll need to fully understand the
components of a blockchain and what can be built on top of this new architecture.
ICO
An ICO is fundamentally different than raising money through VC’s or other traditional
means.
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 2/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
On one-hand, you are selling future usage of your platform (not giving up equity). On
the other-hand, you are becoming a public company on day one. You’ll have a huge
community you’ll need to manage post-ICO, and you need to make sure you want to
deal with this burden beforehand.
Here are a few things to keep in mind while thinking through whether your project
should do an ICO in the first place:
Everything you do and all the actions you take will be reflected in the price of the
token.
Your team will get bombarded non-stop, multiple times a day, with questions about
the price of your token.
There will be great stress in trying to build things that are long-term valuable vs.
short-term valuable.
If your product isn’t open sourced already, there will be a huge backlash to become
completely open sourced. There is a strong expectation that many blockchain
projects are open-sourced projects.
In general, good blockchain projects look and function much more like open-
sourced software projects vs. traditional tech businesses. You and your team will
have to decide both whether your application makes sense to be built on a
blockchain + you want to operate as a transparent and open company.
Planning
Once you are ready and committed to doing an ICO, the core components in planning
are deciding on the offering, whitepaper, token design, legal, precautions against the
inevitable hackers, and being prepared for communication (website, slack, social,
press, interviews, etc).
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 3/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Offering
1. The most important question is: How much do you want to raise? & Why?
2. The second most important question is: What do you want to accomplish with the
particular distribution method you are choosing?
Considerations:
For your ICO — Are you trying to raise the most amount of money? Are you trying
to build a broad base of supporters? Are you trying to target a specific profile of
potential users? Are you trying to incentivize developers to build on top of your
platform? etc.
Allocation — What % are you giving to your team, investors, partners, reserving for
the ecosystem, reserving for the company/foundation?
Where will the money that you raise go to? You should have an annual budget for
the next 5 years.
Do you want a cap? If so what cap will you set? This depends on the amount you are
targeting to raise (see the first question).
Depending on the goals of your raise, a pre-sale can be used as both social proof +
getting tokens to the people who you most want to align in your ecosystem. The
downside of a pre-sale is it does favor certain people/groups over the participants
in the general crowdsale.
If you are doing a pre-sale, you should look into building a specific reservation
contract for the pre-sale to reserve a specific amount of allocation for each of the
pre-sale buyers and being transparent about who participated in the pre-sale and at
what price.
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 4/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
crowdsale.
Do you want to do the KYC process yourself or use a service like Civic?
Depending on your goals, do you want to split an even number of tokens for all
registrants or via first come first serve? With first come first serve, you run the risk
of having a small number of people buying up the majority of your tokens.
How long will your offering be for? (1 day, 3 days, a week, etc).
Will the tokens be released right after the token sale is complete? If not, when?
In general, you want to have a well thought out and crafted offer in which all of the
information is presented to the person looking to participate in your ICO. The worst
offenders are projects which obfuscate key information (for ex. Hidden hard caps, or
not being transparent about the token allocation), and projects that change terms mid-
fundraise.
Doing either of these things might give you more funding in the short-term but will
seriously deteriorate your reputational capital in the long-term.
Whitepaper
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 5/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Ideally your whitepaper would include all of the technical information about your
project, all of the token related information, and all of the relevant information
about your team.
This one document should give a prospective contributor a full picture of your
application and give them enough information to make an informed decision.
Technical whitepapers are hard and can easily take 200+ hours of work from the
whole team in a very short period of time. This is also the one document where
your team has to take ownership in creating this document, and the bulk of it
cannot be outsourced — editors can help clean it up, but your team needs to write
the bulk of the document.
Once you complete your whitepaper, I would highly encourage you to get detailed
feedback from respected figures in the crypto space and field you are working in, as
well as the core demographic you are targeting for your ICO — and incorporate
relevant changes before proceeding.
Legal
You’ll need a reputable law firm who has experience with incorporating blockchain
companies/foundations and running an ICO process — to advise you on your
process.
The biggest legal question you’ll need to answer is: Is the token you are offering
during the ICO a security or not?
What do you need to do to alleviate the concerns that the token may be a security?
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 6/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
This guide doesn’t contain any legal advice so be sure to talk to a lawyer who has been
through this process before.
Communication
In general, the communication strategy for your team will encompass of all of the
channels you will use to communicate about your project (website, whitepaper, slack,
social, etc). All of your channels need to be in sync, your whole team needs to be on
deck, and you need to respond to people on time.
It’s a huge task, and here are some of the key components:
Landing page for the crowdsale (separate from your main product page if you have
one already)
Team — Each team member needs a clear and updated LinkedIn profile because
potential contributors will be doing due diligence on each member of the team.
Advisors — Each advisor needs a clear and updated LinkedIn profile because
potential contributors will be doing due diligence on each member of the team.
A potential red flag to contributors is when there are more advisors than team
members.
projected to last.
*Based on feedback — the budget can be included in the “business whitepaper” (some
teams elect to do two whitepapers one technical and one business oriented) or the website.
In general the budget should be clearly and transparently laid out somewhere with a
record of any changes made to it.
Github
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 8/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Example: https://github.com/0xProject.
Need to have a main communication channel and the team needs to be active
there.
Need to setup the channels properly and moderate heavily. Examples channels:
Announcements, Developers, General, Random, Support, and Scam Alerts (to be
able to notify all users of potential scams)
The main channel that teams use right now is Slack but there are a few major cons
about Slack for crypto projects including: 1) Slack isn’t meant for large group
communication 2) It’s easy to hack the Slackbot and scam users 3) It’s easy to direct
message users and send out false announcements and contribution messages.
Read more about the downsides of slack for cryptocurrency projects here.
BitcoinTalk
Example: https://bitcointalk.org/index.php?topic=2009966.0
Own your own subreddit, brand it, and put in a few posts.
Example: https://www.reddit.com/r/district0x/
Newsletter
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 9/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Email is the best way to directly share important info with potential contributors
on the day of the ICO.
Blog
Need to have a clean, updated blog ideally with a history of posts already.
Example: https://twitter.com/0xproject
Advertising
This is a personal decision your team needs to make. In general, the teams that
advertise look weaker.
Public relations
Events — Conferences, meetups, technical talks, dinners, online Q&A sessions, etc.
Translation
Not only do you need to translate your whitepaper and website, but you’ll need to
translate all of the changes and announcements going forward. You might even
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 10/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
need to hire someone to manage the translations for Q&A and inquiries on various
social channels.
Community Management
Need to have extra people on staff ready to answer questions. On all channels, all
of the time.
The more successful your ICO is, the more community support you will need.
In general, you want to have a sustained presence on the web well before your ICO,
during your ICO, and well after your ICO. Potential contributors need to know that
your team is serious and in it for the long-term.
If you do a pre-sale and ICO, you’ll need two smart contracts plus additional
considerations if you are planning to do a reservation contract.
Security audit on the smart contract — You need to do this well ahead of time and
publish the results. Your entire fundraise is predicated on this smart contract so it
needs to be 100% correct. If it’s only 99% correct, you leave yourself open to
potential hackers.
To be extra safe, some projects now have multiple parties do their own
independent audits and publish all of the individual results.
Need to setup the wallet you will receive the ICO payments. The safest options are
hardware wallets or even multi-sig hardware options.
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 11/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Depending on what currency you accept, you might need more than one setup.
This is not an exhaustive list by any means. If you are worried you should consult with
a security engineer who has been through the ICO process before.
Buy all of the website domains that look like yours, and all of the various TLD
variations of your name.
Hackers will try to re-create your landing page with a domain name that is similar
to yours, using their own address instead of yours. You need to be on the lookout
for any potential scam leading up the ICO and even after the ICO.
Register all of the social media accounts of all of the names that look like yours.
Similar to a website, hackers will also try to copy and spoof your social media
accounts and point them to a different landing page than yours. You’d need to be on
the lookout for this even after your crowdsale is over. One move scammers try to
do is “extending your crowdsale” and tricking potential supporters.
Turn off the Slack API. Slack isn’t set up for public groups that are raising funds.
There are so many scam attempts involving direct Slackbot messages which
admins can’t turn off and a lot of people fall for — despite all of the warnings. Even
though Slack is the default communication channel, I would consider using
another method of public communication or at least heavily control the inflow
leading up to the token sale.
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 12/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Don’t release your wallet public address until the day of the ICO (Release
simultaneously on all of your communication channels at once).
Remind people NOT to send in their contributions from exchanges like Coinbase.
Needs to be from a wallet they control (e.g. Metamask).
Create explainer videos to show how to purchase tokens. You need at least a semi-
professional 2–3 minute video with professional voice talent. Set this to private and
don’t release it till the day of the ICO. Example: https://blog.0xproject.com/zrx-
token-sale-purchase-tutorial-612c2ffe1e0d
Watch out for all attack vectors — shut down Slack if you need to.
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 13/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Remind people to NOT send in their contributions from an exchange, they need to
send it in from a wallet in which they control the private keys.
Keep sharing the tutorial videos you have created for how to participate. Limit the
sources of truth to one place where people find the information they need to
contribute.
This is easily the number one question. Create a tutorial video (for all
combinations of wallets) and post it to all of your channels.
For the people who sent their contribution from an exchange, you’ll need to
respond back to them. Unfortunately their contribution is most likely gone
because they needed to send their contribution from a wallet that they controlled.
Most exchanges have an application page, if you wish to be listed on them, start
building out these relationships early.
At the same time, various exchanges will list your token for sale regardless of
whether you want to or not. For example: EtherDelta is a peer-to-peer exchange,
where anyone can offer any tokens or currencies for sale without your permission.
Give an update shortly after your ICO is completed. The worst case is to not
communicate at all and look like you took the ICO money and ran, don’t do this.
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 14/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Fiscal policy
Fiscal policy is the buying, spending, freezing, discounting, and burning of tokens.
If you retain a lot of tokens in the treasury, people will wonder when those will
flood the market. If you pay people in tokens with no vesting, they can dump them.
If you pay in locked-up tokens, you will also have to supplement those with some
cash. All of this requires clear communication, so people know what’s coming.
In addition, how the tokens are taxed for the team, advisors, investors, etc. need to
be communicated early on. You need to think about compensation plans for
employees and advisors early on.
Monetary policy
Monetary policy is: How many tokens there are, how divisible they are, and the
inflation/deflation policy you have set. Need to be clear and transparent with the
policy you set, and if you ever make any changes to it.
Money management.
Once you raise your funding through an ICO, you’ll need to decide how much of
your contributions cash out into fiat, and how much to stay in crypto (if any). You
should decide this before you complete the ICO.
You should also start the conversations with banks early on so you don’t run into
issues when converting funds from the token sale to fiat or wiring funds for
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 15/16
2/12/23, 2:36 AM Guide to launching an Initial Coin Offering (ICO) | by Chris McCann | Medium
Following all of these won’t make an ICO successful, but hopefully it shares better
insight on the process as a whole from the perspective of the project team owners.
Fundraising through an ICO vs. fundraising through equity isn’t any easier, it’s just
different. As a team you really want to make sure that a token sale is the best thing for
your company because if you do an ICO for the wrong reasons, you’ll be stuck with the
consequences for a very long time.
Search Medium
https://medium.com/@mccannatron/guide-to-launching-an-initial-coin-offering-ico-94587af2c8d5 16/16
2/12/23, 2:39 AM What are the differences between an IPO and an ICO? | by Napoleon Group™ | NapoleonX.ai | Medium
Published in NapoleonX.ai
Save
An ICO (Initial Coin Offering) is distinctive from an IPO (Initial Public Offering), far
from Wall Street, ICO’s tokens are now what stocks are for the exchange market.
This makes ICOs viral, shareable and funded. Behind money that is put into every new
project, ICO’s makers release a share of their total supply in order to reward
contributors for helping them getting funded.
Usually contributions can be done with Bitcoin (BTC), Ethereum (ETH) or fiat money
and there are minimums in order to maintain a substantial amount of participants for
the soft cap and hard cap that are freely set by the companies.
https://medium.com/napoleonx-ai/what-are-the-differences-between-an-ipo-and-an-ico-4bd5ca89215a 1/4
2/12/23, 2:39 AM What are the differences between an IPO and an ICO? | by Napoleon Group™ | NapoleonX.ai | Medium
Making an IPO isn’t given to every businesses, only established private companies that
I’ve been operating for a while are allowed to carry out IPOs. Therefore, even projects
with great ambitions can’t access to IPOs, it’s a path that need years of activity,
resources and well-established entities.
Most of the companies that are doing ICOs don’t even have a product to present to the
public, some of them have proof of concept, others have proof-of-stake. Minimum
Viable Product (MVP) is reduced to documents like whitepapers — goldpapers and
blackpapers — , partnerships and media relations.
https://medium.com/napoleonx-ai/what-are-the-differences-between-an-ipo-and-an-ico-4bd5ca89215a 2/4
2/12/23, 2:39 AM What are the differences between an IPO and an ICO? | by Napoleon Group™ | NapoleonX.ai | Medium
In terms of returns, IPOs offer dividends from company profit. ICOs offer tokens at a
price that will rise thanks to the trust put into the project by the public. It’s a promise
that is done by the team, it’s difficult to secure and predict the future.
The true difference between IPO and ICO is that, IPOs work well when it’s centralized
and fully control by a corporation. ICOs work well when it’s open-source and there is
no central authority.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/napoleonx-ai/what-are-the-differences-between-an-ipo-and-an-ico-4bd5ca89215a 3/4
2/12/23, 2:39 AM What are the differences between an IPO and an ICO? | by Napoleon Group™ | NapoleonX.ai | Medium
https://medium.com/napoleonx-ai/what-are-the-differences-between-an-ipo-and-an-ico-4bd5ca89215a 4/4
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Save
We all know the magic behind the revolutionary Bitcoin is the blockchain technology.
But there are scores of other benefits that this disruptive technology offers. In our
previous blogs, we discussed how blockchain enables transaction of cryptocurrencies
through a decentralized environment. As there are no governing body or third parties
involved, the technology is highly transparent and trustworthy. In the past couple of
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 1/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
years, the technology has evolved significantly and today, blockchain is much more
than just cryptocurrencies.
In this blog, we are going to discuss perhaps the most persuasive offering of the
blockchain platform, which is ICO. If you are a fan of blockchain technology and
following the industry trends, you must have heard about ICO. Before we dig into it for
details, let’s first tell you about ICO.
What is ICO?
“It’s like penny stocks but with less regulation.” — Jeff Garzik
Companies raise funds for various business purposes like acquisitions, expansion,
resource hiring, etc. This is usually done via Initial Public Offering (IPO), where a
company offer its shares for the public to purchase. This was an expensive affair as you
have to utilize capital markets, which small and medium scale companies couldn’t
afford. Powered by blockchain technology, ICO (Initial Coin Offering) was introduced
as a fund-raising mechanism in which new projects offer their underlying crypto
tokens in exchange for Bitcoin and Ether. ICO promise quick liquidity, immutable
contract guarantees and most of all — they democratize access to investment capital.
After getting a lot of success, ICO witnessed increasing adoption among various
companies who started developing ICO and use it instead of utilizing their capital
markets. Notable companies like Telegram and Kakao have raised funds offering ICO
instead of IPO. With a substantial piece of their cumulative money being raised in 2017
alone, ICOs have been able to raise more than $2.3 billion in funds since their
inception. Rather than offering shares to the market, ICOs offer ‘tokens’ for the public
to buy. Few of these tokens can be bought using fiat, while others accept payment via
cryptocurrency. Before learning more about tokens, let’s first discuss the
characteristics of ICO and how it is different from IPO.
Strategy
The strategy behind developing ICO is to raise funds for a project to enter the market.
ICO is usually performed by start-ups. On the other side, IPO is performed at a bigger
scale when a firm is finally stable and wants to expand with the help of the public.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 2/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Legal Aspect
ICOs are not limited to any legal document. They have a resource paper (usually white
paper) where all the project information, it’s purpose, execution plan and possible
results are explained. However, ICOs are not bound to create a white paper. On the
other hand, IPOs are heavily legal bound. They must create a legal document called a
prospectus. This is kind of a legal declaration which has to include various key
information regarding the company.
Eligibility
To offer an IPO, a company require certain eligibility criteria which involve highly
stable financial track records. But in the case of ICO, companies do not require any
regulatory framework.
Duration
IPOs need to undergo a long legal process before being offered (usually take up to 6
months time). But the ICO process is much shorter and less complicated. A company
can start with the crowdsale after issuing white paper and a smart contract. (take up to
1 month). The length of the crowdsale can be dependent on reaching the maximum
hard cap, or a fixed sale duration, which usually lasts a month.
Target
IPOs usually target institutional investors such as banks. There is a small part of the
entire process which is for retail investors. But ICOs are open for anyone. All you need
is a currency in the form of Bitcoin or Ether which you can convert into a token of the
particular ICO.
Purpose
IPOs purpose is to collect dividends while ICO’s promote adoption of the company and
its associated services/platform, meaning the investors will receive the project’s utility
token, stored in their personal crypto-wallet to avail the products or services of the
company.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 3/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Ownership
IPO holders have a decent volume of ownership and control over the company. While
owning ICO tokens does not mean you have ownership or control over the project or
the company. However, it offers owners governing rights on the platform as well as
access to that token’s utility. An ICO investor can reap future benefits in a number of
ways. This depends on the design and utility strategy of the coin with a blend of the
project goal.
ICO and IPO sound similar, but they are completely different in nature. Both have their
own set of pros and cons, but in the modern business era where companies want to
keep more control on their business while attracting more investors, they are more
inclined towards ICOs because of it’s significant benefits.
Let’s run through the key advantages of ICO for which it is attracting many potential
investors.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 4/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Cryptocurrency trading exchanges operate 24*7. This means you can purchase ICOs
whenever you want. While stock exchanges opened for a limited period of time.
3. Transparency
A small company or a start-up firm can use ICO to kick-start funding quickly without
much hassle. As the process is less complicated and doesn’t require any legal
document, this is easier for small companies. Anyone can get funding using ICOs.
5. Fungible
ICOs are highly fungible, movable and sellable assets. You can sell your ICO to
whomsoever you want.
6. Quicker settlement
7. Zero regulation
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 5/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
As cryptocurrencies don’t have any regulatory bodies, ICO transactions and exchange
process is not bound by any governing body. This drives more empowerment and
accessibility.
8. Cross-border transactions
9. Flexibility
ICO tokens like Ethereum ERC-20 are based on standard protocols and can be listed on
a number of crypto exchanges seamlessly. This can be transferred between different
exchanges and personal crypto wallets without any additional costs.
Earlier in this blog, we mentioned that ICOs offer tokens instead of shares to the
market. Now let’s learn little more about token and how it is being used in ICO.
What is a Token?
Utility Tokens
Utility tokens are basically user tokens or app coins. We can use utility tokens to avail
the products or services of the company. So, utility tokens are not built to be an
investment. Any start-up can create utility tokens and sell digital coupons for their
services or products. Utility tokens are not intended to give their holders the ability to
control how decisions are made in a company. They merely enable users to interact
with a company’s services.
A perfect example of a utility token would be the underlying POE token. Po.et is a
platform that aims to decentralize the creative sector by providing a way for content
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 6/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
On the other hand, security tokens offering (STO) are like shares, selling participation
in the fund through a liquid digital currency offering. The value of a security token can
be derived from an external asset which can be traded. These tokens are subject to
federal laws that govern securities. If you fail to comply with these regulations, this
could result in unwanted consequences including financial penalties and also
derailment of the development of a project. However, if a startup abides all the
regulatory requirements, security tokens can offer a huge array of advantages. You can
offer tokens as a digital representation of shares and provide investors with an array of
financial rights, which include; equity, voting rights, dividends, buy-back rights and
many others that utility tokens could not offer.
While regulation on these types of securities remains beneficial for participants, but
on the other hand more such regulations could limit the capabilities of these projects.
It removes decentralization — when you file paperwork with any authority, you are
removing your decentralization. The authority has control over everything you do, as a
company, as an individual and as a project. It has to be done in line with the laws and
rules of that country.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 7/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Security tokens also represent shares in physical assets such as gold or oil. In these
situations, the purpose of the blockchain platform is to provide simple trading
environment for all participants. For example, Dubai based OneGram uses blockchain
technology to create ICO, where each coin is backed by one gram of gold at launch.
To bring all under the roof of cryptocurrencies and token world, it’s not bad to add the
below classifications too to educate the readers.
Equity Token
The key difference between Security Token and Equity Token is that in the security
token, an asset like real estate, gold, etc. are used as collateral. However, in the case of
Equity tokens, the shares of the company are diluted into tokens.
Consensus Token
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 8/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
The first type to appear, and used by Bitcoin and Ethereum is the “consensus token”.
This token is given out as a reward for ensuring the network consensus either via PoW
(Cryptomining) or PoS voting. But, we refer to these types of tokens as
cryptocurrencies in general. Also every other cryptocurrency that followed the first
cryptocurrency Bitcoin is called an altcoin (alternative coin). Thus altcoins refers to all
the tokens and all cryptocurrencies other than Bitcoin.
Stablecoins
“We need tokens to use, not just to keep in wallets. If we do not dive fully into Crypto and use
the Blockchain as a way to enhance our lives and the world around us, instead of just
collecting coins hoping for a Bull market, then our greed will have killed the greatest
opportunity yet offered to mankind.” — John McAfee
As you now know what an ICO is and the types of ICO tokens, you need to check if this
is applicable to your startup. You must be able to answer these questions before
creating your ICO;
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 9/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Once you have figured out how to bring a token / blockchain system into your start-up
and able to present your product with a white paper and a website, you can start
looking at creating your ICO, the wallet and launching into the cryptocurrency
exchanges. Let’s look into the various ICO platforms that helps creating your ICO
tokens.
According to ICOWatchList’s data, more than 82% of projects choose to issue their
tokens on Ethereum. This figure is not going to change in the coming future, as the
platform currently offers the most convenient and easy to use service. Though
Ethereum is the most popular platform for conducting an ICO, but there are many
other options worth considering, depending on the type of project that is being built.
Let us look at these various platforms in blockchain those have many successful ICOs
held on them.
Ethereum
Ethereum’s ICO success credits to the ERC-20 token standard. These tokens are open
source and can represent any fungible tradable good: coins, loyalty points, gold
certificates, IOUs, in-game items, etc. They are universal that any exchange or wallet
service that supports Ethereum can very easily integrate any other ERC-20 tokens. Over
99% ICO tokens issued on top of the Ethereum implements this standard. ERC-223 is a
new proposal to solve issues with the current ERC-20 standard. This new standard
prevents token to be transferred to a contract that does not allow token to be
withdrawn. In ERC-20, if someone sends token into a contract that has not allowed
anyone to use it, the token will simply be locked and can never leave that contract.
Because of this, hundreds of thousands of dollars’ worth of ERC-20 token has been
locked up. ERC-223 merges the transfer functions between wallets and contracts into
one single function ‘transfer’, which can also save transaction fees in terms of gas.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 10/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
ERC-223 is backwards compatible with ERC-20. ERC-223 is a proposal right now, not a
standard yet.
ERC-721 is a popular specification other than ERC-20. The goal of this proposal is to
create a non-fungible token. The biggest difference between ERC-721 and ERC-20 is
that, ERC-721 defines non-interchangeable tokens, which means that each token has
an independent ID, so the independence of ERC-721 can be used in the transaction of
assets and tracking. That is, in some cases we need to have unidentical tokens within
the same platform, and add some extra parameters and price them differently. Popular
blockchain games like CryptoKitties make use of non-fungible tokens on the Ethereum
blockchain. Each CryptoKitty is represented in the form of a non-fungible ERC-721
token. Other example like WePower platform which is supporting green energy
producers, and it’s tokens represent a certain amount of electricity. Each token has a
number of parameters, including even the type of the energy produced (for example,
solar or wind power). ERC-721 standard makes it easy to create marketplaces for
multiple non-fungible token types.
Other popular Ethereum token standard proposals to look are ERC-621, ERC-827, ERC-
1155. ERC is not a technology or program, It’s Ethereum General Request for
Comments (RFC). ERC provides developers with technical guidance for construction.
Developers can submit new ERC standard proposals to the Ethereum community by
submitting EIP (Ethereum Improvement Proposal). EIPs describe standards for the
Ethereum platform, including core protocol specifications, client APIs, and contract
standards.
Ethereum can process between 10 to 30 transaction per second (tps). They already
have many solutions in the works to upgrade the transaction speed like Plasma,
sharding and Truebit solutions to bring Ethereum to Visa-scale transaction capacity.
Ethereum also plans to switch from Proof-of-Work to Proof-of-Stake with the
introduction of Casper, a partial consensus mechanism combining proof-of-stake
algorithm research and Byzantine fault-tolerant consensus theory.
Ethereum has its own programming language, Solidity — similar to Javascript for
writing smart contract. Serpent, one of Ethereum’s earlier smart contracting languages
is no longer safe to use. While issuing tokens on Ethereum is relatively easy, you will
need to be proficient in Solidity to be able to fine-tune your ICO to specific purposes.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 11/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
web3.js is a collection of Javascript libraries which allow you to interact with a local or
remote Ethereum node, using a HTTP or IPC connection. MetaMask tool allows you to
run Ethereum dApps right in your browser. Truffle is a development environment,
testing framework and asset pipeline for Ethereum, aiming to make life as an
Ethereum developer easier. It is one of the most widely used IDEs in the Ethereum
community other than Remix — Solidity IDE. Thousands of ICOs held on Ethereum
blockchain. State of the ÐApps website have an extensive details about the ICOs held
on Ethereum.
Waves
Waves is an open blockchain platform that aims to make the process of launching,
distributing, and using tokens easier. Waves is a decentralized financial trading
platform written in Scala and built on its own blockchain with custom tokens being its
main feature. They enable decentralized crowdfunding as well as transferring, trading
and storing of fiat and digital currencies. Waves missions is to enable any business
with development prospects, regardless of its size and geographical location, to run the
ICO and raise funds for growth and development. The Waves blockchain can process
up to 190 tps.
NEO
NEO is a decentralized and distributed ledger protocol that digitalizes real-world assets
into digital ones, enabling registration, depository, transfer, trading, clearing and
settlement via a peer-to-peer network.
NEO uses a new consensus protocol called dBFT — Delegated Byzantine Fault
Tolerance. It’s a modification of the classic Proof-of-Stake (PoS) protocol where NEO
tokens holders can vote for delegates, known as bookkeepers, who maintain the
network for everyone. This way network can process around 1000 tps, as you don’t
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 12/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
need to wait for a large number of nodes to confirm a transaction. NEO is used like a
share of the company that can be used to vote and mine. Holding NEO gives dividend
paid in GAS. GAS is a coin that is used to run all smart economy platforms created on
NEO. NEO can transact at 1000 tps with a maximum of 10000 tps.
NEO uses e-contracts to keep record transfers of digital assets. Digital tokens generated
by e-contracts function as a general underlying data that could be used for recording
titles and assets like equities, creditor’s claims, securities, financial contracts, credit
points, bills and currencies, and can be applied for equity crowdfunding, equity
trading, employee stock ownership plans, peer-to-peer financing, loyalty programs,
private equity funds, supply-chain financing, etc. NEO supports multiple well-known
programming languages like C# , Java , Javascript and Python. NEO will never be a
truly decentralized network, as the majority of bookkeeping nodes are operated by the
NEO team.
NEO has more than 30 ICOs on its platform. Notable ICOs that were held on NEO
includes QLink ($19 millions), Red Pulse ($14.5 millions), Trinity ($20 millions), etc.
Stellar
Stellar is an excellent choice for any ICO that does not require Turing-complete smart
contracts (unlike Ethereum, has the most expressive programming capabilities) and
can benefit from immediate creation of a secondary market. Developers can use
programming languages such as C++, Java , C#, Javascript, Go and Python. The
platform utilises the Stellar Consensus Protocol (SCP), which works through the use of
quorums, which are a set of nodes used to reach an agreement. Their extremely low
fees and fast transaction times makes them an ideal choice for any ICO project with a
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 13/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
lot of microtransactions. Mobius, the first ICO project on Stellar, has reported that they
are already capable of doing 1000 tps and scale to 2000 tps.
NEM
NEM’s blockchain platform was designed and coded from the ground up for scale and
speed. NEM’s permissioned private blockchain delivers industry-leading transaction
rates for internal ledgers. And its revolutionary consensus mechanismand the
Supernode program ensure that NEM’s open, public blockchain can grow without ever
compromising throughput or stability.
NEM Smart asset system helps you building a fintech system, tracking logistics, ICO,
document notarization, decentralized authentication, and much more. NEM platform
is capable of processing 4000 tps, which is one of the highest figures on the market.
NEM’s blockchain exposes its functionality through an API interface that can be used
with any programming language. The most notable ICOs held on the NEM platform
includes Dimcoin ($14 millions raised) and Loyalcoin ($10.9 millions).
Nxt
The Nxt blockchain provides a simple, robust and secure private blockchain solution to
tokenize any kind of assets an enterprise desires (e.g. shares, bonds, vouchers), which
do not require the implementation of complex smart contracts or complex web site
back-end and considerably reduces the security risks.
Nxt is coded in Java. Like NEM, Nxt offer a wide range of pre-built blockchain solutions
that anyone with little prior knowledge can implement. The Nxt blockchain can handle
up to 4.25 tps.
BitShares
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 14/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
BitShares is a smart contract network that can host tokenized apps. Tokens are
exchangeable for BTS, which is then exchangeable for bitAssets, which are stablecoins
pegged to real-world markets. BitShares 2.0 is coded in C++. It’s a part of the Microsoft
Azure BaaS — Blockchain as a Service Package. It transacts at 3400 tps to theoretical
maximum of over 100000 tps. Its unmatched transaction speed and the use of
stablecoins allow for high transaction throughput decentralized exchanges,
remittance, POS systems to thrive within its ecosystem. OpenLedger — Decentralized
asset exchange built on BitShares platform.
Stratis
Blockchain platforms built on Stratis creates a sidechain that will act as its own
blockchain, while still being attached to the Stratis mainchain network. This relieves a
lot of congestion from the mainchain and allows each sidechain to act independently.
The contracts are written in C# language. The Stratis blockchain can process up to
20000 tps.
QTUM
Qtum is an open sourced public blockchain platform, leveraging the security of UTXO
while enabling multiple virtual machines including EVM and the revolutionary x86
VM. Qtum is PoS based and boasts a Decentralized Governance Protocol (DGP) which
allows specific blockchain settings to be modified by making use of smart contracts.
Currently, QTUM smart contracts have to be programmed in Ethereum’s Solidity.
Designed with stability, modularity and interoperability in mind, Qtum is the foremost
toolkit for building trusted decentralized applications, suited for real-world, business-
oriented use cases. Its hybrid nature, in combination with a first-of-its-kind PoS
consensus protocol, allow Qtum applications to be compatible with major blockchain
ecosystems, while providing native support for mobile devices and IoT appliances. The
Qtum network currently can process up to 60 tps.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 15/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 16/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Most of these above mentioned platforms are not just limited to create ICOs only,
rather they help to create your Blockchain dApps — Decentralized application that run
on a P2P network of computers rather than a single computer with trustless protocols
and where the application data are cryptographically stored in a decentralized open
ledger popularly called as Blockchain or Distributed Ledger. They also provide Smart
Contracts protocols that stores rules for negotiating the terms of an agreement,
automatically verifies fulfillment, and then executes the agreed terms. While
Ethereum still governs the market; EOS, Cardano, Tezos and many others are emerging
platforms for decentralized applications and smart contracts development.
As earlier mentioned, your ICO project should embrace at least one of the blockchain
technology features like decentralized application, P2P lending, micropayment, digital
identity, remittance, POS system, etc., And it should be using smart contracts to bring
transparent, and hassle-free way of digital asset movements by avoiding a middleman.
Thus, to make your token popular and encourage the investors to buy it during the ICO,
you need to use the token that is fully integrated into the company structure. The best
option is to use a token sold at the ICO as an integral part of your system or app
(dApps). ICOs developed using ERC-20 can use crypto wallets like Eidoo, imToken —
Ethereum & ERC-20 mobile light-wallet to avoid custom development and integration
of crypto wallets in their dApps when they are not required.
Auditing plays an important role in any business, but no more so perhaps than in
ICO/STO. Once your ICO and dDapp is ready, you should think of ICO/STO auditing.
You should bring reputable auditing companies with lawyers to audit and validate your
project to bring smartcontracts assurance, regulation compliance assurance, off-chain
components assurance using auditor nodes, KYC / AML assurance, pre and post ICO
regulatory support, etc., which lends your ICO an added element of legitimacy. For
example, Quantstamp audits, secures and drives the mainstream adoption of smart
contracts providing a permanent, publicly verifiable security record that lives forever
on Ethereum. And Zeppelin builds key infrastructure to develop and operate Ethereum
smart contract systems and helps conducting security audits of decentralized
applications.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 17/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Now that you have an idea of how ICOs and dApps are created with the help of these
development platforms available today, it’s time for to discuss about the ICO stages —
its launching strategies and methodologies, to the market and various easy-to-go
ICO/STO issuance and campaign platforms.
ICO Stages
Pre-announcement
Offering
It is important that the whitepaper provides a roadmap that has a clear at least five-
year vision for the business. The roadmap is typically presented as a chart, with a
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 18/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
timeline showing various ICO’s activities from project development to launch, as well
as project future milestones. The roadmap should express a confident vision for future
development, without being overambitious. A roadmap without a long-term objective
could be inimical to the development of the project and thus, turns potential investors
away. It is also important for ICOs to explain their token’s utility, token lock-up period
for certain investors and any bounty or airdrop campaigns. Also the economics of the
project such as how much value want to raise, how many blockchain tokens to issue
are decided in this stage.
During the offering state, the following token sale details are provided:
Soft cap
Hard cap
Total Supply
Token Price
Accepted Payments
Restricted Countries/Age
One of the key success factors of any ICO is a proper marketing strategy. A good project
without a solid marketing campaign cannot gain the backing it deserves. Through a
good marketing campaign, an ICO project can attract attention from the community,
helping to put the project on the radar of potential investors. Successful marketing
campaigns for ICOs are based on a combination of traditional marketing and PR. It is
important to spread the news of your upcoming ICO far and wide: this can be done
through posts on cryptocurrency forums, but it can also take the form of a subscriber
button on your website, through social media channels (blogs, Telegram, Twitter,
Facebook, Reddit, BitcoinTalk, Github, Slack, etc). A project should hire an ICO
manager who knows which crypto community meetings and occasions you should be
present at.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 19/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
ICO Airdrops are being widely used by most of the ICO projects these days. Airdrop
distributes free tokens to the entire crypto community. By executing airdrops, the team
behind an ICO project will attract people who may be interested in it or may not have
heard about it. In order to be eligible to receive airdropped tokens, you need to own
some coins that are based on the same blockchain on which the project is built. For
example, OmiseGo(OMG) Airdrop happened back in July 2017 for all Ethereum
holders. OMG is an Ethereum ERC-20 token. People who had held Ethereum then
would have seen OMG tokens deposited newly in their Ethereum wallet addresses. By
this way, airdrops helps ICO reaching the investors and attract them to look into your
project.
Token Sale
There can be many different stages of the token sale, including but not limited to a
private sale, pre-sale, the actual ICO and a general sale.
Some project owners choose to run a preliminary fundraising effort, called Token pre-
sale or pre-ICO. This is a sale event that takes place before the official token sales on
the exchanges. Usually the fundraising targets will be lower in this stage and most ICO
projects offer an early bird bonus, usually around 25% to 30%. Some even offer up to
100% bonus to encourage more investors on board. They are a good way to offset some
of the costs involved in organizing the actual ICO sale, which then follows relatively
soon after.
ICO projects should post information about the upcoming sale of tokens on special
calendars called Token Calenders. There are many resources on which the schedule of
an ICO is published: Coinschedule, TokenMarket.net, Cyber.fund, Icocountdown,
Coinist, etc.
There are various ICO end-to-end issuance platform available in the market that allows
anyone to build, audit, deploy and monetize ICOs easily. A one stop solution for your
ICO. These platforms focuses on three groups of cryptocurrency users including ICO
creators, funders, and promoters.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 20/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
CoinFactory: ICO and STO launch platform with a post-token issuance community
and company management. It supports token issuance in four different
blockchains — Ethereum, Stellar, EOS and Tezos. CoinFactory comes will all
required marketing features to launch a successful ICO.
Polymath: The securities token (STO) platform that facilitates the issuance and
distribution of legally compliant token-based securities. The Polymath platform
provides means to trade security tokens, authenticate investors, connect with legal
delegates, and access a developers’ marketplace. Poly, an Ethereum ERC-20 token,
powers the system and acts as the underlying economic unit that facilitates
authentication, legal, and developer services.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 21/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Swarm Fund: Builds open infrastructure for digital securities. A fully decentralized
capital marketplace that democratizes investing.
Your token needs to be in demand, it has to be valuable and, most importantly, it needs
to get listed on at least one cryptocurrency exchange. Different exchanges will have
different requirements for tokens to be listed , but if your project offers something
unique and truly valuable to the cryptocurrency community, you shouldn’t have any
problems getting it in.
One of the easiest ways to get your token listed on exchanges like Poloniex, Binance,
etc., is to use the ICO listing service providers like Coinist — have a huge database of
exchange partners they work with to help get your token listed quickly. Platinum is one
another STO Listing service provider. With the help of such exchange listing service
providers you can get your token listed on the exchanges.
We now know that ICO’s function like a crowdsale, where people can offer support for
a company by purchasing their “token”, one that is required for the platform to
function or simply to be used within the platform by the end user. Every investment
holds some risk, that’s why they have potential to earn you money. ICOs are
particularly volatile in nature and you need to perform due diligence before you invest
a dime into an ICO. For example, there have been many ICOs that have failed because
the token being offered did not offer utility or security, and the company was unable to
achieve a growth in price. Most newly created tokens are utility tokens. All these
various startups, which don’t have a proper use case for utility tokens, decide to make
utility tokens instead of security token to avoid unwanted consequences for not
complying with the regulations and eventually fails.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 22/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
IPOs are heavily regulated, where ICOs are not as they bypass the centralized,
regulated fundraising process required by banks or venture capitalists altogether.
There are many startups have taken the funds raised during their ICO, and
disappeared. Their projects get abandoned, and the investors have nothing to show for
their money but worthless tokens. That is the reason in China, ICOs are banned for all
businesses and individuals. And these Chinese ICOs that have completed their funding
cycles have been requested to refund any altcoins raised.
But with the birth of blockchain powered SEC regulated tokenized securities, the
smartest people in finance are waving goodbye to Wall Street’s security in search of
tokenized securities. Soon, STO will become so popular that traditional stock
exchanges and over-the-counter markets will be completely replaced over the next
decade.
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 23/24
2/12/23, 2:40 AM ICO vs IPO? How ICO and STO powered by Blockchain platform is transforming modern day start-ups for crowdfunding — A Very…
Final word
Although ICOs aren’t currently regulated, many governments are taking a closer look.
Still debates are going on whether cryptos to act as a security, commodity, or currency.
It’s only a matter of time before regulatory constraints are set-up to supervise the
industry. If 2017 was the year of ICO utility tokens, 2018 will be remembered for
blockchain powered SEC regulated tokenized securities (STO) to capitalize on the
trillion-dollar opportunity and looking to hedge ICOs increasingly volatile portfolios.
As a blockchain consulting and platform development company, BangBit can develop
tokens for your company to offer ICO (both utility and security tokens) and dApps. Our
blockchain experts have got the highest experience and expertise in developing
various tokens using multiple platforms for varied industries to issue ICO. Contact us
now for a free consulting session on blockchain and how to start your ICO journey.
Search Medium
https://medium.com/@BangBitTech/ico-vs-ipo-44e1da262459 24/24
2/12/23, 2:44 AM ETH 2.0, What is it?. Ethereum 2.0, also known as Serenity… | by pNetwork Team | pNetwork | Medium
Published in pNetwork
Save
ETH 2.0
Current Model
Phase 1: Sharding
The upgrade will implement a new consensus algorithm called proof-of-stake (PoS).
With PoS, instead of miners competing against each other, they will stake their ETH to
validate blocks. This means that it will be less energy intensive. Additionally, Ethereum
plans to implement sharding, a way of partitioning the blockchain so that each node
only needs to process a portion of the transactions. This will further improve
scalability. Finally, Ethereum plans to upgrade its virtual machine (EVM) to eWASM.
This will allow for more efficient smart-contract execution and could potentially make
Ethereum’s blockchain even more secure.
Phase 0
In December 2020, Phase 0 trial went live, touching on three main technological
advancements to the Ethereum Ecosystem. These are; the Beacon Chain, the PoS
consensus mechanism (aka Casper), and the rework of validator nodes.
Think of the Beacon Chain as the Eye of Sauron, a tower built on top of a sea of data.
Instead of looking for hobbits, it is constantly validating, scanning, collecting votes,
penalizing malicious actors, and rewarding validators that correctly attest to blocks.
Beacon Chain is the constructor and coordinator of the new network. It is responsible
for creating new blocks, validating them, and handing our rewards to validators to
ensure that the network is secure, making it a core structure for ETH 2.0.
PoS Framework
2. It would be more secure, as it would be harder for 51% of attacks (where one group
of miners try to control most of the network) to succeed.
3. It would be faster, as POS algorithms can confirm transactions faster than POW
algorithms.
Phase 1
Sharding
Sharding is a new feature that Ethereum 2.0 will introduce. It is an important part of
the Ethereum 2.0 roadmap as it will revolutionize the industry. Sharding is a technique
for splitting data into shards so that a different machine can process each shard. This
allows for scalability by increasing the number of transactions processed at any given
time.
Sharding is also crucial because it enables more efficient data storage on the
blockchain. Today, the Ethereum blockchain stores all data on every node in the
network. This can lead to scalability problems as the blockchain grows. With sharding,
only a subset of data is stored on each node, which reduces the storage requirements
for nodes and allows for faster processing of transactions.
With this upgrade, Ethereum 2.0 will be able to spread the network load across 64
different shards making the network faster and more scalable.
Phase 2
Once phase 1 is complete, the plan is to merge or “dock” Eth 1.0 with the Beacon Chain
and its accompanying architecture of shard chains. Eth 1.0 will be one of the 64 shard
chains and will operate using the new PoS protocol. The Eth 1.0 shard will act as the
history of the current state of Ethereum onto the Beacon Chain, which will make the
transition smoother.
Let’s consider an analogy. Imagine Ethereum is a spaceship that isn’t quite ready for an
interstellar voyage. With the Beacon Chain, the community has built a new engine and
a hardened hull. After significant testing, it’s almost time to hot-swap the new engine
for the old mid-flight. This will merge the new, more efficient engine into the existing
ship, ready to put in some serious lightyears and take on the universe. — Taken from
ethereum.org
EVM to eWASM
https://medium.com/pnetwork/eth-2-0-what-is-it-6104a86ff634#:~:text=Ethereum 2.0%2C also known as Serenity%2C is a massive upgrade,more scal… 4/6
2/12/23, 2:44 AM ETH 2.0, What is it?. Ethereum 2.0, also known as Serenity… | by pNetwork Team | pNetwork | Medium
Ethereum is set to move from the Ethereum Virtual Machine (EVM) to Ethereum-
flavoured WebAssembly (eWASM). This will have numerous benefits for Ethereum
users and developers. eWASM is a more efficient instruction set, meaning that
Ethereum contracts will be cheaper to deploy and run. In addition, eWASM is designed
to be more developer-friendly, with better support for programming languages such as
Rust and C++. Ethereum’s move to eWASM will also make it more compatible with
other blockchains already using WASM, such as EOS and Polkadot. Ultimately, this will
make Ethereum a more attractive platform for developers and users.
Ethereum 2.0 will affect pNetwork and projects currently on the Ethereum network in
a few ways.
First, it will provide a much faster and more efficient way to run contracts and
transactions on the network. This will make it easier for projects to use the Ethereum
network as a platform for their operations.
Second, Ethereum 2.0 will provide a more secure platform for running contracts and
transactions. This will make it less likely for projects to experience security breaches
or other issues on the network.
Conclusion
Overall, Ethereum’s upcoming upgrades are very exciting and have the potential to
make it the most dominant blockchain platform in the world. Ethereum’s current
proof-of-work consensus algorithm is not very scalable or efficient. Sharding and
proof-of-stake will allow Ethereum to scale to meet mainstream users’ needs. In
addition, eWASM will enable more efficient smart contract execution. These upgrades
are important and will make Ethereum faster, more scalable, and more secure.
Search Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
sheinix Follow
Save
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 1/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
smart contracts and is heavily influenced by Python and JavaScript languages. This was
intentional so that developers would find it easy to jump straight into developing Smart
Contracts. Solidity is a “Turing complete” language, meaning it has all the capabilities
for developing complex use cases. In contrast, the Bitcoin programming language,
Scrypt, is “Turing incomplete” by design, so developers are restricted to what use cases
they can implement. Nowadays, Solidity is the most popular programming language
for Smart Contracts, and the one every developer should look into if he or she wants to
start developing Smart Contracts.
Vyper is another programming language created by the Ethereum team, and it runs on
the Ethereum Virtual Machine (“EVM”). It was designed to simplify the process of
writing Smart Contracts and, at the same time, making it simpler to read. One of the
critical differences with Solidity is that Vyper doesn’t include some of the object-
oriented capabilities, making Vyper more secure as there is less room for developers to
make mistakes and introduce bugs.
Security has been a significant headache for Ethereum. Mainly because on some
projects, there were poor development practices that allowed for hacks and loss of
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 2/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
funds. Ethereum needs to provide developers with tools for better security in Smart
Contracts, without compromising the capabilities of Solidity.
The ETH price and Gas cost makes the process of running transactions fragile and in
some cases, not worth it. Especially for Ethereum validators who currently have to
spend a lot of electricity running the nodes with the Proof of Work consensus
algorithm, when they don’t get much in return.
The lack of general knowledge from the wider public and the user experience of DApps
are other concerns that need to be addressed in the future as this is key to reach the
massive adoption of the DApps.
In 2017, we saw a significant increase in the number of projects, mainly due to the
“ICO fever” and bullish markets. The reality is that only a few projects survived, and
less will in the following years. The general public is not adopting DApps yet, mainly
because of the platform’s lack of maturity and the lack of understanding of the
technology in general. Nevertheless, in the last year, there have been quite a few
projects related to Gaming, Gambling, and Finance that has grown a lot and obtained a
good user base.
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 3/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
source: stateofthedapps.com
source: stateofthedapps.com
Ethereum development was planned over four different stages. Each stage was meant
to introduce more features and fix problems. Each step also includes “sub releases”,
known as “hard forks”, that change functionality in a way that is not backward
compatible.
This is the original timeline for the Ethereum development stages and the
intermediate hard forks:
Block #0 — Frontier
This was the initial development stage of Ethereum, from July 30, 2015, to March 2016.
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 5/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
This is the second hard fork from the Metropolis stage, completed in February 2019.
This hard fork also included other changes that fix security issues codenamed
Petersburg.
Ethereum 2.0
Ethereum 2.0 is the term that describes all the updates from Serenity, which will make
Ethereum more scalable, faster and a better blockchain. As stated by Ethereum
researcher Danny Ryan the primary design goals of Ethereum 2.0 are:
Resilience: The network should still be live even when lots of nodes go offline.
Security: Utilize crypto and design techniques that allow for the massive
participation of validators in total and per unit time.
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 6/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
To understand how all of this be achieved, let’s see each Serenity phase in detail:
Another feature of Phase 1 is the introduction of ETH2. A new asset for validators on
the new Beacon chain. This new ETH2 will be created as a reward for validating
transactions on the Beacon Chain, and also can be purchased by any ETH1. Initially,
there won’t be a way to withdraw ETH2 from the beacon chain. If anyone wants to be a
validator for the new chain, they will need at least 32 ETH to stake on the original
chain.
“Imagine that Ethereum has been split into thousands of islands. Each island can do its own
thing. Each of the islands has its own unique features and everyone belonging on that island,
i.e., the accounts, can interact with each other and they can freely indulge in all its features.
If they want to contact with other islands, they will have to use some sort of protocol”.
Sharding will be introduced on the Beacon chain, and it will have initially 100 shards.
Validators will validate transactions from their own shard, and in the first phase, they
won’t approve any smart contract, account or asset.
While sharding will bring more scalability, there are a few setbacks to take into
account. Validators have a small pool of transactions to validate, which makes it easier
for a 51% attack, as they only need 51% computing power (or stake) of the shard they
are in, instead of the whole network.
This technique can also lead to higher centralisation, as each shard can be validated
with a small group of validators.
It will be fascinating to see how this stage is implemented, as it still needs thorough
testing to ensure all validators are randomly selected to avoid centralisation and any
risk attack.
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 8/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
Cross-shard transactions
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 9/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
Lightweight clients
Super-square charting
Closer ties
Ethereum is one of the most significant projects in the crypto space and one on which
a lot of other projects depend. It has excellent support from the development
community as well as enterprises. There are a lot of parties heavily invested in the
future of Ethereum, and the pressure to succeed is high. If the team manages to pull
this off, we will have a fully scalable general-purpose blockchain, which will be closer
to the initial Ethereum pitch: “The world’s supercomputer”. And will also show the
world that the “Blockchain dream” is possible. This will attract even more developers
and investors to keep creating amazing projects on top of general-purpose
blockchains.
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 10/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
Get smarter at building your thing. Join 176,621+ others who receive The Startup's top 5 stories, tools, ideas, books —
delivered straight into your inbox, once a week. Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 11/12
2/12/23, 2:49 AM A Comprehensive view of Ethereum 2.0 (Serenity) | by sheinix | The Startup | Medium
https://medium.com/swlh/a-comprehensive-view-of-ethereum-2-0-serenity-5865ad8b7c62 12/12
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Published in DataDrivenInvestor
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
When I found out how much gas fees I’ve paid transacting on Ethereum blockchain so
far, I was totally blown away. You can also check yours here if you want to be
surprised…
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 1/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Just by transacting NFTs for a few months on Ethereum, I spent $1.9 million on gas. Kidding 🤣 unfortunately
this is not my account.
It’s certainly time for the Ethereum blockchain to have ht belong promised upgrade to
make it a lot cheaper, much faster, and more scalable. Here comes Ethereum 2.0 (also
known as Serenity), the exciting makeover of the current Ethereum blockchain (also
known as Ethereum 1.0), in which phase 1 — The Merge is expected to roll out in Q1/Q2
2022.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 2/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Here’s a special shoutout to Ms. Bee Lee, for her crucial effort contributed to create
this article. Enjoy!
The current Ethereum network will merge with the Beacon Chain. The merge
represents the official switch to the Proof of Stake consensus model, which will end
the Proof of Work model. The merge is expected to happen in Q2 2022 (very soon!).
After the merge, Ethereum will officially become a PoS blockchain which allows
holders to stake their ETH and earn rewards. As the merge is going to be automatic,
Ethereum holders do not need to do anything while Ethereum goes through this phase.
On 15 March 2022, the Kiln Merge Testnet was launched. Kiln will be the last Merge
testnet before the existing public testnets are upgraded. Ethereum developer Tim
Beiko has tweeted about the success of Kiln:
And, if you wanna learn how to create tokens, NFTs, and DAOs smart contracts,
check this link.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 5/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Typically, companies and organizations have certain databases that store users’ data
such as their names, e-mail addresses, addresses, etc. The computers that store such
data usually exist in one location and are controlled by one person or one small group
of people.
With such structure, these individuals need to find a way to agree on the correct set of
data (in the case of a cryptocurrency, the data refers to transactions), so that all of the
versions of their data would match. That is why some sort of mechanism is necessary
to form such a consensus.
So, what is Proof of Stake (PoS)? There are many types of consensus mechanisms, PoS
is one of the most well-known ones among the others like Proof of Work (PoW), which
is what the current Ethereum 1.0 is adopting.
In the PoS system, nodes (or “validators”) process transactions and create new blocks
of data of a blockchain like the way miners do in a PoW blockchain. The difference lies
in the way of gaining the right to create a block. In the PoW system, miners need to
compete to be the first to solve complex mathematical problems which require a lot of
computing power and electricity.
In the PoS system however, consensus is reached by using an algorithm that chooses a
node to win a block of transactions, instead of the nodes having to race to win the
block by spending a lot of computing power and electricity. When a node is chosen, it
forges the next block of transactions in the chain.
From those who have staked a minimum amount of coins, a node is then semi-
randomly chosen by an algorithm. The chosen node creates the block and other nodes
validate it, it will then gets rewarded for creating the new block by getting paid with
the blockchain’s native coin from the transaction fees. For example, Cardano
blockchain nodes get rewarded in the form of ADA. However, if the block that the node
created turns out to have any fraudulent transactions, both the node who creates the
block and the ones who validate it would lose part of or even all of the staked coins.
In order to determine who can be the next block creator, the PoS algorithm uses
different factors such as the size of the stake. To ensure the wealthiest stake pools do
not always win, other factors like the duration the coins have been staked are also
being factored. Some PoS blockchains have also added a degree of randomization to
the selection process, so the bigger and older stakes do not always win. Holders of the
coin can then “stake” their holdings to a staking pool, when a node is selected to forge
a block, the reward it receives is then distributed among the individual stakers.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 7/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Unlike the PoW system which the miners need to be the first to solve a complex
mathematical problem in order to be able to create a block, PoS requires way less
computing power and electricity needing to spend. It is also way less time-consuming
than the PoW system.
That is why Proof of Stake is chosen as the consensus mechanism of Ethereum 2.0, as
it is a much more environmentally friendly and efficient choice, allowing Ethereum
transactions to be a lot faster and cheaper.
Currently, the 10 million ETH the investors staked in the Beacon Chain is earning
about 4.8% in yield per year. It is expected the yield will grow to as high as 15% after
the Merge, while the network transaction fee will be reduced to a fraction compared to
the current PoW system, all thanks to PoS!
By the way, if you are interested in ETH staking, Lido Finance provides great options
with way better liquidity (you don’t need to have your ETH locked).
Sharding
Sharding is a method Ethereum 2.0 plans to use in order to scale its capacity. With the
Proof of Work blockchain (which is what Ethereum 1.0 is using right now), most nodes
in the network have an entire copy of the history of all the transactions. Such a copy
can take up a lot of space, especially for the older cryptocurrencies like Bitcoin and
Ethereum which come with a long list of transaction record. The Ethereum blockchain
is almost reaching 1 Terabyte whish is not good for decentralization since only big
computers can handle it.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 8/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Sharding is a common technique used among the newer PoS cryptocurrencies to help
with scaling without sacrificing security and decentralization. It is a form of database
partitioning that breaks down a large database into smaller and more manageable
pieces, to boost the efficiency in a large scale.
Shard chains are created by sharding, which decrease the workload of network nodes
by requiring each node to only store and manage one shard of the network, instead of
the whole blockchain. On the other hand, shard chains enable parallel processing
which reduces the latency of linear processing that occurs when using only one single
blockchain.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 9/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
So how is Ethereum 2.0 upgrade going to implement sharding to scale its blockchain?
Phase one of the upgrade will spread the whole Ethereum network load across 64
separate shard chains, which will be coordinated by the Beacon Chain. As part of
Phase 0, the teams of validators which have deposited collateral into the Ethereum 2.0
deposit contract, will be randomly assigned to manage particular shard chains on the
Ethereum network.
Eventually, shard chains will be able to execute nodes, just like the main Ethereum
blockchain. It will then be able to support smart contracts as well as decentralized
applications (dApps). It is believed they will need to do a lot of testing on the
movement and aggregation of data between the Beacon Chain and the shard chains
before finalizing. Creating more shard chains other than the assigned 64 ones is also
possible in the future.
Rollups + Sharding
The implementation of rollups is another strategy being developed as part of the
Ethereum 2.0 Phase 1 update. Rollups are already existing today, they are a “hybrid”
Layer 2 scaling solution, which aims at achieving the best of these two worlds by fully
relying on the security of Ethereum while creating a scaling solution for general
purpose applications.
The 2 different types of rollups include Optimistic rollups and ZK rollups. They are
able to scale the Ethereum network at around 15–45 transactions per second, it can
however be able to scale up to 1,000 to 4,000 transactions per second depending on the
type of transactions.
With the exciting sharding method of Ethereum 2.0 upgrade, which offers a significant
amount of space by creating multiple shards, it creates an amazing synergy when
combining together with rollups. The combination of the two is expected to bring the
transaction speed of the Ethereum blockchain up to 100k transactions per second.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 10/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Want to learn more in-depth about rollups? Check my 2 other articles dedicated to
rollups!
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 11/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
medium.datadriveninvestor.com
Right now, only those with larger holdings and transact in larger amount are able to
benefit from the ecosystem. I still remember how ridiculously expensive it has costed
me (close to $150 in transaction fee) when I tried to swap a small amount of an altcoin
on UniSwap a few months back, which also stopped me from hoping to participate in
the liquidity pools provided on these decentralized exchanges on the Ethereum
network.
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 12/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
The transaction fee is so ridiculously high as they are controlled by miners due to the
Proof of Work mechanism, which create a large conflict of interest. With the switch to
Proof of Stake, such issue will no longer exist. Should Ethereum 2.0 prove successful, it
will certainly has a drastic effect on the current bottlenecks that slow down the current
DeFi development.
Final Thoughts
If there is no delay, Ethereum 2.0 is set to roll out sometime this year (Yay!). This is by
far the most significant blockchain network upgrade ever (and probably ever will
be?). If Ethereum can achieve its goals of becoming the global settlement layer for the
metaverse, this Ethereum 2.0 upgrade will certainly be one of the most significant
events in the entire crypto history.
Imagine some day in the future, your kids (hopefully not grandkids) will think you
were insane spending $100 on gas fee buying a $25 NFT on Ethereum 1.0. Same as the
way we now think about how we needed to dial-up to log into the internet back then
when we were all kids. Don’t you still remember that dialing sound?!
What an exciting time we are at, don’t you think? Let’s wait and see how it will all play
out!
If you thought this blog post was worth every bit of your time, please share it with a
friend who would benefit from it too 🥂
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 13/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 14/15
2/12/23, 2:51 AM Goodbye, Ethereum 1.0… Hello, Ethereum 2.0! | by Henrique Centieiro | DataDrivenInvestor
Subscribe
https://medium.datadriveninvestor.com/goodbye-ethereum-1-0-hello-ethereum-2-0-f9b088bf4c2e 15/15
2/12/23, 2:54 AM What is Proof of Stake? (PoS). Proof-of-Work (PoW) was the first… | by Max Thake | Medium
Save
Proof-of-Work (PoW) was the first blockchain consensus mechanism and is still
arguably the most popular choice in achieving distributed consensus (the ability to
trust a stranger without having to go through a third-party).
PoW is used by the likes of Bitcoin and Ethereum (for now) and several other
cryptocurrencies. Strong as it may be, it comes with disadvantages like high
computation requirements, high energy costs and the threat of centralisation-by-
mining-pool.
Once you understand PoW and its downfalls, the need for a system like Proof-of-Stake
(PoS) becomes clear.
In crypto-terms, the stake is the cryptocurrency a user owns and pledges in order to
partake in validation — more on that soon.
PoS shares many similarities with PoW, but also differs in fundamental ways. As in any
blockchain based consensus algorithm, the goal is still to achieve distributed
consensus — to create a secure system whereby users are incentivised to validate other
peoples’ transactions while maintaining complete integrity.
In PoS the miner of a new block, in this case known as the forger, is chosen in a semi-
random, two-part process. The first element to be considered in this selection process
is a user’s stake. How much of the currency in question is the user staking?
Every validator must own a stake in the network. Staking involves depositing an
amount of tokens into the system, locking it in what you can think of as a virtual safe,
and using it as a collateral to vouch for the block.
The more a user stakes, the better their chance of being selected since they’d have
more skin in the game — acting maliciously would see them set back by a greater
amount than someone who stakes less.
Not much is random about that first part, in fact it’s probably got you thinking that PoS
is ripe to be abused by the wealthy. The key here is to include a degree of chance to the
selection process so as to avoid a scenario where the richest users are always selected
to validate transactions, consistently reap the rewards and grow richer and richer.
The second element adds the ‘random’ to the semi-random selection process, although
the way in which this is done differs from blockchain to blockchain. The two most
commonly used methods are Randomised Block Selection and Coin Age Selection.
In Randomised Block Selection, forgers are selected by looking for users with a
combination of the lowest hash value and highest stakes. The Coin Age Selection
method chooses validators based on how long their tokens have been staked for. These
are by no means the only methods of selecting validators, though. Some currencies
combine the aforementioned methods while others are experimenting with their own.
Another difference worth noting between PoW and PoS, is that unlike in PoW systems
where more and more cryptocurrency is continually created as rewards for miners,
the total amount of cryptocurrency units are usually created at launch in PoS systems.
That’s often the reasoning behind using transaction fees as reward for validators. That
being said, in certain cases new currency can be created by inflating the coin supply
which can then be used as reward.
Advantages of Proof-Of-Stake
PoS is widely regarded as one of the best options for a cryptocurrency consensus
algorithms. Here’s why:
Energy Efficiency
PoS algorithms are energy efficient — especially when compared to PoW. Cutting
out the energy-intensive mining process makes PoS a greener option.
Security
Attackers must put their assets — their stake — on the line in order to attempt a
51% attack. A big deterrent. For comparison, attackers don’t lose their hardware
when attempting 51% attacks on PoW systems.
Decentralisation
Large mining-pools (groups of miners combining their resources) can control over
51% of networks running PoW systems, leading to a very real threat of
The idea here is that in the event of a fork (the blockchain splitting in two), block
generators have nothing to lose by supporting different blockchains, essentially
preventing the conflict from ever resolving.
In PoW systems this is guarded against since users would have to split their
computational resources in order to support both sides of the fork. In PoS systems,
however, validators’s stakes would be duplicated onto both chains meaning they could
potentially claim twice the amount of rewards.
https://maxthake.medium.com/what-is-proof-of-stake-pos-479a04581f3a#:~:text=Proof-of-Stake algorithms achieve,also differs in fundamental ways. 5/7
2/12/23, 2:54 AM What is Proof of Stake? (PoS). Proof-of-Work (PoW) was the first… | by Max Thake | Medium
Simulations have shown that forging on several chains is possible, even profitable, but
PoS advocates have demonstrated several work-arounds. Ethereum’s Casper protocol,
for instance, is set to require participants to submit a deposit which will be confiscated
if they are deemed to have violated a pre-determined set of rules — such as signing off
on multiple forks.
“Transitioning the Ethereum network from PoW to PoS has been on the roadmap and in the
Yellow Paper since the launch of the protocol. Although effective in coming to a decentralized
consensus, PoW consumes an incredible amount of energy, has no economic finality, and has
no effective strategy in resisting cartels. Excessive energy consumption, issues with equal
access to mining hardware, mining pool centralization, and an emerging market of ASICs
each provide a distinct motivation to make the transition as soon as possible.”
It’s important to keep in mind that different cryptocurrencies use different consensus
mechanisms (PoW, PoS, DPoS etc.) and it’s just as important to remember that the
consensus mechanisms themselves differ from one another. Not all PoS algorithms
work the same way, for instance.
Doing your own proper due diligence on a cryptocurrency involves understanding its
inner workings. We hope this article helps you do that.
Your email
Subscribe
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
Get the Medium app
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/nerd-for-tech/proof-of-stake-what-is-and-how-does-it-work-1c8bd7f00303 1/7
2/12/23, 2:56 AM Proof of Stake — What is and how does it work? | by Henrique Centieiro | Nerd For Tech | Medium
The mechanics and incentives of proof of state algorithms work differently. When
creating a new block, the proof of stake algorithm chooses who is the block validator
by checking how many coins a person is staking. The bigger the stake, the higher the
probability of being chosen as a block validator. In proof of stake, we call the nodes
doing the work block validators instead of miners, and we say that block validators
mint new blocks instead of mining new blocks.
When a new transaction is issued, it is placed into a block with other transactions, and
the block is limited to a certain size in MB. The validating node verifies the
transactions’ validity in a block and broadcasts the block to the other nodes in the
blockchain. After validating the block and sharing it with the other nodes, the
validating node will receive a reward if the other nodes agree with the content of the
block.
for the validator to be able to participate in the consensus. If they create a fraudulent
block, their deposit will be forfeited, and the block validator loses the ability to
participate.
It’s considered safe and resilient to 51% attacks when comparing to small proof of
work cryptocurrencies
Cons
Fake stake attack and DDoS attacks — somebody can lie on how much stake do they
own in order to connect to another node and flood him with connections (DoS
attack)
In proof of stake, block validators increase their chance of being selected to validate a
block based on how much do they have at stake. Bigger the stake, the higher the odds
of being selected to validate the block and win then reward. In other words, the more
lottery tickets you buy, the higher the probability of winning the prize. Following the
https://medium.com/nerd-for-tech/proof-of-stake-what-is-and-how-does-it-work-1c8bd7f00303 3/7
2/12/23, 2:56 AM Proof of Stake — What is and how does it work? | by Henrique Centieiro | Nerd For Tech | Medium
example of our chart, let’s say Eve bought ten lottery tickets, Frank bought 20 lottery
tickets, and Carol bought 30 lottery tickets, increasing this way her chance.
To perform a 51% attack, one’s would need to buy at least 50% of the cryptocurrency
available, which would be very expensive. Most of the proof of stake mechanisms have
protections against this, but performing a 51% attack on a proof of stake
cryptocurrency wouldn’t be very smart anyway.
Although it would be very expensive for someone to acquire 51% of all the coins of a
cryptocurrency, a person could indeed do it and try an attack. However, it wouldn’t be
in his best interest to attack the network on which he holds a majority. This would
harm the network and make the cryptocurrency value to fall, which means that the
attacker’s holdings would also fall. Consequently, someone who holds a majority in the
network would be incentivized to maintain the network secure.
The bigger the stake, the bigger the chances of being the chosen one for that specific
round. In a network of nodes, Carol was selected to be the validating node of the
round.
https://medium.com/nerd-for-tech/proof-of-stake-what-is-and-how-does-it-work-1c8bd7f00303 4/7
2/12/23, 2:56 AM Proof of Stake — What is and how does it work? | by Henrique Centieiro | Nerd For Tech | Medium
2. Carol has to place a larger stake than the transaction fees and rewards that he may
receive. This stake will be locked until the validation is completed
4. The new block is broadcasted to the other peer nodes on the network
5. A fixed amount of time needs to elapse in order to allow time for the peer nodes to
confirm that Carol did a good job and that he validated the block correctly
7. If the validation is incorrect (i.e. has incorrect data, incorrect transactions, or Carol
tried to forge some fake coins for herself), Carol will lose the stake and reward and
probably also get banned from the network
If you have a Binance account (and probably a few other exchanges), you can start
locking your ETH and earn interest. You can basically lock your ETH for a period of
time (2 years I think) and earn interest which can go up to 20%. Note that the locking
period can be up to 2 years here.
https://medium.com/nerd-for-tech/proof-of-stake-what-is-and-how-does-it-work-1c8bd7f00303 5/7
2/12/23, 2:56 AM Proof of Stake — What is and how does it work? | by Henrique Centieiro | Nerd For Tech | Medium
This Ethereum 2.0 is the long-awaited upgrade to the Ethereum network that is going
to switch it to proof of stake and make it more scalable, spend less electricity (because
it’s proof of stake) and better efficient. In theory, this will happen without impacting
security and decentralization.
Subscribe to our weekly News Letter to receive top stories from the Industry Professionals around the world Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/nerd-for-tech/proof-of-stake-what-is-and-how-does-it-work-1c8bd7f00303 6/7
2/12/23, 2:56 AM Proof of Stake — What is and how does it work? | by Henrique Centieiro | Nerd For Tech | Medium
https://medium.com/nerd-for-tech/proof-of-stake-what-is-and-how-does-it-work-1c8bd7f00303 7/7
2/12/23, 2:59 AM Proof of Work. Proof of Work is yet another buzzword… | by Miguel Palhas | UTRUST | Medium
Published in UTRUST
Save
Proof of Work
Proof of Work is yet another buzzword that gets thrown around a lot in the
cryptosphere. This is because it is an important component of some of the most
important blockchains like Bitcoin. In this post we aim to shed some light into what
exactly this means, and why it is such an important term.
Consensus
In short, Proof of Work (PoW) is one of the mechanisms through which a blockchain
can achieve consensus. That is to say, ensuring that all nodes of the system can agree
on the state of the public ledger. Value, information, and wealth can only be
transferred when actors in an exchange agree upon what is being exchanged and how.
This is usually dealt with by banks, companies and even governments, but blockchains
can do this peer-to-peer, so long as they achieve consensus.
This is important, as you may guess, because it’s what creates consistency in the
blockchain data, prevents users from double-spending their funds, or attacking each
other.
In a Proof of Work (PoW) system, consensus is agreed upon via the work done by
network miners. These are the miners you keep hearing about. They collect your
transaction fees in exchange for keeping the network up and running.
In a broad sense, it can be said that miners process network transactions, and take up
their fees as payment for their effort (e.g.: electricity spent on computing power), and
as an incentive to keep working.
The real processing that happens is more of an endless competition between all
miners, the winner of which gets to create the next block in the chain.
The broadcasting of a single block, and some of its caveats, is a topic I already covered
in more detail on my previous post about [achieving Finality].
Here, we’ll focus a bit more on how this cryptographic puzzle works, and why it is
needed in the first place.
Cryptographic hashes
A hash works very similarly to a written signature.
Your signature proves that a document was read and validated by you, without your
own presence being required. Only you can produce your own signature, but everyone
else can easily check it’s yours. This can be summed up in two simple properties:
1. hard to fake;
2. easy to validate.
These properties are what makes signatures, and hashes, interesting for quickly
validating something.
Yes, I know. Written signatures are not really that secure. But cryptographic signatures,
on the other hand, can be. They serve the same function as the written ones, which is
why the analogy works so well, but they’re generated through mathematical functions
that are designed to provide better guarantees.
Let’s see a quick example of what a cryptographic hash would look like. In many
software download pages, you’ll often see a hash checksum. For example, here’s the
download page for Ubuntu:
After downloading the file, I should be able to independently calculate a SHA256 hash
of that file, and compare it against the hash displayed on the page. If they match, I
have proof that the download file is not corrupted or tampered with. And that’s exactly
what I did:
Great, the hash works perfectly! You can notice that the resulting hash (add461…)
matches exactly the hash from the screenshot.
This is a one-way operation. While I can calculate a SHA256 hash for any file or piece
of data, the reverse is not possible. It’s obviously impossible to recreate the entire
Ubuntu file from just this small string of random characters.
The process I just did manually is similar to what’s used in a blockchain to ensure the
integrity of all transactions. Each transaction hash is derived from the data of the
transaction itself, and serves as a unique identifier.
Each block has a hash, too. And that hash needs to follow certain rules. Let’s take a
look at the latest Bitcoin block hashes, for example:
Notice how all of them start with a bunch of zeros? How did this happen, if hashes are
supposedly random?
Each miner is constantly trying to mine the next block in the chain. And they’re on a
constant race with each other.
As they aggregate transactions sent in by users, they aggregate them in a new block,
and then try to create a hash for the entire block.
This hash can’t be just any hash tough. The blockchain imposes some rules on it.
Bitcoin, for example, requires the hash to start with a certain number of leading zeros.
The actual amount of zeros required is called the network’s difficulty, and it’s a number
that is adjusted every few blocks.
If the current difficulty is 2, then 00abc… would be a valid hash, but 0abc… would not.
Couple this with the fact that hashes are, for all intents and purposes, randomly
generated and unguessable, and miners have only one way to produce different
hashes: brute force. They keep trying over and over to generate new hashes, until they
find one that fulfils the requirement.
Since the same block always generates the same hash, they need to change it slightly
for every new attempt. This is often done by adding a random number within the
block’s data. The only purpose of this number is for miners to change it in order to be
able to make different blocks, and therefore, different hashes.
The better your hardware, the more hashes you can produce. That’s called your Hash
Rate. If you increase your hash rate (by improving your hardware) you get a better
chance of finding valid hashes before everyone else. But since this process is
essentially random, having slower hardware still gives you a small chance at
preventing more powerful miners from getting 100% of the blocks.
This difficulty is adjusted automatically every few blocks, in response to changes in the
total hash rate of the network. If a lot of miners significantly increase their hash rate,
or if a lot of miners join the game, the average time to mine a block will decrease. In
response to this, the difficulty may increase, to keep the average block time around 10
minutes.
If you’ve ever wondered why it takes 10 minutes to mine a Bitcoin block, there’s your
answer. The blockchain itself is enforcing that rule, by adjusting the mining difficulty.
https://medium.com/utrust/proof-of-work-ab12b8e13c7#:~:text=In short%2C Proof of Work,state of the public ledger. 6/9
2/12/23, 2:59 AM Proof of Work. Proof of Work is yet another buzzword… | by Miguel Palhas | UTRUST | Medium
Maybe you’re wondering why this is done at all! Good question! Let’s talk about that:
It is also important for the number of miners to be sufficiently large, or else the
decentralization of the system could be compromised. This compromises security as
well. These are some of the basic tenets of a decentralized blockchain.
On the other side of the system, we have the users, sending transactions through their
wallets.
Users want the blockchain to support as many transactions per second as possible, to
reduce their waiting times. They also want lower fees, or even no fees at all!
Miners, on the other hand, want the reverse. The more fees are paid, the more they
get. And the less transactions there are, the easier it is for them to compute hashes for
new blocks.
Even if miners were willing to mine for free, you still wouldn’t be able to do as the
users wish. More transactions per minute mean that we’d have to support larger block
sizes (or increase the rate of blocks), or decrease the 10 minutes it takes for a block to
be produced.
This would make the mining process more difficult, possibly to a point where only
those with more powerful hardware would be able to do anything at all.
If only the most powerful can compete in the game, then the whole system will
degrade to a much less decentralized one. And decentralization is what guarantees the
security of your transactions.
Preserving the size of blocks, as well as the time between them, is a balance that has to
be done to keep the network usable while still preserving the ability of small miners to
be able to contribute to the network.
Yes, this is a tough one. We’ve all seen the scary news about how Bitcoin consumes
more energy than Switzerland, or the entire cryptocurrency ecosystem, for that
matter, is wasting tons of energy.
Not only that, the incentive given to miners (read: the ability to convert electricity into
money) is driving the industry to produce more powerful mining hardware, and
driving the miners to purchase more and more of that hardware.
So, not only are we creating an incentive to spend energy, but the competitive nature of
this is pushing everyone to spend increasingly more!
This is all true, and of course, a concern. But unlike some may claim, it’s not an
inherent problem of cryptocurrencies, and not even inherent to Proof-of-Work. This
means that there are ways to create Proof-of-Work systems that don’t drive energy
usage up like we’re seeing today.
If you’re into computer science research, then there are a few research papers worth
looking into (such as the Cuckoo Cycle algorithm, or Proofs of Useful Work)
If not though, rest assured that this is an acknowledged problem, and is being actively
worked on by many communities. While it is true that cryptocurrencies do consume
excessive amounts of energy right now, this is a problem that can be solved, and
should see some improvements over the next couple of years.
Save
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 1/9
2/12/23, 3:01 AM Understanding Blockchain Fundamentals, Part 2: Proof of Work & Proof of Stake | by Georgios Konstantopoulos | Loom Network |…
In part one, we discussed the Byzantine Generals Problem, how to achieve Byzantine
Fault Tolerance, and how this all relates to blockchain.
The algorithm in the previous article is in fact a solution which achieves Byzantine
Fault Tolerance. However, that solution is not efficient enough, and its variations have
constraints, namely that less than a third of the network is dishonest.
Running time of solving the Byzantine Generals Problem with the algorithm proposed by Lamport, Shostak and
Pease (n = number of actors, m = number of traitors)
Can we do better?
The topic of the present article will discuss alternative algorithms which achieve
Byzantine Fault Tolerance.
Note: Please bear with any simplifications that I make. These algorithms have a lot of
complex research behind them. I will be providing links as we proceed for the
interested reader to do their own further research.
That leader is also responsible for broadcasting the block to the network, so that the
other peers can verify the validity of its contents.
A hash function is any function that can be used to map data of arbitrary size to data of
fixed size¹.
Example:
keccak256("hello") =
1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8
keccak256("hello1") =
57c65f1718e8297f4048beff2419e134656b7a856872b27ad77846e395f13ffe
In Proof of Work, in order for an actor to be elected as a leader and choose the next
block to be added to the blockchain they have to find a solution to a particular
mathematical problem.
Given data X, find a number n such as that the hash of n appended to X results is a number
less than Y.
Given that the hash function used is cryptographically secure [1,2], the only way to find
a solution to that problem is by bruteforce (trying all possible combinations). In other
words, probabilistically speaking, the actor who will solve the aforementioned
problem first the majority of the time is the one who has access to the most computing
power. These actors are also called miners.
Whenever a new block is mined, that miner gets rewarded with some currency (block
reward, transaction fees) and thus are incentivized to keep mining. In Proof of Work,
other nodes verify the validity of the block by checking that the hash of the data of the
block is less than a preset number.
Due to the limited supply of computational power, miners are also incentivized not to
cheat. Attacking the network would cost a lot because of the high cost of hardware,
energy, and potential mining profits missed.
The picture illustrates very well how Bitcoin, and any other coin that uses Proof of
Work, discourages malicious behavior.
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 4/9
2/12/23, 3:01 AM Understanding Blockchain Fundamentals, Part 2: Proof of Work & Proof of Stake | by Georgios Konstantopoulos | Loom Network |…
For the readers who are interested in how chain-splits (a.k.a. forks or chain
reorganizations work in the case of a disagreement, I suggest this article.
Proof of Work provides the needed security and has been proven to work pretty well so
far. However, it is very energy consuming:
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 5/9
2/12/23, 3:01 AM Understanding Blockchain Fundamentals, Part 2: Proof of Work & Proof of Stake | by Georgios Konstantopoulos | Loom Network |…
Almost all African countries (separately) consume less electricity than the Bitcoin Mining industry
In a lottery, probabilistically, if Bob has more tickets than Alice, he is more likely to win.
In Proof of Work, if Bob has more computational power and energy than Alice — and thus
can output more work — he is more likely to win (mine the next block).
In Proof of Stake, if Bob has more stake than Alice, he is more likely to win (“mine” the next
block).
Proof of Stake takes away the energy and computational power requirement of PoW
and replaces it with stake. Stake is referred to as an amount of currency that an actor is
willing to lock up for a certain amount of time. In return, they get a chance
proportional to their stake to be the next leader and select the next block. There are
various existing coins which use pure PoS, such as Nxt and Blackcoin.
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 6/9
2/12/23, 3:01 AM Understanding Blockchain Fundamentals, Part 2: Proof of Work & Proof of Stake | by Georgios Konstantopoulos | Loom Network |…
The main issue with PoS is the so-called nothing-at-stake problem. Essentially, in the
case of a fork, stakers are not disincentivized from staking in both chains, and the
danger of double spending problems increase. More on that here.
In order to avoid that, hybrids consensus algorithms appeared, such as the PoW-PoS
combination used by Decred. Active research towards a secure and decentralized Proof
of Stake protocol is being done by the Ethereum Foundation with Casper The Friendly
Ghost and Casper The Friendly Finality Gadget.
Conclusion
In this article, we discussed Proof of Work & Proof of Stake, which are currently the
consensus algorithms that achieve Byzantine Fault Tolerance and are practically used
in today’s blockchain systems.
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 7/9
2/12/23, 3:01 AM Understanding Blockchain Fundamentals, Part 2: Proof of Work & Proof of Stake | by Georgios Konstantopoulos | Loom Network |…
Loom Network is the multichain interop platform for scaling high-performance dapps —
already live in production, audited, and battle-tested.
Deploy your dapp to Loom’s Basechain once and reach the widest possible user base across all
major blockchains today.
Want to stake your LOOM tokens and help secure Basechain? Find out how.
Like what we’re doing here? Stay in the loop by signing up for our private mailing list.
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 8/9
2/12/23, 3:01 AM Understanding Blockchain Fundamentals, Part 2: Proof of Work & Proof of Stake | by Georgios Konstantopoulos | Loom Network |…
https://medium.com/loom-network/understanding-blockchain-fundamentals-part-2-proof-of-work-proof-of-stake-b6ae907c7edb 9/9
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 1/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
With some of the recent price records of Bitcoin, Ethereum, Dogecoin, and other
cryptocurrencies, the positive and negative aspects of cryptocurrencies have become a
major focus once again. One aspect that is particularly controversial, is the huge
amount of energy needed to progress and update the blockchains.
Most big coins use Proof of Work as a consensus mechanism, which is inherently
inefficient and not sustainable. A newer alternative is Proof of Stake which hopes to
improve upon the flaws of Proof of Work. Let’s have a look at some of the pros and
cons of both concepts.
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 2/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
Proof of Work
Proof of Work is the most common method of achieving and maintaining consensus in
a blockchain. It’s a way for one party to prove that a significant amount of
computational effort has been made. All other parties can then verify the result with
very minimal effort.
In the Bitcoin blockchain, this is done with a hashing algorithm (SHA-256). Hashing
algorithms can be computed very quickly in one direction, but they are almost
impossible to reverse. Every block in the blockchain contains a number of transactions
and the hash of the previous block. The miners that want to progress the blockchain
try to find a hash value for all of this data by adding an incremental integer until they
find one where the hash value is below a certain numerical value. The threshold value
can be adjusted to set the difficulty of the problem. This controls the likelihood of
guessing the correct result and therefore ensures that the time between blocks stays
roughly consistent.
Once a solution has been found, the person who got the result is rewarded with new
Bitcoins and the transaction fees from the block. Then the process starts over with the
next block. This is called mining because just like in traditional mining, new and very
valuable resources are being found/created.
Modern graphic cards and especially ASIC miners can compute a hash value very
quickly. Therefore, the number of attempts needed to correctly guess the next value is
extremely high. The bitcoin network currently has a hashing power of 177 TH/s (that’s
177,000,000,000,000 hashes every second). As you can imagine, all of this computing
power takes an enormous amount of energy.
Proof of Stake
Proof of Stake is another method of updating the blockchain. It removes the energy-
wasting mining process that Proof of Work suffers from. To emphasize the differences,
Proof of Stake uses another term for mining: Blocks are “forged” rather than “mined”.
To participate in the forging process, users need to own a certain amount of the
currency and lock it into the network as their stake. The chance of winning a block
increases with the size of the stake. The winning node can process all transactions in
the block and append the block to the blockchain. It is also rewarded with all of the
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 3/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
transaction fees of the transactions in the block. To prevent the wealthiest nodes from
dominating the process too much, there are different methods of randomly selecting
the winning node.
The first cryptocurrency to make use of Proof of Stake was Peercoin. While Proof of
Work is still the most common method, more and more coins are using Proof of Stake.
Ethereum, the second-largest cryptocurrency, has started to implement plans to switch
from Proof of Work to Proof of Stake.
Power Consumption
By far the biggest problem of both of these methods is the power consumption needed
for Proof of Work systems. The Bitcoin blockchain alone consumes more power than
Argentina, which would place it in the top 30 of the most power-hungry countries.
Proof of Work isn’t sustainable in the world’s path towards a greener future and coins
that rely solely on Proof of Work will probably lose their value in the mid to long term.
This makes the energy efficiency of Proof of Stake its biggest advantage.
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 4/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
Scalability
Besides power consumption, the number of transactions per second in Proof of Work
is another big problem. The Bitcoin network can only handle up to 7 transactions per
second (in reality more like 4 per second), which isn’t even close to enough to function
as a global payment processor. Because the number of transactions is so limited, the
transaction fees have gone up significantly in recent years and are now somewhere
around 20$ for a single transaction, which doesn’t really work if you want to buy a
coffee for 2$.
While Proof of Stake itself doesn’t improve scalability, it opens up the possibility to
dramatically increase the number of transactions per second with a concept called
Sharding or Shard Chains.
Decentralization
Another benefit of the Proof of Stake system is the barrier of entry. You don’t need to
invest in expensive mining hardware, which makes it easier to participate in the
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 5/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
forging process and more nodes in a network are beneficial against attacks. Although
you still need a large investment to acquire enough coins for the staking threshold.
Security
A potential security problem for cryptocurrencies is the 51% attack. If a single entity
controls 51% of the hashing power in a mined coin or 51% of the stakes in a staked
coin, they can use their majority to rewrite the blockchain and add fraudulent
transactions to their benefit.
However, this isn’t a real problem for Proof of Stake because, in order to gain a 51%
stake in the currency, the attacker needs to own at least 51% of the coins, which is not
only very expensive but also goes against the interests of the attackers themselves.
When they own such a large share of the currency, they wouldn’t have any interest in
lowering its value by an attack.
Also, stakeholders that are behaving maliciously and are caught can lose a portion of
their stake, which further disincentivizes any attacks.
Infancy
A disadvantage of Proof of Stake is its relative infancy. It isn’t as battle-tested as Proof
of Work, which may reveal problems when it is used in large-scale currencies like
Ethereum.
It’s certainly the first thing I thought when I heard about the concept. However, when
you think about it, it is just as much of a problem for the Proof of Work model or — let’s
be honest — the world as a whole. The rich are able to buy the expensive hardware
needed for mining and they are able to open mining centers in countries with low
electricity prices. In fact, only a few big mining pools control a big portion of the
Bitcoin network.
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 6/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
It might be more difficult to get started in a Proof of Stake model though. I have been
doing some small-scale mining with my consumer graphics card recently and it has
been profitable after electricity costs. I guess I could have spent the electricity money
on some staked coins instead, but it would only be a one-to-one transaction without
any profit and it would take a very long time to get enough coins to start staking them
this way.
The Proof of Work consensus mechanism used in the Bitcoin blockchain and many
others is inherently flawed. The massive amount of electricity needed to guess the
correct hash value for the next block is not sustainable in a world on the edge of a
climate disaster.
The Proof of Stake method promises to fix some of the problems of Proof of Work. It is
energy-efficient, arguably more secure, and more decentralized. While it isn’t without
problems of its own, it is undoubtedly the future of cryptocurrencies.
Search Medium
Give a tip
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 7/8
2/12/23, 3:04 AM Proof of Stake vs. Proof of Work in Cryptocurrencies | by Christian Behler | Geek Culture | Medium
Subscribe to receive top 10 most read stories of Geek Culture — delivered straight into your inbox, once a week. Take a
look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/geekculture/proof-of-stake-vs-proof-of-work-in-cryptocurrencies-f558dbbaec4d 8/8
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
Published in Coinmonks
Li₿εʁLiøη Follow
Save
First of all, you must understand that the entire blockchain is an accounting ledger,
which records movements of money over time, and has a consensus method to be able
to record those transactions, based on a protocol that uses an algorithm, so that a node
at the same time validate blocks, and the rest of the nodes agree, and the chain is
forged consecutively and ordered in time.
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 1/7
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
The Proof of Stake algorithm (PoS) is a consensus protocol that proposes the validation
of blocks through proof of possession of cryptocurrencies, and thus a node is chosen
to forge a block.
A Proof of Work (PoW) is a system that requires the validator node, that is, the miner,
to perform work at a cost of time and energy consumption. The work consists of
performing a computation with different degrees of difficulty.
The PoS protocol actively participates in choosing the node with the right to create a
block. The chosen node will produce a block in a certain interval, having to insert a
cryptographic proof in the transaction validation, and all other nodes can verify it.
Because block allocation occurs at the start of an epoch (time period), if the node is
unavailable for any reason (eg offline), the interval remains empty (no blocks).
However, this situation is compensated by the fact that an interval only lasts 20
seconds. So there is a high probability that after the next 20 seconds another available
node will produce a block. We could see block production delays only in the event that
no more nodes were available at a given time. Eventually, some running node gets the
right and produces a block. We can conclude that the persistence is also high
compared to Bitcoin, mainly because the period for block production is shorter.
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 2/7
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
Still, Bitcoin could be considered a bit better if we don’t care about other variables like
block irrevocability, transaction speed, and fees.
Decentralization
The more powerful the PoW participant is, i.e. the one with a higher hash rate, the
more often he wins.
This has led to consensus management in mining farms, where individual miners
delegate their hash rate to pool groups for a higher chance of reward. Mining
competition in PoW has led to having few entities that collect decision power.
Currently, in 2022, more than 50% of the consensus is in 3 mining farms.
In PoS all users with ADA can participate in a consensus algorithm, the validator nodes
with the technology and their funds, and the delegators with their funds in
cryptocurrencies and delegate them to a stake pool. When the user’s ADA succeeds in
creating a block, the pool will create the block on behalf of the user. Stake pool
operators and users will be rewarded. In this way, all users are incentivized to
participate in decentralization.
The main difference in terms of incentives is that in PoW the winner takes all, both the
new coins issued and the fees for that block, while in PoS the rewards are distributed
by first assigning a participation margin to the operator and the rest in the form of
proportional to the funds between the stakepool operator and its delegators. In PoW,
holders cannot participate in consensus, unlike PoS, which decentralizes incentives.
PoS rewards participants proportionally and fairly based on the holding of funds the
users have. Not so in PoW where a few participants get most of the rewards, and small
individual miners have almost no chance of creating a block.
The advantage in PoS is that the incentives tend to be more decentralized in their
distribution than in PoW.
The disadvantage in PoS can be the concentration of funds in a few hands, where the
whales generate a plutocracy in the consensus.
Security
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 3/7
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
A blockchain is secure when it is not possible to change the history of the ledger
arbitrarily and only new transactions are recorded respecting the general consensus.
The ledger is distributed on many computers around the world. The attacker has no
chance to find all computers and try to change the ledger of all hard drives at the same
time.
The security of the PoW is based on its hash power, that is, the more participants there
are in the network, the more powerful and secure it becomes. PoW electricity
consumption is the largest cost.
In PoS, hash power is replaced by science and mathematics, where the protocol
randomly chooses the validator node of each block, weighing better luck for the node
with more delegation. So PoS is more complex and there may be a higher chance that
something will go wrong or you will be attacked in a vulnerability of your code.
Scalability
Scalability is the ability to process all transactions in the blockchain (layer 1) in a set
time, as new users join the network. It is easy to scale when the network is used by
only a few people. However, it is getting more and more difficult as the number of
users gradually grows.
Generally PoW produces blocks at a lower frequency of time than PoS, due to hash
difficulty management. For example, in the Cardano PoS, blocks are forged every 20
seconds against the 10 minutes of the Bitcoin PoW. This comparison is based on time,
but you must also consider the size of the transaction and other parameters such as
latency, to define the speed of network processing, which is measured in transactions
per second (TPS).
Therefore, it is not possible to say that one protocol is faster than another, in general.
We see that, with the configuration as of July 2022, in PoW, Bitcoin with a block size of
1 MB processes ~7 TPS and Bitcoin Cash, with a block size of 32 MB, is capable of
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 4/7
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
managing 25,000 transactions per block, through a network stress test performed in
September 2018, or ~42 TPS. Cardano, with PoS, can process up to 88 KB every 20
seconds, that is 2640 KB or 2.58 MB in 10 minutes, with ~60 TPS for average size
transactions (no smart contracts, no metadata, no large token bundles, etc.).
Also, among other scalability methods, PoS allows to introduce Sharding, so in the
future we can expect thousands of transactions per second. Sharding is dividing the
blockchain into individual segments or Shards, where each segment will have a unique
set of smart contracts and account balances, thus increasing transaction performance.
As we can see, PoS can be more scalable in its L1, in theory, through other methods
than just increasing the block size or decreasing the weight of each transaction.
The fees are influenced by two aspects. Firstly, because of the number of transactions
that the network is capable of processing at a given time and, secondly, because of the
cost required to keep the network running.
The two most used systems for calculating fees are the auction (market fee) and the
fixed one. Bitcoin uses the market fee method, that is, the greater the use of the
network, the cost of the fee increases so that a transaction is processed faster. Cardano
has a fixed fee system, and it only increases in cost by the weight of the transaction
(NFT or smart contracts are heavier), and does not depend on network activity.
Sustainability
Sustainability implies the continuity over time of a system with adequate incentives. If
costs go up and revenues go down, of course there is no such thing as sustainability.
PoW requires large energy consumption over a period of time, unlike PoS.
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 5/7
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
This relationship is not new, there has been a lot of talk, and I am not referring to
ecology and its defenders who say that Bitcoin is harmful, but to the fact that with high
energy costs, the PoW network is only sustainable when miners can develop activity
with high prices in the cryptocurrency price, so that its rewards can exceed the costs,
and in addition there must be activity of use in the network, since the greater the use,
the more fees and the less need for high prices of the cryptocurrency.
₳da (Cardano)
addr1qxdlld4mux6gl38860w297lse59m0646v68x6sraw0asp85ml7mthcd53lzw057u5talp
ngtkl4t5e5wd4q86ulmqz0qskgn43
Blockchain Cryptocurrency
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 6/7
2/12/23, 3:06 AM Proof of work vs Proof of stake. A participation testing algorithm, also… | by Li₿εʁLiøη | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/coinmonks/proof-of-stake-vs-proof-of-work-65cce1b280f3 7/7
2/12/23, 3:09 AM Explained: Database Sharding. what do you understand the term… | by Sparsh Gupta | Nerd For Tech | Medium
Save
Well, The word “Shard” means “a small part of a whole“. Hence Sharding means
dividing a larger part into smaller parts. That means dividing the database into small
databases. Well, actually yes but how ?? the answer is below.
Consider a very large database whose sharding has not been done. For example, let’s
take a DataBase of a college in which all the student’s record (present and past) in the
whole college are maintained in a single database. So, it would contain very very large
number of data, say 100, 000 records.
Now when we need to find a student from this Database, each time around 100, 000
transactions has to be done to find the student, which is very very costly.
https://medium.com/nerd-for-tech/explained-database-sharding-442b72eb28ed#:~:text=Database sharding is the process,smaller chunks%2C called … 2/11
2/12/23, 3:09 AM Explained: Database Sharding. what do you understand the term… | by Sparsh Gupta | Nerd For Tech | Medium
Now consider the same college students records, divided into smaller data shards
based on years. Now each data shard will have around 1000–5000 students records
only. So not only the database became much more manageable, but also the
transaction cost of each time also reduces by a huge factor, which is achieved by
Sharding.
Types of Sharding :
Benefits of Sharding :
The main appeal of sharding a database is that it can help to facilitate horizontal
scaling, also known as scaling out.
Smaller Databases are Faster. The scalability of sharding is apparent and achieved
through the distribution of processing across multiple shards and servers in the
network. What is less apparent is the fact that each individual shard database will
outperform a single large database due to its smaller size. By hosting each shard
database on its own server, the ratio between memory and data on disk is properly
balanced, thereby reducing disk I/O and maximizing system resources. This results
in less contention, greater join performance, faster index searches and fewer
database locks. Therefore, not only can a sharded system scale to new levels of
capacity, individual transaction performance is benefited as well.
Database Sharding can Reduce Costs. Most database sharding implementations take
advantage of low-cost open source databases and commodity databases. The
technique can also take full advantage of reasonably priced “workgroup” versions
of many commercial databases. Sharding works well with commodity multi-core
server hardware, systems that are far less expensive when compared to high-end,
multi-CPU servers and expensive storage area networks (SANs). The overall
reduction in cost due to savings in license fees, software maintenance and
hardware investment is substantial-in some cases 70% when compared to
traditional solutions.
Drawbacks of Sharding :
1. Adds complexity in the system: Properly implementing a sharded database
architecture is a complex task. If not done correctly, there is a significant risk that
the sharding process can lead to lost data or corrupted tables. Sharding also have
major impact on your team’s workflows.
We can’t issue a query and get data from multiple shards. We need to issue multiple
queries to different shards, get all the responses and merge them.
Because of this added complexity, sharding is usually only performed when dealing
with very large amounts of data. Here are some common scenarios where it may be
beneficial to shard a database:
1. The amount of application data grows to exceed the storage capacity of a single database
node.
2. The volume of writes or reads to the database surpasses what a single node or its read
replicas can handle, resulting in slowed response times or timeouts.
3. The network bandwidth required by the application outpaces the bandwidth available to a
single database node and any read replicas, resulting in slowed response times or timeouts.
Before sharding, you should exhaust all other options for optimizing your database. Some
optimizations you might want to consider include:
2. Implementing caching
Many big tech company uses this method for their Distributed system and many of
them innovate this method to next extent part for eg. Google,facebook,Amazon & etc.
You will saw many big tech companies using sharding architecture in their system
designs.
However,Sharding can be a great solution for those looking to scale their database
horizontally. However, it also adds a great deal of complexity and creates more
potential failure points for your application. Sharding may be necessary for some, but
the time and resources needed to create and maintain a sharded architecture could
outweigh the benefits for others.
Further Reading:
and great explanation of data sharding by the Guru of system design a.k.a Gaurav Sen
I hope you Like it my article , I try to explain the database sharding in most minimal
manner . I have started the series called “ Explained: System design” series for
explaining the system designing in software development .
Give a tip
Subscribe to our weekly News Letter to receive top stories from the Industry Professionals around the world Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Save
Your application suddenly becomes popular. Traffic and data is starting to grow, and
your database gets more overloaded every day. People on the internet tell you to scale
your database by sharding, but you don’t really know what it means. You start doing
some research, and run into this post.
Welcome!
What is sharding?
Sharding is a method of splitting and storing a single logical dataset in multiple
databases. By distributing the data among multiple machines, a cluster of database
systems can store larger dataset and handle additional requests. Sharding is necessary
if a dataset is too large to be stored in a single database. Moreover, many sharding
strategies allow additional machines to be added. Sharding allows a database cluster to
scale along with its data and traffic growth.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 1/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
Vertical partitioning is very domain specific. You draw a logical split within your
application data, storing them in different databases. It is almost always implemented
at the application level — a piece of code routing reads and writes to a designated
database.
In contrast, sharding splits a homogeneous type of data into multiple databases. You
can see that such an algorithm is easily generalizable. That’s why sharding can be
implemented at either the application or database level. In many databases, sharding
is a first-class concept, and the database knows how to store and retrieve data within a
cluster. Almost all modern databases are natively sharded. Cassandra, HBase, HDFS,
and MongoDB are popular distributed databases. Notable examples of non-sharded
modern databases are Sqlite, Redis (spec in progress), Memcached, and Zookeeper.
There exist various strategies to distribute data into multiple databases. Each strategy
has pros and cons depending on various assumptions a strategy makes. It is crucial to
understand these assumptions and limitations. Operations may need to search through
many databases to find the requested data. These are called cross-partition operations
and they tend to be inefficient. Hotspots are another common problem — having
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 2/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
uneven distribution of data and operations. Hotspots largely counteract the benefits of
sharding.
Get a more expensive machine. Storage capacity is growing at the speed of Moore’s
law. From Amazon, you can get a server with 6.4 TB of SDD, 244 GB of RAM and 32
cores. Even in 2013, Stack Overflow runs on a single MS SQL server. (Some may argue
that splitting Stack Overflow and Stack Exchange is a form of sharding)
If your application is bound by read performance, you can add caches or database
replicas. They provide additional read capacity without heavily modifying your
application.
Not everything may need to be sharded. Often times, only few tables occupy a majority
of the disk space. Very little is gained by sharding small tables with hundreds of rows.
Focus on the large tables.
Driving Principles
To compare the pros and cons of each sharding strategy, I’ll use the following
principles.
How the data is read — Databases are used to store and retrieve data. If we don’t need
to read data at all, we can simply write it to /dev/null. If we only need to batch process
the data once in a while, we can append to a single file and periodically scan through
them. Data retrieval requirements (or lack thereof) heavily influence the sharding
strategy.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 3/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
How the data is distributed — Once you have a cluster of machines acting together, it is
important to ensure that data and work is evenly distributed. Uneven load causes
storage and performance hotspots. Some databases redistribute data dynamically,
while others expect clients to evenly distribute and access data.
Common Definitions
Many databases have their own terminologies. The following terminologies are used
throughout to describe different algorithms.
Shard or Partition Key is a portion of primary key which determines how data should
be distributed. A partition key allows you to retrieve and modify data efficiently by
routing operations to the correct database. Entries with the same partition key are
stored in the same node. A logical shard is a collection of data sharing the same
partition key. A database node, sometimes referred as a physical shard, contains
multiple logical shards.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 4/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
Reads are performed within a single database as long as a partition key is given.
Queries without a partition key require searching every database node. Non-
partitioned queries do not scale with respect to the size of cluster, thus they are
discouraged.
Algorithmic sharding distributes data by its sharding function only. It doesn’t consider
the payload size or space utilization. To uniformly distribute data, each partition
should be similarly sized. Fine grained partitions reduce hotspots — a single database
will contain many partitions, and the sum of data between databases is statistically
likely to be similar. For this reason, algorithmic sharding is suitable for key-value
databases with homogeneous values.
Resharding data can be challenging. It requires updating the sharding function and
moving data around the cluster. Doing both at the same time while maintaining
consistency and availability is hard. Clever choice of sharding function can reduce the
amount of transferred data. Consistent Hashing is such an algorithm.
Examples of such system include Memcached. Memcached is not sharded on its own,
but expects client libraries to distribute data within a cluster. Such logic is fairly easy to
implement at the application level.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 5/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
To read and write data, clients need to consult the locator service first. Operation by
primary key becomes fairly trivial. Other queries also become efficient depending on
the structure of locators. In the example of range-based partition keys, range queries
are efficient because the locator service reduces the number of candidate databases.
Queries without a partition key will need to search all databases.
The locator service becomes a single point of contention and failure. Every database
operation needs to access it, thus performance and availability are a must. However,
locators cannot be cached or replicated simply. Out of date locators will route
operations to incorrect databases. Misrouted writes are especially bad — they become
undiscoverable after the routing issue is resolved.
Since the effect of misrouted traffic is so devastating, many systems opt for a high
consistency solution. Consensus algorithms and synchronous replications are used to
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 6/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
store this data. Fortunately, locator data tends to be small, so computational costs
associated with such a heavyweight solution tends to be low.
Due to its robustness, dynamic sharding is used in many popular databases. HDFS uses
a Name Node to store filesystem metadata. Unfortunately, the name node is a single
point of failure in HDFS. Apache HBase splits row keys into ranges. The range server is
responsible for storing multiple regions. Region information is stored in Zookeeper to
ensure consistency and redundancy. In MongoDB, the ConfigServer stores the
sharding information, and mongos performs the query routing. ConfigServer uses
synchronous replication to ensure consistency. When a config server loses
redundancy, it goes into read-only mode for safety. Normal database operations are
unaffected, but shards cannot be created or moved.
Previous examples are geared towards key-value operations. However, many databases
have more expressive querying and manipulation capabilities. Traditional RDBMS
features such as joins, indexes and transactions reduce complexity for an application.
The concept of entity groups is very simple. Store related entities in the same partition
to provide additional capabilities within a single partition. Specifically:
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 7/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
Queries spanning multiple partitions typically have looser consistency guarantees than
a single partition query. They also tend to be inefficient, so such queries should be
done sparingly.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 8/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
This model has been popular since mid 2000s. The restriction given by hierarchical
keys allows databases to implement data-agnostic sharding mechanisms and efficient
storage engines. Meanwhile, hierarchical keys are expressive enough to represent
sophisticated relationships. Column-oriented databases can model a problem such as
time series efficiently.
The term column database is losing popularity. Both HBase and Cassandra once
marketed themselves as column databases, but not anymore. If I need to categorize
these systems today, I would call them hierarchical key-value stores, since this is the
most distinctive characteristic between them.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 9/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
A logical shard (data sharing the same partition key) must fit in a single node. This is
the most important assumption, and is the hardest to change in future. A logical
shard is an atomic unit of storage and cannot span across multiple nodes. In such a
situation, the database cluster is effectively out of space. Having finer partitions
mitigates this problem, but it adds complexity to both database and application. The
cluster needs to manage additional partitions and the application may issue additional
cross-partition operations.
Many web applications shard data by user. This may become problematic over time, as
the application accumulates power users with a large amount of data. For example, an
email service may have users with terabytes of email. To accommodate this, a single
user’s data is split into partitions. This migration is usually very challenging as it
invalidates many core assumptions on the underlying data model.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 10/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
Illustration of a hotspot at the end of partition range even after numerous shard splits.
In the case of dynamic sharding, it is bad to have a large number of locators. Since the
locators are frequently accessed, they are normally served directly from RAM. HDFS’s
Name Node needs at least 150 bytes of memory per file for its metadata, thus storing a
large number of files is prohibitive. Many databases allocate a fixed amount of
resources per partition range. HBase recommends about 20~200 regions per server.
Concluding Remarks
There are many topics closely related to sharding not covered here. Replication is a
crucial concept in distributed databases to ensure durability and availability.
Replication can be performed agnostic to sharding or tightly coupled to the sharding
strategies.
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 11/12
2/12/23, 3:12 AM How Sharding Works. This is a continuation of the last blog… | by Jeeyoung Kim | Medium
None of this is magic. Everything follows logically once you consider how the data is
stored and retrieved. Cross-partition queries are inefficient, and many sharding
schemes attempt to minimize the number of cross-partition operations. On the other
hand, partitions need to be granular enough to evenly distribute the load amongst
nodes. Finding the right balance can be tricky. Of course, the best solution in software
engineering is avoiding the problem altogether. As stated before, there are many
successful websites operating without sharding. See if you can defer or avoid the
problem altogether.
Happy databasing!
Open in app Sign up Sign In
Search Medium
https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6 12/12
2/12/23, 3:16 AM What Are Altcoins and How Do They Differ From Bitcoin? | by MaskEX | Coinmonks | Medium
Published in Coinmonks
MaskEX Follow
Save
ALTCOINS
The first cryptocurrency to exist was Bitcoin, which debuted in 2008. It was created by
an individual or group named “Satoshi Nakamoto.” Apart from bitcoin, there are
https://medium.com/coinmonks/what-are-altcoins-and-how-do-they-differ-from-bitcoin-31bb789a8896 1/6
2/12/23, 3:16 AM What Are Altcoins and How Do They Differ From Bitcoin? | by MaskEX | Coinmonks | Medium
cryptocurrencies referred to as altcoins. What are they, and how do they differ from
bitcoin?
While using the same decentralized idea that gave rise to Bitcoin, altcoins go further
by having their special characteristics.
For instance, the idea of “smart contracts,” which are computer programs that utilize
blockchain technology to autonomously carry out agreements between two parties,
was invented by Ethereum. New applications and use cases for cryptography were thus
made possible.
Ripple XRP
Cardano (ADA)
Solana (SOL)
Dogecoin (DOGE)
Polkadot (DOT)
Polygon (MATIC)
Uniswap (UNI)
Avalanche (AVAX)
https://medium.com/coinmonks/what-are-altcoins-and-how-do-they-differ-from-bitcoin-31bb789a8896 2/6
2/12/23, 3:16 AM What Are Altcoins and How Do They Differ From Bitcoin? | by MaskEX | Coinmonks | Medium
Cronos (CRO)
Helium (HNT)
Types of Altcoins
Stablecoins
Cryptocurrencies known as stablecoins are backed by a physical good like gold or are
tied to a fiat currency like the US dollar to preserve price stability. USDC, Dai, and
USDT are among the examples. As they combat the extreme volatility of other
cryptocurrencies, stablecoins are becoming increasingly popular as liquidity vehicles
in the digital world.
A stablecoin’s value may be linked to a basket of reference assets and being directly
tethered to an asset to maintain price stability. Commodities, fiat money, government
securities, digital assets, or any mix of these can be included in the reference asset
basket.
Utility Tokens
A cryptocurrency token with a specific use case within a particular ecosystem is called
a utility token. These tokens enable users to carry out specified actions on a particular
network.
An ecosystem’s utility token is special. For instance, the FIL token on Filecoin may only
be used to pay for storage. Other than speculating on its worth, FIL has no use. Any
utility token may be stated to be the same way.
Unlike cryptocurrencies, utility tokens cannot be mined. Instead, they are often pre-
mined, meaning they are generated all at once and distributed in a way decided upon
by the project team.
https://medium.com/coinmonks/what-are-altcoins-and-how-do-they-differ-from-bitcoin-31bb789a8896 3/6
2/12/23, 3:16 AM What Are Altcoins and How Do They Differ From Bitcoin? | by MaskEX | Coinmonks | Medium
Examples of utility tokens include Filecoin (FIL), Basic Attention Token (BAT), and
Polygon (MATIC).
Governance Tokens
A specific kind of utility token known as a governance token is used to secure voting
rights (the opportunity to vote in blockchain-wide elections). Users may vote on
choices that affect blockchain ecosystems using governance tokens, as the name
implies.
Examples of governance tokens: Maker (MKR), Apecoin (APE), and Aave (AAVE).
Meme Coins
Examples of meme coins are Dogecoin (DOGE), Shiba Inu (SHIB), and MonaCoin
(MONA).
Security Tokens
Payment Tokens
Payment tokens are used to transact directly between buyers and sellers of products
and services on digital marketplaces, as opposed to via an intermediary, as is common
in traditional banking and finance. Of course, the bulk of cryptocurrencies and tokens
https://medium.com/coinmonks/what-are-altcoins-and-how-do-they-differ-from-bitcoin-31bb789a8896 4/6
2/12/23, 3:16 AM What Are Altcoins and How Do They Differ From Bitcoin? | by MaskEX | Coinmonks | Medium
fit within this category, whether they are security or utility tokens. But not all utility
tokens may also function as payment tokens.
Bitcoin vs Altcoins
Bitcoin and altcoins are different from one another in many respects, despite the fact
that they are quite similar and operate on the same basis.
Since the technique used to construct the cryptographic blocks, known as proof-of-
work, is so energy-consuming, demanding, and constrained, implementing and using
Bitcoin is exceedingly challenging.
Altcoins, however, have developed beyond this. Instead, they make use of the proof-of-
stake mechanism to get an edge over the competition, which requires less energy and
speeds up transaction validation.
These criticisms of Bitcoin have been skillfully handled by altcoins, which have been
operating along the lines of sustainability and scalability.
Bitcoin Altcoins
https://medium.com/coinmonks/what-are-altcoins-and-how-do-they-differ-from-bitcoin-31bb789a8896 5/6
2/12/23, 3:16 AM What Are Altcoins and How Do They Differ From Bitcoin? | by MaskEX | Coinmonks | Medium
A newsletter that brings you day's best crypto news, Technical analysis, Discount Offers, and MEMEs directly in your
inbox, by CoinCodeCap.com Take a look.
Your email
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
Open in app
practices. Sign up Sign In
Search Medium
https://medium.com/coinmonks/what-are-altcoins-and-how-do-they-differ-from-bitcoin-31bb789a8896 6/6
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Published in DataDrivenInvestor
You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Save
CRYPTOCURRENCY | BLOCKCHAIN
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 1/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Top 5 bargain gaming altcoins to buy now with $50 — PowerPoint Design Creation by the author.
OK, the cryptocurrency market has been on a tear for the past five weeks. Now you’re
worried that if you get in, you’ll somehow sabotage the system, and it will suddenly
turn the other way. Let’s look at these bargain gaming altcoins.
Don’t feel like the Lone Ranger; most new investors or those coming back into the
market have the same worries. The way to overcome those doubts is with dollar-cost-
averaging (DCA).
I use $50 in most of my articles because most workers can afford to put away $50 a
month for their future. You just have to ask yourself, what am I willing to give up
setting myself on the right path and not worry about still working at 65 or 70.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 2/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Maybe it’s that daily Starbucks or those cigarettes that are destroying your health. It’s
up to you.
Several artificial intelligence (AI) altcoins are doing quite well during the crypto
winter’s thaw. Look at Fetch AI (FET) or Singularity Net (AGIX). You might do well with
$50 worth of either of those too.
If you invest $50 in even the most expensive of these five gaming altcoins, you could
get 56 $SAND tokens, but by buying the least expensive, you could get 29,976 IBAT
tokens.
Once I publish this, a few of my readers will come back and ask why I didn’t include…
insert any of the other gazillion gaming altcoins. It never fails. Someone always does.
Some I already wrote about elsewhere or I’m not familiar with it. I am familiar with
these and own a few, so I am confident that what I write is correct.
These are not in any particular order except familiarity. Some of these are trending.
But do yourself a favor and do your own research (DYOR).
As the 2022 Rug Pull Report on Coin Edition warned, 350 scam coins were created each
day. That’s 117,629 chances to get scammed, as nearly two million investors were last
year. That’s not counting the 1.8 million who lost money due to the bankruptcy of
Celsius, Voyager, and FTX.
DYOR, and only leave your coins on an exchange if you have them locked for staking.
However, even that is a substantial risk. Otherwise, they wouldn’t pay so much.
Remember Squid Game ($SQUID), the $3.3 million rug pull. The developers wrote it
into a smart contract that buyers wouldn’t be able to resell. May they rot in hell!
A friend of mine lost about $2,000 worth of ETH they had staked when the exchange
stopped servicing investors in their country. They were warned to remove their crypto
by a specific date but couldn’t because they were locked.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 3/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Anyway, be careful and consider these five bargain gaming altcoins only after you
DYOR.
#1 — Decentraland ($MANA)
Decentraland is a virtual reality (VR) platform built on Ethereum. The Decentraland
opened to prospectors three years ago in FEB ’20. Gamers and imaginative
homesteaders can buy plots of land to develop using $MANA, an ERC-20 token you
burn to get ERC-721 $LAND tokens.
MANA is also used to buy avatars and other “in-game” items in the marketplace.
“The live Decentraland price today is $0.788985 USD with a 24-hour trading volume of
$376,659,186 USD. We update our MANA to USD price in real-time. Decentraland is up
7.83% in the last 24 hours. The current CoinMarketCap ranking is #42, with a live market
cap of $1,463,634,379 USD. It has a circulating supply of 1,855,084,192 MANA coins and
the max. supply is not available.” — Coin Market Cap.
I’ve never liked a coin with an unavailable max supply. What makes them any different
than a government with the ability to “print on demand?”
Let’s say the price gets to $20, and they decide to put 5 billion more coins into
circulation. The price will plunge like the Titanic. Otherwise, I do like $MANA.
If you buy an altcoin with no max supply, keep an eye out for increased production.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 4/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
As you can see in the chart, MANA has doubled in the previous 30 days.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 5/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Players use the SAND token to facilitate transactions on the Sandbox platform.
“The live The Sandbox price today is $0.888426 USD with a 24-hour trading volume of
$990,579,049 USD. We update our SAND to USD price in real-time. The Sandbox is up
23.05% in the last 24 hours. The current CoinMarketCap ranking is #43, with a live
market cap of $1,332,168,091 USD. It has a circulating supply of 1,499,470,108 SAND
coins and a max. supply of 3,000,000,000 SAND coins.” — Coin Market Cap.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 6/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
GALA is a decentralized gaming token that facilitates transactions within the Gala
Games ecosystem. It is built on the Ethereum blockchain and is an ERC-20 standard
token. It is a utility token to access various games and services within the ecosystem.
Their most popular games are Town Star, a play-to-earn (P2E) farming game like
Farmville, which the founders of Gala Games created for Zynga, and Spider Tanks.
Want to know more? I wrote about it one month ago when the price was $0.023681,
about half of today’s price of $0.052295.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 8/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
“The live Gala price today is $0.052295 USD with a 24-hour trading volume of
$165,846,591 USD. We update our GALA to USD price in real-time. Gala is down 0.62% in
the last 24 hours. The current CoinMarketCap ranking is #111, with a live market cap of
$364,873,289 USD. It has a circulating supply of 6,977,205,436 GALA coins and the max.
supply is not available.” — Coin Market Cap.
The $ATLAS token is a bargain gaming altcoins that you should own now with $50.
Star Atlas First Look! Let’s See Our Ships! │Star Atlas Showroom Review
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 9/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Star Atlas First Look! Let's See Our Ships! │Star Atlas Showroom Review
“The live Star Atlas price today is $0.004157 USD with a 24-hour trading volume of
$1,898,068 USD. We update our ATLAS to USD price in real-time. Star Atlas is up 3.74% in
the last 24 hours. The current CoinMarketCap ranking is #460, with a live market cap of
$40,755,100 USD. It has a circulating supply of 9,803,356,511 ATLAS coins and a max.
supply of 36,000,000,000 ATLAS coins.” — Coin Market Cap.
At the current price, you can buy 12,028 tokens with $50, then sit back and wait for the
next bull run. I think you can do the math if this gaming altcoin becomes $1.00.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 10/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 11/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Is Battle Infinity and the metaverse Battle Arena the future face of fantasy sports? It
could be. However, it will take a lot of promotion. Currently, Battle Infinity is made up
of various P2E games within the IBAT Battle Arena.
In the Battle Arena metaverse world, gamers can battle and play. They can also interact
through their avatars, talk shit, and draft fantasy teams. The virtual world of Battle
Arena can be something special if the founders create a medium for real-world fantasy
sports.
$IBAT is one of the bargain gaming altcoins with tremendous upside potential.
“The live Battle Infinity price today is $0.001668 USD with a 24-hour trading volume of
$153,288 USD. We update our IBAT to USD price in real-time. Battle Infinity is down
1.17% in the last 24 hours. The current CoinMarketCap ranking is #3400, with a live
market cap of not available. The circulating supply is not available and a max. supply of
10,000,000,000 IBAT coins.” — Coin Market Cap.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 12/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
At that price, you could get nearly 30,000 tokens. Of course, if it keeps going down, you
could lose a significant portion of your $50. So, keep an eye on it.
I would caution you to do your own research (DYOR) and never invest money you
cannot afford to lose.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 13/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Note: This post contains affiliate links. Read my disclosure statement for additional
information.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 14/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Stephen Dalton is a retired US Army First Sergeant with a degree in journalism from
the University of Maryland and a Certified US English Chicago Manual of Style Editor.
Also, a Top Writer in Nutrition, Investing, Travel, Fiction, Transportation, VR, NFL,
Design, Creativity, and Short Story.
If you want to make money writing online, start by signing up for a Medium Membership
Today!
It only costs $5 per month, I’ve made money every month since I became a paying member,
and you can too. Thank you.
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 15/16
2/12/23, 3:19 AM Top 5 Bargain Gaming Altcoins to Own with $50 in 2023 | by Stephen Dalton | Feb, 2023 | DataDrivenInvestor
Give a tip
Subscribe
Search Medium
https://medium.datadriveninvestor.com/top-5-bargain-gaming-altcoins-to-own-with-50-in-2023-30b297e1b98c 16/16
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
Published in DataDrivenInvestor
Save
Source
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 1/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
Altcoins are cryptocurrencies other than Bitcoin, which share some similar
characteristics as Bitcoin but may differ in their mechanism to produce blocks or
validate transactions. It improves on aspects of Bitcoin, offers high potential rewards,
but does not have Bitcoin’s market share, and is significantly riskier as many altcoins
end up failing. There are over 16000 coins as of December 2021.
This article will take us through the top-down approach of finding the altcoin gems as
outlined by Guy in this video, and automating the process wherever possible using
Python.
Sign up for a developer portal account on CoinMarketCap and you would be provided
with an API key. Copy the API key and paste it into the code below. The below snippet
is to make an API call to CoinMarketCap to download the top 5000 cryptocurrencies
based on Market Cap and convert the list into a pandas data frame.
url = 'https://pro-
api.coinmarketcap.com/v1/cryptocurrency/listings/latest'
parameters = {
'start':'1',
'limit':'5000',
'convert':'USD'
}
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 2/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
headers = {
'Accepts': 'application/json',
'X-CMC_PRO_API_KEY': 'PASTE_YOUR_API_KEY_HERE',
}
session = Session()
session.headers.update(headers)
try:
response = session.get(url, params=parameters)
data = json.loads(response.text)
print(data)
except (ConnectionError, Timeout, TooManyRedirects) as e:
print(e)
coindf = pd.json_normalize(data['data'])
Filtering on Market Cap leaves us with only 221 Cryptocurrencies out of the 5000 we
started with. The dataset (not all rows and columns shown) looks as below ->
The 24 hr volume gives us a sense of how active the trading is, i.e ‘Is the coin in use?.
Let’s filter out the list by keeping only the coins with the Volume to Market Cap ratio
between 10% and 50%. This means the coin would take approximately 2 to 10 days to
cover its market cap.
coindf3 = coindf2[
(coindf2['quote.USD.volume_24h']/coindf2['quote.USD.market_cap']).betw
een(0.1,0.5) ]
This leaves us with just 41 coins to look at. Now we need to investigate whether the
volume of these coins contains any wash trading. Wash trading is when the investor
simultaneously sells and buys the same security to artificially increase the trading
volume, giving the impression the security is more in demand than it really is.
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 4/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
https://www.coingecko.com/en/coins/lympo#markets
Instead of manually checking the exchange listings for each of the coins on the
website, we can download this data using the Coingecko API. Also, let’s keep only the
coins where the trading volume through the “green” exchanges is the majority.
try:
print(symbol1)
coin_exchange = cg.get_coin_by_id(id = symbol1 )['tickers']
df = pd.DataFrame(coin_exchange)
df.trust_score.value_counts()
except:
print(symbol2)
try:
coin_exchange = cg.get_coin_by_id(id = symbol2 )
['tickers']
except:
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 5/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
continue
df = pd.DataFrame(coin_exchange)
df.trust_score.value_counts()
if df.groupby('trust_score')['volume'].sum()
['green']/df.groupby('trust_score')['volume'].sum().sum() >= 0.5:
crypto_list_shortlisted.append(symbol1)
Starting with 5000 coins, we are left with only 14 coins to research :
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 6/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 7/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 8/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
https://github.com/maticnetwork/bor/graphs/commit-activity
https://github.com/maticnetwork/bor/issues
Some of the development may not be reflected in the Github repository, so be sure to
also check out the official webpage of the token. As an example, the webpage of MATIC
token -> https://blog.polygon.technology
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 9/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
2. READ the white paper: Read about the tech (consensus protocol, interoperability,
scalability), use cases, and roadmap of the project
Search Medium
https://app.intotheblock.com/coin/MATIC/deep-dive?group=socials&chart=all
References :
1. https://www.youtube.com/watch?v=GIfihSBT6Bc
2. https://www.intotheblock.com
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 10/11
2/12/23, 3:23 AM Finding the 100x Altcoin. Altcoins are cryptocurrencies other… | by Rohan Joseph | DataDrivenInvestor
104 2
https://medium.datadriveninvestor.com/finding-the-100x-altcoin-3c9af2bdd7b5 11/11
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Save
There are different types of Blockchain that are being used currently. Learning the
basics of these Blockchains will give you a clear understanding of the type of
Blockchain you can use for your business or for starting a new project.
Public Blockchain
Public Blockchain, as the name suggests, is public. A public blockchain is completely
decentralized and does not have a single entity that controls the network. In this type
of Blockchain, anyone with an internet connection can join the network and
participate in reading, writing, or auditing within the Blockchain. Hence anyone can
review anything at a given point of time on a public blockchain. Simply put, anyone
can use public blockchain from anywhere to input data and transactions and review
them as long as they are connected to the network.
Public blockchain can also be called Permissionless Blockchain because it allows any
user to create a personal address and join the blockchain network, i.e., become a
‘node’ of the network. Also, the public blockchains do not restrict the rights of the
nodes on the blockchain network.
Another critical point to remember is that these types of Blockchain are more
transparent and secure than permissioned blockchains because there are many nodes
to validate transactions. Thus, it would be difficult for bad actors to collude on the
network. Also, it is not possible to modify or alter the data once it has been validated
on the Blockchain.
(i) To be part of a public blockchain, one needs to download the code without needing
any permission from anyone and start running a public node on their local device.
Once this is done, he can then validate transactions in the network, thus participating
in the consensus process — the process for determining what blocks can be added to
the Blockchain.
(ii) Anyone in the world can send transactions through the network and can expect
them to be included in the Blockchain if they are valid.
(iii) In a public blockchain, anyone in the world can access and read Blockchain
transactions using a block explorer, which is a program or a website that allows a user
to search and navigate the blocks of a Blockchain, their contents, and relevant details.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 2/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
(iv) Speed of transactions in the public blockchain is slower than in the case of private
blockchain.
Examples: To date, public blockchains are primarily used for exchanging and mining
cryptocurrency. A few examples of cryptocurrency public blockchain platforms
include Bitcoin, Ethereum, Litecoin, etc. Ethereum is actually the most popular public
blockchain at present.
Limitations: One may face some challenges while using a public blockchain. For
instance,
(i) Difficult Fraud Tracking: The transactions on the public blockchain can be done
anonymously or pseudo anonymously and are not tied directly to the real identity of
the user. These transactions are linked to an account address comprised solely of
numbers and letters. With no real-world identity attached to this address, it is
impossible to track the transaction’s originator. It raises a very critical concern, what if
activities like fraud, hacking, or money laundering take place in this type of
Blockchain. How will the guilty party or person be tracked and punished?
(ii) Lack of governance and regulations: The public blockchain being completely open
and decentralized makes it susceptible to a lack of proper regulation and governance
by an authorized body. Thus, there is no safe upgrade path for any protocols, and there
is no one who can be held responsible for setting and maintaining the network
standards. It is definitely good to keep the development of Blockchain technology as
decentralized as possible; however, we still need some organization that can look after
its features, upgrades, and code of conduct. For instance, if a developer designs a new
standard or protocol but gets busy and forgets to respond, then the progress on that
protocol halts regardless of how valuable that protocol is for everybody. You cannot
hold anyone responsible for maintaining the network standard, thus making the entire
system dicey and skeptical. Therefore there is a need for leadership that needs to look
after all these aspects. Additionally, the public blockchains are not suitable for use in
any internal system and for projects that have strict criteria to follow.
(iii) Slow speed and massive consumption of energy: Another critical area of concern
while using public blockchain technology is its speed and the energy it consumes.
Public blockchains are slow because it takes time for the network to reach a
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 3/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
consensus. For instance, public blockchains like bitcoin manage to process seven
transactions per second compared to Visa, which can do 1700 transactions per second.
Also, public blockchains like Bitcoin rely on a consensus mechanism- Proof of Work to
validate transactions and add new blocks of transactions to the network. In this
process, a lot of energy gets consumed while solving complex mathematical problems
to validate the transactions and create a block. As per the studies published in June
2017, each bitcoin transaction consumes 80,000 times more electricity than a Visa
credit card transaction. But various other consensus mechanisms have been proposed,
like Proof of Stake, which uses far less electricity.
Private Blockchain
The second type of blockchain is Private Blockchain, where the network participants
have control over who can join the network and who can participate in the consensus
process. This is in contrast to public blockchain which is open for anyone to participate
in the network. Access controls in the network will vary for every participant, and the
Regulatory Authority or central organization would decide on various activities inside
the network starting from joining the network until executing any of the
functionalities in this closed network. In this platform, the digital identities of the
participants need to be managed and monitored by the Regulatory Authority.
Therefore, it is not necessarily decentralized even among its members but is a
centralized system that uses distributed ledger technology.
(i) In the case of the public blockchain, the credentials of nodes are not known;
therefore, nobody can decipher who these validators are, which increases the risk of
malicious activities. But in the case of a private blockchain, the credentials of
participating nodes are present on the blockchain; therefore, it is much easier to track
where the fraud happened.
(ii) Additionally, since private blockchains are generally smaller than public
blockchains and have far fewer participants, therefore it takes less time for the
network to reach a consensus. As a result, more transactions can take place. Private
blockchains can process thousands of transactions per second. Also, they take up a lot
less energy and power to validate transactions. On the contrary public blockchain
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 4/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Limitations: There are certain challenges associated with the private blockchain. For
instance,
(ii) The second disadvantage of using private blockchain is trust. The credibility of a
private blockchain network relies on the credibility of the authorized nodes. They need
to be trustworthy as they are verifying and validating transactions.
(iii) Security is another concern while using a private blockchain. With fewer nodes, it
is easier for malicious hackers to gain control of the network. Thus, compared to the
public blockchain, a private blockchain is far more at risk of being hacked or having
data manipulated.
institutes on the blockchain network. From these 20 institutes, the nodes will be pre-
selected to make changes on the network.
Consortium/Federated Blockchain
These nodes have the authority to read or write transactions, and they can also allow
or restrict participants on the network. But none of the nodes alone can add a block to
the Blockchain. To add a block, every single node has to approve the block. The
mechanism of reaching a decision to add a block is based on the voting system, also
referred to as the Proof of Vote mechanism. The purpose of this mechanism is to
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 6/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
follow up on the selected nodes. Here every node will need to vote in order to validate
a block. The number of votes required will be pre-determined in order to reach a
decision of adding the block to the Blockchain. This means that it has been decided in
the code that for fifteen selected nodes, it might take ten nodes’ votes or even fifteen
nodes’ votes to validate a block. By using the Proof of Vote mechanism, the network
helps to ensure that no one is misusing their power.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 7/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
produce to a buyer in India and another price and quantity to another buyer in
Australia. The information about the agreed prices between the farmer and buyers
should not be revealed to other entities involved, like the customs department, the
shipping company, and the warehouse operator. They simply need access to limited
information, like quality specifications and quantity, to perform their necessary
function in supporting such deals. This is a perfect use case for the application of a
permissioned blockchain, that can allow such restricted implementation and limited
permission to the various participants.
Permissioned Blockchain has many other applications like payments, KYC validation,
escrow, insurance claims, charity, music publishing, and much more. In a nutshell, the
permissioned blockchain offers a secure business environment with customization
that allows wider industry adoption across multiple enterprises.
Hybrid Blockchain
The fourth type of Blockchain is Hybrid Blockchain, the blockchain which combines
the best of both private and public blockchains. Simply put, a hybrid blockchain
provides controlled access and freedom simultaneously. In other words, the hybrid
blockchain lets organizations set up a private, permission-based system alongside a
public permissionless system.
Fusing different features from private and public blockchains ensures that an
organization can work with its stakeholders in the best possible way.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 8/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
administrator.
In the hybrid blockchain, there are two different types of users/nodes based on the
level of information that they access:
(i) The first type of users/nodes are those who are part of the private blockchain and
have all the control over the blockchain and can decide the level of security
permissions for a particular user.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 9/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
(ii) And the other type of users/nodes are those who are part of the public blockchain
and can just access the data released on the blockchain.
Even though a set of individuals control the hybrid blockchain network, they cannot
change the transactions’ immutability and security. They can only control which
transactions are made public and which are not.
(i) A user is required to get permission to join the hybrid blockchain network and
become a node on the private network. Once he joins the network, he can fully
participate in the blockchain’s activities, like the rights to do transactions, view them,
or even append or modify them.
(ii) The identity of the user is kept secret from other participating users to protect that
user’s privacy. His identity is only revealed to the party/user he is dealing with.
(iii) To ensure that the identification process of a user is done correctly, companies and
organizations carry out KYC (Know Your Customer) to make it work. Financial
institutes, especially, need to handle the KYC process correctly as they cannot allow
the transaction to be carried out by a user who is anonymous or not entirely known to
the blockchain. Thus the hybrid blockchain has limited anonymity for the users who
take part in the network, though public anonymity is still maintained. This leads to an
intersection of both the public and private systems.
(ii) Since a hybrid blockchain provides the ability to work in a closed ecosystem, thus,
organizations don’t have to worry about getting their information leaked or hacked.
(iii) Another benefit of using a hybrid blockchain is the low transaction cost as it
requires few nodes to verify the transactions. Therefore it also takes less time for the
network to reach a consensus.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 11/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
people who need them. Conversely, the managing authority decides which aspects of
the network should be made public depending on what data needs to be shared.
(ii) The second application of hybrid blockchain is in government activities like voting,
creating public identification databases, automating acquisitions, providing social/
humanitarian assistance, etc. The hybrid blockchain offers the government the
necessary control and enables the public to access it. Totally private or public
blockchains will not work as they either hinder users’ access or reveal too much data.
The hybrid blockchain can ensure that the government stays in control of the data and,
at the same time, gives access of data to the public. Thus, maintaining transparency in
government operations.
(iii) The third application of hybrid blockchain is in real estate. Companies can use a
hybrid blockchain to run systems privately but show certain information, such as
listings, to the public.
(iv) Hybrid blockchains have applications in various other sectors like supply chains,
banking, finance, trade, enterprise services, etc.
If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and
their applications, click the below link.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 12/13
2/12/23, 11:43 AM Types of Blockchain (Part 4- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Happy learning!
Blockchain Game
Search Medium
Get an email whenever Techskill Brew publishes.
Your email
Subscribe
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
https://medium.com/techskill-brew/types-of-blockchain-part-4-blockchain-basics-c0b2e40c1780 13/13
2/12/23, 11:46 AM Merkle Tree in Blockchain (Part 5- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Save
The data/transactions in a block are not stored as plain text; instead, they are stored in
a data structure called the Merkle tree. In other words, the Merkel tree serves as a
summary of all the transactions in a block. Every transaction in a block is uniquely
hashed by hash functions like MD5, BLAKE2, SHA-1, SHA-256 to produce a digital
fingerprint of the entire set of transactions. Each pair of hashed transactions is hashed
together by the hash function, and this process continues until there is one hash for
the entire block.
Structurally, the Merkle tree is a type of binary tree, where the hashes of the
transactional data on the bottom row are referred to as “leaf nodes,” the intermediate
hashes as “branches,” and the hash at the top as the “root.” Merkle tree is also called
the Hash tree. Each block in the Blockchain has one Merkle root.
The Merkle tree of transactions A, B, C, and D; Hash ABCD is the Merkle root/root hash
Suppose there are four transactions in a block, as shown in the above figure. Each of
the four transactions (A, B, C, and D) has a unique hash (Hash A, Hash B, Hash C, and
Hash D). Then every pair of these hashed transactions combine together to create
another hash. In this case, hashed transaction A pairs with hashed transaction B to
generate a new Hash AB. On the other hand, hashed transaction C pairs with hashed
https://medium.com/techskill-brew/merkle-tree-in-blockchain-part-5-blockchain-basics-4e25b61179a2 2/8
2/12/23, 11:46 AM Merkle Tree in Blockchain (Part 5- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
transaction D to create a new Hash CD. The Hash AB and Hash CD are the branches of
the Merkle tree. The Hash AB and Hash CD are then grouped together by the hash
function to produce the Hash ABCD, which is the Merkle root/root hash for this Merkle
tree. Merkle root is then stored in the block header.
A block is composed of a header and a body. The block header contains Merkel root,
Timestamp, Block Version number (indicates which set of block validation rules to
follow), Difficulty Target, Nonce, and Previous Hash. On the other hand, the block
body contains all confirmed transactions within the block.
the five transactions (A, B, C, D, and E) will have a unique hash (Hash A, Hash B, Hash
C, Hash D, and Hash E). The pair of hashed transactions A and B is hashed to produce
the Hash AB. Similarly, the pair of hashed transactions C and D is hashed to produce
the Hash CD. But hashed transaction E is left without a pair to hash into a new branch.
Since the Merkle trees are binary in nature, they require leaf nodes to be even for them
to work. Therefore, if there happens to be an unpaired hash, then that hash is copied
and paired with itself. In this example, Hash E is duplicated to pair with itself to be
hashed to form Hash EE. After this, the Hash AB and Hash CD are grouped and hashed
to create a new Hash ABCD. On the other hand, Hash EE gets duplicated and pairs with
itself to be hashed to form Hash EEEE. The hashes ABCD and EEEE are further
grouped and hashed to produce one hash, i.e., the Merkle root.
The Merkle tree of transactions A, B, C, D, and E; Hash ABCDEEEE is the Merkle root/root hash
This root hash of a block is then used to find the block’s unique valid hash with leading
0’s. For example, the Merkle root/root hash of a block #72608 is
a1c6d67c992a70fca66188e178d9ca7c20d5c775393948f19955be7f0952c0f. The root hash
is then combined with other information of the block (block number, the previous
block’s hash, the timestamp, the difficulty target, and the nonce) and run through a
hash function to produce the block’s unique and valid hash with leading 0’s:
00001a03b7328189f5f7154681c5827a1b2fce2fcb5301a8e412e22ea9a7859. Once the block
gets the valid hash, it becomes a part of the Blockchain, and further new blocks can be
added to this block.
https://medium.com/techskill-brew/merkle-tree-in-blockchain-part-5-blockchain-basics-4e25b61179a2 4/8
2/12/23, 11:46 AM Merkle Tree in Blockchain (Part 5- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
https://medium.com/techskill-brew/merkle-tree-in-blockchain-part-5-blockchain-basics-4e25b61179a2 5/8
2/12/23, 11:46 AM Merkle Tree in Blockchain (Part 5- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
verified with every other hash on the Blockchain to prove that nothing has been
altered or tampered with.
Since the hash function is said to be deterministic, it generates the same hash
whenever the same input is passed through it. Therefore, if an individual tries to
double-spend his digital currency, a hash will be generated for that transaction. If that
hash matches with the existing records present on the Blockchain, that transaction is
rejected. Hence, double-spending is prevented.
Merkle proofs
Merkle proofs allow for verification of a specific transaction/content in a large body of
data. In Blockchain systems, there are two types of nodes:
(i) The nodes holding a complete history of Blockchain are called “full nodes.”
(ii) And other nodes are called “lightweight nodes.” A Lightweight Node contains only a
partial list of Blockchain, which usually includes just the block headers (containing
Merkle root) instead of its entire transaction history. The lightweight node can only
validate transactions included in a block without the need to download the whole
Blockchain.
When a lightweight node wants to verify a specific transaction, it uses the hash
function to obtain the hash value of that transaction. The full node sends all the hash
values to the lightweight node required for verification based on the structure of the
Merkle tree. Next, the lightweight node repeats the hash operation to compute the root
hash value. Then the root hash value obtained by the process is compared with the root
hash value sent by the full node.
Suppose a lightweight node wants to verify whether transaction D has been lost or
tampered with. For this, the full node sends the hash values Hash C, Hash AB, Hash
EFGH, and Merkle root to the lightweight node. First, the lightweight node finds the
hash of transaction D, i.e., Hash D using the hash function. Then Hash D, along with
the values Hash C, Hash AB, and Hash EFGH, are recomputed to generate Merkle
root/root hash. If the computed Merkle root and original Merkle root match, then it
can be verified that the Hash D is a genuine leaf of the Merkle tree, and thus,
transaction D is a part of the Merkle tree. On the contrary, if the computed Merkle root
https://medium.com/techskill-brew/merkle-tree-in-blockchain-part-5-blockchain-basics-4e25b61179a2 6/8
2/12/23, 11:46 AM Merkle Tree in Blockchain (Part 5- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
and original Merkle root do not match, then it can be confirmed that transaction D has
been tampered with.
If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and
their applications, click the below link.
Happy learning!
Blockchain Game
https://medium.com/techskill-brew/merkle-tree-in-blockchain-part-5-blockchain-basics-4e25b61179a2 7/8
2/12/23, 11:46 AM Merkle Tree in Blockchain (Part 5- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Your email
Subscribe
By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy
practices.
Search Medium
https://medium.com/techskill-brew/merkle-tree-in-blockchain-part-5-blockchain-basics-4e25b61179a2 8/8
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Save
Hash functions are one of the most extensively-used cryptographic algorithms that
generate a fixed-length output for any input data irrespective of its size and length. The
input data can be a word, a sentence, a longer text, or an entire file. The fixed-length
output generated for the input data is called a hash. Many types of cryptographic hash
functions/ algorithms are available like MD5, BLAKE2, SHA-1, SHA-256, etc. Secure
Hashing Algorithm 256, commonly referred to as SHA-256, is one of the most famous
cryptographic hash functions used extensively in Blockchain technology. It was
developed by the National Security Agency (NSA) in 2001.
When we pass a certain message through the hash algorithm, it generates a hash
against this input. Regardless of the size of the letters or numbers you input, the hash
algorithm always generates a fixed-length output. The fixed-length output can vary like
32-bit, 64-bit, 128-bit, or 256-bit depending on the hash algorithm being used. For
instance, SHA-256 generates a hash value of 256 bits, equivalent to the size of 64
characters.
Using a fixed-length output increases security since anyone trying to decrypt the hash
won’t be able to tell how long or short the input is simply by looking at the length of the
output. The only method to determine the original string from its hash is by using
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 2/9
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
“brute-force.” Brute-force basically means that one has to take random inputs, hash
them and compare them with the target hash. For instance, if the SHA-256 hash
algorithm is used, a brute-force attack would need to make 2^256 attempts to generate
the initial data.
Now, let’s discuss the important properties of a cryptographic hash function used in
the Blockchain:
A small change in the input value alters the Hash value significantly
One of the unique properties of a cryptographic hash function is that even a small
change in the input value brings about a drastic change in its output value. This is
referred to as the Avalanche Effect. For instance, when the first input, ‘Blockchain is
the future’ is passed through the hash function, a specific output or hash is generated.
But when a small change is made to the input, like, an extra exclamation mark is
added- ‘Blockchain is the future!’ you can see that the new hash is generated, which is
entirely different from the previous hash. This property of cryptographic hash
functions makes them resistant to hacking as no correlation can be derived about the
input data by just looking at the hash alone.
Computationally Efficient
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 3/9
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
One of the other crucial properties of a cryptographic hash function used in the
Blockchain is its quick computation. The hash function requires computers on the
Blockchain network to perform certain complex mathematical tasks to generate a hash
from the input data. So when we say that the hash function should be computationally
efficient, it simply means that the computers should be able to finish the required
mathematical task in a short time.
Deterministic
A cryptographic hash function used in the Blockchain must be deterministic. In simple
words, a hash function is said to be deterministic if it generates the same hash
whenever the same input is passed through it. No matter how many times we pass an
input ‘ Blockchain is the future’ through the hash function, it should always generate
the same exact output or hash every single time.
If different outputs are generated by a hash function for the same input, the hash
function will become useless, and it would be impossible to verify a specific input.
Pre-Image Resistance
The input for a cryptographic hash function can be any kind of data. This data can be a
number, a word, a sentence, a passcode, a song, a book, or a complete movie. But the
hash generated for any kind of input data by the hashing algorithm will be an
alphanumeric code and that too of a fixed length.
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 4/9
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Collision Resistant
Collision resistance is another important property of a cryptographic hash function.
Being collision-resistant simply means that it should be highly improbable to generate
the same output or hash for two different inputs.
As discussed earlier, the input for a hash function can be of any type, size, and length.
Therefore, there are infinite possibilities for the data input that can be fed into a hash
function. But the corresponding hash or output generated will have a fixed length. This
means that there will be a finite number of outputs that can be generated using the
hash algorithm. If inputs can be infinite and outputs are finite in number, it is quite
possible that more than one input can produce the same output.
So the goal of being collision-resistant is to make the probability of finding any two
such inputs which share the same output negligible. So if a hashing function is
collision-resistant, this possibility won’t pose any security risk to the data.
One-way functions
Hash functions are generally referred to as one-way functions because they are not
reversible. While a hash function is a cryptographic function, it’s not encryption.
Encryption works by encrypting the relevant data with an encryption algorithm and an
encryption key. This results in a ciphertext that can only be viewed in its original form
if decrypted with the correct key. A hash function, in contrast to encryption, works as a
one-way function; in simple words, if you have a hash, you can not decrypt it to find
the corresponding input. So in a real-life scenario, even if a hacker gets access to a
hash output, it is completely useless as he can’t decrypt it to get the input.
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 6/9
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
To help you understand it in a better way, let us take an example — Suppose Mr. A
holds the land entitlement of a piece of land. That information is stored with the
relevant Government Authority in their database. Now, this land record data is given a
unique hash using a hash function. As the record is a centralized record, it can be
tampered with, and changes can be made in the records by some corrupt officials
because of their personal gains. Assume that some corrupt official tampers the data
and changes the land area Mr. A owns. In this case, when the altered land record data
will be passed through the hash function, the hash generated would be different from
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 7/9
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
the previous one. Thus, indicating that the land data has been tampered with. So this is
how a hash can be used to track and validate the data.
On the other hand, it is not possible to decrypt this hash and find out that it represents
land record data for the land owned by Mr. A. Therefore, we can say that a hash can be
used to track and validate the information but can’t decrypt and find the original data.
If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and
their applications, click the below link.
Happy learning!
Blockchain Game
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 8/9
2/12/23, 11:47 AM Hash Functions in Blockchain (Part 3- Blockchain Series) | by Techskill Brew | Blockchain 101 by Techskill Brew | Medium
Your email
Subscribe
Search Medium
https://medium.com/techskill-brew/hash-functions-in-blockchain-part-3-blockchain-basics-c3a0286064b6 9/9