Introducing Particle Network’s Omnichain Paymaster: Cross-Chain Gas Sponsorships
Table of Contents:
As we progress through the simultaneous development of the many upgrades coming to Particle Network, we have successfully concluded the release of our Omnichain Paymaster.
This service, directly integrated into Particle Network's Modular Smart WaaS stack, constitutes a part of our Omnichan Account Abstraction stack for AA interoperability. In its first version, our Paymaster allows developers to recharge USDT on one chain (Ethereum and BNB Chain initially) to sponsor users’ gas on any EVM chain. Particle's Paymaster automatically calculates the exchange rate for the chain's native token and deducts it in the background.
Let's take a deeper look at this release and its inner workings:
What is Particle's Omnichain Paymaster
Particle Network’s Paymaster is a specialized tool designed to make gas payments easier and friendlier for end users across chains, leveraging Particle Network's Omnichain AA design. This service, which has helped us sponsor over 500k UserOperations across different networks in the previous month, is already fully integrated with Particle’s Modular Smart WaaS (Wallet-as-a-Service).
For those unfamiliar with both of these concepts, let’s quickly revisit them.
Omnichain Account Abstraction
Omnichain Account Abstraction is Particle Network's approach to address several user experience and robustness issues with ERC-4337 AA infrastructure and its design. It reduces AA's focus on transaction flow and puts the spotlight back on user accounts and their programmability. Omnichain AA also represents a solution for different cross-chain and interoperability pain points the industry has long been facing.
Paymaster
Paymasters, in the context of ERC-4337, play a critical role in enhancing the user experience by abstracting gas payments. Paymasters act as financial guarantors, covering transaction fees for users or allowing them to pay for gas using tokens different from the native chain's native coin. This setup allows users to, e.g., perform transactions on Ethereum without needing Ether as gas. This feature simplifies the user experience and makes dApp usage friendlier, particularly when dApps pay for gas on behalf of users.
In its first implementation, Particle's Omnichain Paymaster enables developers to sponsor gas for users through USDT on multiple chains. To do this, they recharge USDT on either the Ethereum Mainnet or BNB Chain and are able to use it on different chains. By integrating the Particle Network Paymaster, developers using Particle Network’s Smart Wallet-as-a-Service can begin leveraging Omnichain Paymaster while seamlessly onboarding users into Web3 dApps via social logins. In the future, the Paymaster will be updated to support more origin chains and additional tokens for gas payments.
Advantages of the Particle Paymaster
Particle's Paymaster offers several compelling advantages, making it an powerful component of the Omnichain AA ecosystem:
- Multi-chain usage: Once developers deposit USDT, they can sponsor UserOps on every EVM-compatible chain.
- Adaptable sponsorship logic using Webhooks: Configuring webhooks allows developers to accurately control which UserOP can be accepted by the cross-chain Paymaster
- Monitoring: Developers are able to monitor every UserOp they sponsored.
- Expiration times: Developers can define an expiration time for the Paymaster signature. Once the UserOperation reaches its expiration, the Paymaster signature will automatically lapse.
Webhooks
Configuring webhooks allows developers to accurately control which UserOP can be accepted by the Paymaster. We use two types of webhooks:
- Before the Paymaster signs (before_paymaster_sign).
- After the Paymaster signs (after_paymaster_sign).
Every time a Webhook request is made, a signature for the body is generated, which developers can verify to determine whether the request was sent by Particle Network. A unique public and private key (RSA-2048) is generated for each project. This key can be downloaded from the users’ Particle dashboard page for verification.
Webhook: before_paymaster_sign
This hook will be triggered before the Paymaster signs. The Paymaster will determine whether to sign the UserOP based on the status code returned by the Hook. It includes:
- Body
- chainId
- userOp - UserOperation struct.
- entryPoint - The entryPoint address.
- parsed - Transaction struct. The Paymaster will attempt to parse the calldata of the UserOP. If it cannot be parsed, this field may not exist.
- Response
- If the status code of the response returned is 200, then the Paymaster will accept the UserOP and sign it.
Webhook: after_paymaster_sign
This hook will trigger after the Paymaster signs. It includes:
- Body
- chainId
- userOp - UserOperation struct.
- entryPoint - The entryPoint address.
- parsed - Transaction struct. The Paymaster will attempt to parse the calldata of the UserOP. If it cannot be parsed, this field may not exist.
Using Webhooks for your sponsorship policy within the cross-chain Paymaster
Developers can use Webhooks to implement any sponsorship logic they wish in conjunction with the Paymaster.
For the before_paymaster_sign webhook, we return all the data necessary:
- projectUuid
- chainId
- userOp
- and parsed data:
- accountType: BICONOMY, CYBERCONNECT, SIMPLE
- txs
- Any policy
- You can use chainId to decide which chains you want to sponsor.
- You can use userOp to decide which user address(sender) you want to sponsor.
- You can use userOp to calculate the gas fee and decide whether to sponsor or not.
- You can use the accountType and txs to use them as a smart contract whitelist or blacklist.
This allows, for example, for the following business scenarios:
- A GameFi project to allow every new user to gaslessly mint a game NFT.
- A financial platform can sponsor gas for every deposit, so their users don't need to learn the concept of gas.
- An NFT platform can enable users to trade NFTs without gas, using their own fees to cover gas.
In many cases, programmatic sponsorship policies can be used and adapted towards creating a friendly experience and simplifying experiences where it matters most.
Wrapping up
Particle Network's Omnichain Paymaster is a practical and useful tool for developers to simplify gas payments across networks. We have battle-tested it by sponsoring over 500k UserOperations across different chains in the last month and, as such, are proud to integrate it into our Modular Smart WaaS stack.
With this first stepping stone, we aim to address a common challenge in the blockchain space, making it easier for developers to manage transaction costs and improve the user experience of their dApps across chains.
We encourage developers to explore the potential of Particle Network’s Omnichain Paymaster. For more information, visit our documentation. Remember that all of our services are now 100% to use for developers!
Particle Network's Wallet Abstraction solutions are 100% free for developers and teams. By integrating them, you can set your project in a path to leveraging chain abstraction.
About Particle Network
Particle Network powers chain abstraction, addressing Web3's fragmentation of users and liquidity. This is enabled by Particle's Universal Accounts, which give users a unified account and balance across all chains.