The standard library implementation for SimplicityHL.
simf/lib
├── secp256k1
│ └── operations.simf
│ ├── Conversions between `Ge`, `Gej`, and compressed `Point`.
│ ├── Subtraction for `Fe`, `Scalar`, `Gej`.
│ ├── Equality predicates and their `assert_*` counterparts.
│ └── Safe Jacobian-to-affine normalization.
├── u1
│ └── convert.simf
│ └── Conversions from `u1` to other uint types and `bool`.
├── u8
├── u16
├── u32
├── u64
│ ├── convert.simf
│ │ └── Conversions between `u8`, `u16`, `u32`, `u64` and other uint types.
│ └── math.simf
│ └── Overflow-checked arithmetic and `gt`/`ge` functions.
├── u128
├── u256
│ ├── bit.simf
│ │ └── Basic bit operations available as jets for `u8`-`u64` but missing for `u128` and `u256`.
│ ├── comparison.simf
│ │ └── Basic comparison operations available as jets for `u8`-`u64` but missing for `u128` and `u256`.
│ ├── convert.simf
│ │ └── Conversions between `u128`, `u256` and other uint types.
│ └── math.simf
│ └── Carry/borrow arithmetic, multiplication, division, and overflow-checked wrappers.
├── asserts.simf
│ └── Assertion helpers: `assert_eq_*` for uints and `bool`, plus `assert_none_*` for `Option`.
├── binary.simf
│ └── Basic binary logic operations: `and`, `or`, `not`, `xor`.
└── op_return.simf
└── Utilities for detecting and enforcing `OP_RETURN` (null data) outputs.First, install simplex development framework:
curl -L https://smplx.simplicity-lang.org | bash
simplexupThen install simplicityhl-std dependency via simplex.
simplex install https://github.com/BlockstreamResearch/simplicityhl-stdNote
The library works with Simplex version 0.0.7 or higher.
After installing the library, import modules from std::lib:
use std::lib::u32::math::checked_add_32;
use std::lib::asserts::assert_eq_32;
fn main() {
assert_eq_32(unwrap(checked_add_32(1, 2)), 3);
}We are open to any mind-blowing ideas! Please take a look at our contributing guidelines to get involved.
The library is released under the MIT License.