Merkle Tree

Status
IN PROGRESS
Stakeholders
Outcome
Due date
Owner

Background

Shorthand

Discussion Participants: 武宮誠 , Kamil Salakhiev

武宮誠 :

What I was thinking is that the leftmost leaf is a block (except for genesis) and every other leaf is a transaction. However, it is just transactions in the same block.

Do you still think this is too big?

Each block should have its own tree. Not all intermediary parts need to be stored probably.


Kamil Salakhiev:

Yes. We can keep only transactions and keep parent hash for every block. That way we can also prove that transaction belongs to the blockchain.

@mtakemiya btw, if in future we want to have light clients to Iroha (might be useful for wallets and bridges) then we should move transactions outside BlockPayload (or we can call it BlockHeader instead).
Then instead of transactions themselves we should store merkle hash of the tree composed of transactions from the block. This would allow us to keep block headers as light as possible.

武宮誠 :

We should be storing the merkle root in the block header now in iroha 2, I mean, that is how the design is. For the block hash, the txs shouldn't be hashed, but only the merkle root.

Problem

To make fast validations of Blockchain state we should use some secure solution like Merkle Tree.

Solution

Block's Merkle Tree should have parents Block's hash as a leftmost leaf, and transactions hashes for other leafs. Blocks headers will store only hashes of Merkle Tree (Merkle root). 

Block

Decisions

Alternatives

Concerns

Assumptions

Risks

Additional Information