Building a blockchain

Step 1: Create the folder structure and main.js

Step 2: Create a block

Step 3: Calculate the Hash value of the block

installing crypto npm package to import SHA256 library

Step 4: Create a Blockchain class

Step 5: Create a Blockchain

Stress test

koreCoin returns a JSON string on the Terminal

Tampering with the chain

terminal log

Tampering with the chain smartly

Congratulations! You have now implemented an almost immutable Blockchain on your machine.

Link to complete code

Closet Zen master. Part cyborg.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Little facts I learn day by day

Adding Users in Active Directory Powershell Script

4 | How to create a Crowd sensing Application using Generic sensor API and Javascript

Essential Frontend Web Development Tools You Should Know

Publishing a real NodeJS package: Implementation and Tests

JavaScript: The privacy and security nightmare

Fed up with Promises? Try Generator Functions.

3 Points to Consider before Migrating Away from React Because of Facebook’s ‘BSD+ Patent’ License

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Closet Zen master. Part cyborg.

More from Medium

The future of fabric and the end of food waste

Make Money during World War III

The Block Report: $15 million in Economic Activity for Genesis Block Companies

DeFi 101: Everything you need to know about DeFi, In simple terms …