Merkle tree is a tree in which every leaf node is labelled with the hash of a data block and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure verification of the contents of large data structures. Hash trees are a generalization of hash lists and hash chains.
Questions tagged [merkle-tree]
73 questions
2
votes
2 answers
Merkle trees for hiding State fields from counter-parties?
The Corda v3 docs describe Transaction tear-offs and the use of Merkle trees to 'hide' information during a transaction. Specifically, the example used is to hide sensitive data from an Oracle during it's validation of the transaction.
Does the…

yamori
- 1,213
- 4
- 14
- 27
2
votes
1 answer
How is a Merkle tree path generated?
I was trying to understand how Merkle tree works in SPV and many other scenarios in blockchain technologies and couldn't get my head around this one question: how the Merkle path is generated in validating a transaction.
In the graph below, suppose…

Maxareo
- 275
- 2
- 12
2
votes
1 answer
bitcoin block solving, all nonces used but no hit
I'm trying to understand how bitcoin block solving attempts works.
I see a nonce is a 32-bit number, so around 4 billion values to try.
Also, I saw a famous mining pool having 500 Ph/s power at hand. And I found there one particular block solved in…

Jean F.
- 127
- 8
1
vote
1 answer
I am getting invalid type ( struct ) error while interacting with the solidity smart contract
Here is the Error Message:
Uncaught (in promise) Error: invalid type (argument="type", value="Proof", code=INVALID_ARGUMENT, version=abi/5.7.0)
Here is the solidity function
function createOffer(
address _requestorAddress,
address[]…

Rashid Iqbal
- 36
- 3
1
vote
2 answers
Having troubles with smart pointers and vectors, constant crashing
So im trying to build a merkle tree from a vector of strings, first convert all the strings to the MerkleNodes and then form their parents, building the tree upside down.
But it seems to be an issue when i push all the nodes to the vector in the…

Mauricio Alvarez
- 11
- 1
1
vote
0 answers
MerkProof.Verify Always Retuns false on solidity but returns true frontend
I have this code for verifying a merkleproof on solidity
event beforeClaim(bytes32 root, bytes32 node, bool proof);
function claim(
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public {
…

Suliman Noor
- 84
- 6
1
vote
1 answer
How to verify that a transaction hash is included in a block's transactionsRoot on chain?
I am doing some research to see how you would verify that a transaction hash is included in the transactionsRoot for a specific block in Ethereum. The challenging part for this is that I am trying to do this on chain.
Can anyone help me figure out…

0xKitsune
- 131
- 6
1
vote
1 answer
Web3py merkle tree support
I am trying to implement a merkle tree just like merkletreejs but python does not have any good libraries that support keccak256 and sorted keccak256 trees. Does anyone know of a good python lib for this?

Smurf Blue
- 11
- 3
1
vote
1 answer
Why encode a binary value as a byte instead of a bit?
I am used to seeing the encoding of flags (i.e., binary values) as bits. See, for example, the SYN and ACK flags in the TCP header.
I recently stumbled upon the specification of Certificate Transparency:…

synack
- 13
- 3
1
vote
0 answers
MerkleProof Different hashes in Smart Contract and Javascript
I get different hashes for the MerkleProof in the Smart Contract and the Javascript (test)
Smart Contract
pragma solidity ^0.8.0;
import "../node_modules/@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract Token {
bytes32…

Homer
- 239
- 2
- 11
1
vote
1 answer
What is the time complexity of comparing two Merkle trees?
I have a simple recursive function that compares two merkle trees and accumulates the differences in the leaf nodes. However, I am unable to measure the time complexity of it. Specifically, I would like to see how does it compare against comparing…

Arun Manivannan
- 4,213
- 3
- 29
- 38
1
vote
1 answer
merkletreejs method getHexProof doesn't work?
I am trying test merkle proof with merkletreejs library and I can't figure out why this works
const tree = new MerkleTree(leaves, SHA256)
const root = tree.getHexRoot()
const leaf = SHA256('a')
const proof = tree.getProof(leaf) //…

Руслан Миров
- 594
- 9
- 28
1
vote
0 answers
Merkle tree for finding data inconsistencies - optimizing number of queries
I understand the idea behind using Merkle tree to identify inconsistencies in data, as suggested by articles like
Key Concepts: Using Merkle trees to detect inconsistencies in data
Merkle Tree | Brilliant Math & Science Wiki
Essentially, we use a…

tpoker
- 492
- 1
- 5
- 15
1
vote
1 answer
How to calculate the merkle root in a hyperledger fabric?
How can I calculate the merkle root of a hyperledger fabric?
I have a hard time finding merkle root in Fabric.
The block header contains number , prefix_hash , data_hash .
Are any of the above three related data related to the merkle root?
Or can I…

김영서
- 35
- 1
- 5
1
vote
1 answer
What's the difference between blockchain and immutable linked list?
There is an interview question: What's the difference between blockchain and immutable linked list?
I answered they were the same technology and then failed the test. Please correct me what I'm wrong.

Phuc
- 159
- 2
- 7