Hello in this lesson we are going to cover the structure of a block in block chain. And by learning this you'll become every invoice called blockchain you'll have a greater understanding of blockchain and you'll serve as a good basis going forward whether you're using blockchain technology like Bitcoin aetherium something else something I saw your currency, whatever that may be. So the basic structure of a block in blockchain is like this. There are four sections or sections. And the first section is the block. size and the block size is just about the size of the block in bytes.
Simple stuff. We have the block header this To the family where the meat of the block is or coil or meat, and, and this actually formed of several fields, we'll cover that in a moment. Then we have the trend, the action counter, which is just how many transactions there are in this block. And finally, we have the transaction. So all the transactions that are being processed within this block of blockchain, like I said, the block header is formed have several fields, and they are very, very interesting fields. And let's cover those amazing and awesome fields right here.
So there are six fields. So divide that in half. Free there, and we have free here. So the first field is the version. And the version is just essentially a number to track the software protocol upgrades. Next, we have the previous block.
Hash. And this is just a hash of the entire previous block. This will become a bit more evident exactly what this is in a moment. We have a Merkel route. And the Merkel route is a hash of the root of a Merkel tree, which we'll cover in a separate video exactly how a Merkel tree works. And these are all the blocks transaction.
So all of these transactions here are pumped into a Merkel tree and this produces so all these go into a Merkle tree and it comes out with a Merkel root. If one of the transactions were modified change removes any change to the overall transaction which will occur then this Merkle tree would result in a different Merkel root hash really should hash it. So it's a bit more obvious that it's well i hash Next we have a time stamp. I think you can guess what this is. This is just a approximate creation time of the block is interested in seconds from Unix epoch time. Next we have the difficulty target and the difficulty target is essentially a proof of work algorithm difficulty target for This block.
Finally, we have a nonce. And you might be thinking, or is that even a real thing? Yes, it's a word in the English language. And on top of that, it's a fundamental concept in cryptography. The nonce is essentially a random counter used for the proof of work algorithm. There's just a random number that was just helps to prove the algorithm.
That's all. So this is some pretty cool stuff. Now, let me show you how multiple blocks linked together. Now that we've actually seen the overall structure, let's go to a higher level view. So imagine if we have a big space between we have free blocks. The number of blocks doesn't actually matter.
And in these blocks, we are going to have four sections. Again, this is just a very simplification of what you've already seen above. So all of these blocks contain the information from above as well and with in the section so the things we are concerned with is the previous hash the time stamp dump the random nonce, the root hash and linked to this. We have all of our transactions and the transactions, going to keep it simple. And as put some squiggly lines, these are all our transactions, our awesome block chain transactions. And the way they link together is actually only simple, very cool.
You take the hash of the previous block, and that forms the previous hash. So that's how they are linked together. You can think of this as a chain are trying to draw a chain here. So when blocks are chained together, that's how blockchain gets its name, block, chain. So we have previous hash here, we have the timestamp, the random nonce, the root hash. Same thing for this one.
And again, the roof I mean the entire blocks hash formed the previous hash. So that is the structure of a block. You might have one question in your mind and that is, what about the second block in blockchain? What does I mean the first block the first block in blockchain, what does that get previous hash from and that is called the Jenny Genesis from for Genesis block and this is that tickly created just as the starting point for this Genesis block, Sam So, awesome Genesis block Genesis block of Genesis one is a I think you see it the way you get the pictures called Genesis and the Genesis block have everything that our block here has. And obviously, what all of this has is why for you look at it from a more in depth point of view. But the only two things that it doesn't have is the previous hash.
So the previous hash field is just left, blank, the other fields, so the timestamp that has a bunch of data in there, the next two fields, the random nonce, and a bunch of data in there, the root hash and a bunch of data in there. And then let me do it in a different color. The transactions are also non existence so we have no transaction and this is just me. So, this is the Genesis block. This is the first block in any blockchain implementation. And like I said, it is statically coded.
And it is this that is hashed, and it forms the previous hash in block number two also referred to as one, the second block essentially. So, that's it for the structure of a block in blockchain. If you have any questions, feel free to reach out if there's a few concepts that you didn't quite grasp in this video, feel free to rewind, check them out again. And as usual, I look forward to seeing you in my next lesson.