> ## Content Index
> Fetch the complete content index at: https://blog.chainsafe.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Paymaster on ZKsync Layer 2 with Web3.js
- URL: https://blog.chainsafe.io/paymaster-on-zksync-layer-2-with-web3-js/
- Published: 2024-10-01T01:41:42.000Z
- Updated: 2026-11-04T21:34:25.000Z
- Author: Oleksii Kosynskyi
- Tags: #Import 2026-11-04 06:17

In this article, we explore the **Paymaster** feature in ZKsync, which allows users to sponsor transaction fees. This is a powerful tool that provides flexibility, enabling users to handle gas fees in a more customizable manner. Before diving into this, ensure you have followed the steps from the previous articles, especially [setting up the local environment](https://blog.chainsafe.io/setting-up-your-zksync-development-environment-with-web3-js-plugin/) and working with [wallets](https://blog.chainsafe.io/working-with-wallets-on-zksync-using-web3-js/) and [smart accounts](https://blog.chainsafe.io/smart-accounts-on-zksync-layer-2-with-web3-js/). Here’s an example of how to use Paymaster for sending transactions, transferring tokens, and withdrawing funds.

#### Example 1: Send ETH Using Paymaster

In the first example, we demonstrate how to send ETH while using the Paymaster for sponsoring transaction fees.

#### Example 2: Send Tokens Using Paymaster

In the second example, we showcase how to send tokens using Paymaster.

#### Example 3: Withdraw Using Paymaster

The third example demonstrates how to withdraw ETH using the Paymaster.

### Conclusion

The **Paymaster** feature is a powerful addition to ZKsync, enabling greater control over transaction fees. It allows you to specify custom logic for gas payments, creating a more flexible environment for users. The examples above show how you can integrate Paymaster into ETH transfers, token transfers, and withdrawals.

In the [next article](https://blog.chainsafe.io/exploring-multisig-in-zksync-using-web3-js/), we’ll explore the multi-sig feature and how it can be utilized within the ZKsync ecosystem. Stay tuned!

#### Helpful Links and Resources

Here are the essential links to help you get started:

- Web3.js Plugin for ZKsync: You can find the official plugin repository [here](https://github.com/ChainSafe/web3-plugin-zksync?ref=blog.chainsafe.io).
- Examples for Using the Plugin: I've also prepared a dedicated repository with all the code examples from this tutorial and more, which you can access [here](https://github.com/avkos/example-web3-plugin-zksync?ref=blog.chainsafe.io).
- ZKsync Web3.js Documentation: For more detailed information and resources, check out the official documentation [here](https://sdk.zksync.io/js/web3js?ref=blog.chainsafe.io).