Friday, 22 December 2017

Java Blockchain Mining and Consensuses

Mining and Consensuses in Blockchain

In the previous blog we got to know what a Blockchain is, and how you can we create a Java based Blockchain which can not be tampered (Integrity).

Blockchain has couple of more design principles other than Integrity : Decentralized, Consensuses, Public Ledger etc. Before we jump to Mining it is important to understand these concepts first.

Public Ledger 

Assume that different participants are adding transactions and blocks to a Blockchain. That means there has to be a central Blockchain that is accessible to all, since all participants needs to add block to the existing Blockchain, This means there has to be a master participants governing and storing the Blockchain. But this is against the principle of Blockchain (Decentralized). There is no master participant in the network. To solve the above issue, each participant keeps a copy of the Blockchain with itself. Once a block is added, it is distributed across the network and all participants update their Blockchain. This concept is called Public Ledger. A ledger (list of transactions) which is public.

But this causes another problem in the network.

Lets assume that 2 participants are trying to add a block, simultaneously to a Blockchain.  Only one can be allowed to do so and the other has to be discarded since the previous hash in that block will be invalid.

Java Blockchain tutorial

This blog provides a working Blockchain example in Java.

Before we jump into the actual code, lets first understand the basics of Blockchain.

Introduction :

Lately, you might have herd a lot of buzz around different crypto-currencies emerging in market : Bitcoin, Etherium, Ripple, Dash ... and the list goes on. The market share of Bitcoin has gone exponentially up from $ 4000 to $ 17000 in just three months. Other currencies are also following the same trend.

The reason that these currencies are getting so much traction is the common architecture design they share : Blockchain

Bitcoin is not Blockchain and Blockchain is not Bitcoin. Bitcoin is just one implementation of crypto-currency use case that can be build on Blockchain.

Share the post