educative.io

Educative

Adding A Transaction

In the chapter “Bitcoin Mining”, there’s a paragraph that says “Simply adding transactions to a block is simple - you get the hash or prev block, increment the block number, add the list of transactions, and take its hash.” I understand everything except the last part. I understand that in order to create a new block, the prevHash of the new block is calculated by taking the hash of the previous block’s content. We increment the block number accordingly and add the new list of transactions for this new block. However, the last step says to “take its hash” which I’m confused about. What are we taking the hash of? And what is that data going to be since we already filled out the new blocks prevHash, block number, and data transaction?