One of the two eternal problems of the market is that users pay network fees for every activity. Paymaster was born to solve this problem. So what is Paymaster? Let’s learn how Paymaster works in the following article.
What is Paymaster?
Paymaster is a service in the Account Abstraction model that allows users to pay gas fees on the blockchain using various tokens instead of the native token (the main token on the network).
For example, users transacting on Ethereum need ETH tokens to pay fees. But with Paymaster, users can pay transaction fees with USDC, USDT… without needing to hold ETH.
Accordingly, dApps integrating Paymaster support users in paying gas fees with coins or tokens other than the blockchain’s native token, creating flexibility and convenience in the transaction experience.
What problem does Paymaster solve in the crypto market?
According to Le Thanh – Founder of Ninety Eight, one of the two barriers that make it difficult for newcomers to access the crypto space is gas fees. When participating in transactions or activities on dApps, users need to pay network fees. Depending on the network, users also have to use the network’s native coin to pay fees. For example, Avalanche requires AVAX tokens, BNB Chain requires BNB tokens…
In the case of trading WETH tokens for USDT tokens on the BNB Chain network, users need to buy BNB tokens, hold them, and pay fees when transacting. In general, this has caused a lot of inconvenience.
For Layer 1 networks, gas fees from users are distributed to validators/miners, as “wages” for validating and storing transactions. Meanwhile, for Layer 2 blockchains, the gas fee is used to pay for tasks such as Data Availability, Sequencer…
It can be seen that paying fees is a mandatory activity on each network, although this is an obstacle for newcomers to the crypto market. Even the gas fee barrier also causes difficulties when, depending on each blockchain, users also have to use the network’s native coin to pay gas fees. For example, Ethereum uses ETH to pay fees, while on Avalanche, transaction fees are paid with AVAX tokens.
Many solutions have been born to solve the above problem, such as Gasless Transaction of Gnosis Chain…, but cannot be applied to Ethereum – the largest EVM network in the crypto market. Until the beginning of 2023, the ERC-4337 standard, also known as Account Abstraction, was launched on Ethereum, from which Paymaster was also integrated into Ethereum and EVM-using networks.
Accordingly, dApps on these networks can set up Paymaster contracts and integrate them into the platform. Some projects have integrated Paymaster into their applications and have operational data such as Web3 wallets (Holdstation on zkSync), Lending/Borrowing (Nostra Finance on Starknet), DEX (Syncswap on zkSync)…
Also, does Paymaster help users avoid gas fees?
The answer is no. Paymaster is simply a way to simplify the process of paying gas fees for users, but it still maintains a revenue stream for validators/miners on the network. Paymaster is commonly used in two forms:
- Sponsor Paymaster: This type of Paymaster allows dApp developers to prepay a certain amount of gas fees to the network. Users do not have to pay gas fees on the network when participating in the dApp, and the prepaid amount will be gradually amortized.
- ERC-20 Paymaster: This type of Paymaster allows users to pay transaction fees with other tokens (usually stablecoins) instead of the network’s native token.
According to Biconomy, since its launch, Paymaster has always been the “main feature” of AA, as 95% of users interacting with AA use Paymaster.
Further reading: ERC-4337 is about to pave the way for millions of crypto users.
How Paymaster Works
Within the architecture of dApps that integrate paymaster, it is implemented in the form of a smart contract. The Paymaster smart contract was conceptualized in 2021. However, it wasn’t until March 2023, following the EIP-4337 proposal on Ethereum, that this smart contract was successfully integrated onto the Ethereum blockchain.
With the established framework from Ethereum, a series of networks utilizing the EVM virtual machine also successfully integrated the Paymaster smart contract, including Optimism, BNB Chain, Arbitrum… According to Dune Analytics, Zksync and Base are the two leading networks in terms of Paymaster demand. These two blockchains have recorded a combined total of over 5 million transactions related to Paymaster.
Example of a project using Paymaster – Nostra Finance on Starknet:
Step 1: First, the user accesses the Nostra Finance site and initiates a transaction.
Step 2: In the right corner of the screen, Nostra Finance displays the Paymaster icon in the form of a gas pump. In this section, users can customize the token to pay for gas fees for transactions on Nostra Finance, instead of using the ETH token.]
It can be seen that Nostra Finance is using ERC-20 Paymaster. For Sponsor Paymaster projects, users also need to sign a smart contract authorizing fees for the project.
Step 3: After customizing the token, users need to sign a smart contract agreeing to pay another token for network fees. This smart contract has the function of reading the account balance and paying gas fees if the user has enough balance.
Step 4: Finally, the user only needs to carry out the transaction and the network fee is paid with a different token.
In theory, Paymaster operates through AA. Accordingly, AA consists of the following components:
- UserOperation Object: In AA, each transaction is executed through a UserOperation. This component contains all the information about the user’s transaction, such as “Sender”, “Maximum gas fee”…
- Entry Point Contract: This is the contract responsible for verifying transactions/activities from UserOperation.
The projects will then set up a Paymaster contract and send their data to AA and validate the Entry Point Contract. In general, Paymaster operates quite dependently and has a compatible structure with AA. Without the AA solution, Paymaster would not be able to function.
Further reading: How Account Abstraction works.
Advantages and Disadvantages of Paymaster
Advantages
Improved User Experience: Paymaster optimizes the gas fee payment process, so users don’t have to worry about holding native tokens in their wallets. As a result, interacting with decentralized applications becomes easier, attracting more users and contributing to the development of the ecosystem.
New Business Model: Developers can apply Sponsored Paymaster to encourage users to interact with their applications without incurring any costs. This not only increases engagement but also creates opportunities for more effective marketing campaigns.
Mitigating the Risk of Native Token Price Volatility: With ERC-20 Paymaster, users can pay gas fees with any ERC-20 token, instead of depending on the price of the native token. This not only helps stabilize transaction costs but also facilitates users in managing their assets.
Widely Used by DeFi and NFT Applications: With the popularity of DeFi applications, Paymaster has become a useful tool to expand the customer base. Some projects have integrated Paymaster functionality so that users can use DeFi services without having to hold tokens to pay transaction fees. There have even been NFT projects on zkSync that allow holders to enjoy free gas when participating in any activity on zkSync.
Disadvantages
Although Paymaster offers many benefits, there is also a notable drawback:
Complexity in Deployment: dApps need to build and maintain Paymaster smart contracts. Therefore, if not carefully prepared, smart contracts related to Paymaster can create security vulnerabilities related to assets used to pay gas fees for users, such as paying 100 USDT for transaction fees…
Also, deploying Paymaster can lead to long-term cost issues for dApp developers. Although the transaction fee sponsorship model can attract users initially, maintaining a fund large enough to pay gas fees for all transactions will become a financial burden.
Mechanisms Similar to Paymaster
Paymaster has only become popular since the beginning of 2023 with the advent of AA technology. But in reality, the crypto market has seen many solutions to support users in making gasless transactions, without going through AA.
According to some, most of these solutions lack flexibility and are more difficult to implement compared to AA. Therefore, Paymaster is still more widely used.
Here are two common mechanisms besides Paymaster:
Using Rollapp
One of the most popular models applied by many dApps is using Rollapp to pay gas fees for users. Rollapp is a Rollup designed to allow dApps to operate on their own network, but at the same time maintain a connection to the original network where the dApp is operating.
Rollapp allows customization of the transaction fee structure, from which users can still avoid paying gas fees when participating in the dApp. Similar to Sponsored Paymaster, Rollapp provides free resources on the platform to users, as these costs are managed and governed by the Rollapp developers themselves. However, Rollapp still has to bear the related costs when using Layer 1 resources, such as Data Availability costs, validator/miner fees…
Some dApps that have successfully applied Rollapp include dYdX and Loopring…
Further reading: Zero Gas Fee – Who Pays the Gas Fee for Users?
Using Relayer
Unlike Rollapp, which is mostly used by dApps, Relayer is a gas-free mechanism applied by Layer 1 blockchains. To visualize, Relayers are third-party entities that act as intermediaries to help users transact without having to pay gas fees themselves.
Typically, Relayer is an external service, operated by servers, that has access and can execute transactions on behalf of users. Currently, Relayer is used on networks such as Gnosis Chain, Viction…