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

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.
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.
Followed by addition of user, we normalize the stake values of all users and generate a roulette wheel.
Click on below button to Simulate
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
Mining Procedure will be initiated once the choose validator clicks on below button.
Note: Only the choosen validator can perform this action.
Here is the generated blockchain.
0
0