Skip to Content
DevelopersFuzzing

Fuzzing

Fuzzing feeds generated inputs into parsers, script evaluators, P2P handlers, and other edge-heavy code. Tidecoin inherits Bitcoin Core fuzz infrastructure and adds post-quantum and transport-related coverage.

This page summarizes the workflow. The source of truth is ../tidecoin/doc/fuzzing.md.

libFuzzer Quickstart

cmake --preset=libfuzzer cmake --build build_fuzz FUZZ=process_message build_fuzz/bin/fuzz

Run the fuzz test runner:

build_fuzz/test/fuzz/test_runner.py --help

Use --preset=libfuzzer-nosan for throughput runs without the normal sanitizer overhead.

Useful Targets

TargetArea
process_messageP2P message processing
script_interpreter / eval_scriptScript execution
key_io / bech32Address and key encoding
psbtPSBT parsing and mutation
bip324_pqPost-quantum transport framing
powProof-of-work related parsing/checking

Check src/test/fuzz/ for the full list.

Corpus Workflow

  1. Run a harness until it finds new coverage or failures.
  2. Save interesting generated inputs.
  3. Re-run with sanitizers enabled.
  4. Minimize crashing inputs before opening a PR.
  5. Report security-sensitive crashes privately.

Fuzzing often needs long runs. Fast local smoke runs are useful, but deep parser coverage can take many hours or days.

Triage Rules

FindingAction
Crash in consensus, script, PQ parsing, wallet secret handling, or P2P parsingTreat as potentially security-sensitive until understood.
Assertion failure from invalid fuzz inputCheck whether the harness should reject earlier or the code should handle it.
Timeout or OOMMinimize input and inspect for algorithmic complexity risk.
Sanitizer reportReproduce with the same build and preserve the input.

Do not open a public issue for a suspected vulnerability. Use Security Reporting.

See also: Testing, Functional Tests, PQ Test Vectors.

Last updated on