Where it fits
Indexer
VM
Emitted ACTIONs
Indexer handlers
Embedded in the indexer; contracts orchestrate validated ACTIONs and never touch the ledger directly.
What it is
The VM executes XChain smart contracts. Contracts are JavaScript, run in sandboxed V8 isolates, and crucially cannot touch the ledger directly; they orchestrate the platform's validated ACTIONs, so a contract bug can never drain funds or mint tokens.
How it fits into the platform
A library embedded inside the indexer: when an EXECUTE action arrives, the indexer runs the contract in the VM, and the ACTIONs it emits flow back through the same validated handlers as any user transaction.
What it can do
- Deterministic execution via sandboxed V8 isolates
- A rich gateway: state, ledger reads, oracle, cross-chain, 19 emittable actions
- Exact bignumber math (including sqrt, pow, log)
- AST-based gas metering and hard resource limits
- Outside-world attestation (HTTPS / AI) via request-and-callback
- Stakeable contracts with slashing
Under the hood
- isolated-vm with non-deterministic APIs stripped
- Atomic snapshot semantics: all-or-nothing rollback
- Immutable, versioned contracts (api_version)