11# Bitcoin Fuzzing
22
3- Bitcoin is the advanced integration in this repository. It runs on the same
4- campaign pipeline as Boilerplate and uses the SDK's framework-driven entry
3+ This app integrates the fuzzing framework shipped with ` ledger-secure-sdk `
4+ (on its fuzzing-framework branch). It uses the SDK's framework-driven entry
55(` fuzz_harness_entry ` ) for APDU routing — the Bitcoin-specific pieces are
66per-lane weighted ` fuzz_commands[] ` maps (via the SDK's
77` FUZZ_PICK_COMMAND_RAW ` / ` FUZZ_PICK_COMMAND_STRUCTURED ` override hooks),
@@ -11,16 +11,16 @@ through `os_io_rx_evt()`.
1111
1212## Run it
1313
14- From the workspace root:
14+ Point ` BOLOS_SDK ` at a ` ledger-secure-sdk ` checkout on the fuzzing-framework
15+ branch, then run the SDK campaign script from this app's root:
1516
1617``` bash
17- BOLOS_SDK=" $( pwd) /ledger-secure-sdk" \
18- " $BOLOS_SDK " /fuzzing/scripts/app-campaign.sh \
19- --app-dir " $( pwd) /app-bitcoin-new" bitcoin-run
18+ export BOLOS_SDK=/path/to/ledger-secure-sdk
19+ " $BOLOS_SDK " /fuzzing/scripts/app-campaign.sh --app-dir " $( pwd) " bitcoin-run
2020```
2121
2222- ** ` bitcoin-run ` ** is the campaign name (optional); outputs go to
23- ` app-bitcoin-new/ .fuzz-artifacts/bitcoin-run/` . Omit for a UTC timestamp.
23+ ` .fuzz-artifacts/bitcoin-run/ ` under the app root . Omit for a UTC timestamp.
2424- Defaults: ** ` WARMUP_SEC=30 ` ** , ** ` MAIN_SEC=60 ` ** , ** ` WORKERS=min(2, nproc) ` ** .
2525 For longer campaigns, raise all three (see
2626 ` ledger-secure-sdk/fuzzing/docs/APP_CONTRACT.md ` ).
@@ -36,9 +36,11 @@ checked-in corpus is stale for your layout.
3636## Single harness
3737
3838Bitcoin builds one fuzzing harness configuration. Two small fuzz-only repairs
39- are gated behind ` HAVE_AUTOAPPROVE_FOR_PERF_TESTS ` : a wallet-policy
39+ are gated behind ` FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION ` : a wallet-policy
4040repeated-pubkey bypass (the crypto mock returns a constant pubkey) and a relaxed
4141cross-chain swap output-count check (so the OP_RETURN parser stays reachable).
42+ UI confirmations are auto-approved separately via the app's own
43+ ` HAVE_AUTOAPPROVE_FOR_PERF_TESTS ` flag (` display.c ` ).
4244MuSig signing runs against the SDK crypto mock, so its consistency checks reject
4345the mocked values early; descriptor parsing is still fully exercised.
4446
@@ -260,8 +262,8 @@ files.
260262 in ` harness/fuzz_dispatcher.c ` and keep the README's slot/fault tables
261263 in sync when you add new targeted operations.
2622645 . ** Adjust fuzz-only repairs** — keep repairs gated with
263- ` #ifdef HAVE_AUTOAPPROVE_FOR_PERF_TESTS ` and document any new one in the
264- source site that applies it.
265+ ` #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION ` and document any new one in
266+ the source site that applies it.
2652676 . ** Promote corpus inputs** — drop the hashed corpus files under
266268 ` fuzzing/base-corpus/ ` . They are auto-loaded by ` app-campaign.sh `
267269 unless their ` .compat-key ` is stale for the current build.
0 commit comments