With a four-billion-dollar ICO and everyone in the blockchain community raving about it, EOS took the blockchain sphere by storm in 2018. The credit clearly goes to its father, Dan Larimer – the mastermind behind various other mainstream blockchain projects such as Bitshares and Steemit. However, due to the success of these well-marketed ones, one of Dan’s projects has always been ignored: Graphene blockchain. The blockchain community is privy to the fact that EOS, Bitshares, and Steemit would have never seen the light of day if Dan hadn’t come up with Graphene, one of the most scalable blockchains.

But because of a lack of documentation, the potential of this underrated gem is still isn’t realized in the circle.

So, here’s a handy guide for those who wish to understand and learn about Graphene blockchain. Keep in mind that this article is the first in the duology of our graphene blockchain tutorial. If you want to read these articles in a series, here’s the link to open the second one in a new tab.

Consensus in Graphene Blockchain

As most of us know, Bitcoin and Ethereum are based on POW consensus mechanism, where all the nodes can participate in the competition of adding blocks to the blockchain. The POW mechanism seems completely decentralized on paper, but in reality, with increasing load on the system – outgrows the computational power needed to mine these blocks. At a certain point, it becomes nearly impossible for a person with a desktop computer to add any value to the system. In such scenarios, only huge mining rigs and pools are able to mine and add blocks.

Graphene deqode
It is clear that Ethereum in its current form is not completely decentralized as the three major rigs/pools contribute to more than 50% of blocks produced.

POW based blockchains are facing a major backlash. This is due to the amount of power being used in the mining process. As reported by CBS, the Bitcoin network alone consumes more electricity than 159 individual countries, including Ireland.

With these drawbacks, there was always a growing need for a less power hungry and more decentralized consensus mechanism. This is where DPOS stepped up.

The Delegated Proof of Stake Consensus (DPOS)

Graphene blockchain is based on the DPOS consensus mechanism, where ‘N’ number of witnesses are selected via continuous voting by stakeholders to produce blocks. This ‘N’ is an odd number. Only these witnesses produce the blocks in their respective time slots until the next maintenance interval. After the maintenance interval, the algorithm chooses the next set of witnesses based on the voting results. It is important to understand here that:

  • Only stakeholders can participate in the voting process
  • One stakeholder can only vote one witness.

Apart from witnesses, the stakeholders also elect delegates who have the privilege of proposing changes to the network parameters. These changes range from something as simple as transaction fees – to the number of elected witnesses. A particular majority of delegates approve the proposed changes. Post this, a two week period is given to the stakeholders. During this, they may vote out the delegates and veto the proposed changes (note that these network changes aren’t very likely to be proposed).

Thus, under DPOS it is safe to assume that the administrative authority rests in the hands of the users, just like a democracy. But unlike witnesses, the delegates are not compensated for retaining their positions.

Case Study: Learn how we helped an energy company using Graphene blockchain.

Testnet Setup

Let us kick this off by running a testnet on your local setup. Firstly, you have to install boost libraries in your system. You can install them from here:

https://github.com/cryptonomex/graphene/wiki/build-ubuntu

Clone this repo: https://github.com/cryptonomex/graphene.git. After that, clone the sub-modules by this command:

git submodule update –init –recursive

Make the build by the following steps:

cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=”-fpermissive” .
make

Once the build is successful, create the genesis file

mkdir -p genesis
programs/witness_node/witness_node –create-genesis-JSON genesis/my-genesis.json

Edit the genesis.json file accordingly. For instance, you could specify how much accounts should be there initially, maintenance interval time, ’N’ – the number of witnesses, initial balances in accounts etc.

Then, start the witness-node with the following command depending on the number of witnesses you have initialized in my-genesis.json

./witness_node –RPC-endpoint “127.0.0.1:8090″ –enable-stale-production –genesis-JSON genesis/my-genesis.json -w \””1.6.0″\” \””1.6.1″\” \””1.6.2″\” \””1.6.3″\” \””1.6.4″\”
graphene_node_start

Boom! You now have Graphene blockchain’s testnet running on your system.

You now have a basic understanding of Graphene blockchain’s DPOS consensus. Please click here to navigate to the next article in the series, where we will discuss about more concepts like multi-node setup and smart contracts on Graphene.

If you have any query regarding this blog, please email the author at shanu@deqode.com. Drop your email here if you want to build a project on Graphene blockchain.

Code reference: https://www.monetha.io

Author

Graphene expert and Solutions Engineer at Deqode who is proficient in scaling customized blockchain applications. Experienced with Ethereum, Bitshares and Hyperledger, Shanu plays a crucial role in developing end-to-end blockchain applications for businesses.

1 Comment

  1. ‘One stakeholder can only vote one witness’

    This is not correct, one stakeholder can vote on as many witnesses, committee, and worker proposals as they wish. Stakeholder cannot vote for more witnesses than have been approved as number of active witnesses by the committee … i.e. they can vote for up to 30 witnesses. Otherwise thank you for nice summary 🙂

Write A Comment