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. https://akor.in/

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

Recommended from Medium

Introduction to communicate between RN and Native

Solana Web3 Tutorial (4) — Interact with Token Program

JavaScript Algorithm: Equal Sides of an Array

Material UI — Styling Has Never Been So Easy

My first vanilla JavaScript Project: making a simple To-Do app

Tic Tac Toe game with Vue

What Is Lightning Development Framework And Its Stacks?

Using strict, standards, hoisting, and increasing maintainability!

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
Kore

Kore

Closet Zen master. Part cyborg. https://akor.in/

More from Medium

Jack Dorsey is building ‘Web5’ powered by Bitcoin

Top Five Cool Blockchain Trends To Look For In 2022

If Web 2.0 is great, what’s Web 3.0?

Finance Blog 5 (Jun 2022): Finance and Blockchain