Transaction fees
Overview
Every transaction on Xsolla ZK is charged a fee. It is paid in XLA on mainnet and in XZK on testnet.
You submit a standard EVM transaction with one gas limit and one gas price. The fee covers both of the following costs:
- Execution: the cost of the EVM gas your transaction uses, as on Ethereum.
- Settlement: the cost of proving the transaction and publishing its data to Ethereum.
While your transaction is processed, ZKsync OS tracks execution gas and settlement cost separately. When the transaction finishes, ZKsync OS converts the settlement cost into gas units. If that value exceeds the EVM gas used, the difference is added to gasUsed. This has two consequences:
- A transaction receipt may show higher gas consumption than an identical transaction on Ethereum.
- A gas limit that covers only EVM execution may not be enough, because on Xsolla ZK it must also cover the settlement cost. If the settlement cost exceeds the gas limit during execution, the transaction reverts. If the gas limit or gas price cannot cover the settlement cost during validation, the transaction is rejected and not included in a block.
Fee components
| Component | Description |
|---|---|
| Currency. | XLA on Xsolla ZK (XZK on testnet), 18 decimals. |
| Transaction type. | Supported types: Legacy, EIP-2930, and EIP-1559. |
| Base fee. | Minimum price per gas unit. The operator sets it from its own execution and settlement costs, according to the ZKsync OS fee model. The base fee changes by at most 12.5% per block. |
| Priority fee. | An addition to the base fee, as on Ethereum. The chain accepts it, but eth_maxPriorityFeePerGas returns 0. |
| Settlement price. | The price of proving the transaction and publishing its data to Ethereum. The publishing part follows Ethereum gas and blob prices. |
| Block gas limit. | Maximum total gas that all transactions in one block can use. Set to 100,000,000. |
Set gas limits
To set a gas limit:
- Estimate the gas on Xsolla ZK. Call
eth_estimateGasagainst the Xsolla ZK RPC. The estimate includes the settlement cost at the current base fee. - Add headroom. The amount depends on the transaction and on current network conditions; a fixed percentage does not guarantee success. Add more on transactions that write a lot of storage.
- ts
1import { createPublicClient, http } from "viem";
2import { xsollaZkTestnet } from "./chains"; // see Connect to Xsolla ZK
3
4const client = createPublicClient({ chain: xsollaZkTestnet, transport: http() });
5
6const estimate = await client.estimateGas({ account, to, data });
7const gas = (estimate * 12n) / 10n; // 20% headroom
Reduce settlement cost
Settlement cost grows with the amount of data a transaction publishes to Ethereum, mostly state changes. To reduce it:
- Write fewer storage slots — pack values into one slot where you can.
- Batch several updates into one transaction instead of many small ones.
- Emit events for data that does not need to live in storage.
Sponsored transactions
Apps can pay fees for their players with ERC-4337 paymasters. The v0.7 EntryPoint is deployed on Xsolla ZK Testnet, but not yet on mainnet. Check Contract addresses before relying on it.
Common errors
| Error | Cause | Troubleshooting |
|---|---|---|
Error out of gas with a gas limit that works on Ethereum. | Settlement cost was added on top of EVM gas cost. | Set the gas limits. |
| Transaction rejected before inclusion in a block. | The gas limit or gas price cannot cover the settlement cost during transaction validation. | Increase the gas limit or maxFeePerGas. |
Error insufficient funds with enough ETH. | Fees are paid in XLA (or XZK on testnet), not ETH. | Fund the account with XLA (or XZK on testnet). |
| Presigned deployment fails. | Fixed gas price and limit do not cover the settlement cost. | Deploy with a fresh transaction estimated against the Xsolla ZK RPC. |
Useful links
Last updated: October 28, 2026Found a typo or other text error? Select the text and press Ctrl+Enter.