Lesson 7: "Saving Disk Space in Blocks" A look at what's inside the blockchain

我为什么要上这堂课?

From now on, we will sort out the peripheral matters necessary for realizing the Bitcoin system that we have learned so far. First, we will learn about the structure within each block of the blockchain. The nodes needed to make the blockchain work must hold all the data that is recorded in the blockchain. In this lesson, we will learn how nodes can hold the data in the blockchain.

在本课中,你将学习到什么?

  • Structure within each block of the blockchain
  • Markle tree of transactions
  • The amount of future data a node will hold

How to compress the data held by a node

Each Bitcoin transaction will be recorded in one of the blocks that make up the blockchain.

Therefore, the node running the blockchain must hold the data of all blocks in order to verify the transaction records.

However, as the number of bitcoin transactions increases, the amount of data that the nodes have to keep also increases.


To solve this problem, there is a built-in mechanism that limits the data that a node needs to keep at all times to a very small portion.

Specifically, once a certain number of the latest transaction records have been accumulated, it is safe to delete the earlier records.

To achieve this mechanism, hash functions are used here as well.


Multiple transaction records are hashed together, and only the output hash value is kept at all times. This is called a Markle Tree.

In Lesson 4, we learned that each block stores the hash value of the previous block.

The hash value of this block contains the hash value of all the transaction records contained within each block, hashed together.

This means that as long as the hash value is available, the transaction record itself is no longer needed.


检查您的课程进度

了解了本课的内容,
就点击 "检查 "按钮吧!

Amount of future data held by a node

If only the block header data is retained, and not the past transaction records, the size of the block header will be approximately 80 bytes.

Bitcoin is tuned by Difficulty to form a block about once every 10 minutes.

Therefore, 80 bytes x 60 minutes x 24 hours x 365 days = 4.2MB of data added per year.

It can be said that this amount of data can be retained without any particular problem as hardware performance improves in accordance with Moore's Law.


检查您的课程进度

了解了本课的内容,
就点击 "检查 "按钮吧!

Lesson 7: "Saving Disk Space in Blocks" A look at what's inside the blockchain

0%

0%

你还没有完成所有的课程。 在做测试之前,让我们先完成所有的测试吧!

点击下面的按钮,开始测试。