Rosetta Ethereum Smart Contracts (I’ll work on making this more clear on the website!)
The Rosetta APIs were designed specifically to support the generic usage of smart contracts on Ethereum (or any other blockchain with smart contracting). As you mentioned, the expressive notion of accounts allows an implementer of the Rosetta APIs to represent an account’s on-chain activity in the context of a smart contract:
"address": "<smart contract>",
The lack of pre-defined operation types allows for you to support any on-chain activity with types that are native to your deployed contracts. Celo’s implementation of the Node API is based on a fork of geth and may provide some insight on how to proceed with an Ethereum-based implementation.
The way I see it, you have 2 choices for implementing Rosetta on top of Ethereum (your choice will very likely depend on what sort of native ETH functionality you want integrators to have):
- Support all native Ethereum operations + any operations from your smart contracts
- Just support operations related to your smart contracts (likely MUCH easier)
If you do decide to undertake option 1, I HIGHLY recommend breaking out your work into 2 projects:
- Basic EVM Rosetta implementation that allows for module-based smart contract parsing
- Your module that fits into this implementation (which wraps item 1)
This will allow other projects that want to use Ethereum to not have to re-invent the wheel and for you guys to get shared development resources on the core Ethereum implementation. If you go the route of working on a master Ethereum repo, it could get unwieldy pretty quickly if each team deploying smart contracts on Ethereum has to open a PR.
Hope this helps!