Why is the Blockchain intended to be a chain and not a tree? Why do orphaned blocks get trimmed off? Would you please provide a detailed answer.
-
7You tell us - how could it work if it were a tree? If a transaction paying money to me exists on one branch and not on another, do I have the money or not?– Nate EldredgeCommented Nov 2, 2019 at 0:47
-
@NateEldredge Would you please tell me why not?– محمد جعفر نعمةCommented Nov 3, 2019 at 3:16
-
2The goal of a consensus system is to obtain consensus. What is the consensus if the tree has multiple leaves?– Pieter WuilleCommented Nov 3, 2019 at 19:50
-
1Mohamad the chain structure is how Satoshi designed it. As others said, it's designed to accommodate consensus. Maybe you have a different question and you'd like to reword yours? What drove you to this question? Perhaps what's behind the question would yield better answers.– Jose FonsecaCommented Nov 4, 2019 at 2:27
-
@JoseFonseca, I am newbie to blockchains. My question is for the sake of boosting performance– محمد جعفر نعمةCommented Nov 4, 2019 at 14:07
1 Answer
I am not sure that I can rule out that something useful could be achieved with a tree of blocks, but let me walk you through a few thoughts and you can then tell me whether they answer your question.
When we're talking about Bitcoin, we should make clear what we're actually interested in achieving. We're talking about a decentralized system to track value, so to put it crudely, the main goal is to agree on who owns what. Additionally, we need a way to update ownership, or people wouldn't be able to transfer value.
In accounting systems, these two functions are generally fulfilled by a journal and a ledger. The ledger contains the current balances and the journal is a log of all changes.
You should think of transactions as updates to the ledger. But, since the network doesn't have a central party, what happens if some malicious party attempted to tell different parts of the network conflicting updates? How would network participants know which version of the update to apply?
To that end, Bitcoin has a lottery to elect temporary authors for the journal. To enter the lottery, participants pay with computing power, and when they win, they get to write one page of updates to the journal, i.e. author one block. Of course everyone else is watching the journal as well, so they have to stick to the rules and pick a valid set of updates. Regarding the "doublespending problem", this means that when there are multiple conflicting transactions, they can only chose a single one. Voilá, we now have a mechanism how to pick a ground truth in the network without a central figurehead!
You might have noticed that the ownership of value is not actually tracked in the blockchain! Rather, it's the Unspent Transaction Output Set (UTXO Set) that tells us who owns what. Where the blockchain corresponds to the journal, you can think of the UTXO Set as the ledger. While the ledger is the thing we're interested in, you need to apply the whole journal to compile the current ledger. So, in the end, the blockchain is basically a waste product of our desire to converge on a single shared UTXO Set.
Now, given our goals, it may seem a little more obvious, why we only want one single last page in the journal instead of multiple in parallel: otherwise, there would be multiple possible versions of the ledger and we wouldn't agree who owns which money!