Skip to content

Overview

The Relay uses JSON-RPC 2.0 to facilitate communication between the Porto SDK and the blockchain. The RPC is responsible for building, simulating and sending intents to the contracts on behalf of a user.

Execution is paid for in one of the fee tokens accepted by the RPC on a given network. You can get the supported fee tokens for a chain by querying wallet_getCapabilities.

Endpoints

The Relay has a single hosted endpoint: https://rpc.ithaca.xyz.

Local Development

To run the Relay locally, you can use the following command:

curl -sSL s.porto.sh/docker | docker compose -f - up -d

Once complete, the Relay will be available at http://localhost:9200:

cast rpc --rpc-url http://localhost:9200 wallet_getCapabilities "[31337]"

Account management

Accounts are managed through the RPC using the following methods:

Account upgrade

Upgrading an existing EOA is split into two steps:

Account information

For more details on how accounts work, see the Account documentation.

Intent execution

Intents are executed in two steps. First, wallet_prepareCalls is called to simulate the call and estimate fees. A context is returned with the built intent, which also includes a quote signed by the Relay, which expires after some time. The built intent is verified and signed by the user's key, and the quote plus the signed intent is sent to the Relay with wallet_sendPreparedCalls.

The Relay will validate that the quote is still valid, that the intent was signed, and will then include it in a transaction on the destination chain. wallet_sendPreparedCalls returns an opaque identifier that is the equivalent of a transaction hash. To get the status of an intent, plus any transaction receipts for the intent, you must use wallet_getCallsStatus.