Canister smart contracts on ICP can directly interact with the Ethereum network and other networks that are using the Ethereum Virtual Machine (EVM), such as Polygon and Avalanche. This integration is possible thanks to ICP's HTTPS outcalls and chain-key signatures, which allow Ethereum state to be queried and Ethereum transactions to be signed and submitted by canisters.
-
HTTPS outcalls: To query information from Ethereum and other EVM networks, HTTPS outcalls are used. HTTPS outcalls can obtain information from external sources. In this integration, they're used to obtain data from JSON-RPC services by querying Ethereum's transactions, addresses, and block information. To facilitate JSON-RPC calls, the EVM RPC canister provides an API endpoint that canisters can use.
- Chain-key signatures for ECDSA: A canister can have an Ethereum address and sign transactions for that address in a secure and decentralized way using chain-key cryptography. This allows canisters to hold Ethereum natively. Messages sent by the smart contract can be signed in this way, enabling calling any smart contract on Ethereum from the canister.
The main components are depicted in the following figure.
This functionality also forms the basis for EVM-based chain-key tokens, like ckETH, ckUSDC, and many more.
Additional Resources
Developer docs on EVM RPC canister
https://github.com/dfinity/evm-rpc-canister