Skip to content

dash-num dash-num

dash-num

This crate supplies the wide blob and arithmetic types used by the Dash Base SDK for consensus-stable types, including

  • Fixed-width HashBlobs stored in little endian and rendered in big endian format for 160-bit (Hash160) and 256-bit width (Hash256)
  • Unsigned 256-bit arithmetic (Arith256) with consensus-compatible behavior (e.g. wrapping operators)
  • Compact representation of difficulty targets (CompactTarget) and bidirectional conversion with Arith256

Usage

To import dash-num to your project, add the following to the [dependencies] section in Cargo.toml

dash-num = "0.1.0-beta"

To use an unpublished revision of this crate, identify the commit hash to pin against and use the following replacing the value of rev.

dash-num = { git = "https://github.com/dashpay/base-sdk", rev = "a1b2c3d4e5f67890abcdef1234567890abcdef" }

To build this crate on a clone of the repository, at the repository root, run the following

cargo build --package dash-num --all-features

Features

This crate is #![no_std] + alloc by default.

Feature Default Description
codec ✅ Enables support for encoding and decoding types using bitcoin-consensus-encoding
full Enables all features and std support.
serde Enables support for encoding and decoding codec-backed types using serde. Implies codec.

Documentation

Documentation for the most recent release of dash-num is available at https://dashpay.github.io/base-sdk/num and changes between versions are recorded in the changelog.

License

dash-num is released under the terms of the MIT license. Copyright © 2026-present, The Dash Core developers. To read a copy of the license terms, visit https://opensource.org/license/MIT.