---
title: Virtual Machine
description: RISC-V virtual machine for smart contract execution on the Thru blockchain
source_url:
  html: https://thru.org/docs/spec/vm/overview/
  md: https://thru.org/docs/spec/vm/overview.md
---

# Virtual Machine

ThruVM is a RISC-V-based virtual machine that executes smart contracts on the Thru blockchain. It provides deterministic program execution with segmented memory management and comprehensive system calls.

## Key Components

### [Instruction Set Architecture](https://thru.org/docs/spec/vm/instruction-set.md)

RISC-V base ISA (RV64I) with extensions for multiplication/division (M), compressed instructions (C), bit manipulation (B), and cryptographic hash functions (Zknh).

### [Memory Layout](https://thru.org/docs/spec/vm/memory-layout.md)

48-bit segmented address space with different segment types for read-only data, account metadata, account data with copy-on-write semantics, and anonymous memory regions.

### [Executable Format](https://thru.org/docs/spec/vm/executable-format.md)

Binary format specification with 8-byte header, variable-length program bytecode, and 4-byte footer.

### [System Calls](https://thru.org/docs/spec/vm/syscalls/overview.md)

Comprehensive syscall interface for memory management, account operations, program control, state compression, and event emission.

### [Error Handling](https://thru.org/docs/spec/vm/errors.md)

Error codes for memory faults, resource exhaustion, invalid operations, and syscall failures.
