Skip to content

Chi Cost Table ​

These costs describe the native xian_vm_v1 runtime. Use readonly simulation against the target node for a complete operation estimate; the local Python harness has a separate metering implementation.

Accounting ​

text
chi_used = (raw_meter_cost // 1000) + 5

The result is capped by the transaction's submitted chi limit.

ItemRaw cost
storage read2 per encoded key/value byte
storage write25 per encoded key/value byte
submitted transaction1 per byte
returned value1 per byte
cross-contract dispatch10,000 per call, plus called work

VM computation and host operations use the fixed xian_vm_v1 gas schedule.

Fee Conversion ​

SettingValue
base transaction cost5 chi
initial paid-mode conversion in canonical bundles20 chi per XIAN

The effective conversion rate is on-chain at chi_cost.S:value and can be changed by validator governance. Paid fees use chi_used / chi_rate.

In free_metered mode the runtime reports the same chi usage but creates no execution-fee debit or fee-derived reward.

Resource Limits ​

LimitValue
metered storage-write byte budgetless than 128 KiB, including encoded keys and values
submitted contract source128 KiB
range(...) and bounded sequence repetition131,072 entries
bounded binary allocation and string repetition128 KiB
default node simulation chi budget1,000,000

Sequence entry counts and encoded byte counts are different units. A list of large values can cost much more than a list of the same length containing small integers. Return bytes are metered; the Python harness's separate 128 KiB return-value limit is not a general native-VM return-size guarantee.

ZK Verification ​

OperationRaw cost
raw Groth16 verification base750,000
raw public input50,000 each
raw payload byte50 each
registry-backed verification base500,000
registry prepared-key setup250,000
registry-backed public input50,000 each
registry-backed payload byte25 each

Shielded protocol helpers also have fixed host-operation costs. Proofs are limited to 4,096 hex characters, raw verifying keys to 8,192 hex characters, public inputs to 32, and verifying-key IDs to 128 characters.

Optimization ​

  • cache repeated state reads in local variables
  • keep keys and stored values compact
  • avoid unnecessary writes and cross-contract calls
  • paginate scans and bound returned collections
  • simulate the exact transaction before choosing a chi limit

See Chi and Metering for the fee modes and Estimating Chi for simulation.