{"id":6567,"library":"clvm-rs","title":"CLVM-rs","description":"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.","status":"active","version":"0.17.5","language":"en","source_language":"en","source_url":"https://github.com/Chia-Network/clvm_rs/","tags":["blockchain","chia","clvm","rust","cryptocurrency"],"install":[{"cmd":"pip install clvm-rs","lang":"bash","label":"Install latest stable version"}],"dependencies":[{"reason":"Requires Python 3.10 or newer for runtime execution of the Python bindings.","package":"Python","optional":false}],"imports":[{"symbol":"Program","correct":"from clvm_rs.program import Program"},{"symbol":"run_program","correct":"from clvm_rs.api import run_program"}],"quickstart":{"code":"from clvm_rs.program import Program\nfrom clvm_rs.api import run_program, CLVM_COST_RATIO_DEFAULT\nfrom clvm_rs.clvm_tools.binutils import assemble\n\n# A simple CLVM program: (q . 1) which quotes the atom 1\nprogram_code = '(q . \"hello\")'\nprogram = Program.fromhex(assemble(program_code).hex())\n\n# An empty argument list (nil)\nargs = Program.null()\n\n# Set flags for evaluation (e.g., MEMPOOL_MODE)\n# For a simple run, default flags are often sufficient\nflags = 0 # No special flags for this simple example\n\ntry:\n    # Run the program with a default cost ratio\n    cost, result = run_program(program, args, flags, CLVM_COST_RATIO_DEFAULT)\n    print(f\"Program executed successfully. Cost: {cost}\")\n    print(f\"Result: {result.as_python()}\")\nexcept Exception as e:\n    print(f\"Error executing program: {e}\")","lang":"python","description":"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`."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or higher (e.g., `pyenv install 3.10.13`, `conda install python=3.10`).","message":"Starting 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.","severity":"breaking","affected_versions":">=0.17.2"},{"fix":"Update calls from `intern(...)` to `intern_tree(...)` and consider `intern_tree_with_flags` if propagating allocator flags.","message":"The `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.","severity":"breaking","affected_versions":">=0.17.3"},{"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.","message":"Version 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.","severity":"gotcha","affected_versions":">=0.16.5"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}