xian-vm-core
xian-vm-core is the Rust-side consumer of the frozen xian_vm_v1 compiler IR
emitted by xian-contracting.
flowchart LR
Source["Contract source"] --> Compiler["xian-contracting compiler"]
Compiler --> IR["xian_vm_v1 IR"]
IR --> Validator["Rust IR validator"]
Validator --> VM["Native VM execution slice"]
VM --> Host["Host storage and syscall bridge"]
Host --> State["Deterministic state and events"]
Fixtures["Python parity fixtures"] --> Validator
Fixtures --> VM
Supported scope:
- deserialize the structural JSON IR
- validate its top-level invariants and recursive node shapes
- instantiate validated modules and execute a direct-IR interpreter slice
- provide one Rust-owned contract for the Python frontend to target
- expose a minimal Python-facing native capability surface for
xian-abciprobing viaxian_vm_core._native
Execution coverage is intentionally narrow but real:
- local function calls and builtin calls such as
len,range,str, andisinstance - aggregate/container helpers such as
sorted,sum,min,max,all,any,reversed, andzip - explicit storage ops for
VariableandHash - foreign storage reads for
ForeignVariableandForeignHash, including function-local references with dynamic contract/variable targets - arbitrary-precision integer values instead of
i64-only VM integers - fixed-precision
decimal(...)construction and arithmetic - native
datetime.datetime/datetime.timedeltavalues, includingdatetime.datetime.strptime(...), arithmetic, comparison, and common field access - bigint-oriented builtins needed by the shielded contracts, including
int(..., base),pow(base, exp, mod), andformat(value, "064x") hashlib.sha3(...)andhashlib.sha256(...)crypto.verify(...)andcrypto.key_is_valid(...)LogEventemission- static-import and dynamic-import contract export calls
- native container method calls used by contracts today, including
dict.keys(),dict.values(),dict.items(),dict.get(), and the common mutable list helpersappend,extend,insert,remove, andpop - native string helpers used by the shielded contracts, including
lower(),isalnum(),startswith(...), andjoin(...) - Python-style subscript slicing for
list,tuple, andstr, including thevalue[2:]helper pattern used in the shielded contracts - sequence repetition for
list,tuple, andstr - host-delegated
zk.*syscalls, which remain explicit runtime boundary calls instead of Rust-local protocol logic
It is a bounded execution slice, not the full executor.
The crate includes curated conformance fixtures generated from the current local harness. Those fixtures are checked from Rust so the VM can match actual contract behavior on a controlled contract subset alongside hand-written executor tests.
Metering covers both host-side data costs and VM execution:
- storage reads, writes, transaction bytes, and return-value bytes are charged directly in the VM host path
- execution cost is driven by an explicit
xian_vm_v1gas schedule over VM statements, expressions, calls, and loop iterations - module initialization is metered, so first-load authored contracts do not get free global-declaration and module-body execution
contract.exists(...),contract.has_export(...),contract.info(...), and related contract metadata syscalls resolve directly against the driver/IR in the native host bridge- authored contract storage persists
__xian_ir_v1__, and the native host requires that validator-derived artifact forxian_vm_v1execution; stored__source__remains available for dashboards, BDS, and other inspection tooling - native deployment accepts cleartext source only, rejects submitted
deployment_artifacts, and derivesvm_ir_jsonthrough the pinned compiler before staging writes - native deployment requires explicit deterministic
nowcontext from the caller; the host does not fall back to local wall-clock time for submission metadata - the native deployment path validates the compiler-produced IR before staging writes or executing constructors
- the Python deployment path and offline tooling keep canonical source-to-runtime recompilation in the Python artifact validator; the native path is Rust-native for bundle validation, not a Rust recompiler
- the five-node
make localnet-parallel-e2enative-authority soak passes end to end, including shielded token flows and parallel prefix-scan access patterns
That parity corpus covers:
- storage/event flows
- range/list/dict control-flow helpers
- foreign storage reads
- fixed-precision decimal semantics
- datetime/timedelta behavior
- bigint parsing, modular arithmetic, hex formatting, and shielded-style helper flows
- hashing and ed25519 verification helpers
- static-import and dynamic-import nested contract calls
- real authored shielded contract sources for
shielded-note-tokenandshielded-commands, including constructor-seeded state snapshots and hash-helper exports - real authored token, registry, game, and oracle flows across repos, including:
currency.transfer(...),stable_token.burn(...),reflection_token.transfer(...),profile_registry.create_channel(...),turn_based_games.join_match(...), andoracle.price_info(...)
The intent is to keep the Xian VM implementation Rust-first for performance, while still freezing semantics in the Python compiler frontend before runtime execution work starts.
The crate ships a small PyO3/maturin surface for integration work:
runtime_info()/runtime_info_json()supports_execution_policy(...)validate_module_ir(...)/validate_module_ir_json(...)
That surface is intentionally narrow. It is there so node-side code can probe the VM runtime honestly before transaction execution is wired through the Rust engine.
The largest remaining runtime work is metering drift on the heaviest authored flows and the host-operation split between delegated calls and Rust-owned implementations. Integer width, basic authored shielded execution, and pre-call setup flows are covered by the authored parity corpus and fixture generator.
Releases
Push a vm-core-vX.Y.Z tag with matching versions in pyproject.toml and
Cargo.toml after ../../scripts/validate-release.sh passes. The release
workflow builds native wheels for Linux, macOS Intel/ARM and Windows, and a
source distribution. PyPI Trusted Publishing uses project xian-tech-vm-core,
owner xian-technology, repository xian-contracting, workflow release.yml
and environment pypi-xian-vm-core.
Runtime semantics are consensus-sensitive. Validators must use the same accepted VM version; existing histories containing previously failed dynamic foreign-storage calls need an explicit upgrade boundary.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xian_tech_vm_core-0.1.1.tar.gz.
File metadata
- Download URL: xian_tech_vm_core-0.1.1.tar.gz
- Upload date:
- Size: 774.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cefe1982fc30eaa0246dabb2048f46a6d07254e6042fd277eced33021ef7940
|
|
| MD5 |
82646f6ad5aee0e1033eccda3736f45e
|
|
| BLAKE2b-256 |
40a3844d4b25c1809a284b0e5a69d0142d1d2396ad496aa2cdecf9f17a986a29
|
Provenance
The following attestation bundles were made for xian_tech_vm_core-0.1.1.tar.gz:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_vm_core-0.1.1.tar.gz -
Subject digest:
8cefe1982fc30eaa0246dabb2048f46a6d07254e6042fd277eced33021ef7940 - Sigstore transparency entry: 2791727384
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Branch / Tag:
refs/tags/vm-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_vm_core-0.1.1-cp314-abi3-win_amd64.whl.
File metadata
- Download URL: xian_tech_vm_core-0.1.1-cp314-abi3-win_amd64.whl
- Upload date:
- Size: 798.1 kB
- Tags: CPython 3.14+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af6bb96199a7f7e8d157e8480d46a8935636728c77109cd66b51fd84903fec80
|
|
| MD5 |
a26e93b8520a3a6b0029ca5303a3f2db
|
|
| BLAKE2b-256 |
69d0d84b867b5a668bc5a69d3a1d83df356539ffcf327cf75d5b7847930e2e09
|
Provenance
The following attestation bundles were made for xian_tech_vm_core-0.1.1-cp314-abi3-win_amd64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_vm_core-0.1.1-cp314-abi3-win_amd64.whl -
Subject digest:
af6bb96199a7f7e8d157e8480d46a8935636728c77109cd66b51fd84903fec80 - Sigstore transparency entry: 2791727494
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Branch / Tag:
refs/tags/vm-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_vm_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: xian_tech_vm_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 961.1 kB
- Tags: CPython 3.14+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b254527d5b96cf2e0cc5a1cee59fcc588fbc8a4d8e8b27fbf1ca737846c03311
|
|
| MD5 |
fbec44753b369793f96758fd15e2dceb
|
|
| BLAKE2b-256 |
68f6c0995de0e6497fb843a074ab38263a2154deca2ba52982a575d13341c3fa
|
Provenance
The following attestation bundles were made for xian_tech_vm_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_vm_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
b254527d5b96cf2e0cc5a1cee59fcc588fbc8a4d8e8b27fbf1ca737846c03311 - Sigstore transparency entry: 2791727465
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Branch / Tag:
refs/tags/vm-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_vm_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: xian_tech_vm_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 846.3 kB
- Tags: CPython 3.14+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c4a20d3f9daa86f3f7cf8bc39b2886248cd9db73f5a4369e3acf6151582f446
|
|
| MD5 |
9a938ab2b8ac4bab660129365cecc91b
|
|
| BLAKE2b-256 |
3823825df780513a63a927c90033854e669f8f6c65aa505f52356678e96c4bf2
|
Provenance
The following attestation bundles were made for xian_tech_vm_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_vm_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl -
Subject digest:
1c4a20d3f9daa86f3f7cf8bc39b2886248cd9db73f5a4369e3acf6151582f446 - Sigstore transparency entry: 2791727449
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Branch / Tag:
refs/tags/vm-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_vm_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: xian_tech_vm_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 894.8 kB
- Tags: CPython 3.14+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc2aa0a0b0399fb5830e3a419d90a4fc17d1b16c74d0f42edb258475b1b541bc
|
|
| MD5 |
3a6bc443ecc45c96bdcfe511464e76f1
|
|
| BLAKE2b-256 |
fb51307313b548707ff0ef0d76011af61b71d94777f62230ee96242665e3a448
|
Provenance
The following attestation bundles were made for xian_tech_vm_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_vm_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl -
Subject digest:
cc2aa0a0b0399fb5830e3a419d90a4fc17d1b16c74d0f42edb258475b1b541bc - Sigstore transparency entry: 2791727417
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Branch / Tag:
refs/tags/vm-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f5827131ac8049c3b802d2813cd4331a7d9f13a -
Trigger Event:
push
-
Statement type: