Skip to content

Chi Cost Table

These are stable runtime constants. Use readonly simulation against the target node for a complete operation estimate.

Accounting

text
chi_used = (raw_meter_cost // 1000) + 5

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

ItemRaw cost
storage read1 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
paid-mode conversion20 chi per XIAN

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

Resource Limits

LimitValue
raw runtime safety ceiling50,000,000,000 units
writes per transaction128 KiB
returned value128 KiB
submitted contract source128 KiB
sequence or binary allocation128 KiB
default local chi budget1,000,000

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.