Abstract 101 - From Sad to Chad
  • Introduction
  • Thanks
  • Abstract's Overview
    • What is Abstract ?
    • Who is behind it ?
      • Investors
      • Contributors
    • Why Abstract ?
      • Context
      • The Vision
      • Going further #1: Consumer crypto
    • How does it work ?
      • ZK-Sync
      • Eigen DA
      • Going further #2: Native Account Abstraction
      • Going further #3: Abstract Global Wallet
      • Going further #4: Paymasters
      • Going further #5: Panoramic Governance
    • How to build on Abstract ?
    • Integrations
  • How to onboard ?
    • The socials
      • X (previously Twitter)
      • Discord
      • Telegram
      • Youtube
    • Community
      • Abstract Ecosystem
      • Key Individuals
      • Partners Communities
    • Testnet
    • Mainnet (coming q4 2024)
    • Projects
      • Canna Sapiens
      • DUPER
      • DYLI
      • Ghost
      • Magnify Cash
      • Multiplier.fun
      • Onchain Heroes
      • PengPals
      • Pixelady : Cataclysm
      • Pudgy Studio
      • The Plooshies
      • Zyfi
  • Conclusion
Powered by GitBook
On this page
  • What are Paymasters ?
  • Paymaster Flows
  • Gas with a Paymaster
  • How does Abstract use Paymasters ?
  • How are paymasters built on Abstract ?
  • Sources

Was this helpful?

  1. Abstract's Overview
  2. How does it work ?

Going further #4: Paymasters

Overview of how Abstract is using Paymasters

What are Paymasters ?


Paymasters are specialized accounts designed to subsidize transaction fees for users, enhancing usability and flexibility within protocols. They also facilitate the payment of fees using ERC20 tokens, instead of the default ETH.

Paymaster Flows

Paymasters can operate under various flows, some of which may require user interaction, such as setting allowances for token swaps. These flows enable paymasters to support a wide range of use cases, from simple fee subsidies to more complex scenarios involving ERC20 token exchanges for transaction fees.

The most common ones are :

General Paymaster Flow

The GaslessPaymaster contract ensures that transaction fees are handled automatically without user intervention.

Approval-Based Paymaster Flow

The ApprovalFlowPaymaster contract allows for transactions costs to be covered using an allowed ERC20 token at the exchange of 1.

Gas with a Paymaster

Interacting with a paymaster generally consumes more gas than a standard transaction due to additional computations and operations. The primary factors contributing to this increased gas usage are:

  1. Internal Computations: These include the operations within the paymaster's transacations (usually minimal)

  2. Funds Transfer: The gas consumed when a paymaster sends funds to the bootloader*. (comparable to what users might pay for similar transactions independently)

*Bootloader: In ZKsync case, it's the program that accepts an array of transactions and executes the entire ZKsync batch.

  1. ERC20 Token Allowance Management: Optionally, if the user compensates the paymaster with an ERC20 token, managing the token's allowance consumes additional gas.

How does Abstract use Paymasters ?


In Abstract, paymasters are smart contracts that pay gas fees on behalf of other accounts. They provide a way to sponsor transactions, allowing users to interact with the network without needing to hold the native token for gas fees.

How are paymasters built on Abstract ?

To understand how paymaster will be used in Abstract, we need to take a look how they are natively understood onchain:

  1. All Txs are submitted to the Booloader

  2. This Bootloader checks if a paymaster is implemented

  3. If YES : Tx sent to the paymaster contract then sent to the account

  4. If NO : Tx directly sent to the account


Sources

PreviousGoing further #3: Abstract Global WalletNextGoing further #5: Panoramic Governance

Last updated 7 months ago

Was this helpful?

https://docs.abs.xyz/
https://docs.zksync.io/build/developer-reference/account-abstraction/paymasters
https://www.youtube.com/watch?v=oolgV2M8ZUI
Page cover image
How Paymasters are built on Abstract (source: )
https://www.youtube.com/watch?v=oolgV2M8ZUI