Skip to content

Meta-transaction support for RSKJ

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE-OPENGSN
Notifications You must be signed in to change notification settings

franciscotobar/rif-relay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RIF Enveloping - V2

A secure transaction relay system to enable users to pay fees using ERC-20 tokens.

CircleCI

Description

RIF Enveloping takes its inspiration from the Gas Station Network (GSN) project. GSN is a decentralized system that improves dApp usability without sacrificing security. In a nutshell, GSN abstracts away gas (used to pay transaction fees) to minimize onboarding and UX friction for dApps. With GSN, "gasless clients" can interact with smart contracts paying for gas with tokens instead of native-currency.

RIF Enveloping V1 started as a fork of GSN with two goals in mind:

  • Be compatible with existing and future smart contracts without requiring such contracts to be adapted to work with RIF Enveloping.
  • Be as cost effective as possible.

RIF Enveloping V2 is a redesign of GSN, it reduces gas costs and simplifies the interaction between the different contracts that are part of the system. It achieves this by:

  • Securely deploying counterfactual Smart Wallet proxies for each user account: this eliminates the need for relying on _msgSender() and _msgData() functions, making existing and future contracts compatible with RIF Enveloping without any modification.
  • Allowing relayers to receive tokens in a worker address under their control and decide what to do with funds later on.
  • Reducing gas costs by optimizing the GSN architecture.

Our main objective is to provide the RSK ecosystem with the means to enable blockchain applications and end-users (wallet-apps) to pay for transaction fees using tokens (e.g. RIF tokens), and thereby remove the need to acquire RBTC in advance.

It is important to recall that - as a security measure - the version 1 contracts deployed on Mainnet have limits on the staked amounts to operate, these limits were removed in version 2.

Technical Documentation

The following technical content is available:

Testnet Contracts - V2

Primary contracts

Contract Address
Penalizer 0x2aC0d7bCdEEa716c47041763D2ACb44544C1F072
RelayHub 0xD8cf6b656cd510392a076821ecd722F80E06734F
SmartWallet 0xB945ef22A7C39Bce170CE2d3d4dcc0Ae12349241
SmartWalletFactory 0xfF9b58102407FB077A3Fe632E5a9c94554C6dFf4
DeployVerifier 0x86cC4c29E00bE2ffdD3A2DBAeda247391d98585A
RelayVerifier 0x47f34837b4a96875011d8a375dcADfc9ea18Fa75

For CustomSmartWallet support

Contract Address
CustomSmartWallet 0xC3BE4ABE9C39941b0D647F78df611007bC99F410
CustomSmartWalletFactory 0x3eA66409DE3Ed4664852a0Ef0570bf933a24f486
CustomSmartWalletDeployVerifier 0x5cC5ABA3a626fc100402e919aEC9829b29E4c8da
CustomSmartWalletRelayVerifier 0x61551023521B964495fB19FA433eED9EFE8A913c

For Testing purposes

Contract Address
SampleRecipient 0x2D319651D8Bf9A049e15232fE43196F94D3CB13B

Changelog

V2

  • RelayHub contract doesn't receive payments, the payment for the service (in tokens) is sent directly to the worker relaying the transaction on behalf of the user.
  • RelayHub contract now handles relay manager staking.
  • Paymaster verifications are done off-chain to optimize gas costs, thus the paymasters are now called Verifiers and they are not part of the on-chain relay flow nor they handle payments at all.
  • Big gas cost optimization.
  • Security issues fixed.

About

Meta-transaction support for RSKJ

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE-OPENGSN

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 80.3%
  • Solidity 15.5%
  • Shell 2.4%
  • JavaScript 1.5%
  • Dockerfile 0.2%
  • Perl 0.1%