Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
EVM RPC Canister
We, the DFINITY R&D team, are excited to announce that the EVM RPC canister is now live and available for use by the ICP developer community. The EVM RPC is an Internet Computer canister smart contract designed to communicate with Ethereum and other EVM blockchains using an on-chain API.
Why this is Important
Developers aim to write ICP smart contracts that communicate with the Ethereum network and other EVM chains. ICP already facilitates this through HTTPS outcalls, and the Ethereum protocol defines a specification for software applications to interact with any Ethereum node via an HTTP-based RPC (remote procedure call) interface.
With the rise of EVM-compatible layer-2 chains, developers can now leverage this interface to sign and send raw transactions, among other capabilities. The RPC interface can be used to interact directly with the Ethereum network and other networks such as Optimism or Arbitrum.
Despite the availability of protocol-level tools, bundling them together can be burdensome for developers. This is why the DFINITY R&D team announced a few months ago that they would create an EVM RPC canister for the community, integrating all best practices.
DFINITY’s engineering team has designed a solution that harnesses the capability of a canister smart contract to perform HTTPS outcalls and reach Byzantine consensus to provide a means of integrating directly with the Ethereum network or any EVM-compatible derivative network. This is achieved through an integration with other canister smart contracts deployed on the ICP mainnet. The EVM RPC Canister makes it possible to combine the limitless computational power of the Internet Computer with the billions in assets held on the Ethereum network to build new, novel, entertaining, and useful applications in the decentralized application ecosystem.
How to use it
The canister is live!
To get started, checkout the EVM RPC documentation or the sample code or the canister code on GitHub or you can look up the canister on the ICP dashboard!
How it works
Before the EVM RPC Canister
To send or receive data from Ethereum, such as querying the latest block, an application must perform several complex steps.
The first step is obtaining the address of an Ethereum node to send a request to. While several aggregators do exist, the availability of any individual RPC server is not guaranteed, making it difficult to build a reliable application that depends on data coming from an arbitrary RPC endpoint. Furthermore, several RPC servers lack a coherent privacy policy, and many introduce a high latency into the request chain.
For these reasons, it is typical to utilize a well-known RPC provider, such as Ankr or PublicNode, who provide API’s with high uptime, low latency, and a broad range of supported chains.
An application that uses a sole RPC provider to query an Ethereum node.
For an application with stringent security requirements, it is important to also ensure the result from a provider is consistent with other nodes on the network. This is accomplished by sending multiple requests in parallel to differing providers, then comparing the response returned by each to determine if they agree. If there is a mismatch in any of the responses, there must be a well-defined mechanism for distinguishing fact from fiction.
An application that utilizes several RPC providers to ensure a high degree of data integrity
Finally, the response returned by the Ethereum node must be decoded and deserialized into the underlying type system used by the application, such that it can be utilized in the context of the application’s implementation of the Ethereum data.
The Internet Computer’s role as a hub in linking disparate blockchains together is made possible through strong security properties and a unique ability to execute outbound HTTPS requests on-chain through canister smart contracts.
What this all means is that any application that seeks to integrate with the Ethereum network in some way must procure multiple API keys, store them securely and manage their rotation, while also vetting providers to ensure API quality, uptime, and data integrity. On top of that, the application must define interfaces and implement conversion logic to work with the incoming data. If that all seems like it’s a bit much to deal with efficiently for a standalone application, that’s because it is.
The design behind the EVM RPC Canister
The EVM RPC Canister seeks to reduce the complexity in querying and transacting with EVM-compatible networks. It is designed to be used by other ICP canisters and applications deployed outside of ICP that leverage agents.
The service exposes an interface that provides encapsulation of several key Ethereum JSON RPC APIs into a conveniently typed Candid interface, ensuring response consistency by canonicalizing and comparing results from multiple providers for a given call. This ensures a high-degree of confidence in the integrity of data returned from and sent to supported EVM-compatible networks, including the Ethereum mainnet.
The EVM RPC Canister also abstracts away the burden of procuring, managing, and rotating API keys for different RPC providers, exposing a single interface that scales opaquely with usage. This means that a canister only needs to attach cycles and can assume the EVM RPC Canister will just work, allowing the canister developer to focus solely on their business logic.
Behind the scenes, the EVM RPC canister is instrumented and monitored around the clock for irregularities, spikes in usage, outages, attacks, and more, backed by a highly skilled team ready to resolve any issues the moment they arise.
Governance
The Network Nervous System is a DAO, or decentralized autonomous organization, that governs the Internet Computer, making it possible to build democratized, decentralized applications that are governed by a community. The EVM RPC Canister is an example of one such application — it is controlled by the NNS, meaning any changes that are made to the canister’s code must be done so through a proposal that is voted on and approved by Neurons in the system (i.e. ICP token holders).
Any changes to RPC providers, including their addition, removal, or modification, must be performed by a party authorized to perform a one-time action through an NNS proposal. This ultimately puts the power to shape the capabilities of the EVM RPC Canister directly in the hands of the community utilizing it.
The code that is used to build the Web Assembly (Wasm) module that gets installed to the EVM RPC Canister is publicly available on GitHub, and anyone can build the Wasm and verify its hash matches the one deployed to the ICP mainnet. Doing so ensures the integrity of the canister itself — the code that one is able to read and verify themselves is the exact same code running on the Internet Computer.
Secure and convenient
The EVM RPC Canister absorbs the complexity of procurement, management, and rotation of API keys used to facilitate communication with Ethereum and Ethereum-compatible networks. It offers several conveniences that make working with data originating from EVM-based RPC endpoints simple and easy. DFINITY’s development of the EVM RPC Canister as a decentralized service allows the community to govern its evolution over time.
Together, these innovations are making it possible for developers to build dApps and DeFi projects that natively use one of the largest cryptocurrencies in the world, leveraging immense value and bringing advanced capabilities to Ethereum smart contracts.
Conclusion
The EVM RPC Canister simplifies the integration of ICP smart contracts with Ethereum and other EVM-compatible networks. By abstracting away the complexity of managing API keys and ensuring data integrity, the EVM RPC Canister empowers developers to focus on building innovative, decentralized applications.
Get Started Today
- Explore the EVM RPC documentation to understand how to integrate the EVM RPC Canister into your projects.
- Check out the sample code to see practical implementations of the EVM RPC Canister.
- Join the developer community at forum.dfinity.org to share your experiences, ask questions, and collaborate with other developers.
By using the EVM RPC Canister, you can build dApps and DeFi projects that harness the strengths of both ICP and Ethereum, driving forward the future of decentralized applications.
____
Start building at internetcomputer.org and join the developer community at forum.dfinity.org.
ICP <> Ethereum: How ICP’s EVM RPC Canister Connects the Networks was originally published in The Internet Computer Review on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.