> ## Documentation Index
> Fetch the complete documentation index at: https://l2docs.whitechain.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Network fees

> What a transaction costs on Whitechain: the L2 execution fee, the L1 data fee, who receives them, and how to estimate the total in WBT.

<Note>
  Available on Testnet today. Final Mainnet fee parameters are published before Mainnet launch.
</Note>

## What gas is

Every action on Whitechain uses computing resources, whether you send WBT, swap tokens, or call a smart contract. Gas is the unit that measures that work. You pay for the gas your transaction uses, which keeps the network running and prices out spam.

You pay gas fees in WBT, not ETH. WBT is the native gas token, so you need a WBT balance to send any transaction. On Testnet, claim test WBT from the [faucet](/learn/get-started/get-testnet-wbt).

## The two parts of a fee

A fee on Whitechain has two parts: the cost to run your transaction, and the cost to publish it to Ethereum. On a Layer 2 (L2), the second part can be the larger one when Ethereum is busy. It rises and falls with Ethereum's own gas prices, even when Whitechain is quiet.

| Part             | Pays for                                | Set by                                                 |
| ---------------- | --------------------------------------- | ------------------------------------------------------ |
| L2 execution fee | Running your transaction on Whitechain  | L2 gas used times the L2 gas price                     |
| L1 data fee      | Publishing your transaction to Ethereum | Your transaction size times current L1 and blob prices |

Your total is the two parts added together. Your wallet shows the combined number before you sign.

## How the L2 fee is calculated

Three values set your L2 execution fee.

| Value        | What it is                                                                                                       |
| ------------ | ---------------------------------------------------------------------------------------------------------------- |
| Gas used     | The amount of computation your transaction needs. A plain WBT transfer uses 21,000 gas; contract calls use more. |
| Base fee     | The protocol-set price per unit of gas. It adjusts with demand and never drops below 5 gwei.                     |
| Priority fee | An optional tip you add to be included faster.                                                                   |

The L2 execution fee is the gas used times the gas price. The gas price is the base fee plus any priority fee, both measured per unit of gas. Whitechain is EVM-compatible, so an operation uses the same gas it would on Ethereum. The base fee follows EIP-1559 and moves from block to block with demand. It never drops below **5 gwei**, a floor that stops zero-fee spam. At that floor the base fee adds a fraction of a cent to a normal transfer.

## The L1 data fee

Whitechain writes every transaction to Ethereum, so its state can always be rebuilt. Posting that data costs ETH, and the L1 data fee covers it. This is the one fee component that a plain Ethereum transaction does not have.

The charge depends on three inputs: the compressed size of your transaction, the current Ethereum base fee, and the current blob base fee (EIP-4844). Whitechain reads both Ethereum prices on-chain and refreshes them each L1 block. Ethereum's base fee can move by at most 12.5% per block, so short-term swings stay small.

The L1 data fee is charged on every transaction and cannot currently be limited by the transaction gas limit. The amount is an estimate taken at submission. Data is posted to Ethereum in compressed batches, so the real cost evens out over time and you never set it yourself.

## A worked example

The figures below assume the 5 gwei minimum base fee, the current floor on Testnet. Each row shows the L2 execution fee at that floor, which is the gas used times the base fee. The L1 data fee is added on top and stays small in normal conditions.

| Action                             | Gas used | L2 fee at 5 gwei | At \$50 per WBT |
| ---------------------------------- | -------- | ---------------- | --------------- |
| Send WBT                           | 21,000   | 0.000105 WBT     | \$0.005         |
| Call a contract, first state write | 43,718   | 0.00022 WBT      | \$0.011         |
| Deploy a minimal contract          | 117,683  | 0.00059 WBT      | \$0.030         |

<Note>
  The USD column assumes \$50 per WBT, a round figure for illustration. WBT trades on the open market, so check the [live WBT price](https://www.coingecko.com/en/coins/whitebit) before using these numbers for planning. The WBT amounts are the fixed values; the dollar amounts move with the market.
</Note>

Sending WBT costs about 0.000105 WBT to execute, well under one cent. Deploying a small contract costs about 0.0006 WBT, roughly three cents. Complex contracts use more gas, so their fees are higher. The base fee rises above 5 gwei only when blocks fill up.

The deploy row matches a real transaction on Testnet. Its full breakdown, including the L1 data fee, is below and on the [explorer](https://explorer.testnet.whitechain.io/tx/0xeaf6963ce0b1edc69412d993255cefce72420110462277a23d2bfd5fa203e4de).

| Item             | Value            | At \$50 per WBT     |
| ---------------- | ---------------- | ------------------- |
| Gas used         | 117,683          | n/a                 |
| L2 execution fee | 0.00058853 WBT   | \$0.029             |
| L1 data fee      | 0.0000000222 WBT | less than \$0.00001 |
| Total charged    | 0.00058855 WBT   | \$0.029             |

The observed gas price was 5.001 gwei, including a small tip, so the execution fee sits just above the 5 gwei estimate. The L1 data fee is a small share here because posting to Ethereum Sepolia is inexpensive. When Ethereum is busy, this part grows and can exceed the L2 execution fee. Testnet L1 costs do not reflect Mainnet, where posting to Ethereum costs more.

<Note>
  A failed transaction still pays for the gas it used, and both fee parts are always charged. The explorer may show only the L2 gas cost, so your balance can drop by more than that figure. The difference is the L1 data fee.
</Note>

## Common scenarios

| Action                | Typical gas                         | Notes                                               |
| --------------------- | ----------------------------------- | --------------------------------------------------- |
| Send WBT              | 21,000                              | Fixed for a plain transfer                          |
| Swap tokens           | Higher, varies                      | Depends on the pool and route                       |
| Call a smart contract | Varies widely                       | More complex calls cost more                        |
| Failed transaction    | Gas used up to the point of failure | You still pay; a failed transaction is not refunded |

Failed transactions still cost gas. The network does the work up to the point where the transaction fails, so you pay for the gas it used. Set a sufficient gas limit to avoid running out partway through a contract call.

## Who receives the fee

Whitechain runs the sequencer that orders transactions and the batcher that posts their data to Ethereum. The protocol collects your fees into on-chain fee vaults. The base fee, the priority tip, and the L1 data fee each go to a separate vault. The L1 data fee offsets the cost of posting data to Ethereum. Whitechain sets the operator fee to zero, so you pay the L2 execution cost and the L1 settlement cost only.

## How Whitechain fees differ from Ethereum

| Difference     | On Whitechain                     | Why                                                   |
| -------------- | --------------------------------- | ----------------------------------------------------- |
| Fee token      | WBT, not ETH                      | WBT is the native gas token                           |
| Cost level     | Far below Ethereum L1             | Data is batched and posted once for many transactions |
| L1 sensitivity | Totals rise when Ethereum is busy | The L1 data fee tracks Ethereum's gas price           |

## Fee parameters

The values below are the current Testnet configuration.

| Parameter            | Testnet value | Effect                                         |
| -------------------- | ------------- | ---------------------------------------------- |
| Native gas token     | WBT           | The token all fees are paid in                 |
| Minimum base fee     | 5 gwei        | Floor for the L2 base fee                      |
| EIP-1559 elasticity  | 6             | A block can hold up to 6x its target gas       |
| EIP-1559 denominator | 250           | How fast the base fee adjusts between blocks   |
| L2 block gas limit   | 40,000,000    | Maximum gas per L2 block                       |
| Operator fee         | None          | No surcharge; you pay the settlement cost only |

With elasticity 6 and denominator 250, the base fee changes by at most 2% per block. Large moves take many blocks, even when demand rises.

<Note>
  Mainnet fee parameters are not final. The values above are the current Testnet configuration and may change. Confirmed Mainnet parameters are published here before Mainnet launch.
</Note>

## Estimating a fee

Use existing tooling. Libraries such as viem include OP Stack support and update when the fee formula changes across network upgrades, so your code keeps working without edits. Estimate the L2 execution fee the same way you would on Ethereum, and let the library return the L1 data fee.

If you cannot use a library, read the L1 data fee from the `GasPriceOracle` predeploy at [`0x420000000000000000000000000000000000000F`](https://explorer.testnet.whitechain.io/address/0x420000000000000000000000000000000000000F) on Testnet. This predeploy sits at the same fixed address on every OP Stack chain. Call `getL1Fee` with your serialized, unsigned transaction, since estimation happens before signing. Do not implement the formula yourself. It changes with network upgrades, and `getL1Fee` is kept in step.

Your total is the L2 execution fee (gas used times gas price) plus the L1 data fee. To avoid overpaying, let your wallet or library set the base fee, and add a priority fee only when you need faster inclusion. If an estimate looks high, check the current Ethereum gas price first, because the L1 data fee tracks it.

<Note>
  Whitechain uses the standard OP Stack fee model. For the full mechanism, including the exact L1 data fee formula, see the [Optimism transaction fees documentation](https://docs.optimism.io/app-developers/transactions/fees). The specific OP Stack upgrade active on Whitechain is being confirmed with engineering and is stated here before Mainnet launch.
</Note>

## Related

* [Faucet](/learn/get-started/get-testnet-wbt)
* [Network reference](/learn/network/reference)
* [Use viem with Whitechain](/build/dapps/use-viem)
* [Transaction finality](/learn/network/transaction-finality)
