Creating a blockchain with Javascript (Blockchain, part 1)

preview_player
Показать описание
Learn how to write your own Blockchain with JavaScript. In this video I'll show you what is behind a blockchain by using simple code. It's not a complete implementation, but enough to understand how blockchains work and how they guarantee that blocks can never be changed.

After creating our blockchain we'll try and tamper with it. This will demonstrate a blockchains ability to detect fraud.

Next video (implementing proof-of-work):

💌 Sign up for Simply Explained Newsletter:
Monthly newsletter with cool stuff I found on the internet (related to science, technology, biology, and other nerdy things)! No spam. Ever. Promise!

💰 Want to buy Bitcoin or Ethereum?
Buy for $100 and get $10 free (through my affiliate link):

► Source code
Available on GitHub:

🌍 Social

#blockchain #javascript #coding #crypto #nodejs #simplyexplained
Рекомендации по теме
Комментарии
Автор

I do not understand anything about coding, but the way this mysterious gentleman stated everything, I was completely hooked up seconds by seconds till the end. I guess some peoples do have some extraordinary quality of teaching. Thanks Savjee

tauwheed
Автор

Great video. I'm a programmer so this made a lot more sense to me than watching someone try to describe how the blockchain works in a spoken presentation!

vegn_brit
Автор

After +1 year of courses, projects documentation and tutorials I could finally understand how Javascript classes work thanks to this video. Thanks!

FacundoTroitero
Автор

Savjee, I have finally been compelled to subscribe to a youtube channel. As an 'old dog' programmer, you have got me moving on blockchains more than the dozens and dozens and dozens of articles I have read. For a 'show me' programmer, this is just what the doctor ordered and I thank you for taking to the time to share your knowledge and for doing such an easily understood walk-through. Well done young man...

owenparker
Автор

So much information fit in this 15 minutes and this finally made blockchain click in my head. Thank you for this!

Procyon
Автор

For my internship, I was recently requested to do a simple web3-based project. This is what I've decided to use. Thanks for this project and for being a great teacher😁

blackswan
Автор

Oh man, after watching heaps of videos on bitcoin, etherium and block chain. This is the first time I really got my head around only because we think in terms of code. Love you for that.

saxenaabhi
Автор

Great tutorial, thank you.

I was "playing" with your code and i've just discovered that changing the "Genesis block" (block 0) attributes is possible (the chain stays valid). This is due to the "isChainValid()" method; as you can see, the method has a "for(var i = 1; i < this.chain.length; i++){ [...]" which starts from "i = 1". This means that no controls are applied to the first block (data can be changed without any problem).

A simple work-around is to change the "for([..])" loop (make it starts from "i=0" and check the previous block only "if(i>0)").

Thanks for your time and knowledge

mauriziomaisto
Автор

My gosh, in terms of covering the basic fundamentals this is an amazing intro!

lucysluckyday
Автор

Major in Law but I think this guy has successfully guided me through the jungle of IT and let me know a little bit of how Blockchain are created and its security mechanism

shorttripsvn
Автор

Demystified this for me, finally! Thank you so much for making these concepts so tangible.

prabhusingh
Автор

Thank you for sharing this. Today I decided to learn about blockchain. I hope I can learn enough to produce something to help make our world a better place.

breal
Автор

Very well done video. Steady pace, clear code, and an engaging voice. The blockchain just became a whole lot less intimidating and mysterious, so thank you.

jessss
Автор

I know nothing about coding, but this example really made me understand what's happening with blockchains - thank you!

CourtneyZinckgraf
Автор

This looks similar to linked lists in Data Structure with added security!

vasanthkumar
Автор

Very clean explanation, and also very clean english for those who doesn't speak english natively. Thanks!

fernandofradegrada
Автор

"Simply Explained" indeed ! Amazing, cleared a lot of concepts.

TheStoriesProductions
Автор

I swear, this is the video finally where I really understood the concept of Blockchain. I have watched many videos but was getting just repetitive things time and time again.
Thank You very much.
I have like and subscribed to you channel.

FreedomForKashmir
Автор

Damn bro, that light theme doesn't hurt your eyes?

Ricardoromero
Автор

These hands-on turorials really come in handy to grasp the blockchain concepts.
There's this scenario where tampering the data of the final block in the chain will lead to the block getting invalidated due the mismatch of the hash generated post-tampering with the existing hash of the final block. So, this will prompt a "false" in the chain validation.
But, if we recalculate the hash after tampering with the data (only for the final block), it prompts us the chain being valid since the hash has been regenerated (modified after the hash mismatch). Thus the validity of the chain turns out to be "true" which is sort of a glitch from the blockchain conceptual perspective, but is correct from the logical point of view

supratimbasu