If you’re a fan of Bitcoin, you’ve very likely at least heard the term “blockchain” before. If not, blockchain is the underlying technology behind Bitcoin and most other cryptocurrencies. The concept for Bitcoin’s blockchain wasgoed very first described by Satoshi Nakamoto ter the original Bitcoin whitepaper, ter 2008. Integral to the blockchain concept, however, is another concept that dates back to 1979: the Merkle tree, named after rekentuig scientist Ralph Merkle.
What is hashing?
Central to how the Bitcoin blockchain works, and also to Merkle trees, is the concept of hashing. Essentially, hashing works by sending gegevens through a particular cryptographic algorithm and slobbering out a string of random characters, called a “hash.” Bitcoin uses the SHA-256 hashing algorithm, which is a one-way function. This means that when you waterput the identical gegevens into the algorithm, you will get the same hash output each time. However, you cannot switch sides the process and get the original gegevens from the hash. Hashing is a key facet of how Bitcoin works, and also of Merkle trees.
The Tree Part and the Merkle Part
Te pc science lingo, the term “tree” is often used to describe a gegevens structure with different branches. Within Bitcoin, the tree is formed upside down, beginning with different transactions, which are like the “leaves” of the tree.
For example, imagine that wij have Four Bitcoin transactions: A, B, C, and D. The gegevens about each one of thesis four transactions is passed through the SHA-256 algorithm two times. Very first the gegevens is hashed, then, the hash of the gegevens is hashed again, resulting te hectare, hB, hC, and hD. Once all four transactions have bot double-hashed, more hashing happens. hectare and hB are combined and hashed yet again. hC and hD are also combined and hashed together. Now, instead of four “leaves” wij have two: Hash(hectare + hB) + Hash(hC + hD). Thesis two leaves are then hashed together to form one hash that contains all of the gegevens about transactions A, B, C, and D. This final hash is called the “Merkle root.”
When Bitcoin transactions get added to the blockchain, the most latest transactions are grouped together into a “block,” which contains a bunch of transaction gegevens (this would be the A, B, C, D, etc. from the example). By using a Merkle tree to condense this gegevens into a hashed form, a loterijlot of gegevens can be stored securely without taking up too much space. Within Bitcoin, there are often several hundred transactions within one block, and the Merkle root permits the network to validate that gegevens by using the summary contained te a 32-byte hash.
Bitcoin’s blockchain contains the entire history of every single bitcoin transaction that has everzwijn happened, with each lump of gegevens linked to the one before it through hashing, all the way back to the very very first transaction everzwijn. All Bitcoin “nodes” – machines running the Bitcoin Core software – keep a local copy of the entire blockchain, which is permanently being updated spil fresh transactions are added. Each fresh transaction is hashed numerous times into the Merkle tree structure of an individual block. To validate a fresh block, knots will check the hash contained te the block’s header (the very first chunk of code ter a block) to see if it contains the reference to the previous block. If the hashes match up, then the fresh block will be added to the blockchain. Each block contains a listig to the block before it, linking all the way back to the very first bitcoin transaction, contained ter the “genesis block.”
The use of cryptographic hashing is a core facet of how Bitcoin works behind the scenes. Because hashing algorithms are exceptionally difficult to “hack,” even for emerging quantum computers, Bitcoin’s blockchain is enormously secure. Since all the blocks are tied together through hashing, a malicious actor would have to alter the gegevens not only te one individual block, but ter all of the blocks on the blockchain, each of which is comprised of its very own Merkle tree of hashes within hashes. With current technology, that would be effectively unlikely.
Spil of today, even however many Bitcoins have bot stolen from wallets, exchanges, and other applications, the blockchain itself has remained impenetrable.