This repository contains the fuzzing corpus for the Stratum V2 Reference Implementation (SRI), a next-generation Bitcoin mining protocol implementation.
This corpus is used for continuous fuzz testing of the Stratum V2 protocol implementation to discover edge cases, parsing vulnerabilities, and potential security issues. The corpus contains inputs that have been discovered during fuzzing campaigns and represent interesting test cases for protocol message parsing and handling.
The corpus serves multiple purposes:
- Regression Testing: Ensures that previously discovered edge cases continue to be handled correctly
- Fuzzing Seed Corpus: Provides high-quality starting inputs for fuzzing campaigns
- Documentation: Demonstrates real-world protocol message patterns and edge cases
- Community Collaboration: Allows the community to contribute interesting test cases
Each directory contains binary files representing inputs that exercise different code paths in the respective fuzz targets.
To use this corpus with the Stratum repository:
- Clone both repositories:
git clone https://github.com/stratum-mining/stratum.git
git clone https://github.com/stratum-mining/stratum-fuzzing-corpus.git- Copy or link the corpus into the stratum fuzz directory:
cd stratum
cp -r ../stratum-fuzzing-corpus/* fuzz/corpus/
# Or create a symlink:
# ln -s ../../stratum-fuzzing-corpus/* fuzz/corpus/- Run fuzzing with the corpus (e.g.:
deserialize_sv2frametarget)
cd stratum
cargo +nightly fuzz run deserialize_sv2frameFor 24/7 fuzzing operations, the corpus provides a solid foundation:
# Run with multiple jobs using all CPU cores
cargo +nightly fuzz run deserialize_sv2frame -- \
-max_total_time=0 \
-jobs=$(nproc) \
-workers=$(nproc)We welcome contributions to expand and improve the fuzzing corpus!
If you discover interesting test cases during fuzzing:
- Fork this repository
- Add your corpus files to the appropriate fuzz target directory
- Ensure files are minimal (run
cargo fuzz cmin <target_name>to minimize) - Submit a pull request with a description of what makes the input interesting
- Minimize inputs: Use
cargo fuzz cmin <target_name>to reduce corpus bloat - Binary format: Corpus files should be raw binary inputs
- Privacy: Ensure corpus files don't contain sensitive information
The corpus is periodically minimized and deduplicated to:
- Keep repository size manageable
- Maintain high-quality, diverse inputs
If the corpus reveals a bug in the Stratum implementation:
- Do not include the crashing input directly in this repository
- Report the issue to stratum-mining/stratum
- Follow responsible disclosure practices
- After the bug is fixed, the input can be added to the corpus
- Stratum V2 Reference Implementation
- Stratum V2 Specification
- Stratum Protocol Website
- cargo-fuzz Documentation
Join the Stratum V2 community:
- Discord: SV2 Discord Community
- Twitter: @Stratumv2
- Website: stratumprotocol.org
This corpus is released under the same license as the Stratum V2 Reference Implementation:
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
This fuzzing corpus is maintained by the Stratum V2 community with support from contributors who run continuous fuzzing infrastructure and discover valuable test cases.
Note: This is an evolving corpus. Inputs are added as fuzzing campaigns discover new interesting cases. The corpus aims for quality over quantity, prioritizing inputs that maximize code coverage and edge case discovery.