zksync
zksync copied to clipboard
Is the balance tree in CircuitAccount a binary sparse merkle tree?
From the implementation, it seems like the balance tree uses the same sparse merkle tree data structure as the circuit account tree.
pub struct CircuitAccount<E: RescueEngine> {
pub subtree: SparseMerkleTree<Balance<E>, E::Fr, RescueHasher<E>>,
pub nonce: E::Fr,
pub pub_key_hash: E::Fr,
pub address: E::Fr,
}
However, as noted in the illustration in protocol.md, the balance tree is none binary.
What is the correct interpretation?
Follow up questions:
- why does
CircuitAccountTreehave a sub tree, but notAccountTree? - Do both reside in the "server"?
- Why are there two trees?
Great!