In just 3 weeks we're hosting BTC++ Exploits edition in Florianopolis, Brazil, so we thought it would be fun to offer up some bounties for the best technical explanations of exploits-related concepts.
This week's bounty is for Fuzzing. We've got 10,000 sats for the best explanation of what fuzzing is and how it is used in Bitcoin development.
Go!
10,000 sats bounty
Fuzzing is adversarial randomness with memory. You throw garbage at code, but smart garbage — the fuzzer remembers which inputs made the program do something new (hit new code paths) and breeds more like them. It's evolution applied to breaking software.
In Bitcoin: every P2P message, every transaction, every script is untrusted input from the open internet. Fuzzers like libFuzzer run billions of malformed versions through Core's parsing code, looking for the crash that could split the network or worse. Bitcoin Core has 100+ fuzz targets in
src/test/fuzz/— every serialization boundary gets hammered.The dirty secret: fuzzing finds bugs that careful code review misses, because humans don't think in terms of "what if byte 47 is 0xFF and the length field lies?"
Fuzzing in Bitcoin development is an automated testing technique that bombards Bitcoin Core (and related code) with millions of random, mutated, or malformed inputs—like weird transactions, blocks, or P2P messages—to crash the program, reveal bugs, memory errors, or security holes before real attackers can exploit them. It's a key defense that runs continuously (via tools like libFuzzer and OSS-Fuzz) to harden consensus-critical code against malicious network data.
Fuzzing simulates an endless stream of evil inputs to find and fix vulnerabilities proactively.
Mining aims to find new blocks, fuzzing tries to find new vulnerabilities. Both require wast amounts of computing power to explore the search space.
For a cryptographic hash function we believe there is no shortcut and you just have to bruteforce to find the desired prefix, in fuzzing you can have heuristics to guide you - like is the program crashing, was this function visited or did something else unexpected happen with this random input.
Fuzzing is an automated software testing technique designed to discover bugs, crashes, memory issues, assertion failures, and potential security vulnerabilities by feeding a program a massive number of semi-random, mutated, or invalid inputs (often called "fuzz" inputs) and observing how the code behaves under those extreme conditions.
The core idea is simple but powerful: instead of writing hand-crafted test cases for every possible scenario (which is impossible for complex systems), a fuzzer generates or mutates inputs intelligently, runs the target code repeatedly, and uses feedback (especially code coverage — which branches/paths were executed) to guide the generation of new, more interesting inputs that explore previously untested areas of the codebase. When the program crashes, hangs, leaks memory, or triggers undefined behavior on some input, that's a signal of a potential bug worth investigating.
There are different styles of fuzzing:
Popular coverage-guided fuzzers used in open-source projects include libFuzzer (from LLVM/Clang, in-process and very fast), AFL++ (American Fuzzy Lop successor, great for binary-only targets), and Honggfuzz.
How Fuzzing Is Used in Bitcoin DevelopmentHow Fuzzing Is Used in Bitcoin Development
Bitcoin Core (the reference implementation) has integrated coverage-guided fuzzing deeply into its development process since around 2016–2018, evolving from early experiments to a mature infrastructure. This helps catch subtle bugs — especially in parsing, deserialization, validation, and consensus-critical code — before they become exploitable vulnerabilities on mainnet.
Key aspects in Bitcoin Core:
In short: fuzzing acts as an automated "adversary" that tries to break Bitcoin Core's code with weird inputs 24/7, making the network more robust against real-world exploits. It's one of the most cost-effective ways the project invests in security.
Thanks ChatGPT.
From my understanding it’s a way for a programmer to test their code with different input and scenarios to see if the code is secure
Fuzzing is a form of program-driven quality testing. It is used to purposefully input bad or erroneous data into Bitcoin Core node software to find bugs, errors and glitches. The results can the be used to build in protections going forward, making the blockchain network stronger and more resilient.
deleted by author