Starknet <> EVM JSON-RPC adapter

EVM JSON-RPC standard is used by several Wallets (Metamask) and data providers (Infura, Nansen). When data providers and wallets need to support a new EVM chain the only thing they need to do is change the json-rpc url and chain-id in all their requests.

Starknet JSON-RPC API closely resembles that of the EVM json-rpc but is not exact, this adds developer overhead for all the wallets and data providers when integrating starknet into their services.

There are two services which rely on the JSON-RPC url:

  1. Wallets: Supporting ethereum wallets is a different discussion, since starknet supports abstract wallets the closest equivalent to this in ethereum are contract wallets (Gnosis safe), which donโ€™t work straight away with Metamask anyways.

  2. Data providers: We can reduce the infra overhead of data providers by writing a wrapper service which:

    1. Takes in an EVM json-rpc request
    2. Converts in correct starknet JSON RPC request
    3. Makes the request to a starknet node and gets a starknet json-rpc response
    4. Returns the EVM json-rpc response back to the user.

    The data providers then can directly support starknet nodes without putting extra developer work, the only thing they will need to do is change their JSON-RPC url and chain-id. In the future we can also develop support to enable simple wallet integration.

This approach is similar to Warp developed by Nethermind. Where Warp maps between solidity <> cairo, this adapter will map between EVM <> Starknet JSON-RPCโ€™s.

11 Likes

Might be of interest:

7 Likes