Casper is the idea of Proof of Stake (POS) in Ethereum. It is being designed by Vlad Zamfir, Vitalik B. and other community members. Vlad came in touch with Ethereum community in September 2014. Ethereum foundation team had wanted to have Proof of Stake (POS) even before the Ethereum network was launched, but because it wasn't designed completely, they started Etherum blockchain with Proof of Work algorithm, keeping POS in the roadmap. Vlad Zamfir introduced the concept of Casper “the friendly ghost” in his blog in Aug 2015. It is called Casper “the friendly ghost” because it is an adaptation of some of the principles of the GHOST (Greedy Heaviest-Observed Sub-Tree) protocol for proof-of-work consensus to proof-of-stake.
Proof of Stake - Security deposit based protocol
The economics in digital currency works with consensus, that needs to be maintained in order for digital currency to continue having its price just like Proof of Work as started with Bitcoin. Casper in Ethereum is introduced with security-deposit based economic consensus protocol to help accomplish a lot more in blockchain network.
The basic concept of 'Proof of Stake' is the reliability of the players on the network which is signed by the security deposits behind the key. The nodes, also called “bonded validators”, must place a security deposit (an action called “bonding”) in order to serve the consensus by producing blocks. The use of security deposits addresses the “nothing at stake” problem, and ensures that behaving badly is expensive. A validator has his deposit at stake, and if he misbehaves in an objectively verifiable manner, will end up losing it. In Casper, the protocol directly controls the security deposits, which affects the incentives of validators. Specifically, if a validator produces anything that Casper considers “invalid”, then their deposit are forfeited along with the privilege of participating in the consensus process. In other words, Proof of Stake has direct control on anti-sybil mechanism because it is in the protocol itself.
It is an adversary that comes onto a public network and introduces a lot of nodes. It behaves correctly until have a very large majority of nodes and then start sabotaging the network. Essentially, sybil attack on Bitcoin can be solved in by using scarce resource which was difficult by sybils to get because they are scarce and sybils can’t multiply it by running up new nodes. The general idea of resolution is 'Sybil Resistant Force' because if something scarce, it can’t be copied by sybil attackers. Also, sybil hackers rely on the cheap nodes.
Casper specifies the policies about each player's profit and loss amount in different outcomes, if attackers do manage resources and perform an attack. It assures that people maintaining consensus can’t undermine their guarantee. If they do undermine, it will be expensive for them. One of the main design criteria in Casper is that it is expensive for an adversary to even conduct a successful attack. In POS, validators pledge their deposit, if anything goes wrong, part or whole of the deposit is forfeited.
Validator in Casper
A validator (bonded validator) in Casper is very much like the node or the miner of 'Proof of Work' protocol except they will be allowed to engage in the process only when they make security deposit. It is called as 'bonded validator' to ensure that validation in Casper cannot be done without security deposit.
In Casper, to produce a block, a validator needs to securely sign blocks and place bets on the consensus process otherwise known as 'gambling on consensus'. The possibility of being selected as validator is directly proportional to the deposit made.
How are validators decided?
To become a validator, there will be a minimum number of ETH to be deposited as security. If this deposit is less, then the cost of steering of the system will be very low and if it is too high not many people can participate. However, the team has not decided on the exact numbers of ETH for deposit as well as a minimum of validators needed to be on the system yet. Most likely, amount of ETH will be adjusted dynamically over the time but for validators, most of the team believes it shouldn't be less than 100 validators.
In case there are more than required validators available then, selection of the validators will depend on the crypto economic entry source available in the protocol. It will be process of sampling based on the size of the deposit. This will be based on data structure, betting rule etc.
Team is yet to take any decision on validator's rewards; if they should get block reward, transaction fee, or both. There is a possibility of issuance of variable amount as block reward instead of fixed. The team believes that the economics are better if clients are the only source of revenue of the validators because then validators can't profit by doing things that will stop the clients making transactions.
Validators profitability depends on
online availability. If one is offline for longer after being bonded, he loses part of deposit.
Protect the system from hacking. DDoS protection is recommended.
Performance and availability of other bonded validators. It's a risk which is not self-mitigated, and one can end up losing money if other nodes are not performing well.
Users and developers in Casper
Proof of Stake (Casper) acts like a consumer protection policy in Ethereum for users and developers. Lower latency significantly improves the user’s experience. In normal conditions transactions will finalize very quickly. However, the application developer still needs to deal with the possibility of forking, as they do in proof-of-work, but the consensus protocol itself provides them with a clear measure of what it would take for any given transaction to be reverted.
Correct validators online all the time.
Run Casper node on the computer.
Worry about being hacked / producing wrong block.
What is Gambling (betting) on consensus in Casper?
Betting is a process by which a validator exposes himself to the loss, if something doesn't turn out to be the case. Validators get engaged in a process of 'gambling' (or betting) whether or not blocks will be added in future history of chain. They are made to bet their deposits on how they expect everyone else to be betting their deposits. If they bet correctly, they earn their deposit back with transaction fees and possibly token issuance upon it – if on the other hand, they do not quickly agree, they re-earn less of their deposit. It works with consensus; by everyone synchronize on a condition at which they will lose their deposit. Therefore, through iterated rounds of betting validator bets converge. If someone likes to do 'revert history', then he has to bet against himself and ends up losing money he deposited on previous bet. This gambling game help prevent the chances of sybil attack in the system.
With Casper in operation, when one mines a block in the Ethereum blockchain, he is placing a bet (of his deposit) on the previous block will be included in the chain. The more blocks are in the chain, the more of the network's effort has gone behind the block on bet. Proof of Work consensus is also a betting scheme in a way; that miners bet their block will be part of the heaviest chain; if they eventually prove to be correct, they receive tokens, whereas if they prove to be incorrect, they incur electricity costs without any compensation. Heavy computational work is behind the security of consensus in Proof of Work but in Casper, it is the bet on the block as the security that the chain cannot be reverted. The economic cost of these Proof of Work bets adds up linearly in the number of confirmations (generations of descendant blocks), while, in Casper, validators can coordinate placing exponentially growing portions of their security deposits against blocks, thereby achieving maximum security very quickly.
Different type of behaviors of validators decide the amount of security at risk.
If one is on the network, put the deposit but never validated, then he will lose some (not all) of the deposit.
If one produces an invalid block, or try to revert finality of a block, then entire deposit is lost.
If one follows up a bad betting strategy or for some other reason he is not with the converging network, then he will lose some deposit. This will be less than if he was offline the whole time.
The whole idea is the bigger the deposit, more checks will be in place to ensure the block is valid.
Block Time in Casper
Casper does allow for faster block times than is possible with proof-of-work consensus. Vlad Zamfir, believes that with this technology in place it will be good to have less block time (as less as 1 block/sec or lower), it’s under discussion. It can be started with 4 second block time and can be pushed as low as it can go. The general concept in blockchain as explained by Vlad is 'the higher overhead one is willing to tolerate, the lower latency it can have'. The overhead planned in the network is linear in terms of blocks and quadratic for validators.
How will POW switch to POS in Ethereum?
The biggest question in mind of the present miners of Ethereum blockchain is how the actual switch will take place? Is it going to be instantaneous? When Casper is deployed on Ethereum, all the CPU and GPU will be disconnected? Hopefully, Vlad Zamfir’s answer will lower their anxiousness. For those who are planning to continue with Ethereum even after the switch from POW to POS, will have to download the upgraded software at their client. This upgraded software will inform every client that at some point in future, with consensus mechanism there will be the change from Proof of Work to Proof of Stake version. There will be the 'last block' of POW and the 'first block' of POS. It will be a kind of hard fork which has to be done based on consensus protocol. There may be disagreement on the 'last block' at the time POW blockchain fork but eventually one chain will win and everyone will agree on it. This will be finalized by the bonded validators of Proof of Stake.
Production cap on Ethereum
Most of the design criteria for the consensus protocol is independent of the idea of monetary consideration or issuance rate. So, there is no final word on the number of production cap, or a set rate of inflation; if it is going to be steady or declining. Team focus is to secure the transactions made on the network.
Is Ethereum via Casper is planning to ever deploy the decentralised governance process via its validators, the way Dash does via its master nodes?
If there ever be a decentralized governance platforms in Ethereum in future, it will not be run by the validators. Validators are the biggest source of risk to the protocol to all of the guaranties Ethereum wants to provide to its users and developers.
Ethereum aims to
Develop a platform for people to deploy their applications.
All transactions made are always correct.
Transaction they made cannot be reverted.
User wants access to their applications
If anything goes wrong in the system, it is mostly because of validator missing on some protocols.
Unlike other blockchains where mining is basically for personal business interest, Ethereum is planning a platform for users and developers. Ethereum community doesn't want to stick by basic business interest.
Advantage of Casper
Disadvantage of Casper
Conceptual and implementation difficulty.
Consensus failure due to finality -Finality means, when client wants to add some block but it doesn't get included in the blockchain. They will not get consensus on the block to be included in the chain and it would include large amount of security loss.
Censorship - If some validators do manage to censor, they get efficiently large pool that can actually be censored. Then they can censor evidence transaction, block request from other validators, and they can have monopoly on the validator set which can be used to do jack up the fees, undermine the users guarantees in several ways.
Last recourse to resolve either of the failure mode will be hard fork.
Transaction finality means, a transaction can never be reverted and that it's state is finalized. There are two relevant kinds of transaction finality:
the finality of the fact that the transaction will be executed at a height (which is from finality of its block, and therefore priority over all future blocks at that height), and
the finality of the consensus state after that transaction’s execution (which requires finality of its block and of unique blocks at all lower heights).
Censorship is a kind of risk to consensus protocols in which attacker’s forms coalition that aims to maximize the profits of their members at the expense of non-members. In proposed structure of Casper, validator's revenues are to be made up primarily of transaction fees. So, to earn an increased share of transaction fees, a majority coalition could censor the remaining nodes. Else, an attacker could bribe nodes to exclude transactions affecting addresses. To resist attacks conducted by majority coalitions, Casper is designed with anti-sybil mechanism in the protocol itself; censorship can be made expensive. It provides economic guarantee of censorship limit.
For more updates, technical blogs and general discussion on Ethereum and blockchain technology, please follow us @ether_world (Twitter), EtherWorld_co (reddit.com) and Ethereum Blockchain Technology (Facebook).