Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

TxEVM Gas

TxEVM meters execution in gas like any EVM chain. What differs is how gas is paid. Today the fee is charged in USDC on your TxCore spot balance. After the platform token launches, TxEVM switches to standard EIP-1559 fees paid from the native balance.

Two gas modes

USDC mode (current)Native mode (coming soon)
Fee paid inUSDC, debited from TxCore spotNative token, from the EVM balance
Block base feeAlways 0EIP-1559, with a floor
Fee bid in the transactionAccepted but ignoredStandard EIP-1559 bid
Transaction valueMust be 0Allowed
Price querytxflow_usdcGasPriceeth_gasPrice

The mode is a network-wide setting. It changes only at an EVM block boundary, so every transaction in one block uses the same mode.

USDC mode

Sending a transaction

Sign an ordinary EIP-1559 (or legacy) transaction. Two rules apply:

  • value must be 0. The native balance has no value yet and cannot be moved. A transaction with non-zero value is refused with value … is not allowed.
  • The fee fields do not matter. maxFeePerGas, maxPriorityFeePerGas, and gasPrice are accepted at any value and never charged. Wallet defaults work as-is.

The signer pays. Its TxCore spot account must hold enough available USDC to cover the transaction's gasLimit at the current price; otherwise the transaction is refused with insufficient USDC for gas. Perp balances are not used.

How the fee is computed

fee (USDC wei) = ceil(gas_used × USDC_gas_price / 1_000_000)
  • USDC_gas_price is in USDC wei (6 decimals) per million gas. The floor is 20_000, which is 0.02 USDC per million gas.
  • Admission checks the balance against gasLimit. The charge uses the actual gas_used, so an overestimated gasLimit costs nothing extra.
  • The fee is debited from TxCore spot when the block seals. The receipt's standard effectiveGasPrice is 0, so wallets show a zero fee. The amount actually charged is in the receipt's extra field usdcGasFee, in USDC wei.

Example at the floor price: a transaction that uses 100,000 gas costs ceil(100_000 × 20_000 / 1_000_000) = 2,000 USDC wei = 0.002 USDC.

How the price moves

The USDC gas price follows the EIP-1559 rule against each EVM block's gas target (half the block gas limit), with a gentler step than Ethereum: at most 0.25% per block. It rises when blocks run above target and falls back toward the floor when they run below.

RPC methods

MethodUSDC mode returns
txflow_usdcGasPriceCurrent USDC gas price, in USDC wei per million gas
eth_gasPrice0
eth_maxPriorityFeePerGas0
eth_feeHistoryBase fee 0 for every block
eth_estimateGasGas units, as on any EVM chain
eth_getTransactionReceipteffectiveGasPrice 0, plus usdcGasFee with the USDC charged

To quote a fee before sending: eth_estimateGas × txflow_usdcGasPrice / 1,000,000, rounded up.

Notes for contract developers

  • block.basefee and tx.gasprice read 0 in USDC mode. Do not use them for pricing, refunds, or anti-spam logic.
  • msg.value is always 0, so payable functions cannot receive native value yet.
  • Do not hard-code a zero gas price in scripts or relayers. It stops working when Native mode starts.

Native mode

In Native mode the platform token becomes TxEVM's native balance. Fees follow standard EIP-1559, paid from the signer's EVM balance, and eth_gasPrice returns a real price. Transactions may carry value. The token moves between TxCore and TxEVM the same way other linked assets do (see Transfers).

Switching from USDC to Native

The switch is part of a network upgrade on TxCore. No action on TxEVM triggers it, and the activation height will be announced in advance.

  1. The open block finishes in USDC mode. The switch never happens mid-block. Transactions in the block that is open at the upgrade are charged in USDC.
  2. The next block opens in Native mode. When it opens, the platform token's full supply is placed on its system address on TxEVM. From then on, the token can move between TxCore and TxEVM as the native balance.
  3. Every later transaction pays in the native token. Its maxFeePerGas must be at least the block's base fee, and the signer's EVM balance must cover gasLimit × maxFeePerGas + value. USDC is no longer charged for EVM transactions.

What changes for you after the switch:

BeforeAfter
Paying for a transactionSpot USDC on TxCoreNative balance on TxEVM. Move the platform token to TxEVM first with coreToEvmSend.
A transaction signed with a zero fee bidAcceptedRefused with max fee per gas … is below the next block base fee
eth_gasPrice, effectiveGasPrice0Real values
usdcGasFee in receiptsPresentAbsent
Core → EVM credit feeUSDC on TxCoreUnchanged: still USDC on TxCore

To be ready for the switch, take fee bids from eth_gasPrice / eth_feeHistory rather than hard-coding them, and do not assume value is always 0.

Next

PageFor
OverviewAccess requirements, testnet parameters, roadmap
TransfersMoving USDC between TxCore spot and TxEVM
JSON-RPCSending transactions and the RPC methods above
Try TestnetFaucet and account setup