Paymaster
Omnichain Paymaster - Recharge USDT on one chain and use it for multiple chains
Particle Network has implemented a Paymaster service that supports multiple chains. You can recharge USDT on one chain(Ethereum and BNB Chain supported now) and use the Paymaster service on any chain. Particle Paymaster will automatically calculate the exchange rate and deduct it in the background.
What is Particle Paymaster
Particle Paymaster is a multi-chain Verifying Paymaster, which means
Deposit once and sponsor UserOp on every chain;
Bring any sponsorship logic using Webhooks;
Monitor every UserOp you sponsored.
The ERC20 Token Paymaster is used by the user directly, so it's hooked into our SDK directly, no extra configuration is needed.
How to use
Use Particle Network's AA SDKs, Particle's Paymaster will be automatically included, and no extra configuration is needed;
Use Particle Paymaster's RPC directly to plug the multi-chain paymaster in your AA project.
For any testnet, it's sponsored by Particle Network automatically, no need to deposit
3. Because of our modular design, you can always use any other paymaster you want, we have also natively integrated Biconomy Paymater.
Biconomy Paymaster only supports BICONOMY smart account.
Expiration time
You have the option to define an expiration time for the Paymaster Signature. Once the user operation reaches its expiration, the Paymaster Signature will automatically lapse.
Webhook
Configuring webhooks allows you to accurately control which userOP can be accepted by Paymaster
There are two types of webhooks
before paymaster sign (before_paymaster_sign)
after paymaster sign (after_paymaster_sign)
When sponsor
If the response for before paymaster sign webhook's status code is 200, we will consider it passed;
We recommend you use 400 for rejected sponsorship.
Webhook Source Verification
Every time a Webhook request is made, we generate a signature for the body, and developers can verify the signature to determine whether the request was sent by Particle Network
We have generated a unique public and private key (RSA-2048) for each project, and you can download the public key from the dashboard page for verification
Verification Example:
Before paymaster sign
This hook will trigger before Paymaster signs. The Paymaster will determine whether to sign the UserOP based on the status code returned by Hook
Body
chainId
userOp - the struct of user operation
entryPoint - The entry point address
parsed - Transaction struct. Paymaster will attempt to parse the calldata of 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 would accept the UserOP and sign it
Example:
After paymaster sign
This hook will trigger after Paymaster signs
Body
chainId
userOp - the struct of user operation
entryPoint - The entry point address
parsed - Transaction struct. Paymaster will attempt to parse the calldata of UserOP. If it cannot be parsed, this field may not exist
Example
How to use Webhook for your sponsorship policy
For the before_paymaster_sign webhook, we have returned 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.
...
Config & Check Paymaster
Check Balance & Deposit;
Check UserOp sponsor records.
Last updated