Merkle Trees Explained
๐ 4 min read
Quick Answer
Pokok Merkle ialah helah pintar yang membolehkan dompet telefon ringan mengesahkan pembayaran berada dalam blok tanpa memuat turun keseluruhan blok. Ia memampatkan beribu-ribu transaksi ke dalam satu cap jari kecil.
๐ก Think of it asโฆ
Kejohanan kalah mati cap jari. Gandingkan transaksi, cincang setiap pasangan ke dalam satu kod, kemudian gandingkan kod tersebut dan cincang sekali lagi โ pusingan demi pusingan โ sehingga cincang juara tunggal ("akar Merkle") mewakili keseluruhan blok.
Membina pokok itu
Setiap transaksi dalam blok dicincang. Cincang tersebut digandingkan dan dicincang bersama, dan proses itu mengulangi tahap sehingga hanya tinggal satu cincang: akar Merkle, yang disimpan dalam pengepala blok.
The magic: proofs
To prove a single transaction is in a block, you only need a short path of hashes up the tree โ not the whole block. This is called a Merkle proof, and it is what makes lightweight (SPV) wallets possible.
Why it matters
Merkle trees give Bitcoin efficiency and integrity at once: change any transaction and the root changes, instantly invalidating the block, yet verifying inclusion stays tiny and fast even for millions of transactions.
๐ Key takeaway
Pokok Merkle memerah keseluruhan blok urus niaga ke dalam satu cincang akar, jadi sesiapa sahaja boleh mengesahkan satu pembayaran dengan bukti kecil dan bukannya keseluruhan blok.
Why this matters for you
This is why the mobile wallets popular across Asia can be both lightweight and trustworthy โ Merkle proofs let your phone verify payments without storing hundreds of gigabytes.
Soalan lazim
Adakah saya perlu memahami pokok Merkle untuk menggunakan Bitcoin?โผ
Not at all โ it works silently in the background. But it explains how your phone wallet can be secure without being heavy.
What is the Merkle root?โผ
The single hash at the top of the tree, stored in the block header. It acts as a tamper-proof summary of every transaction in the block.
Is this related to SHA-256?โผ
Yes โ the tree is built entirely from SHA-256 hashes. Merkle trees are an application of cryptographic hashing.