Dash Core Documentation
repository·develop·Indexed 23 days ago
https://github.com/dashpay/dashOpen-source software for the Dash digital currency, enabling instant, private peer-to-peer payments. This documentation covers the Dash network validator, wallet, and GUI, as well as developer tools for memory consumption analysis (dash_dbg.sh), PGP key management, Docker container deployment, and build utilities including Guix for reproducible builds.
What's inside Dash Core
- Dash is an experimental digital currency that enables instant peer-to-peer payments globally without a central authority. The network collectively manages transactions and money issuance. The reference client is an open-source project released under the MIT license.
Overview of ctaes
developctaes is a simple C module designed for constant-time AES encryption and decryption. It is specifically engineered to be resistant to side-channel attacks by avoiding tables or data-dependent branches, instead utilizing a bit-sliced approach (based on https://eprint.iacr.org/2009/129.pdf).
Key characteristics:
- Pure C: No external dependencies.
- Small Footprint: Produces slightly over 4k of executable code when compiled with
-Os. - Security: Constant-time implementation.
- Performance: Slower than table-based or instruction-specialized implementations, achieving approximately 15 MB/s on modern CPUs.
Overview of the RELIC cryptographic toolkit
developRELIC is a research-oriented cryptographic meta-toolkit designed for efficiency and flexibility. It is intended to be used as a foundation for building specialized cryptographic toolkits tailored to specific security levels and algorithmic requirements.
Key features include:
- High portability and support for architecture-dependent code.
- Support for experimentation with alternative implementations.
- Comprehensive tests and benchmarks for implemented functions.
- Flexible configuration options.
- Maximum efficiency for cryptographic operations.
Overview of internal C++ interfaces
developThe Dash Core codebase uses a set of internal C++ interfaces to define boundaries between major components: the node, the wallet, and the GUI. This separation allows these components to run in different processes, facilitating multiprocess architecture, independent testing, and modular development.
Note: These interfaces are intended for internal use within the Dash Core ecosystem and are not currently designed to be stable or for external consumption.
Overview of mimalloc features and design
developmimalloc (pronounced "me-malloc") is a high-performance, general-purpose allocator designed for low-latency and large-scale services. Key design features include:
- Free list sharding & multi-sharding: Uses many small free lists per "mimalloc page" and multiple lists per page (thread-local vs. concurrent) to reduce fragmentation and contention.
- Eager page purging: Automatically marks empty pages as unused to the OS to reduce memory pressure.
- Secure mode: Can be built with guard pages, randomized allocation, and encrypted free lists to protect against heap vulnerabilities.
- First-class heaps: Allows efficient creation and destruction of multiple heaps for different allocation regions.
- Bounded performance: Provides bounded worst-case allocation times and bounded space overhead (~0.2% metadata).
- Small footprint: Approximately 10k LOC, making it easy to integrate into other projects.
Available Dash Core containers
developDash Core provides several container images for different stages of development, testing, and deployment. Note that containers with dependencies require BuildKit to be enabled for syntax extensions to function correctly.
| Name | Depends On | Purpose | | --------- | -----------| -------------------------------------------------------------------------- | | `ci-slim` | None | Slimmed down container used to run functional tests and (some) linters | | `ci` | `ci-slim` | Full container used to (cross) compile | | `develop` | `ci` | Interactive environment to allow debugging in an environment that's 1:1 CI | | `deploy` | None | Packaging of builds for release on Docker Hub | | `guix` | None | Interactive environment for building (and packaging) with Guix |Use the dashconsensus library for script verification
developThedashconsensuslibrary provides critical consensus verification functionality for Dash, making it available for other applications and language bindings. The primary interface is defined in the C headerbitcoinconsensus.h(located atsrc/script/bitcoinconsensus.h).Use the Python implementation of BLS12-381 and Signatures
developThis package provides a Python implementation of the BLS12 curve, optimal ate pairing, BLS signatures, and aggregation.
Warning: This implementation is intended for reference and educational purposes only. It is not optimized for production use.
For production-grade performance, use the Python bindings instead.
Experimental Guile bindings overview
developThe Guile bindings provide efficient immutable vectors for the
GNU GuileScheme implementation. Note that the interface is currently incomplete and experimental.Key features include high-performance immutable vectors (such as
ivectorandivector-u32) and efficient operations likeivector-appendandivector-fold.Untitled record
developimmer is a C++ library providing persistent and immutable data structures. It is designed for interactive and concurrent programs, leveraging structural sharing to allow efficient comparison of values and safe data access across multiple processes without the need for deep copies.
Key benefits include:
- Interactivity: Efficiently reason about change via structural sharing.
- Concurrency: Safe reading from multiple processes without mutation.
- Parallelism: Support for efficient concatenation algorithms (e.g., $O(\log(n))$).
- Performance: State-of-the-art data structures with efficient cache utilization and customizable memory management strategies via policy-based design.
What is mimalloc Secure Mode?
developSecure mode is enabled during build time using the
-DMI_SECURE=ONflag incmake. It provides several mitigations against exploits:- Guard Pages: Internal mimalloc pages and heap metadata are surrounded by guard pages to prevent buffer overflow exploits from reaching metadata.
- Encoded Free Lists: Free list pointers are encoded with per-page keys to prevent overwrites and detect heap corruption.
- Double Free Detection: Double frees are detected and ignored.
- Randomization: Free lists are initialized in random order, and allocation randomly chooses between extension and reuse within a page. Large heap blocks from the OS are also address randomized.
Note: These are mitigations, not guarantees. Evaluate them as part of an overall security strategy.
What is Minisketch and how do sketches work?
developMinisketch (
libminisketch) is an optimized C library for BCH-based set reconciliation. It implements the PinSketch algorithm to produce "set sketches"—compact checksums of a set of elements.Key Properties
- Capacity-based Recovery: Sketches have a predetermined capacity $c$. If the number of elements in a set (or the size of the difference between two sets) does not exceed this capacity, the entire set or difference can be recovered from the sketch. A sketch of $b$-bit elements with capacity $c$ is stored in $bc$ bits.
- Symmetric Difference via XOR: The sketches of two sets can be combined using the XOR operation to obtain a sketch of their symmetric difference (elements that occur in one set but not both).
Set Reconciliation Protocol
If Alice and Bob have sets that largely overlap, they can reconcile them using this protocol:
- Alice and Bob both compute a sketch of their respective sets.
- Alice sends her sketch to Bob.
- Bob XORs Alice's sketch with his own to obtain a sketch of the symmetric difference.
- Bob attempts to recover the elements from the difference sketch.
- Bob sends the recovered elements that he does not already have to Alice.
This succeeds as long as the size of the symmetric difference does not exceed the sketch's capacity.
Note: For large elements, it is recommended to compute sketches over hashes of the elements. In that case, Bob must also send the hashes of the elements he is missing so Alice can respond with the actual elements requested.