This repository is the fork of sigma-rust created for lightweight wallets where most of the sigma-rust advanced features are not required. Unless you have such a specific case, you're better off using the original sigma-rust.
The original codebase of sigma-rust is heavily minimized to prune everything not related to signing simple transactions. However, the original design is preserved and as a result most of the original tests remained unchanged.
Due to the highly focused nature, this library supposed to be stable, all new features can be done elsewhere.
You want to interact with Ergo blockchain and want to support only basic P2PK addresses, BIP-32 keys, and interact with dApps via ErgoPay. You don't want to compile smart contracts, interact with contracts directly and, therefor, you don't need the ErgoTree interpreter. And you also want a minimalistic non-opinionated library that is focused on keys management and transaction signing. You also have your own Android/iOS/JS/Whatever bindings or don't need them at all. You are also planning your way of interacting with Ergo nodes.
You want to integrate you library/ecosystem with Ergo blockchain and need to avoid new dependencies. This library is already minimized towards what you need so you can copy the code and even minimize it further. It helps passing code audit.
You may be interested to learn blockchain development, Ergo, Rust or all of it. You can start from this library and then switch to full-blown sigma-rust.
See Architecture for high-level overview.
This library has the limitations vs the original sigma-rust described below.
Only Constant and ConstantPlaceholder nodes allowed in sigma-rust-mini. And because ErgoTree root expression should be of type SigmaProp, then only Literal::SigmaProp can be in the ErgoTree.
P2S addresses are supported but can only contain rudimentary ErgoTrees.
Overarching crate exposing wallet-related features: chain types (transactions, boxes, etc.), JSON serialization, simple box selection for tx inputs, tx builder and signing. Exports other crates API, probably the only crate you'd need to import.
Heavily pruned ErgoTree interpreter. The original sigma-rust design is preserved, all ErgoTree operations were removed along with evaluation and related code.
Heavily pruned ErgoTree IR. The original sigma-rust design is preserved, but most of the nodes and related serializers and code were pruned.
ErgoScript compiler was completely removed
Ergo binary serialization primitives. Remained mostly unchanged.
The following bindings form sigma-rust was removed. If you need them then use the original sigma-rust.
- 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)
- sigma_rb(Ruby)
See CHANGELOG.md.
Since all bindings were removed, most of the original examples are not relevant, except pure Rust examples listed below.
Rust:
- Oracle Core;
- Ergo Headless dApp Framework;
- Ergo Node Interface Library;
- Spectrum Off-Chain Services for Ergo;
- AgeUSD Stablecoin Protocol;
- ErgoNames SDKs
Also take a look at tests where various usage scenarios were implemented.
And last but not the least, there is a whole section of examples for the original sigma-rust library.
See Contributing guide.
Feel free to join the Ergo Discord and ask questions on #dev-tooling
channel.