일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- REACT
- graphQL
- concept
- useState
- CLASS
- Props
- solidity
- evm
- node.js
- error
- bitcoin
- blockchain
- built in object
- web
- Redux
- express.js
- SSR
- tailwindcss
- 기준
- Interface
- JavaScript
- API
- 삶
- hardhat
- typeScript
- Ethereum
- HTML
- middleware
- nextJS
- CSS
- Today
- Total
ReasonJun
Bitcoin : Merkle Tree 본문
A Merkle Tree, often referred to simply as a Merkle Tree or a hash tree, is a fundamental data structure used in Bitcoin and other blockchain systems to efficiently represent and verify the integrity of a large set of data, such as transactions in a block. The Merkle Tree is named after its inventor, Ralph Merkle. Here's how it works in the context of Bitcoin:
Structure of a Merkle Tree:
A Merkle Tree is a binary tree in which each leaf node represents a piece of data (in Bitcoin, these are typically individual transactions) and each non-leaf (internal) node represents the cryptographic hash of its children. The process of constructing a Merkle Tree can be summarized as follows:
- Data Preparation:
- Bitcoin transactions within a block are collected and ordered.
- Pairing and Hashing:
- Pairs of transaction data are hashed together (using a hash function like SHA-256).
- If there's an odd number of transactions, the last transaction is duplicated before hashing to ensure an even number of pairs.
- Construction:
- The resulting hash values are then paired and hashed again until a single hash value, known as the Merkle Root, remains at the top of the tree.
- This Merkle Root is what is included in the block's header.
Purpose and Benefits in Bitcoin:
The Merkle Tree serves several important purposes in the Bitcoin network:
- Data Integrity Verification:
- The Merkle Root is a compact representation of all transactions in a block.
- By only providing the Merkle Root, anyone can verify that a specific transaction is included in the block without having to download and process the entire block's data. They do this by requesting only the relevant branch of the Merkle Tree.
- Efficiency:
- It reduces the amount of data that needs to be transmitted and verified during block propagation.
- It allows for efficient pruning of old transactions, as nodes can retain only the Merkle Root and relevant branches for verifying recent transactions.
- Security:
- Altering any transaction within the block would require recalculating the Merkle Root, which is computationally expensive.
- It provides a simple and efficient way to ensure the integrity of the transaction data within a block.
- Lightweight Clients:
- Lightweight or SPV (Simplified Payment Verification) clients in Bitcoin use Merkle Trees to verify transactions without the need to store the entire blockchain.
In summary, a Merkle Tree in Bitcoin is a hierarchical data structure that efficiently represents and verifies the integrity of transaction data within a block. It reduces data transmission and storage requirements while providing a high level of security and trust in the blockchain. The Merkle Root is a key component of a block's header and is essential for ensuring the validity of transactions in the Bitcoin network.
'Blockchain > Bitcoin' 카테고리의 다른 글
Bitcoin : P2P Network (0) | 2023.09.17 |
---|---|
Bitcoin : gRPC vs HTTP API (0) | 2023.09.17 |
Bitcoin : ECDSA (Elliptic Curve Digital Signature Algorithm) (0) | 2023.09.17 |
Bitcoin : Cryptographic systems (RSA / ElGamal Encryption / Hash Encryption) (0) | 2023.09.17 |
Bitcoin : whitepaper (2) (0) | 2023.09.16 |