Gasless Transactions
RibbleChain's account abstraction (ERC-4337) enables gasless transactions, where users don't pay gas fees directly. This guide explains how to perform gasless transactions using a RibbleChain smart wallet.
How Gasless Transactions Work
- Paymaster: A third party (e.g., dApp or RibbleChain) covers gas fees.
- Smart Wallet: Executes transactions via the EntryPoint contract.
- UserOperation: Bundles transaction data for gasless processing.
Prerequisites
- A RibbleChain smart wallet (see Creating a Smart Wallet).
- $XRB testnet tokens from the Faucet.
Step 1: Connect to a dApp
Open the RibbleChain Wallet app and connect to a dApp (e.g., DEX):
- Click "Connect Wallet."
- Approve the connection.
Step 2: Perform a Gasless Transaction
Example: Swap tokens on the DEX:
- Select tokens to swap (e.g., $XRB to $RST).
- Confirm the transaction in the wallet app.
- The paymaster covers gas fees, and you pay no $XRB for gas.
Step 3: Verify Transaction
Check the transaction on the RibbleChain Explorer:
- Search by transaction hash.
- Confirm the gas fee was zero for the user.
Step 4: Enable Gasless Mode (MetaMask)
For MetaMask users, enable gasless mode:
ribblechain-cli wallet config --gasless true