Registry / data / clvm-rs

clvm-rs

JSON →
library0.17.7pypypi✓ verified 87d ago

CLVM-rs is a Rust-based implementation of the Chialisp Virtual Machine (CLVM) for the Chia Network's cryptocurrency, designed for enhanced security and performance. It provides Python bindings allowing developers to interact with the CLVM's core functionalities. Currently at version 0.17.5, the library maintains an active development pace with frequent updates and improvements.

pip install clvm-rs
INSTALL
IMPORT
SIG · CLVM-RS
C
clvm-rs
datapythonv0.17.7
Install
1.8s avg
Import
54ms
Disk
22MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.17.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 1.98s
py 3.11
✕ build_error
✓ 1.85s
py 3.12
✕ build_error
✓ 1.78s
py 3.13
✕ build_error
✓ 1.7s
py 3.9
✕ build_error
✕ build_error
22MB installed
● package 22MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Program
from clvm_rs.program import Program
run_program
from clvm_rs.api import run_program

This quickstart demonstrates how to assemble a simple Chialisp program, create a `Program` object, and execute it using `run_program`. It shows basic program evaluation and result retrieval. Note that `assemble` is usually part of `clvm_tools_rs` or `clvm_tools`, but often used in conjunction with `clvm_rs`.

from clvm_rs.program import Program from clvm_rs.api import run_program, CLVM_COST_RATIO_DEFAULT from clvm_rs.clvm_tools.binutils import assemble # A simple CLVM program: (q . 1) which quotes the atom 1 program_code = '(q . "hello")' program = Program.fromhex(assemble(program_code).hex()) # An empty argument list (nil) args = Program.null() # Set flags for evaluation (e.g., MEMPOOL_MODE) # For a simple run, default flags are often sufficient flags = 0 # No special flags for this simple example try: # Run the program with a default cost ratio cost, result = run_program(program, args, flags, CLVM_COST_RATIO_DEFAULT) print(f"Program executed successfully. Cost: {cost}") print(f"Result: {result.as_python()}") except Exception as e: print(f"Error executing program: {e}")
Debug
Known issues
breakingStarting from version 0.17.2, clvm_rs requires Python 3.10 or newer. Projects on older Python versions will need to upgrade their Python environment or use an older clvm_rs version.
fix
Upgrade your Python environment to 3.10 or higher (e.g., `pyenv install 3.10.13`, `conda install python=3.10`).
affects: >=0.17.2
breakingThe `intern` function was renamed to `intern_tree` in version 0.17.3 as part of `CHIA-3823`. Code calling the old `intern` function will break.
fix
Update calls from `intern(...)` to `intern_tree(...)` and consider `intern_tree_with_flags` if propagating allocator flags.
affects: >=0.17.3
gotchaVersion 0.16.5 introduced stricter mempool rules and fixed edge cases in `is_canonical_serialization()`. This may lead to previously accepted, non-canonical CLVM programs or transactions being rejected by the mempool.
fix
Ensure that generated CLVM programs and serialized objects strictly adhere to canonical forms and mempool validation rules. Review and update code that might produce borderline valid CLVM.
affects: >=0.16.5
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'clvm_rs'
The 'clvm_rs' Python package is not installed in the active Python environment or the environment is not correctly activated.
fix
Ensure your virtual environment is active and run: `pip install clvm-rs` or `pip install clvm_tools_rs` if you intend to use the higher-level tools.
ERROR: Could not find a version that satisfies the requirement clvm-rs
No pre-built binary wheel is available for your specific operating system, Python version, or architecture, or the Rust toolchain is missing for source compilation.
fix
First, ensure Rust and Cargo are installed (e.g., `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`). Then try `pip install clvm-rs` again. For specific architectures like M1 Macs, building from source might be required after cloning the repository and using `maturin develop`.
Cargo, the Rust package manager, is not installed or is not on PATH.
The `clvm-rs` library has Rust components that need to be compiled during installation if a pre-built wheel is not available, and the Rust toolchain (including `cargo`) is not found on your system's PATH.
fix
Install Rust and Cargo using `rustup`: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`. Verify that `~/.cargo/bin` is added to your system's PATH environment variable after installation.
ImportError: cannot import name 'deserialize_and_run_program2' from 'clvm_rs'
The specific function `deserialize_and_run_program2` has likely been removed, renamed, or moved to a different module in a newer version of `clvm-rs` or its dependent Chia libraries, or there is a version incompatibility.
fix
Review the official `clvm-rs` or `clvm_tools_rs` documentation and changelogs for your installed version to identify the correct function name or import path. Ensure all related Chia-Network libraries are updated to compatible versions.
Upgrade
Version history
0.17.7latest on PyPI · released Apr 29, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.10 or newer for runtime execution of the Python bindings.
Agent activity
21 hits · last 30 days
node
16
OpenAI (training)
1
Resources
clvm-rs — pip install clvm-rs · libregistry