Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve storing to support billions of transactions #8

Open
vgsantoniazzi opened this issue May 26, 2020 · 0 comments
Open

Improve storing to support billions of transactions #8

vgsantoniazzi opened this issue May 26, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vgsantoniazzi
Copy link
Owner

vgsantoniazzi commented May 26, 2020

Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space. To facilitate this without breaking the block's hash,
transactions are hashed in a Merkle Tree, with only the root included in the block's hash.
Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes do
not need to be stored.
A block header with no transactions would be about 80 bytes. If we suppose blocks are
generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year. With computer systems
typically selling with 2GB of RAM as of 2008, and Moore's Law predicting current growth of
1.2GB per year, storage should not be a problem even if the block headers must be kept in
memory.

@vgsantoniazzi vgsantoniazzi self-assigned this May 26, 2020
@vgsantoniazzi vgsantoniazzi added the enhancement New feature or request label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant