Coreum Deterministic Gas


Coreum is using a deterministic gas model for its transactions. Meaning that given a transaction type (e.g /coreum.asset.ft.v1.MsgMint) one can know how much gas will be used before hand, and this amount is fixed if some preconditions are met. Of course this deterministic gas does not apply to the type of transactions that have a complicated, nondeterministic execution path (e.g /cosmwasm.wasm.v1.MsgExecuteContract). We provide tables with all deterministic gas & nondeterministic gas for all our types. For a more recent data, consult this fileopen in new window


Here is the formula for the transaction

Gas = FixedGas + Sum(Gas for each message) + GasForExtraBytes + GasForExtraSignatures

If message type is deterministic, then the value is looked up from the table, if it is non-deterministic, then the required gas is determined after the execution.

GasForExtraBytes = max(0, TxByteSize-FreeBytes) * TxSizeCostPerByte

GasForExtraSignatures = max(0, NumOfSigs-FreeSigs) * SigVerifyCost

Currently we have values for the above variables as follows:

  • FixedGas: 50000
  • SigVerifyCost: 1000
  • TxSizeCostPerByte: 10
  • FreeSignatures: 1
  • FreeBytes: 2048

As an example if the transaction has 1 signature on it and is below 2048 bytes, the user will not pay anything extra, and if one of those values exceed those limits, the user will pay for the extra resources.

Full example

Let's say we have a transaction with 2 messages of type /coreum.asset.ft.v1.MsgMint inside, also there are 2 signatures and the tx size is 2050 bytes, total will be:

TotalGas = 50000 + 35000 * 2 + (2050-2048) * 10 + 1 * 1000

TotalGas = 121040

Gas Tables

Deterministic messages

Message TypeGas
/cosmos.authz.v1beta1.MsgExecspecial case
/ case
/ case

Special Cases

There are some special cases when custom logic is applied for deterministic gas calculation. Real examples of special case tests could be found hereopen in new window


DeterministicGasForMsg = bankSendPerCoinGas * NumberOfCoins

bankSendPerCoinGas is currently equal to 24000.


DeterministicGasForMsg = bankMultiSendPerOperationGas * (NumberOfInputs + NumberOfOutputs)

bankMultiSendPerOperationGas is currently equal to 11000.


DeterministicGasForMsg = authzMsgExecOverhead + Sum(DeterministicGas(ChildMsg))

authzMsgExecOverhead is currently equal to 2000.

Nondeterministic messages

Message Type
Last Updated: