how does Etherscan get this information from the blockchain? Is it possible via using a web3 module? Any insight?
Asked
Active
Viewed 36 times
1 Answers
0
how does Etherscan get this information from the blockchain?
Almost certainly by reading the raw account data stored in the World State Trie. It might simply be the case of iterating over the associated Patricia-Merkle trie and counting the number of leaf nodes, each of which corresponds to a used address. (See the first diagram in this answer.)
Is it possible via using a web3 module?
In theory you could iterate through all known blocks, call getBlock, grab the transactions, inspect the to and from addresses, and build your own list of used addresses.
However, this would be so slow over RPC that it would likely never finish.
Richard Horrocks
- 37,835
- 13
- 87
- 144