TVM is a Rust implementation of the Trustless Virtual Machine execution layer described in the JAM Graypaper.
It is built as a just-in-time assembler and runtime: TVM translates the PVM/RISC-V-inspired instruction stream into native x86_64 machine code, manages program execution, and exposes host-side invocation APIs for JAM runtime contexts.
TVM was built as a low-level implementation of the JAM execution environment. The project is preserved here as a technical showcase and reference artifact for the assembler, runtime, shared-memory model, gas accounting, and host-function boundary.
- JIT assembler in Rust using
dynasmrt, with explicit mapping from TVM virtual registers to x86_64 and MMX registers. - Runtime support for shared program memory, state memory, gas metering, page-fault handling, host calls, and controlled exits.
- Generic invocation APIs for refinement, accumulation, authorization, and transfers.
- Host-function implementations for account storage, preimages, service creation, privilege management, authorization queues, and validator updates.
- Test-vector coverage for VM instructions, initialization, and JAM host functions.
tram-ffibridge code for using the runtime from the adjacent TRAM client work.
The TVM wiki is the main architecture archive. Good starting points:
- Architecture: JIT assembly, runtime structure, gas metering, shared memory, and register allocation.
- Rust API docs: generated API documentation for the runtime crate.
- assembler/src/assembler.rs: program decoding, block assembly, gas checks, and executable buffer management.
- core/src/shm/memory.rs: shared-memory layout and page protection.
- runtime/src/tvm.rs: execution loop and host/runtime coordination.
This repository is not currently under active development. It is published as a preserved technical artifact from the 2024-2025 JAM implementation work, not as a current product or network client.
The source is available for review under the repository's existing All Rights Reserved license.
TRAM is the companion JAM client/state-transition project. TRAM sits at the protocol and state layer; TVM sits at the execution/runtime layer.