viandwi24
blockchain-simulation
Vue

A Simple Blockchain Simulation with Javascript Nodejs and VueJs as Front End

Last updated Apr 17, 2026
63
Stars
12
Forks
0
Issues
0
Stars/day
Attention Score
32
Language breakdown
Vue 48.0%
JavaScript 42.9%
SCSS 9.1%
Files click to expand
README

Blockchain Simulation

This is just a Web to simulate how Blockchain works in a short and simple way. Built on javascript (nodejs) and using Vuejs as Front End. (Just for education only)

Preview

Demo

To see directly, you can see via the following link : Live Demo

Loader Animation create in After Effect, if you wanna see :

Usage

You can see the base lib in /blockchain-simulation/lib
const Blockchain = require('./blockchain')
const Transaction = require('./transaction')
const { KeyGenerator } = require('./signature')

// Create a new blockchain const mycoin = new Blockchain()

// Configure the blockchain mycoin.blockProofOfWorkDifficulty = 4

// create a new wallet const mywallet = (new KeyGenerator()).generate() // { publicKey: '...', privateKey: '...' }

// make default balance of wallet const systemTransaction = (new Transaction(mycoin.system.publicKey, mywallet.publicKey, 1000)).sign(mycoin.system.privateKey) mycoin.addTransaction(systemTransaction) // mycoin.mine(mycoin.system.privateKey)

// create a new transaction const destinationAddress = 'my-friend-address' const mytransaction = new Transaction(mywallet.publicKey, destinationAddress, 10)

// sign the transaction with my wallet private key mytransaction.sign(mywallet.privateKey)

// add the transaction to the blockchain mycoin.addTransaction(mytransaction)

// const mineAddress = 'miner-address' mycoin.mine(mineAddress).then(() => { // mine was successful console.log({ myballance: mycoin.getBalance(mywallet.publicKey), myfrinedballance: mycoin.getBalance(destinationAddress), minerballance: mycoin.getBalance(mineAddress), }) // get last block const lastBlock = mycoin.getLastBlock() console.log(lastBlock) // check valid chain console.log(mycoin.isValid()) // true })

This script you can see in /blockchain-simulation/lib/example.js

Contributors

You Can Contribute!!!

I will gladly accept your contribution for the better. You can follow the contributing guide listed here

Donate

You can support the development of this project at :

License

Blockchain Simulation is open-sourced software licensed under the MIT license.

© 2026 GitRepoTrend · viandwi24/blockchain-simulation · Updated daily from GitHub