Transactions relayer

A simple relayer service providing gas management for high volume transactions sending

Features

Features

Description

Gas Management

Rockside manage gas required for transactions

High volume transaction

Transactions sending from multiple account.

Concurrent transactions sending is possible.

No account pending transaction queue limitation.

Non-custodial service

We are only responsible for paying the gas fee

Relay strategies

Different strategies are available to relay the transactions of your users.

Deploy a smart-wallet for each of your users: On this model you do not have to modify your dApps contracts, the sender will be the smart wallet of your users (available via msg.sender).

Deploy a forwarder proxy for your dApp: On this model you will have to modify your dApps contract to retrieve your users identity. The sender will always be your forwarder, so the address of your users need to be appended to the call data. An example of implementation is available here.

Refund strategies

You can decide how to refund Rockside Relayer for the relay of your users transactions. For now, only Ether can be used. Support of ERC20 token is coming.

On-chain refund: On your contract (users smart-wallet or forwarder) you can implement a refund logic to pay the relayer for the gas used.

If your relay strategy is based on deploying smart-wallet for your users, Rockside will make the difference between the gas used by all the relayed transactions and the refund received (payed by your users). You will be charged for the remaining fees.

You can find an example of refund logic by looking to methods relayExecute and handlePayment of Rockside for smart wallet contract. Within this implementation, if a gasPrice is specified to the meta-transaction, the amount of gas used is sent back to the relayer.

Off-chain refund: If you do not implement the refund logic on your contract, Rockside will determine the amount of gas used by your transactions during a month and you will be charged for it.

Relay contract prerequisite

Rockside can relay transactions to any smart-contract that respect the following interface.

interface Relayable {
function relayExecute(bytes memory sig, address signer, address destination, uint value, bytes memory data, uint gasLimit, uint gasPrice, uint256 nonce) public
}

The different parameters are:

  • sig: Signature generated by the signer. The signature structure depends on you, but we recommend that you respect EIP 712.

  • signer: Address of the EOA used to generate the signature.

  • destination: 'To' of the meta transaction

  • value: Value of the meta transaction

  • data: Data of the meta transaction.

  • gasLimit: Maximum amount of gas to pay for the transaction. Can be used in your Refund logic, if the gas used is greater than this value, the transaction will be reverted.

  • gasPrice: amount of Ether to pay for each Gas. In Rockside implementation, can be used in your refund logic.

  • nonce: Value of the nonce used to prevent replay attack. For Rockside Smart Wallet we use a multi-dimensional nonce approach described here.

A full implementation used by Rockside for smart wallet contract is available here: Rockside Contract.

You can deploy an instance of a Rockside smart wallet by using our API.

post
Relay a transaction

https://api.rockside.io/ethereum/:network/contracts/relayableidentity/:contract_address/relayExecute
Request
Response
Request
Path Parameters
contract_address
required
string
Address of your smart-contract.
network
required
string
Available network are "ropsten", "mainnet", "poanetwork"
Headers
apikey
required
string
Rockside API key is available on Rockside Dashboard
Body Parameters
nonce
required
string
The nonce used to protect against Replay attack
gas
optional
string
The amount of gas to use to send the transaction. Its also the gasLimit sent to your relay contract.
gasPrice
optional
string
Amount of Ether to pay for each gas. If not specified Rockside will define the best gasPrice to execute the transaction. If specified only whitelisted destinations defined on your token will be authorized.
from
required
string
Address of the EOA that is used to sign transactions params.
to
required
string
Destination address of the transaction.
value
optional
string
Amount (in hexa) of ether you want to send.
data
optional
string
Hash of the invoked method signature and encoded params.
signature
required
string
A hash signed with the EOA authorized on the smart contract. It contains all parameters of the transaction ( from, to, value, data, contract account nonce)
Response
200: OK

Example:

curl -X POST \ https://api.rockside.io/ethereum/ropsten/contracts/relayableidentity/CONTRACT_ADDRESS/relayExecute \ -H 'apikey: YOUR_API_KEY' \ -d '{"from":"FROM_ADDRESS", "to":"TO_ADDRESS", "value":"0x0", "signature":"SIGNED_PARAMETERS"}'

Response:

{
"transaction_hash": "0xb317b54b42bcdcc2bcf8ae96e3dc9463142422175dff85ff9e3de211f83ff4a0"
}