npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

paymaster-contracts

v0.1.0

Published

Smart contracts for UniswapPaymaster - pay for transactions with any token via Uniswap V4

Downloads

6

Readme

Introduction:

To use any EVM blockchain, users must pay their transaction costs (weighted in gas) in native currency, such as Ether. This has been already acknowledged for a long time by the community as a major pain in the user experience and as a significant blocker for mass adoption, where newly onboarded users may eventually receive cryptocurrency in their account but kept blocked from doing anything with it due to the lack of native currency to pay for the gas, which is a really frustrating.

This led to extensive research and innovation which has produced several ERCs and EIPs aiming to solve this issue, eventually giving birth to the concept of "Gas Abstraction", as a sub-topic of the broader "Account Abstraction" space.

Among various approaches, ERC-4337 has emerged as the current leading solution due to its unique advantage: enabling gas abstraction without requiring Ethereum core protocol changes. However, while ERC-4337 provides an elegant off-protocol architecture for alternative gas payment methods, current paymaster implementations remain centralized and, frankly, immature.

Core requirements for truly useful gas abstraction:
  • Universal token support: Users should be able to pay gas with any token
  • Zero downtime availability: permanently available, censorship-resistant infrastructure is a must, since users cannot be sponsored during downtimes
  • Minimal pricing and costs overheads: costs should be extremely low to make the system usable

Current Paymaster landscape

Today's Paymasters suffer from fundamental centralization issues with strong consequences:

  • Ecosystem dominated by few players: Most users rely on a single provider, and outages blocks users from using their funds with no built-in aggregation to switch providers
  • Limited token support: Token selection based solely on paymaster owner capacity and profitability - users are at the mercy of provider decisions
  • Poor user experience: Users must manually switch between providers (Pimlico, Alchemy, Biconomy) for different tokens, similar to pre-DEX aggregator swapping
  • Monopolistic pricing, large players win it all: The centralized paymaster owner captures 100% of service fees and solely decides pricing without sane competition because of the high bar to enter the gas sponsoring market, similar to CEX fees before Uniswap enabled market-driven fee discovery
  • Operational overhead: Centralized Paymasters relies on manual or partially automated rebalancing required at all times with large operational costs, where any rebalancing downtime causes transaction sponsoring downtime
  • Single capital provider: A centralized paymaster owner provides all ETH for user operations, creating strict scalability limits constrained to what the owner can provide
  • Liquidity fragmentation: Competing players create separate paymasters, fragmenting liquidity and decreasing capital efficiency
  • Concentrated volatility risk: The owner bears all price risk from both ETH (gas payments) and accepted tokens (fees), with no risk distribution mechanism, forcing higher fees to cover risks and making the model unsustainable during market volatility

Did you know that centralized paymasters today charge between 5% 100%?, based on a quick search, ZeroDev, Circle, and Pimlico Paymasters charge between 5-10%, while another less competent services charge up to 100%


A decentralized alternative: Paymaster Pools

To drive meaningful improvement, a decentralized paymaster infraestructure is proposed instead, aiming to enhance the landscape in the following manners:

1. Permissionless Liquidity Provision

Allows anyone to become a sponsoring liquidity provider of any size, removing the high bar to enter the gas sponsoring market.

2. Distributed Profit Sharing

Distributes the sponsoring profits proportionally across all liquidity providers.

3. Free-Market Price Discovery

Allows creation of different paymaster pools with any determined sponsoring fee configuration, enabling the market to discover the right sponsoring fee, inspired by the Uniswap model for swaps.

4. Unified Paymaster Router

Offer a PaymasterRouter (Singleton) that simply indicates which paymaster offers the lowest sponsoring fee at any moment for a given token while having sufficient liquidity, dramatically simplifying UX.

5. Censorship Resistance, Immutability

Paymaster Pools are immutable contracts where anyone can provide liquidity and exit at all times, creating a strong and decentralized resistant system.

6. Increased Capital Utility: Rehypothecation

Since Paymaster Pools are Uniswap V4 liquidity pools in their core, swaps between [ETH, TOKEN] remain functional, novely increasing capital utility as a consequence, as the provided liquidity can be simultaneously used for swapping and for gas sponsoring, potentially increasing LP's profits on [ETH, TOKEN] pairs in comparison with traditional pools where LPs only make profits from swaps.

This is achieved through an innovative EntryPointVault system - an ERC4626-style vault that tokenizes ERC-4337 EntryPoint deposits as tradeable shares. This enables:

  • Liquid Gas Deposits: EntryPoint deposits become transferable ERC20 tokens, creating a liquid market for gas credits
  • Composable Gas Infrastructure: Other protocols can integrate with EntryPoint deposits via standard ERC20 interfaces
  • Capital Efficiency: The same ETH can serve multiple purposes - gas sponsoring, swap liquidity, and yield generation
  • Distributed Risk: Gas deposit risks are spread across many token holders rather than concentrated in a single paymaster operator

Through ongoing development towards "liquidity rehypothecation", ETH is locked in the ERC-4337 EntryPoint (available for sponsoring at all times) but moved into Uniswap's Pool Manager just-in-time when swaps happen, virtually allowing the same ETH liquidity to both sponsor transactions and serve as swap liquidity concurrently, making profits from both sources with the same capital.

~~Getting paid for providing liquidity for swaps~~ => Getting paid for providing liquidity for swaps AND for gas sponsoring AND for gas deposit yields.

7. Autonomous Rebalancing

Naturally, since gas sponsoring decreases ETH balances and increases token balances (increased by sponsoring fees), there is constant pressure in the zeroForOne direction (ETH to Token), and a rebalance mechanism is required.

Similar to how MakerDAO allows anyone to liquidate positions and make a profit by regulating the system, and because Paymaster Pools are Uniswap V4 Pools, the chosen rebalancing mechanism are simply permissionless swaps, allowing anyone to capture generated imbalances as arbitrage opportunities. (Note that LPs earn fees on both sponsoring and rebalancing transactions, as rebalancing swaps also pays fees to LPs!)


Building the infrastructure for truly decentralized gas abstraction on Ethereum.