So what is the relationship between this cryptographic hashing and blockchain technology? So this is important, and I will go through this briefly in this module, but in more detail a little later on. So that's one thing with this course, that there are materials that might appear redundant later on, but I'm doing that on purpose, because some of these concepts are challenging and sometimes it's best to hear it two or three times. So let's talk about a public blockchain. We are exploring a Bitcoin-like blockchain, and we need to figure out how this cryptographic hashing actually plays a role. So I showed you this diagram earlier in the overview. This is a basic structure of a blockchain where we've got sub sheets rather than one large sheet, and they're chained together, remember I said the last line was a digest or a signature, and then the first line of the next block is identical, and that is the link, that is the chain part. In the Bitcoin blockchain, these blocks are added about every 10 minutes, and that's a choice. So Ethereum might be 18 seconds, another blockchain might be one second, another blockchain might be 2.5 minutes, its a choice. But in Bitcoin blockchain, it's about every 10 minutes. So it turns out that the last line of the block is a SHA-256 of the contents of the block. So when I said digest, I use that word very specifically because another term for a hash is message digest. So this SHA-256 reflects all of the information that is in that particular block. It is repeated in the next block. So that is a piece of the puzzle. So what does this mean? So it means that if any information in the block is altered, then it changes the digest or the hash. As soon as that happens, the last line doesn't match the first line. Let me give you a simple example. So I'm not actually using a SHA-256 here, but just to see the simplicity of this example, let's pretend it's a SHA-256. So I get three blocks, 999, 1,000, 1,001. Notice in green, I've got the hash of block 999, and then that hash appears as the first line of block 1,000. Similarly, the next green is the hash of block 1,000 which appears as the first line of block 1,001. So notice in block 1,000, there is a transaction. So there's minus 17 from my account that goes to John, plus 17. So think of me as buying a car from John. So I pay 17, and then John gets 17. So now I'm going to hack this blockchain. So I'm going to go in, and it's easy to do frankly. You'd go in and change the ledger. You can edit the ledger, no problem, it's on your computer, it's open, you can edit it. So this is what I'm going to do, and you probably don't even see what I did. It is so subtle. All I did was change the sign. So instead of a minus 17 for me and a plus 17 for John, I flip the sign. So John is minus 17 and I'm plus 17. So for me, it's a great deal, I get the car and John pays me 17. So this definitely an nefarious action. So I do that. Again, I'm free to do that. Anybody can do this in terms of editing a particular block on their computer or maybe even a bunch of computers, but this is the problem; when we actually do the hash of block 1,000, we get something that doesn't match the first line of 1,001. The network sees the inconsistency and automatically tosses out block 1,000 which has been corrupted by me and replaces it with the original block 1,000, and that matches the hash of the first line of block 1,001. So this is a subtle but very important point. So I can go and edit the database. I can change history on the database as downloaded to my computer. However, almost immediately I'm defeated by the network because they see the hashes don't match and the block is replaced. So this makes it futile for a hacker to go back and try to change history. The hashes will not match, the block will be thrown out. This is the ingenious idea of immutability in the database. This is how it actually happens. You can change it, but it's not going to last for long because the network is going to throw out your block and to replace it with the one that actually works.