The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [patricia-merkle-tries]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

How Merkle Patricia Trie updates the account balance?

This is my understanding of the Merkle Patricia Trees in Ethereum so far: There are three kinds of merkle trees storing diff info - state, transaction and receipt. When a new block is added it ...
0
votes
0answers
25 views

Does it possible to perform Merkle root proof with filters?

I have a centralized e-commerce system with orders table inside. There are few order categories inside this system such as: Pending payment Pending shipping Pending delivery Completed Cancelled I ...
2
votes
0answers
36 views

Get proof that a transaction was included within a block

I see that the web3 api has the getProof method: https://web3js.readthedocs.io/en/1.0/web3-eth.html#getproof My question is - is there a similar way to get (and verify) a proof that a transaction x ...
2
votes
1answer
57 views

Implementing Merkle Patricia Trie

I am currently trying to implement Ethereum's Merkle Patricia Trie using Python 3.6 and I am having some troubles and honestly I am frustrated. I am using the following sources: Ethereum Wiki ...
1
vote
0answers
20 views

How can I recover the path to a specific transaction in the tx patricia merkle tree?

I'm working on a project where a non trusted entity is running an ethereum node (either geth or aleth), and has to pass information along to a non networked party. Namely, the non networked party ...
0
votes
0answers
24 views

Ethereum Trie dependence on mutation order

Given a set of non-overlapping key/value tuples, for all possible orderings of it, may constructing the trie by putting each tuple in the order yield different root hashes in the end?
4
votes
0answers
99 views

How to generate a state root

I am trying to implement a Simplified World State Trie based on Merkle Patricia Tree. Take the following image for example there are four accounts address  value a711355   ...
1
vote
1answer
48 views

what is the role of merkle tree in ethereum? [duplicate]

I know the functionality of merkle tree, it makes a root hash from a group of data.My question is how merkle tree is act in ethereum blockchain,precisesly in the place of transaction hash,block hash,...
1
vote
1answer
26 views

Why do Merckle trees use nibbles

In Appendix D of the yellow paper for Ethereum, it describes the Modified Merkle Patricia Tree, and states: Any series of bytes may also trivially be viewed as a series of nibbles, given an endian-...
0
votes
0answers
17 views

Verify transaction was included in certain block within smart contract

Is there a good resource for proving that a particular transaction was included in block x?
1
vote
2answers
36 views

How are transactions stored in a block?

In State, use Merkle Patricia Trie for storing data. "key value" is account address(hash value). And also, Ethereum block uses MPT for storing transactions. However, Additionally Ethereum Block use ...
2
votes
0answers
304 views

How Merkle trees are implemented in a database exactly

I have just checked out these resources: What is a Merkle Tree? Beginner’s Guide to this Blockchain Component Using Merkle trees to detect inconsistencies in data Exploring the use of Hash Trees for ...
3
votes
2answers
222 views

Why are transaction tries in Ethereum not plain Merkle Tries?

I understand the Ethereum block header contains a Merkle Patricia Trie (MPT) root for the global state, one for receipts (which I don't understand but am not focussed on for now), and one for all the ...
3
votes
1answer
45 views

Ethereum Merkle Patricia Tree Riddle

since I spend some time on diving into the data structures that ethereum is based on, I stumbled upon the following task from a stanford course which i included at the bottom. I am struggling ...
2
votes
1answer
64 views

How do ethereum validate a OLD transaction(say 10k blocks ago) without sync/replay-ing the full node?

When a full node receives a freshly mined new block, it seems straightfoward how we could validate all the transactions contained in the block. As we already the current world state, we could just ...
1
vote
0answers
38 views

Calculating Merkle root on chain

I'd like to calculate a Merkle tree on chain, and then only store the root. The tree will track all balances for an ERC20 token. How many accounts would this be feasible for? If there are 1000 ...
2
votes
1answer
25 views

How to recreate a HexaryTrie from a saved database

I am trying to create a HexaryTrie from the database that the trie writes to. Here is my Code: from trie import ( HexaryTrie, ) db = {} trie1 = HexaryTrie(db) trie1[b'deadbeef'] = b'deadbeef' ....
0
votes
2answers
42 views

Using Python trie to build transactionsTrie. Why is my Transactionsroot wrong?

I am trying to build a TransactionsTrie with python. I am using this [trie][1]-Library. I followed the Instructions. Edit: Removed the original question because it was stupid. @carver Thank you ...
2
votes
1answer
262 views

Are number of transactions in Merkle Tree always “even”?

According to definition and structure of the Merkle Tree, apparently, the number of transactions in a block that inserted in a Merkle Tree structure must be even (and not odd), is not it? Please see ...
2
votes
1answer
59 views

Leaf node with encodedPath containing only Hex-Prefix in Merkle Patricia Trie

A leaf node is defined as the tuple [encodedPath, value], and encodedPath uses the Hex-Prefix encoding. Is it possible we have a leaf node with encodedPath having only the prefix and no partial path ...
1
vote
1answer
135 views

Merkle proof for Smart Contract mapping field data

I'm trying to get merkle proof for Ethereum Smart Contract mapping field data. I created test smart contract and deployed to test network. Smart Contract Code like following code: contract ...
1
vote
1answer
63 views

Which node to use in Merkle Patricia Tree when there are single and shared nibbles at the same point?

If I understood well, extension and leaf nodes should be used when there are shared nibbles, and branch nodes when there are differences. Which type of node should be used when storing a different ...
1
vote
1answer
580 views

How the blocks and tries are stored

Newbie here! I still not sure if I understood how some structures of Ethereum are physically stored (assuming Geth implementation) State Trie: only one off-chain Merkle Patricia Tries stored using ...
2
votes
1answer
136 views

ELI5 sparse Merkle trees on sharding

Lately, there's been some interest in sparse Merkle trees (SMTs). I know Ethereum uses Patricia tries (PTs), but this thread seems to indicate that working with SMTs would yield similar performance, ...
1
vote
0answers
68 views

Custom Merkle Patricia Tree

One of the requirements of building our company's DApp is to maintain a separate, custom Merkle Patricia Tree that contain's data from our company's platform only. The Tree needs all CRUD operations ...
8
votes
1answer
480 views

Why Merkle-Patricia Trie has three types of nodes?

I've been reading about Merkel Patricia Trie and I think that I understand how it works, but it looks a bit overcomplicated to me, which suggests that I do not understand it fully. Here is how Merkle ...
1
vote
0answers
53 views

Why is the transactionsRoot the same hash as “empty patricia merkle trie” root hash?

My setup is as follows: I am Using ganache-cli and metamask to send 1 ETH from account 1 to account 2. When I use JsonRPC to get the Information about Block 1 (the one with the transaction) the ...
1
vote
1answer
50 views

Sound but incorrect change in Merkle-tree

From the whitepaper, The first step in in verifying block validity is: Check if the previous block referenced by the block exists and is valid. With regard to a merkle tree propogating change ...
0
votes
1answer
39 views

Merkeling in Ethereum

I am currently facing the challenge to prove that a transaction is mined into a block. Dose anyone know libraries/tools that do this kind of thing? e.g.: create a proof that can be validated offline ...
1
vote
0answers
103 views

UTXO vs Account scalability paradigms and Merkle proof of ownership

From Ethereum's design rationale: Potential scalability paradigms: UTXOs are more theoretically compatible with certain kinds of scalability paradigms, as we can rely on only the owner of some ...
2
votes
1answer
416 views

How to store storage trie in leveldb?

I want to know the structure of storage trie and its data structure in leveldb, and I read solidity storage. I still have questions? In the yellow paper, it says that storage root is a mapping ...
2
votes
1answer
141 views

How to check member in merkle tree

If we want to check that data is member of it or not we will take the root, data block, and all the blocks in path between data and root. According to this picture if i want to check that data block, ...
0
votes
1answer
128 views

Why stateRoot, transactionsRoot and receiptsRoot not included in the blockheader of any etherscan ?

My question may be stupid. I'm trying to understand how ethereum is made and in all articles I read that a block header include a list of things and the stateRoot, the transactionsRoot and the ...
1
vote
1answer
126 views

Trie, Radix Trie, Patricia and Merkle Patricia Trie

Can you explain to me the main differences between these 4 tries? Thank you
1
vote
1answer
72 views

Addresses in paths of State Patricia Trie

Every block header has 3 patricia trees. In State Patricia Trie, the paths are the sha3 of the ethereum addresses, and the value for any particular address is encoded with RLP. But, what addresses ...
1
vote
1answer
87 views

Examples of light-client interactions to extract Merkle proofs?

I'd be grateful for pointers to working examples of interacting with the geth/parity light-client protocols. I'm particularly interested in working code which shows how to extract the Merkle proof ...
3
votes
1answer
404 views

How to calculate the merkle proof for quering the balance of a token holder?

I know this can be done through accessing the full node of Ethereum, but I want to know, how could I do it technically? Suppose I have an ERC20 token contract having address 0xabc.. and Alice is the ...
1
vote
1answer
970 views

What are the storage and state tries?

I have seen that nodes hold a storage trie and state trie. What are those tries and are there these two tries per a contract code (in every copy of the blockchain)?
1
vote
2answers
327 views

How do merkle and patricia trees co-exist

I understand how those tree's work separately, but i can't imagine how to put it in one structure. From ethereum's wiki: All substantial quantities of data in Ethereum are stored in a data ...
3
votes
1answer
166 views

JavaScript merkle-patricia-tree/secure - OutOfMemory when traversing large (~70Gb) state tries

I have the JavaScript code below, which is traversing the state trie from geth's leveldb for Ethereum mainnet Block #5200035. After some time with high cpu usage and having reserved about 6Gb RAM, ...
2
votes
2answers
249 views

Storage trie - are trie nodes reused for two contract instances with the same storage content?

Reading geth code and various posts here, I think I have now a good understanding of how the data is stored in Ethereum (please correct me if I am wrong at some point). At the lowest level we have a ...
1
vote
1answer
42 views

Reference a long-forgoten account

In the Etherem Blog Vitalik says: "but we do not store history older than 5000 blocks.". 1) Is it to be understood that the state Trie does not contain the state of accounts which were not in use ...
3
votes
0answers
26 views

Does any client maintain a mapping of hashes to addresses?

As explained in the Design Rationale wiki: Using sha3(k) as the key in the "secure tree" (used in the state and account storage tries): this makes it much more difficult to DoS the trie by setting ...
4
votes
1answer
271 views

Why are keys hashed in Merkle Patricia Trie?

Account addresses are hashed before they are recorded in the Patricia Merkle Trie, as well as storage slot indexes. This makes it difficult to enumerate all accounts and storage slots by scanning the ...
3
votes
1answer
233 views

Rationale Behind Ethereum's Data Storage Scheme

1) Why does Ethereum store data in 32byte chunks? I don't suppose this to be some backward-compatibility left-over; is it? We could store data in variable length fields as well. 2)I don't think ...
5
votes
1answer
381 views

Ethereum Merkle Patricia Trie and Hashes

In Ethereum, there's a hash of all of the 3 tries in each block. Out of curiosity. The docs state that the functionality is supposed to just provide a mapping between 160bit keys and values. I find ...
2
votes
0answers
33 views

Markle patricia tree odd key lengh

I was going through MTP deatils here Can someone give real scenario example for odd key length? "When traversing paths in nibbles, we may end up with an odd number of nibbles to traverse, but ...
4
votes
1answer
312 views

(key,value) pair in account storage and corresponding modified Merkle patricia tree

In the yellow paper(section 4.1, storageRoot) at it is mentioned storageRoot: A 256-bit hash of the root node of a Merkle Patricia tree that encodes the storage contents of the account (a mapping ...
4
votes
1answer
300 views

Getting the Merkle Patricia trie

How do I get the Merkle Patricia tries of a block from a client? Do clients implement a standard call to retrieve it?
5
votes
2answers
638 views

Ethereum Merkle Patricia Trie (Extension node)

I do not have time to look through the source code right now. My questions is: In Ethereum, when is the decision to replace part of a given path with an Extension-node made? I suppose the sole idea ...