Introduction to meta transactions
Why?
- To fix user onboarding
- User needs ETH to use Ethereum (Paradox: said many times)
"40% abondon a website that takes more than 3 seconds to load"
User onboarding journey
Enter meta transaction
Decouple the sender of the transaction from the payer of the gas fees
How do meta transactions work?
- User signs a transaction and sends it to a relayer
- Relayer wraps it and uploads it to the network
Decentralizing layers
using gas station networks
Enter gas station network
- Decentralised pool of incentivised layers
- Single co-ordinating hub
- Recipient dapp pay for execution
(You do not need to worry about relayers, it already exists. Just code payment strategy)
Towards a standard for meta-txns
Minimize onboarding and UX friction for dapps
GSN Alliance
How does GSN work?
- User signs a transaction to a recipient
- Picks a relayer from the pool and sends the transaction to it
- Relayer checks if the recipient will pay for the execution
- Relayer wraps the transaction and sends it via the hub
- Recipient contract unwraps and executes the transaction
- Hub pays the relayer for its effort with the recipient’s funds
Example use cases of GSN
- Pay gas in any token: Allow users to pay for gas in any token
- Pay gas in fiat: Allow users to pay for gas in fiat without having to go through KYC
- Privacy: Enabling ETH-less withdrawal of tokens sent to stealth addresses
- Onboarding: Allow dapps to subsidize the onboarding process for new users
Ethereum GSN Architecture
Notes: Ethereum GSN Architecture
- Client: signs & sends meta transaction to relay server
- Relay servers: one for all, all for one
- Paymaster: agrees to refund server for gas fees
- Trusted Forwarder: verifies sender signature and nonce
- Recipient contract: sees original sender
- RelayHub: connecting participants trustlessly
Building on GSN
"Sounds great! But how do I use it?"
Things to consider
- Write GSN-capable contracts
- Send txs via a relayer on your client app
- Add funds to your dapp in the GSN hub
- Spin up a local GSN for development & testing
Contracts
Managing payment and unwrapping meta-txs