5

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 Patricia Merkle Trie.

Why not storing the addresses and indexes in clear?

1 Answer 1

5

It's done for DoS Protection, 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 up maximally unfavorable chains of diverge nodes 64 levels deep and repeatedly calling SLOAD and SSTORE on them. Note that this makes it more difficult to enumerate the tree; if you want to have enumeration capability in your client, the simplest approach is to maintain a database mapping sha3(k) -> k.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.