Proof of Stake

Is a consensus mechanism that is developed to address the problems with Proof of Work like Energy Consumption, 51% Attack, etc. Below is a basic implementation of Proof Of Stake to choose a validator who adds the next block to the chain.

Contract Address: 0x8121e709F247B848756a0A052a0d4083e077C396

Deployer Address: 0xc1FB5B292FCa463211ADf25844fd39F94F1544fb

STEP 1

The first step is to add a validator with basic details.A user stakes some of the native tokens of the network which makes that node eligible for mining. The probability of a node being selected as a miner depends on the amount it Staked.

To simulate the process, please change to other address from metamask and submit the form. For making it more clear, add two or more validators.

Add Validator

Connected Account: NULL

STEP 2

Change the metamask account to other address and add sample transactions.

They’ll be added to the pool and remain uncommitted until the block is mined.

Add Transaction

From Account: NULL

STEP 3

Followed by addition of user, we normalize the stake values of all users and generate a roulette wheel.

Click on below button to Simulate

STEP 4

The final step will be choosing the validator.

The network randomly chooses a validator. There will be high probability to the user who staked most as per the roulette wheel generated above.

Note: Only Admin can do this

STEP 5

Mining Procedure will be initiated once the choose validator clicks on below button.

Note: Only the choosen validator can perform this action.

The Blockchain

Here is the generated blockchain.

Nonce:

0

Number of transactions:

0

Validator:

Previous Block Hash:

Current Block Hash: