3.1 Demonstrating a Blockchain - Video Tutorials & Practice Problems
Video duration:
5m
Play a video:
Video transcript
We will now go into a demo of a blockchain. So you see exactly how all the elements we've been discussing work together. To do so I'm gonna be leveraging an open source platform, which you can find at demoblockchain.org. And I will work through all these things so I encourage you if you want, after we finish the lesson, you could actually try it for yourself and check out all these concepts yourself. To do so I wanna point out the navigation of what we're gonna be talking upon. For this specific demo, I'm gonna be focusing on the section titled Hash from there I'm gonna be going to Block then I'm gonna be going to Blockchain and then I'm gonna be moving to the part called Distributed. I will not be discussing the sections called Token and Coinbase, which are very very Bitcoin specific. But for the purposes of this course, I will focus specifically on these four elements as we go through it. To start, I wanna focus on this specific tab called Hash. What you're seeing right now is what's known as a cryptographic hash generator. Let me explain first what a cryptographic hash is. A cryptographic hash is a fixed sized alphanumeric string that represents a certain amount of data. Let me explain what that means. It's almost like a digital fingerprint. So for instance in here, I'm gonna put some data and you will see the hash for it right now what you see as a hash for nothing. But if I type in here dog, you will find that that hash changes. And now you have this fixed size alphanumeric string, that is it's a string of alphanumeric characters. These are actually hexadecimal. So together they are 16 different characters, all pieced together. And what you have is a fixed sized alphanumeric string, composed of hexadecimal characters. So right now you have the word dog. That is what it's known as a cryptographic hash for this amount of data. Now specifically, this cryptographic hash type is called a SHA256. SHA stands for secure hash algorithm, and the type of SHA that it is, is a SHA256. To give you a little bit of background SHA and this cryptographic hash specifically SHA was developed by the national security agency, that is the NSA. And it has then since become a standard that's open source and actually, it's actually been used extensively. So in Bitcoin, this is the primary use of cryptographic hash that is used. So what you're seeing here is this is a SHA256 hash for this amount of data. This is actually D-O-G dog, but it's capital D. Now here's, what's interesting, let's say I change that capital D and I put a lowercase d notice that the cryptographic hash changes. Let me go back to where it was before. If I go back to the uppercase D you see that you have this cryptographic hash, which ends in a-d-8-8, but again if I just change it to lowercase d you completely the cryptographic hash, let me go back to the uppercase D. This is literally a digital fingerprint of this amount of data. Now here's what's interesting, if I do anything, like for example, I put a space, well I change the data. Right now you have a completely different cryptographic hash, but if I remove that space, I go back to the same same exact digital fingerprint. So you see these cryptographic hashes serve as digital fingerprints. Now here's what's interesting, I can go on for here, I can say dog is great. You see, and with every single character I add, I change the cryptographic hash, dog is great and I am happy, you see I can just go on. Here's what's interesting notice that this cryptographic hash is exactly the same length, regardless of how much text I put in here. Let's go back to where we were again if we go back to D-O-G, you notice we're exactly the same cryptographic hash ending in a-d-8-8. These cryptographic hashes are essential in preserving the integrity of data, because let's just try something different. Instead of using something as simple as dog, let's just paste something longer. This is actually the lyrics to twinkle twinkle little star. And you notice that for this amount of text, you also have a fixed size alphanumeric string. That is, this is a cryptographic hash for this. What's fascinating about these cryptographic hashes, is that you can put any amount of data and get a cryptographic hash of the same length. So in the case of the SHA256 hash, I could take the entire works of every single book ever written in the U.S. Library of Congress, and I could paste it in here, and I would still get a fixed sized alphanumeric string, that is a SHA256 hash of this length. Key things you need to understand also is that it's not just limited to text, you could literally take a photo or you could take a video, and because it's data, that data also includes specific characters. And it's a lot of information, which you can actually convert into a cryptographic hash. What that means is that you can take a picture and you can verify that it's the original picture and nobody has photoshopped it, nobody has changed it, nobody has modified in any way, because if anybody makes a change, like for example, let's assume here like a diamond and say, I put a comma, I put a comma in here, I break the cryptographic hash for it. Let me go back to where I was before. Now, I'm back to the original, you see this preserves the integrity assume you have a document with tens of thousands of pages and somebody walks inside and places a period. Well, if it's a legal document, that period could really change the entire meaning of that entire contract. So having a technology as powerful as these cryptographic hashes, in this case we're looking at a SHA to preserve the integrity of the data is essential. We will now explore how this cryptographic hash technology is used in building a blockchain.