https://github.com/layer-3/nitrovm
https://github.com/layer-3/nitrovm
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/layer-3/nitrovm
- Owner: layer-3
- Created: 2026-04-09T19:32:31.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-10T03:05:17.000Z (2 months ago)
- Last Synced: 2026-04-10T03:15:48.234Z (2 months ago)
- Language: Go
- Size: 160 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NitroVM
A WebAssembly runtime for executing smart contracts, inspired by the EVM execution model.
## Overview
NitroVM provides a sandboxed WASM-based execution environment for smart contracts with familiar blockchain primitives: contract addresses, persistent storage, gas metering, and native asset ownership. It uses the [CosmWasm](https://cosmwasm.com/) VM (wasmer) via [wasmvm](https://github.com/CosmWasm/wasmvm) CGO bindings.
## Key Features
- **CosmWasm Runtime** — Contracts compile to WebAssembly and run in a deterministic sandbox powered by [wasmer](https://wasmer.io/) via CosmWasm's VM, with built-in gas metering, float rejection, and opcode validation
- **EVM-style Addresses** — Contracts are identified by 20-byte hex addresses (`0x...`)
- **Native Token (YELLOW)** — Gas metering and value transfers use the native YELLOW token
- **Persistent Storage** — Key-value storage per contract, backed by pluggable storage adapters (SQLite initially)
- **Two-step Deployment** — Store contract code, then instantiate with init parameters (the CosmWasm model)
- **Host Functions** — CosmWasm-compatible host imports for storage, crypto, address handling, and chain queries
## Contract Languages
Contracts are written in **Rust** using the [cosmwasm-std](https://crates.io/crates/cosmwasm-std) crate.
## Contract Lifecycle
```
Store Code --> Instantiate --> Call
(upload wasm) (create instance (execute contract
with init data, functions via
assign address) calldata)
```
## Architecture
```
Calldata
|
v
+-----------+ +-------------------+
| NitroVM | ---> | CosmWasm Host Fns |
| (Go) | | (storage, crypto, |
+-----------+ | addr, queries) |
| +-------------------+
v
+-----------+ +----------------+
| wasmvm | ---> | CosmWasm VM |
| (CGO) | | (wasmer, gas |
+-----------+ | metering, |
| validation) |
+----------------+
|
v
+-----------+
| Storage |
| Adapter |
+-----------+
|
v
+-----------+
| SQLite |
+-----------+
```
## Status
Early development. See [SPEC.md](SPEC.md) for the detailed technical specification.