<blockquote>
  <p>But my question is if I need to group my logs per component.. like.. every one hour I get a new log file on a product.. and I want that all to stay together in the same block as and when it happens.. is it possible?</p>
</blockquote>

<p>The merkle root functions as a <em>cryptographic commitment</em> to the transaction content of the block, so by definition this is designed to be an unalterable value. </p>

<p>If you alter the merkle tree, then the merkle root will change, and thus the block hash will change as well. Blocks are ordered by referencing the previous block's hash, so to change a block's merkle tree you would need to rewrite the history of the chain from the point onwards. </p>

<p>Additionally, the chance of altering the merkle tree of a valid block, and then having it still be valid afterwards, is infinitesimally small. (and even if it somehow was valid, the block hash would be different, and so it would not be a part of the longest chain).</p>

CC BY-SA 4.0
2020-02-21T23:03:57.597Z
2020-02-21T23:03:57.597Z
chytrik
<p>When i read about merkle trees.. I saw we shall build a system wherein we could club all the transactions that happend in like 10 minutes to stay in a block. I mean.. whatever is known.. the known transactions are made to a block. 
But my question is if I need to group my logs per component.. like.. every one hour I get a new log file on a product.. and I want that all to stay together in the same block as and when it happens.. is it possible? </p>

<p>Concisely.. is it possible to dynamically add transactions in a merkle tree? 
Is that a bad implementation? Does computational power increases in this cos everytime one transaction is added.. we need to rehash the entire blockchain,? </p>

<merkle-tree>
Is it possible to dynamically add transactions to a merkle tree?
Archana Vimalkumar
# Is it possible to dynamically add transactions to a merkle tree?

(Asked by: username_0 on 2020-02-21)

When i read about merkle trees.. I saw we shall build a system wherein we could club all the transactions that happend in like 10 minutes to stay in a block. I mean.. whatever is known.. the known transactions are made to a block.
But my question is if I need to group my logs per component.. like.. every one hour I get a new log file on a product.. and I want that all to stay together in the same block as and when it happens.. is it possible?

Concisely.. is it possible to dynamically add transactions in a merkle tree?
Is that a bad implementation? Does computational power increases in this cos everytime one transaction is added.. we need to rehash the entire blockchain,?

**Tags:** merkle-tree


---

## 1 answers

### Answer by username_1 on 2020-02-21. Score: 1

> But my question is if I need to group my logs per component.. like.. every one hour I get a new log file on a product.. and I want that all to stay together in the same block as and when it happens.. is it possible?

The merkle root functions as a *cryptographic commitment* to the transaction content of the block, so by definition this is designed to be an unalterable value.

If you alter the merkle tree, then the merkle root will change, and thus the block hash will change as well. Blocks are ordered by referencing the previous block's hash, so to change a block's merkle tree you would need to rewrite the history of the chain from the point onwards.

Additionally, the chance of altering the merkle tree of a valid block, and then having it still be valid afterwards, is infinitesimally small. (and even if it somehow was valid, the block hash would be different, and so it would not be a part of the longest chain).


---

