I would like to share some rough thoughts after using the EVM RPC canister a bit and building examples in Azle (TypeScript/JavaScript CDK).
First off, I call into question the need for the EVM RPC canister if you have a library like Ethers.js, as long as the EVM RPC canister does not have a direct integration with Ethereum and simply relies on underlying RPC providers. I would have to double-check to be certain, but I remember reading while building my examples, which use Ethers.js, that Ethers.js has a provider that will send requests to mulitple RPC providers and essentially come to consensus on their results. If that’s the case, isn’t that exactly what the EVM RPC canister is doing? Then what benefit does the canister have if Ethers.js is fully available to the developer? Seems a much simpler and more standard experience to just use a library that already exists.
With that being said, perhaps not all languages available on ICP will have access to a nice library like Ethers.js. Even if that’s the case, I call into question why the EVM RPC canister is using Candid as the main interface language for this functionality. It’s quite complicated and confusing to use, and especially to teach to someone new to ICP. Wouldn’t it be better to just create an HTTP canister that acts identically to the other RPC providers? Not only could canisters within ICP interact with it using an HTTP API (for example Azle canisters can use fetch
and icp://
and probably soon https://
to do cross-canister calls), but also we could expose this API to the internet. Perhaps while it just proxies other providers it might not be such a good idea, but if we ever get a more direct integration this could possibly be the most secure and transparent Ethereum JSON RPC provider in existence.
In short…can we embrace HTTP for the EVM RPC canister? And do we even need the canister (assuming a non-direct integration) in the presence of libraries like Ethers.js?