Going further #4: Paymasters
Overview of how Abstract is using Paymasters
What are Paymasters ?
Paymasters are specialized accounts designed to subsidize transaction fees for users, enhancing usability and flexibility within protocols. They also facilitate the payment of fees using ERC20 tokens, instead of the default ETH.
Paymaster Flows
Paymasters can operate under various flows, some of which may require user interaction, such as setting allowances for token swaps. These flows enable paymasters to support a wide range of use cases, from simple fee subsidies to more complex scenarios involving ERC20 token exchanges for transaction fees.
The most common ones are :
Gas with a Paymaster
Interacting with a paymaster generally consumes more gas than a standard transaction due to additional computations and operations. The primary factors contributing to this increased gas usage are:
Internal Computations: These include the operations within the paymaster's transacations (usually minimal)
Funds Transfer: The gas consumed when a paymaster sends funds to the bootloader*. (comparable to what users might pay for similar transactions independently)
*Bootloader: In ZKsync case, it's the program that accepts an array of transactions and executes the entire ZKsync batch.
ERC20 Token Allowance Management: Optionally, if the user compensates the paymaster with an ERC20 token, managing the token's allowance consumes additional gas.
How does Abstract use Paymasters ?
In Abstract, paymasters are smart contracts that pay gas fees on behalf of other accounts. They provide a way to sponsor transactions, allowing users to interact with the network without needing to hold the native token for gas fees.
How are paymasters built on Abstract ?
To understand how paymaster will be used in Abstract, we need to take a look how they are natively understood onchain:
All Txs are submitted to the Booloader
This Bootloader checks if a paymaster is implemented
If YES : Tx sent to the paymaster contract then sent to the account
If NO : Tx directly sent to the account
Sources
https://docs.abs.xyz/ https://docs.zksync.io/build/developer-reference/account-abstraction/paymasters https://www.youtube.com/watch?v=oolgV2M8ZUI
Last updated