2. What is Ethereum?
“Ethereum is a decentralized platform for applications that run exactly as programmed
without any chance of fraud, censorship, or third-party interference.”
3. Well, the code written on the Ethereum blockchain can’t be altered, tempered, or
hacked. This tamper-proof feature ensured by cryptography makes it an interesting
application of the blockchain technology.
Ethereum is not just a blockchain; it’s a decentralized programmable blockchain-
based software platform. Uses its own cryptocurrency asset (called Ether – ETH)
which runs the Ethereum network.
Ethereum allows you to build and execute smart contracts and Distributed
Autonomous Applications (DApps), without censorship, downtime, or any third party
interference.
The inbuilt programming language Solidity is used to write smart contracts
and DApps. After that, the cryptocurrency asset (Ether) helps in executing these
apps and contracts.
Ethereum is also called programmable money.
Cont..
4.
5. What is proof of work?
PoW is the consensus algorithm, most cryptocurrencies
including Bitcoin run on “proof-of-work.”
Proof-of-work as a process has the following steps to it:
The miners solve cryptographic puzzles to “mine” a block to add to
the blockchain.
This process requires an immense amount of energy and
computational usage. The puzzles have been designed in a way
which makes it hard and taxing on the system.
When a miner solves the puzzle, they present their block to the
network for verification.
Verifying whether the block belongs to the chain or not is an
extremely simple process.
This is the system that Bitcoin and Ethereum (till now) have been
using.
6. The problem with proof of work.
As it turns out, there are quite a few problems with
proof-of-work.
First and foremost, proof of work is an extremely
inefficient process because of the sheer amount
of power and energy that it eats up.
People and organizations that can afford faster
and more powerful ASICs (application-specific
integrated circuit) usually have a better chance of
mining than the others.
As a result of this, bitcoin isn’t as decentralized as
it wants to be.
As you can see, ~65% of the hashrate is divided
among five mining pools alone!
These big mining pools can simply team up with
each other and launch a 51% on the bitcoin
network. The hashrate distribution graph:
7. What is Proof of stake?
Proof of stake will make the entire mining process virtual and replace miners with
validators. There is minting/forging instead of mining.
This is how the process will work:
The validators will have to lock up some of their coins (Ether) as stake.
After that, they will start validating the blocks. Meaning, when they discover a block
which they think can be added to the chain, they will validate it by placing a bet on it.
If the block gets appended, then the validators will get a reward proportionate to their
bets.
There are two major types of Proof of stake algorithms:
Chain-based PoS
BFT-style PoS.
The chain-based PoS algorithm randomly selects a validator during each time slot (for
example every 10 seconds). And then this validator has the right to create a single-block.
The BFT (Byzantine Fault Tolerance)-style PoS: The validators are randomly chosen for
each round end up agreeing on whether or not the block becomes part of the chain.
8. The Biggest Roadblock to Proof of Stake
Ethereum developers always planned to eventually move on to proof of stake. However, before they could do
so, they had to address one of the biggest flaws of proof of stake(POS).
Consider this scenario for a moment:
There are a main blue chain and a red chain sort of branches from the
main itself. What is there to stop a malicious miner from mining
on the red blocks and force a hard fork?
which In a proof-of-work(POW) system, this risk can be mitigated.
Suppose malicious miner Alice wants to mine on the red chain. Even if
she dedicates all of her hash power to it, she won’t get any other miner to
join her on the new chain. Everyone else will still continue to mine on the
blue chain, because it is more profitable and risk-free to mine on the longer chain.
POW is extremely expensive resource-wise. It makes no sense for a miner to waste so much resource on a
block that will be rejected by the network anyway. Hence chain splits are avoided in a proof of work system
because of the amount of money that the attacker will have to waste.
However, things look a little different when you bring in POS. If you are a validator, then you can simply put
your money in both the red chain and blue chain without any fear of consequence at all. No matter what
happens, you will always win and have nothing to lose, despite how malicious your actions maybe.
This is called the “Nothing at Stake” problem, and this is something that Ethereum had to address. They
needed a protocol which could implement POS and mitigate the “Nothing at Stake” problem.
9. Etheruem Casper
Casper is the POS protocol that Ethereum has chosen to go with. It has implemented a
process by which they can punish all malicious elements.
This is how POS under Casper would work:
The validators stake a portion of their Ethers as stake.
After that, they will start validating the blocks. Meaning, when they discover a block
which they think can be added to the chain, they will validate it by placing a bet on it.
If the block gets appended, then the validators will get a reward proportionate to their
bets.
However, if a validator acts in a malicious manner and tries to do a “nothing at stake”,
they will immediately be reprimanded, and all of their stake is going to get slashed.
Casper designs harsher incentives to guarantee network security, including punishing
miners who go offline, unintentionally or not.
This means that validators will have to be careful about their node uptime. Carelessness or
laziness will lead to them losing their stake. This property reduces censorship of
transactions and overall availability.
10. Proof of Stake Problem Solved
In a proof of work protocol, it doesn’t matter whether a miner mined on the blue
chain or the red chain. Both the honest and the malicious miner would have spent
the same amount of resources.
In Casper, however, if an honest validator mines on the blue chain then they would
get reward proportionate to their bet, however, a malicious miner will get their stake
slashed off for betting on the red chain.
11. A Tale of Two Caspers
Casper is not one specific project. It is a combination of two research projects which is
currently being undertaken by the Ethereum dev team.
The two projects are:
Casper the Friendly Finality Gadget (FFG)
Casper the Friendly GHOST: Correct-by-Construction (CBC)
12. Casper FFG
Casper the Friendly Finality Gadget aka Vitalik’s Casper is a hybrid POW/POS
consensus mechanism.
What is finality?
Finality, means that once a particular operation has been done, it will forever be etched
in history and nothing can revert that operation.
This is pretty much designed to ease the transition into proof of stake. The way it is
designed is that there is a proof-of-stake protocol overlaying on top of the normal
ethash proof of work protocol. So while blocks are still going to be mined via POW,
every 50th block is going to be a POS checkpoint where finality is assessed by a
network of validators.
This is the version of Casper that is going to be implemented first.
13. Casper CBC
Casper CBC aka Vlad’s Casper uses the correct-by-construction (CBC) protocol.
So what is, is the CBC protocol?
This is what a normal protocol design looks like:
You formally specify the protocol.
Define the properties that the protocol must satisfy.
Prove that the protocol satisfies the given properties.
This is what a CBC protocol looks like:
You formally but partially specify the protocol.
Define properties that the protocol must specify.
Derive the protocol in a way that it satisfies all the properties that it was stated to specify.
In layman’s terms, you are sort of deriving the protocol dynamically. One of the ways to derive
the full protocol is to implement an estimate safety oracle called an “ideal adversary” which
does one of the following:
Raises exceptions of a fault of a justified estimate.
Lists out any future failures that can happen.
14. Why do we need Ethereum Casper?
There are several advantages of implementing proof-of-stake. They can all be broadly
listed down among the following categories.
Helps achieve decentralization.
Energy efficiency.
Economic security.
Scaling.
Transition to POS.
15. Achieving Decentralization
As we have seen above, POW protocols are not really decentralization friendly
anymore.
As you can see, the majority of the hashrate is concentrated within some specific
pools, and this means that no matter what happens, they will always have a better
chance of mining blocks and obtaining rewards than anyone else.
Because they can obtain more money, they
can, therefore, afford better and faster ASICs.
This basically means, no matter what happens,
big mining pools will always have an edge
over individuals and smaller pools. In other
words, the rich will always get richer.
Proof-of-stake makes this completely
irrelevant by making mining completely virtual.
16. Energy Efficiency
A big problem is that PoW consumes a lot of electricity.
The annual global mining costs of bitcoin is $1,423,794,674 and it alone annually consumes
28.48 TWh worth of electricity. Most countries consumed less electricity than these Miners
So it is obvious that bitcoin eats a lot of power, and there is a lot of money spent on the
resources. While there is no doubt that bitcoin and POW has made a lot of positive social
changes, we should at least see what a large scale POS system can do and whether it
work just as well without consuming so much power.
17. Economic Security
The biggest advantage that POS, and especially Casper, has is its economic
security. Think about this, suppose you are a validator and you have your own
money stored up as the stake in the network. It is in your own interests to act in the
best interest of the network. Why would you act maliciously knowing that there is a
huge part of your stake which can be slashed away and taken over if you do?
Why would you attack a network and harm the coin’s value when you have so much
of your currency locked up in it?
Also, this “slashing effect” removes the chance of a “spawn camping attack” (When
a 51% miner cartel keeps attacking over and over again, rendering the chain useless)
Spawn attacks can be prevented in POS by the simple fact that just one attack will
lead to the slashing and removal of the invested stake. And if you don’t have any
stake invested you cannot take part in POS validating.
18. Scaling
In decentralised systems, there is the inherent problem of scalability. The most obvious way
that POS is going to help scalability is by enabling sharding.
What is sharding?
“horizontal partitioning of a database”
Sharding is a term that has been taken from database systems. Let’s see what sharding
means with respect to the database. Suppose you
have a huge bulky database for your website.
Having a bulky database not only makes searching
for data slower, but it also hinders your scalability.
So, what do you do in this case?
Do a horizontal partition on your data and turn
them into smaller tables and store them on
different database servers
These smaller databases are known as shards of
the larger database. Each shard should be
identical with the same table structure.
19. Sharding with POW is not impossible, but it is hard.
So what will happen if we do implement sharding in a POW protocol?
Sharding will make processing faster by splitting a state into different shards.
However, if we are using POW, the smaller shards will be in danger of being taken
over by malicious miners because of its low hashrate. In fact, this is the biggest
reason why POW blockchains can never implement sharding, any and all small
shards can be easily taken over.
This risk is completely mitigated in POS since it doesn’t have the concept of mining.
Cont…
20. Transition to Proof of Stake
People, in general, are not that good with change. When they get used to
something, it is very difficult for them to get out of that comfort zone.
It will be incredibly irresponsible to drop the POS bomb on the people and expect
them to just get with the times. It might reduce the public’s faith in the system, and
the value of Ethereum may drop. Hence, it is much more prudent to have a gentle
transition from POW to POS that Casper FFG is planning to do.