Skip to content

target: Add libbitcoin-server fuzzing support#90

Draft
str8outtaheap wants to merge 5 commits intodergoegge:masterfrom
str8outtaheap:target/libbitcoin
Draft

target: Add libbitcoin-server fuzzing support#90
str8outtaheap wants to merge 5 commits intodergoegge:masterfrom
str8outtaheap:target/libbitcoin

Conversation

@str8outtaheap
Copy link
Contributor

@str8outtaheap str8outtaheap commented Dec 17, 2025

Summary

Adds support for fuzzing libbitcoin-server (bs) as a fuzzing target. libbitcoin-server (compared to libbitcoin-node) includes a ZeroMQ query interface with address indexing, allowing us to query blockchain state, transactions, and addresses. This provides better control and introspection capabilities (might be heavier/slower).

What's included

  • LibbitcoinTarget: Spawns and manages libbitcoin-server process
  • LibbitcoinGenericScenario: P2P fuzzing scenario with inbound-only connections
  • Dockerfile.libbitcoin: Builds bs at /opt/libbitcoin/bin/bs with AFL++ instrumentation
  • scripts/test-libbitcoin.sh: Manual verification of server startup

Notes / Limitations

  • Uses native libbitcoin consensus (not libconsensus wrapper)
  • Inbound connections only (libbitcoin-server does not support dynamic peer management)
  • No mocktime support (libbitcoin-server does not support mocktime)

Testing

# Build Docker image
docker build -f Dockerfile.libbitcoin -t fuzzamoto-libbitcoin .

# Run container
docker run -it -v $(pwd):/fuzzamoto fuzzamoto-libbitcoin bash

# Inside container:
/fuzzamoto/scripts/test-libbitcoin.sh
cargo test --release --package fuzzamoto -- libbitcoin --ignored

WIP

  • Nyx VM integration
  • ZeroMQ support for HasTipHash/HasTxOutSetInfo oracles
  • Seed corpus generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant