To get the history of a transactions for an account, we have to traverse the whole chain everytime, but etherscan provides the entire history of all the accounts instantly.

Similarly it does the same thing for smart contracts, it gives all erc20 transaction history by giving us the whole 'Transfer' event log.

I was exploring Etherscan and was trying to implement these functionalities for a private network and was trying to find if these are some build-in functionalities to achieve this but it seems like it isn't.

There are several of these ether chain explorers and they are showing all the tokens in any particular wallet, hence keeping track of all token transfers from all public contracts. Now that is a lot of data tracking.

Also I couldn't find out how they are monetizing this service.

So, Is my assumption true?? How they do it. For the usage of similar features in private network, do I have to save and keep track of everything too?


Re. monitisation - etherscan.io runs advertisements.

If you want to determine something like all token transfers you would need to 'scan' the blockchain from inception (or at least when the token was created) - you can do this if you have a full archive node, or scan new blocks as they are added and create a secondary data store with the data you need.

  • So it is what it appears, they are reading all the transaction history and event history and then storing everything into a more faster and better accessible database. Thanks. – Abhishek sharma Jun 27 '18 at 5:26

I also believe monetization is through ad revenue.

It would be impractical to use a live Ethereum client for real-time block exploration at the scale of Etherscan. My understanding is they parse blocks as they arrive and inject records into a database. Caching for performance reasons doesn't undermine the decentralization premise given that we are all free to access the blockchain ourselves and confirm reports that are found on Etherscan.

I think it's worth mentioning that they parse transactions and derive fields that are not directly observable in raw block data. For example, the "internal transactions" imply an analysis of raw transaction data similar to what the miners do. You won't see that information in any object returned from, say, geth, and you won't see special treatment of tokens.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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