Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@
"group": "Concepts",
"pages": [
"learn/protocol/accounts",
"learn/protocol/paymasters",
"learn/protocol/blocks",
"learn/protocol/cryptography",
"learn/protocol/data-availability",
Expand Down
57 changes: 57 additions & 0 deletions learn/protocol/paymasters.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Paymasters
description: How Paymasters enable gasless transactions and token-based fee payments on Starknet.
---

# Paymasters

A **Paymaster** is a smart contract that can pay transaction fees on behalf of a user.
This allows developers to sponsor transactions or accept alternative tokens for gas payments.

Paymasters build upon **Account Abstraction**, which makes every account a smart contract that defines its own validation and fee logic.

---

## Why Paymasters Exist

In most blockchains, users must hold the native token (like ETH) to pay for transaction fees.
This creates friction for onboarding and limits flexibility for dApps.

Starknet introduces Paymasters to solve this. With Paymasters, developers can:

- **Sponsor user transactions** (gasless UX)
- **Accept ERC-20 tokens for fees**
- **Implement custom fee logic** (for example, reward systems or whitelists)

---

## How They Work

When a transaction is sent, the flow looks like this:

1. The user's account signs and sends the transaction.
2. The transaction references a Paymaster contract.
3. The Paymaster validates the request and, if approved, covers the gas cost.
4. The sequencer executes the transaction as normal.

This system allows for flexibility — a Paymaster can restrict usage, set budgets, or require users to meet specific conditions.

---

## Example Implementations

You can explore Paymaster integrations in ecosystem SDKs and libraries:

- [starknet.js – Paymaster guide](https://starknetjs.com/docs/next/guides/account/paymaster/)
- [starknet-react Paymaster Providers](https://www.starknet-react.com/docs/paymaster-providers)
- [StarknetDart Avnu Provider](https://starknetdart.dev/packages/avnu_provider)

Each library shows how to integrate Paymasters for your app or wallet.

---

## Related Topics

- [Accounts](./accounts) — How Starknet accounts are smart contracts.
- [Fees](./fees) — How transaction costs are calculated and paid.
- [Transactions](./transactions) — The lifecycle of a transaction on Starknet.