Gnosis Safe x Rockside: The safest and easiest way to deal with Ethereum transactions

Find out why the combination of the two services makes it easy to create a seamless user experience

Tangui Clairet
Rockside
4 min readNov 4, 2020

--

dApps users want secure and easy to use services.This requires using fully tested and audited contracts. Transaction fees should be optimized and transactions should never be stuck. Find out how the Rockside Relayer and Gnosis Safe combo meets these expectations.

The combo to offer seamless user experience and maximum security

Rockside has developed a service for relaying transactions through Gnosis Safe Smart Contract. Thanks to this new service, users sign message containing information about the transaction they would like to execute and Rockside guarantees them the transaction will never be stuck.

Rockside ensure the inclusion in a Block at the best price/time ratio and bear any additional gas if necessary. The use of “Rockside x Gnosis Safe” is compatible with all smart contract and remains completely non-custodian.

About Gnosis Safe wallet

Gnosis Safe is one of the best smart contract based wallet available on Ethereum. Fully tested, audited and trusted by the ecosystem. It can manage all token standards and more, has a fully configurable multi-signature feature and is compatible with all the client side wallets. The safe will represent your identity on the chain, it will hold your ether and be the owner your tokens (ERC20, ERC721, …).

About Rockside

Sometimes Ethereum transactions are stuck or lost. To attempt to solve this problem, developers overpay transactions and must remain on-call to unblock them. Rockside is a transaction relayer for sending Blockchain transactions at a fixed and predetermined price and time. Rockside ensure the validation of your transactions and bears any additional gas.

“Using Rockside to relay transactions to Gnosis Safe greatly simplifies the implementation of seamless user experience with transaction Fee payment by the dApp or Gas reimbursement with any ERC20 for example. Transactions will never be stuck and the system remains completely non-custodian!” Vincent— Rockside CTO

Show me the code!

The first thing you need is an EOA (External Owned Account). It can come from a third party wallet compatible with wallet connect.

You need to deploy the safe with this EOA as its owner. The easiest way to deploy your gnosis safe is to use their web app https://gnosis-safe.io/app/ and follow instructions. If you want to do it by your self, you should take a look at the documentation here.

Finally, be sure to transfer some ether to the safe, it will need it to reimburse the transactions relays.

Now your safe should be all set !

Making transactions with Rockside

When you want to make a transaction with the safe you have different things to consider.

First get Rockside relay params:

And the result should be something like this:

You must choose a speed and save the associated gas_price and relayer.

You need to create a safe transaction object with the following: to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, nonce (details on each fields).

You can either encodePacked those arguments or call function getTransactionHash(address to, uint265 value, bytes data, uint8 operation, uint256 safeTxGas, uint256 basGas, uint256 gasPrice, address gasToken, address refundReceiver, uint256 nonce) to get the transaction hash. Once you have it sign it using the EOA controlling the gnosis safe.

You can now encode the call to gnosis:

You now have the encoded hex data of the call and you can make a relay request to Rockside.

And the result will be a transaction_hash and tracking_id. The tracking_id is more reliable, it will remain the same if the transaction is replayed.

And that’s it ! Your transaction will be relayed by Rockside, you can be sure that it will be included in the blockchain in time.

Batching

You can make batch by calling MultiSend (available here) a contract developed by Gnosis team. But the tricky thing is that you need to call it with a DELEGATECALL. For more details, the repository linked below include an example on how to use it.

Conclusion

As a dApp developper, if you want to provide your users with a SmartWallet, Gnosis Safe is a very good choice (open source, tested, audited, secure…). But having the safe is just the half way, you still need to relay transaction to it.

“Just send to Rockside API the same data as you will send to a node, we manage the rest.” — Frederic, VP of Engineering

Rockside, by managing replay transaction and gas price optimisation , makes Gnosis integration quick and easy for developers.

Repository

Co-written by Tangui Clairet and Vincent Le Gallic

Join the Rocksiders community :

Subscribe to our newsletter.
Try Rockside, visit our website
Follow us on Twitter.
Join our
Telegram
Join our Slack.

--

--