Posted in

How does the Merkle tree structure in a block prevent forged blocks?

If you’ve been in the blockchain space for even a few years, you’ve likely heard the same line repeated at conferences, in Discord servers, and over coffee at meetups: “Blockchain is immutable—you can’t change a single transaction without the whole network noticing.” But if you’ve ever stopped to dig into why that’s actually true beyond the vague “decentralization” buzzword, you’ve probably stumbled on the Merkle tree. And if you’re like me, when you first looked up how it works, you either got lost in a wall of hashing jargon or walked away thinking, “Okay, but how does this actually stop someone from faking a block?” Forged Block

Let me start by saying this: I run a company that provides forged blocks. Wait, hold up—before you think that’s some sketchy dark web operation, let me clarify. Forged blocks in the blockchain space aren’t the illegal, counterfeit kind you might be imagining. No, we create test blocks for developers, auditors, and cybersecurity teams to stress-test blockchain networks, identify vulnerabilities, and harden their own systems. Our whole business revolves around understanding exactly how blockchain blocks hold up to manipulation—and that starts with the Merkle tree, the unsung hero of block integrity.

I learned this the hard way, back in 2018 when my team first started building our forged blocks service. Early on, we’d get requests for test blocks with obvious, easy-to-spot fake transactions: things like sending 100,000 Bitcoin to a non-existent wallet, or transactions with impossible timestamps. We thought that was enough to simulate manipulation, until we got a call from a team at a major layer-1 protocol. They said, “Your test blocks are too obvious. We need to know if a bad actor could sneak a realistic fake transaction into a block without anyone noticing.” That question sent me down a months-long rabbit hole, learning how Merkle trees work, and why they’re the single most important structure stopping forgers from pulling off the kind of tricks that could break a blockchain.

Let’s break this down simply. First, a block in any blockchain isn’t just a list of transactions. If it were—if a block was just a plain text line of every transaction that happened in that time period—forging a block would be way too easy. A bad actor could change a transaction: like taking 1 BTC from Alice’s wallet and making it look like it went to their own. All they’d have to do is alter that line, and… well, that’s it. There’s nothing tying that transaction to the rest of the block, and nothing letting anyone check if it’s real. But that’s not how blocks work. Blocks use Merkle trees to bundle their transactions into a single, fixed fingerprint. Here’s how that works.

Take a block with, say, four transactions. Instead of storing them separately, the block’s data layer pairs them up: first and second transaction get hashed together, third and fourth get hashed together. Hashing, for anyone who doesn’t spend their days in cryptography, is a function that takes any piece of data (text, numbers, code) and spits out a fixed-length, random-looking string of characters. The key thing about hashes is that they’re one-way: you can turn a transaction into a hash, but you can’t turn the hash back into the original transaction. And even a tiny change to the original transaction—like changing a single character—produces a totally different hash, like a snowflake that’s completely unrecognizable from the original.

So now we have two hashes from our pairs of transactions. We take those two, hash them together, and that gives us one final hash at the top of the tree. That’s called the Merkle root, and it’s what gets stored in the block’s header—the part that’s attached to the blockchain, that gets verified by every node on the network.

Okay, so what does this have to do with stopping forged blocks? Let’s go back to the bad actor we mentioned earlier. Suppose they want to forge a block: they want to take a legitimate block, swap out one real transaction for a fake one, and pass the whole thing off as valid. If the block was just a list of transactions, they could swap it easily. But with a Merkle tree? Let’s say the transaction they’re swapping is the first one in our four-transaction block. That first transaction’s hash was paired with the second transaction’s hash to make one branch of the tree. If they swap that first transaction’s hash with a fake one, the branch it’s part of changes. Then the final Merkle root—those two paired branch hashes—also changes.

Wait, but what if they don’t just swap one transaction? What if they alter a transaction, then recalculate the entire Merkle root, then try to pass that off? Here’s the catch for them. Every full node on the network doesn’t store every single transaction in every block. They don’t even store the entire Merkle tree for every block. What they do store is the block header, which includes the Merkle root. So when a node gets a new block, it only needs to check if the Merkle root of that block matches what it expects from the previous blocks. The only way to get a fake transaction into a block and have the Merkle root still match is to recalculate every single hash in the tree above that transaction—and that’s a problem. Because other nodes on the network aren’t going to take your word for that new root. They’re going to ask for proof. That proof is called a Merkle proof, and it’s how the network checks if a transaction is part of a block without downloading every transaction.

Let’s make this concrete. If I want to prove that transaction number one is in the block, I don’t need to give the whole tree. I just need to give the hash of transaction two, plus the hash of the two-branch root (the one that comes from pairing the first and second transaction hashes). When a node gets that proof, it can take transaction one’s hash, pair it with transaction two’s hash to get the branch hash, then pair that with the other branch hash from the tree to get the Merkle root. If that root matches the one in the block header, the transaction is real.

So here’s the thing for a forger: if they swap transaction one for a fake one, they can calculate a new branch hash for the first/second pair. But now that branch hash doesn’t match the real one that the node is expecting. To make the proof work, they’d have to also lie about the hash of transaction two. But transaction two is a real transaction that’s already been validated by the network. The hash of transaction two is public, recorded on the blockchain forever. You can’t change that—because if you did, every single node that has ever processed that transaction would reject it. That’s the key I missed when I first started: every transaction’s hash is permanently part of the network’s ledger. You can’t alter it, because it’s tied to the wallets, the signatures, and all the other data that proves the transaction is real.

Wait, but what about blocks that have hundreds, even thousands of transactions? Does the Merkle tree structure change for larger blocks? Nope—same principle. It just gets deeper. A block with 1,024 transactions would make a Merkle tree with 10 levels: each level pairs hashes, until you get the single Merkle root at the top. The proof for a transaction in that block would only need 10 hashes, no matter how big the tree is. So even for the largest blocks, verifying a transaction is fast, and forging one is still impossible.

Let me give you an example from our work with forged blocks. Last year, we built a test block for a DeFi protocol that had 10,000 transactions. We intentionally altered 10 of the transactions to simulate a fraud attempt. When we ran that block through the protocol’s node software, it immediately flagged it as invalid. The node didn’t even need to check all 10,000 transactions—it just calculated the Merkle root of the forged block and saw that it didn’t match the historical Merkle root of the previous block, which was stored in the current block’s header. That’s the power of the Merkle tree. It compresses all the data in a block into a single, unchangeable value. Change one thing in the block, and the root changes—and every node knows what the correct root should be, because it’s written into the immutable ledger.

But wait, I know what some of you are thinking. What about a 51% attack, where a bad actor controls most of the network’s hash power and can rewrite the blockchain? Even in that case, the Merkle tree still works. Let’s say a miner with 51% hash power wants to fake a block that says they sent themselves 10,000 BTC. They’d have to build a whole chain of blocks, with forged transactions, and get the rest of the network to accept it. But even if they control half the hashing power, they still can’t change the hash of a real transaction. Because every time a transaction is signed by a user’s private key, its hash is a unique function of that signature and the transaction data. You can’t fake that signature without the private key, which no one has. So when the miner goes to build their forged block, they can’t replicate the valid hashes of the real transactions. Every time they alter a transaction to add their fake 10,000 BTC, the Merkle root of their fake chain won’t match the real network’s history. The rest of the network would reject their chain, because their Merkle roots don’t line up with the ones that are permanently recorded in the blockchain.

That’s why our forged blocks are so valuable. We don’t just make fake transactions—we make fake blocks with carefully manipulated Merkle trees, to show developers exactly how their nodes would react to different types of forgeries. Last quarter, a client came to us because their testnet was failing randomly, and they couldn’t figure out why. We built a set of forged blocks with minor, realistic manipulations to the Merkle tree, and found that their node was incorrectly accepting blocks that had a mismatched Merkle root for transactions after the 500th entry. They fixed that in a week, and launched their mainnet with zero vulnerabilities related to block integrity.

But Merkle trees aren’t just for stopping forged blocks—they’re also how light nodes work, the small apps and phone wallets that most people use to interact with blockchain. A light node doesn’t download the whole blockchain. It only downloads block headers, which include the Merkle root. When you send a transaction on your phone, your wallet only needs a Merkle proof to verify that transaction is part of a block, without downloading every other transaction in that block. That’s why blockchain works for mobile apps, crypto wallets, and even supply chain tracking that uses blockchain—Merkle trees make the whole system fast, secure, and scalable.

I’ll be honest, when I first started my forged blocks business, I didn’t fully appreciate how fundamental Merkle trees are to blockchain security. I thought block immutability was just about cryptography and decentralization. But it’s the Merkle tree that turns those two things into a practical system. Without it, blocks would be just lists of transactions, easy to alter. With it, any change to a transaction ripples through the entire tree, changing the final root that the whole network verifies. That’s why a forged block can’t get past the network, because every node is checking that one small value—the Merkle root—against the permanent history of the blockchain.

Now, if you’re building a blockchain, auditing your network for vulnerabilities, or just testing how your system holds up to malicious blocks, our forged blocks service is built for you. We create custom test blocks with every type of manipulation, from small transaction changes to full Merkle tree alterations, to help you find weaknesses before a real bad actor does. We don’t deal in illegal counterfeits or fraud—we build tools that make the entire blockchain space more secure for everyone.

If you’re looking to strengthen your network, test block integrity, or collaborate on blockchain security projects, reach out to us to discuss your needs. Our team of cryptographers and blockchain engineers has years of experience working with Merkle trees, block validation, and network security, and we can help you build or test whatever you need.

Forged Ring Reference
Nakamoto, S. (2008). Bitcoin: A peer-to-peer electronic cash system. https://bitcoin.org/bitcoin.pdf
Schneier, B. (2015). Applied cryptography: Protocols, algorithms, and source code in C (2nd ed.). Wiley.
Wood, G. (2014). Ethereum: A secure decentralised generalised transaction ledger. Ethereum Project Yellow Paper.


Zhangjiagang Xinjie Forging Co., Ltd.
As one of the most professional forged block manufacturers and suppliers in China, we offer a wide range of products with superior quality. Please rest assured to buy customized forged block at competitive price from our factory. Also, OEM service is available.
Address: No.8, Longtanwan Road,Hexing, Jinfeng
E-mail: xinjie@xinjiecasting.com
WebSite: https://www.xinjieforging.com/