Rust implementation of ErgoScript cryptocurrency scripting language.
This is a fork of ergoplatform/sigma-rust, not a competing
project. Think of it as a bleeding-edge build of sigma-rust, kept close to upstream develop, with three aims:
- Take pressure off upstream review. We have a backlog of open pull requests upstream. Carrying them here lets work that depends on them continue meanwhile, so upstream reviewers can clear the queue at their own pace.
- Converge towards a validation-ready sigma-rust upstream. The goal is a library that matches the reference implementation, sigmastate, closely enough to validate blocks and transactions. That work happens here first and is meant to flow back upstream.
- Send cleaner upstream PRs later. Once the backlog has shrunk, changes that have been running here can go upstream as consolidated, battle-tested pull requests rather than as a series of incremental fixes.
Our upstream pull requests so far are listed under Upstream pull requests.
Releases (crates.io, npm, PyPI) come from upstream.
See Architecture for high-level overview.
Overarching crate exposing wallet-related features: chain types (transactions, boxes, etc.), JSON serialization, box selection for tx inputs, tx builder and signing. Exports other crates API, probably the only crate you'd need to import.
ErgoTree interpreter
ErgoTree IR and serialization.
ErgoScript compiler.
Ergo binary serialization primitives.
Bindings:
- ergo-lib-wasm(Wasm)
- ergo-lib-wasm-browser(JS/TS)
- ergo-lib-wasm-nodejs(JS/TS)
- ergo-lib-ios(Swift)
- ergo-lib-jni(Java)
- ergo-lib-c (C)
- ergo-lib-go (Go)
- sigma_rb(Ruby)
- ergo-lib-python
See CHANGELOG.md.
To get better understanding on how to use it in your project check out how its being used in the following projects:
Rust:
- Oracle Core;
- Ergo Headless dApp Framework;
- Ergo Node Interface Library;
- Spectrum Off-Chain Services for Ergo;
- AgeUSD Stablecoin Protocol;
- ErgoNames SDKs
TS/JS:
- Ergo SDK (Wasm bindings);
- Yoroi wallet (Wasm bindings);
- Ergo Desktop Wallet (Wasm bindings);
Examples:
Also take a look at tests where various usage scenarios were implemented.
See Contributing guide.
Feel free to join the Ergo Discord and ask questions on #sigma-rust channel.
Our pull requests to ergoplatform/sigma-rust, as of 2026-11-08. The live list is on GitHub.
| PR | Title | Into | Merged |
|---|---|---|---|
| 895 | fix: Option DATA parser treats any nonzero tag as Some, per JVM getOption | v0.30.0 |
2026-07-09 |
| 909 | fix: read Header version as a signed Byte at the unparsedBytes gate (JVM parity) | v0.30.0 |
2026-07-09 |
| 906 | Reject self ContextExtension keys >= 0x80 (JVM context-construction parity) | v0.30.0 |
2026-07-09 |
| 868 | fix: reject non-pair tuples at eval to match sigma-state consensus | v0.30.0 |
2026-07-09 |
| 877 | fix(ergotree-ir): Global.powHit returns UnsignedBigInt, not Boolean | v0.30.0 |
2026-07-09 |
| 897 | fix: reject unsupported (arity != 2) tuple-typed values at eval (JVM checkType) | v0.30.0 |
2026-07-09 |
| 891 | fix: checked ERG summation in stateful transaction validation | v0.30.0 |
2026-07-15 |
| 852 | ergo-nipopow: tolerate skipped prefix entries in has_valid_connections | v0.30.0 |
2026-08-03 |
| 866 | fix(nipopow): pack_interlinks key encoding — use first-occurrence position | v0.30.0 |
2026-08-03 |
| 915 | style: restore fmt and clippy gates on v0.30.0 (ergo-nipopow) | v0.30.0 |
2026-08-03 |
| 875 | Set tree_version from the evaluated tree in reduce_to_crypto | develop |
2026-09-15 |
| 927 | fix: wire-parse conformance with sigmastate 6.0.6 (folds #902, #911, #922, #926, #871) | develop |
2026-11-02 |
| 857 | fix: BigInt256 modulo must use mathematical mod, not remainder | develop |
2026-11-02 |
| PR | Title | Into | Opened |
|---|---|---|---|
| 847 | Fix panic in gen_indexes when index modulo N equals zero | develop |
2026-03-31 |
| 848 | ergo-lib: port ErgoTreePredef, EmissionRules, and genesis construction | develop |
2026-04-04 |
| 850 | ergo-lib: add SoftForkVotesCollected and SoftForkStartingHeight Parameter variants | develop |
2026-04-06 |
| 851 | ergo-nipopow: add prove_with_reader for db-backed proof construction | develop |
2026-04-08 |
| 855 | fix: guard NiPoPow scorex_parse against allocation bomb | v0.30.0 |
2026-04-09 |
| 858 | perf: lazy constant resolution in ErgoTree evaluation (draft) | develop |
2026-04-12 |
| 859 | fix: pre-JIT ErgoScript leniency for v0/v1 ErgoTree scripts | develop |
2026-04-13 |
| 860 | fix: accept SOption(T) where T expected in check_post_eval_tpe | develop |
2026-04-16 |
| 865 | fix(interpreter): wrap Resolver closures in Arc::new for upstream API change (draft) | develop |
2026-05-18 |
| 867 | fix(interpreter): handle non-Spanned variants in wrap_spanned_with_src | develop |
2026-05-24 |
| 869 | fix: coerce mismatched-numeric arithmetic operands to the wider type | develop |
2026-05-31 |
| 870 | fix: negation of MIN_VALUE wraps to match sigma-state | develop |
2026-06-01 |
| 872 | Fix v1 Autolykos zero pow_distance serialization to match sigma JVM | develop |
2026-06-03 |
| 873 | Fix BigInt/UnsignedBigInt toBytes/toBits to emit minimal-length bytes | develop |
2026-06-03 |
| 874 | Register GroupElement.expUnsigned in the method descriptor table | develop |
2026-06-03 |
| 876 | JIT Costing: The Definitive PR (draft) | develop |
2026-06-03 |
| 878 | fix(ergotree-interpreter): implement numeric cast to UnsignedBigInt in eval | develop |
2026-06-04 |
| 879 | fix: tolerate absent/non-bytearray context var in DeserializeContext substitution | develop |
2026-06-04 |
| 880 | fix(ergotree-interpreter): reduce atLeast with degenerate bound instead of erroring | develop |
2026-06-04 |
| 882 | fix: deserialize FunDef (0xd7) — polymorphic val definitions | develop |
2026-06-06 |
| 883 | fix: lambdas capture their defining environment | develop |
2026-06-06 |
| 884 | fix: Box.getReg is method id 19; absent/out-of-range dynamic index is None | develop |
2026-06-06 |
| 885 | fix: parse box value and token amount unbounded from the wire | develop |
2026-06-07 |
| 886 | fix: AvlTree.insertOrUpdate returns None on a wrong-tree proof | develop |
2026-06-07 |
| 887 | fix: Header.stateRoot is an AvlTree; v2 powOnetimePk is the group generator | develop |
2026-06-07 |
| 888 | fix: EQ over cross-kind SigmaProps throws when the left is a conjecture | develop |
2026-06-07 |
| 889 | fix: variable-length Context.headers; lastBlockUtxoRoot as its own context input | develop |
2026-06-07 |
| 890 | fix: AvlTree ops map wrong-tree proofs and failed ops per the reference impl | develop |
2026-06-07 |
| 892 | test: AvlTree degenerate-input eval regressions (pairs with ergo_avltree_rust#14) | develop |
2026-06-07 |
| 893 | fix: reject standalone TreeLookup node at eval to match the reference interpreter | develop |
2026-06-07 |
| 894 | fix: AvlTree digest is variable-length; updateDigest stores any-length Coll[Byte] | develop |
2026-06-07 |
| 898 | fix: reject ErgoTree v>0 header without the size bit (JVM Rule-1012) | develop |
2026-06-10 |
| 899 | fix: reject non-unary lambdas at closure creation (JVM FuncValue.eval) | develop |
2026-06-10 |
| 900 | fix: Box/Header identity and Box.bytes use the retained wire bytes | develop |
2026-06-10 |
| 901 | fix: deserialize LastBlockUtxoRootHash (0xa6) — the bare context-root op form | develop |
2026-06-10 |
| 903 | Fix json+no_std build of ergotree-ir (missing alloc imports) | develop |
2026-06-12 |
| 905 | Dispatch SBox accessor method-forms (PropertyCall 99:2..6) | develop |
2026-06-13 |
| 907 | fix: reject two deserialize-time over-acceptances (v6 audit) | develop |
2026-06-14 |
| 908 | fix: accept full u8 range for STypeVar name length (JVM TypeSerializer parity) | develop |
2026-06-15 |
| 910 | fix: lossily decode STypeVar name to match the JVM TypeSerializer (UTF-8 leniency, byte-exact U+FFFD) | develop |
2026-06-16 |
| 923 | fix: reject ContextExtension count >= 128 and variable id >= 0x80 at parse (sigmastate 6.0.6 parity) | develop |
2026-09-27 |
| 924 | fix: storage-rent verdict is final; JVM Int fee/age arithmetic; StorageContractCost (ErgoInterpreter parity) | develop |
2026-09-27 |
| 925 | fix: reject box creation height > Int.MaxValue at parse (getUIntExact parity) | develop |
2026-09-27 |
A further 10 were closed without merging: superseded, folded into a later pull request, or no longer needed.