Polygon Fellowship Proposal 1 - Paymaster as a service

Brief Overview

With the advent of EIP 4337, I expect on-chain wallets & paymaster services will explode and help a large number of people get onboarded with web3. A lot of DAOs & old age companies would want to sponsor gas fees & want a smoother experience for their users. But deploying a Paymaster, and having a developer code the custom logic would be painful for every other organisation. This is where I feel, a service which would automatically deploy/manage & let organisations monitor the transactions that they are sponsoring would come in super handy for organisations.

Category**:** DAO Tooling

Competition**:** EIP 4337, is still new and is in the beta phase. While sponsoring gas has been around. People have sponsored gas through meta transactions as well. Though this requires changes to the underlying smart contract people are interacting with. https://www.biconomy.io/ is one such organisation which is helping people sponsor gas although with meta transactions.

Objectives

  1. Deploy a Paymaster smart contract.
  2. Configure basic rules that will govern the type of user operation the organisation is willing to sponsor. I have listed a few below, this list though is not polished:
    1. Sponsor first X transactions by a wallet while interacting with Y contract.
    2. Sponsor all gas fees up to $X while interacting with Y contract.
    3. Sponsor all the transactions while doing an airdrop - one-time paymaster.
    4. Sponsor gas of people who hold a specific NFT.

Problem it solves

  1. Onboarding the user is tough, it is super irritating to have the native token of the blockchain at all times. This creates a layer of friction for DAOs when users are interacting with them.
  2. Deploying & maintaining your own Paymaster would require all organisations to have a developer at hand.
  3. Once the above two problems would be solved, it would also lead to the problem monitor all the transactions they are sponsoring. This will be super helpful to calculate CAC for an organisation & also see the ROI they are getting from these transactions.

Implementation

I am yet to start working on this project, I have started helping stackup, an on-chain EIP 4337 compatible wallet with developer documentation. This I believe helps me give a better understanding of EIP 4337 & also see things in action. Then I would start building this service.

Implementation Plan:

  1. There are two ways I can go from here. Create multiple paymaster contracts with configurable values and deploy on demand. Or create a master paymaster which will allow the execution of multiple strategies based on its deployment configuration.
  2. I will as of now use stackup.sh entry point & its wallets for the purpose of this fellowship, though entry point could always be changed through ownerOnly functions
  3. I will then create a dashboard which will list all the transactions which will be sponsored and orgs will be able to monitor them. For this, I will be creating a subgraph which will explore the list of transactions that will be routed from the paymaster contract. This is still theoretical as of now and I will have to check its validity.

How would it help Polygon Ecosystem? If we have the capability for organisations to easily sponsor gas and make the web3 experience simpler for users. This would indeed lead to an increase in the transactions that will be helping Polygon’s chain.

Why this project?

While I was investing with Defi across chains, I myself have faced issues where I don’t have the native token of the chain and I have to go back and do the whole thing of bringing gas, which is frustrating! Looking for a solution to this problem I stumbled upon EIP 4337, and I loved the idea. Though soon realised it was still in the early stages. I figured out there are a couple of DAOs who are trying to solve the problem of paying gas in the native tokens, namely: Sequence & Stackup. I have also started working with Stackup & I will be helping them with the developer documentation and contract auditing.

While the above problems solved my immediate problem I also realised that Paymaster service would play a crucial role in future & I don’t see any such solutions for them as of now.

Subscribe to Garvit Khatri
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.