Bithereum’s Proof of Stake Concept

By Sachit Singh and Scott Wade

You have likely heard the terms Proof of Stake (PoS) and Ethereum’s Casper Protocol in the past and if you have been following the Ethereum Development group over the past few weeks, you may have even heard the latest news involving these developments. These technologies are the backbone of Bithereum Network, so it’s important to understand how PoS and Casper work in order to understand Bithereum’s consensus model.

Most cryptocurrencies including Bitcoin run on “Proof of Work” (PoW), a process that has miners solving cryptographic puzzles to mine a block to add to the blockchain. The problem with PoW is it is extremely inefficient and uses a massive amount of power and energy. To combat the issues of the current Proof of Work (PoW) model used to mine Bitcoin, Bithereum will implement a Proof of Stake (PoS) model based on Ethereum’s Casper protocol.

Enter Ethereum’s Casper

Casper is the PoS protocol that Ethereum has chosen to use to combat an issue known as the “Nothing at Stake” problem, as it is a process by which they can punish all malicious elements. We discussed the “Nothing at Stake” problem in our previous blog in case you need a refresher.

Under Casper, PoS will work a bit differently than a standard PoS model:

  • The validators stake a portion of their ETH as stake.
  • They will then start validating the blocks. Meaning, when they discover a block which they believe can be added to the chain, they will validate it by placing a bet on it.
  • If the block is appended, the validators will get a reward proportionate to their bets.
  • If a validator acts in a malicious manner and tries to do a nothing at stake, they will be immediately reprimanded and all of the stake will be slashed.

Casper is designed to work in a trustless system and anyone who acts in a malicious or Byzantine Fault manner, will be punished immediately. In a standard PoS protocol, this does not happen because malicious elements have nothing to lose.

But this isn’t the only place where Casper punishes the validators, the protocol designs harsher incentive to guarantee network security, including punishing miners who go offline, unintentionally or not. This means validators have to be careful about their node uptime. If a validator is careless or lazy, it could mean they will lose their stake. These protocol features give Casper a distinct edge over standard proof of work protocols.

It’s important to understand Casper is not one specific project, it’s an amalgamation of two research projects currently being undertaken by the Ethereum dev team: Casper the Friendly Finality Gadget (FFG) and Casper the Friendly GHOST — Correct-by-Construction (CBC). Bithereum’s PoS model follows closely to the FFG model.

Casper FFG

Casper FFG, also known as Vitalik Buterin’s Casper, was designed as a hybrid PoW/PoS consensus mechanism aimed to be the first implementation of Casper to ease the transition into PoS. Casper FFG was designed so there is a PoS protocol overlaying on top of the normal ethash PoW protocol. As blocks are mined via PoW, every 50th block would be a PoS checkpoint where finality is assessed by a network of validators.

In loose terms, finality means that once a particular operation has been done it cannot be reverted. Of course, as Buterin notes, no system can provide 100% finality. With a centralized system it is possible to hack into system or physically break into a registry, and decentralized systems have faced the same issues as well. But, according to Buterin, Casper is guaranteed to provide stronger finality than PoW for three reasons:

  • Two-thirds of validators make maximum odd bets to finalize the blocks. Because of this, there is little incentive for them to collude and attack the network since their own stakes are at jeopardy.
  • Validators have no incentive to collude and act maliciously because they always stand to lose money.
  • If double finality does occur, then users have a choice as to which chain they want to go for. Whichever chain gets the majority of votes becomes the dominant chain. Double finality in Casper will end up in a hard fork instead of a reversion.

The development of FFG has undergone some critical changes to improve the protocol by introducing sharding and a new algorithm to increase fault tolerance all the way to 99%. We will be watching closely to ensure Bithereum has the strongest PoS protocol possible.

Bithereum’s Casper w/ Opcodes

Since a Casper contract can be created using Ethereum smart contracts, which isn’t the case with Bitcoin, Bithereum will use various opcodes and introduce new opcodes to create a Casper-like contract. Bitcoin Opcodes, are defined as Operation codes from the Bitcoin Script language which push data or perform functions within a pubkey script or signature script. The existing opcodes that will be leveraged are OP_CHECKLOCKTIMEVERIFY from BIP 65, along with the proposed OP_GROUP in BCH. Additional new opcodes to be introduced will be as follows: OP_VALIDATORSELECT, OP_RANDAO, and OP_SLASH.

The first step is to create the designated address called the Bithereum Staking Address, which will be built into the network in which users will be able to stake their coins to be selected as validators. The opcode OP_CHECKLOCKTIMEVERIFY will be leveraged in order to freeze the funds in the Bithereum Staking Address for X amount of time, as defined by our staking guidelines at the time of the release.

For Bithereum, OP_GROUP will be utilized for the initialization of the staking process in each round, and work in conjunction with other opcodes to facilitate Bithereum’s PoS model. In October 2017, Andrew Stone issued a proposal for a new opcode to be implemented to Bitcoin Cash, referred to as OP_GROUP. What this opcode creates is a system of representative money in which certain tokens can be “colored” to create additional native tokens to represent something specific.

As elaborated by Stone, OP_GROUP colored coins allow direct representation of assets as satoshis and embed the colored coin transfer and validation into the Bitcoin scripting language in a manner that allows colored coins to take advantage of scripting and that makes them very easy to implement for existing Bitcoin Cash implementations. Coins are essentially colored, or “minted”, when a certain amount of the token is associated with a unique ID (color). Only the creator of this particular color has the ability to mint additional ones, as well as un-color, or burn the unique ID to change it back to the native token. The colored coins are going to inherit all the features normal bitcoins have, you can lock them, you can send them freely to anyone and you can use more advanced scripting options on them.

As Bithereum will begin as a PoS hybrid, and validators will only be chosen every 100th block, validator selection will be triggered upon the completion of the 99th block. The validator selection process will be done via the opcode OP_VALIDATORSELECT, which will contain Bithereum’s staking guidelines based on coinage as well as additional randomization methods that will be detailed at a further time, in order to pick 5 validators.

To specify, this new opcode will be added through a soft fork and will allow for the selection of various validators from the Bithereum Staking Address. Validators will be selected in a random, nondeterministic way with varying probabilities based on coinage. This makes for pre-planned attacks far more difficult. Coinage is calculated by N*D, where N is the number of coins you have staked, and D is the number of days those coins have been staked. There will be a maximum number of days you can have your coins staked in one go, which will prevent validators with large stakes from dominating.

As this process is occuring, another process will be occurring simultaneously via the opcode, OP_RANDAO. Like Casper, we will be using RANDAO to verify that validators get selected. When a validator sends their stake to the Bithereum Staking Address, they will receive a private, random number S that will be associated with their stake. After the selection process takes place, the selected validators are required to display their unique random number.

Once the validators have been selected and each staker has presented their unique S variable from RANDAO successfully, the selected validators’ coin colors (unique IDs) through OP_GROUP will be broadcasted via the blockchain explorer. At this point, the new opcode OP_SLASH is then utilized to ensure that each validator is displaying honest behavior, and if not, the particular malicious actor’s stake is lost/slashed immediately. Once the block has been validated post-slashing, the validators receive the block rewards in proportion to the amount each of them staked. This entire process is then repeated again after the next 100 blocks and so forth.

As staking begins, Bithereum will also have a built-in algorithm that is associated with the interval of blocks that will need to pass before staking takes place. As mentioned above, the validation checkpoint for staking will occur every 100 blocks to start, but this interval will be slashed in half every few months, for the most part. It will begin as every 100 blocks, but will reduce to 50 blocks after 2 months and keep on reducing as such. After a year, validators will be chosen after every 6 blocks. Once a year passes, the blocks will reduce 2 more times, once into 3 and finally into every block. In conjunction with this staking halving interval, a difficulty bomb will be implemented into the PoW mining efforts; as time passes, mining PoW blocks will become more difficult, ultimately pushing everyone into a pure-PoS system.

A Proof of Stake consensus model will not only be an economical advancement by increasing transaction speed and reducing fees, it will also be an ecological advancement by lowering the excessive energy consumption used by Proof of Work mining. Bithereum essentially creates an outlet for both Bitcoin and Ethereum, allowing Bitcoin to take on its new role as a store of value, and allowing Ethereum to be used for its true purpose as fuel for a worldwide computer that can contain a vast ecosystem of dApps on its platform. With Ethereum’s technology atop a modified version of Bitcoin, Bithereum will bring together the best of the two leading cryptocurrencies to create an unparalleled peer-to-peer digital currency.

Bithereum Network

Visit the Bithereum Network website to learn more. Stay-up-to date with our project news and announcements by following our social media channels: Facebook, Twitter, and LinkedIn. Join the conversation on our community channels: Telegram, and Reddit.