I'm trying to understand a Merkle Patricia tree.
For example there are two accounts:
x00: {balance: 1}
x01: {balance: 2}
I can't understand how to begin building my trie. RLP and HP encoding are known, but what is the root node?
Let's take a pseudo-code example:
x00: {balance: 1} x01: {balance: 2} x02: {balance: 3} x03: {balance: 4}
You calculate the first-level nodes:
hashOf("x00: {balance: 1}", "x01: {balance: 2}") -> node1 0x1234 hashOf("x02: {balance: 3}", "x04: {balance: 3}") -> node2 0x5476
You then calculate the second-level node(s):
hashOf("node1 0x1234", "node2 0x5476") -> node3 0x3981
node3
, with the value of 0x3981
, is your root node.