Docs

Introducing sponsorship rules for paymaster

Rahul Menon

At thirdweb, our mission is to give web3 devs the tools they need to build great web3 apps. In Q3 of 2023, we launched our Account Abstraction toolkit. This gave devs all the pieces (Connect, Account factories, Bundler, Paymaster, and RPC) needed to easily integrate account abstraction into their apps. A key part of the toolkit is paymaster, which lets app devs sponsor gas fees for onchain actions that users take. This lets you easily build completely gasless web3 apps and is a massive UX improvement over traditional web3 apps, where users have to constantly approve and pay for transactions

By just passing a single flag (gasless:true) you can completely abstract away gas fees in your web3 app

However while you could now make your entire app gasless, you couldn't easily set rules around only sponsoring certain transactions.

With sponsorship rules, devs can now easily define rules around which transactions (User Ops) the paymaster should sponsor. This can be used to prevent abuse, progressively onboard users, and incentivize specific in-app actions.

We currently have 4 sponsorship rules available out of the box and will be adding more soon.

  • Global spend limits: Maximum gas cost (in USD) that you want to sponsor. This applies for the duration of the billing period (monthly).
  • Contract address restrictions: Allows you to specify a list of allowlisted contracts. Only transactions sent to these contracts will be sponsored.
  • Chain restrictions: Use this if you want to sponsor transactions only on certain chains. If this is not set, transactions on all supported chains will be sponsored.
  • Server verifier: This is a general purpose check that can be used to define custom rules. Before a transaction is sent, it checks with an endpoint that you specify on whether it should be sponsored or not.

You can easily set sponsorship rules through the configuration tab in the smart wallet dashboard. Once set, you can simply use the API key in your project and sponsorship rules will automatically be applied. Sponsorship rules are multichain by default and are not tied to an account factory.

Sponsorship rules is live today! Start building now or book a demo to learn more