Skip to content

Tutorial: Reproduce the Nomad Bridge Hack in 10 Minutes

What you'll accomplish: Fork Ethereum at block 15,259,100, run the Nomad Bridge Replica exploit, verify the forged transaction was accepted, confirm the reproduction is deterministic across two runs, and export a verifiable publication bundle.

Total time: ~10 minutes (2 min setup + 5 min first run + 3 min second run) Dependencies: Python 3.11+ + Foundry (or Docker)


Before You Start

Make sure you have completely followed the Deployment Guide.

You should have: 1. Cloned the repository and installed dependencies natively (uv sync) or built the Docker images. 2. An Ethereum archive RPC endpoint configured in your .env file (e.g., LlamaNodes free tier is sufficient for this experiment).

Using Docker? This tutorial uses the native CLI commands (uv run crucible <cmd>). If you are using Docker, prepend commands with docker compose run --rm orchestrator <cmd>, or see the Docker Caveats section in the Deployment Guide for chained commands.


Step-by-Step Commands

Step 1: Validate your environment

uv run crucible doctor

Expected output (all checks pass):

Checks:
  [ok] Python imports — all present
  [ok] Foundry — forge 1.0.0 (stable)
  [ok] Config — testbed.yaml loaded
  [ok] RPC — ETH_RPC_URL resolves
  [ok] Directories — workspace, logs, datasets, states

If any check fails, fix the issue before continuing. The most common failure is a missing or incorrect ETH_RPC_URL in your .env file.

Tip: The Nomad experiment declares topology: bridge but this tutorial uses --topology single. If the runtime fidelity check fails with a "trace artifacts" error due to this mismatch, add --no-fidelity to skip the L2 verification: uv run crucible experiment run experiments/nomad_replay.yaml --no-baseline --no-fidelity


Step 2: Fork Ethereum and run the exploit

This is the core command — it forks the chain and runs the experiment.

# 1. Start the fork in the background (or in a separate terminal window)
uv run crucible fork --topology single &

# 2. Run the experiment
uv run crucible experiment run experiments/nomad_replay.yaml --no-baseline

Expected output:

[ok] Starting chain 'ethereum' (fork block 15259100)...
   Forking Ethereum at block 15,259,100...
[ok] Chain 'ethereum' ready on http://127.0.0.1:8545
📡 Loading experiment: nomad_replay
📡 Starting scenario: nomad_pre_exploit
   🔹 Starting Nomad replica fraud reproduction at fork block 15259100
   🔹 Replica contract: 0xB92336759618F55bd0F8313bd843604592E27bd8
📡 Starting attack: nomad_replica_fraud
   🔹 Starting Nomad Replica fraud reproduction (auto-instrumented)
   🔹 committedRoot check complete — [ok] 0x00 == 0x00
   🔹 Attacker funded — 0x0000...0001 has 0.5 ETH
   🔹 Sending forged process() transaction...
   🔹 Exploit transaction sent — tx 0x5ea1...519c
📡 Attack result: [ok] success
📡 Verifying reproduction...
   [ok] committedRoot_is_zero — passed
   [ok] process_call_succeeds — passed
   [ok] message_accepted — passed
📡 Writing manifest...
📡 Completed: DS-2026-00001   (experiment run time: 5.2s)

Key points: - committedRoot is 0x00 — the vulnerability precondition is met - The forged process() call succeeds — the Replica contract accepts the message - All 3 assertions pass - Your run ID will differ — note it down as RUN_A (e.g., DS-2026-00001).

To give your run a human-readable label, add the --name flag:

uv run crucible experiment run experiments/nomad_replay.yaml --no-baseline --name nomad-v2-repro

This alias appears in crucible history, the run manifest, and experiment dashboards.


Step 3: Read the experiment report

LAST=$(ls -t logs/nomad_replay/ | head -1)
echo "=== Most recent run: $LAST ==="
cat "logs/nomad_replay/$LAST/report.md" | head -30

Expected output (summary section):

# Experiment Report — DS-2026-00001

## Summary
| Metric | Value |
|---|---|
| Experiment | nomad_replay |
| Scenario | nomad_pre_exploit |
| Attack | nomad_replica_fraud |
| Outcome | success [ok] |
| Duration | 5.2s |
| Log entries | 18 |
| Transactions | 1 |
| Contract events | 2 |
| Storage diffs | 2 |
| Gas used | 25,150 |
| Balances changed | 2 |

## Assertions
| Assertion | Result |
|---|---|
| committedRoot_is_zero | [ok] Pass |
| process_call_succeeds | [ok] Pass |
| message_accepted | [ok] Pass |

Step 4: Inspect the raw artifact files

The artifact streams contain the machine-readable record. Check what was captured:

LAST=$(ls -t logs/nomad_replay/ | head -1)
echo '=== Events ==='
cat "logs/nomad_replay/$LAST/chain_ethereum/events.jsonl"
echo ''
echo '=== Storage diffs ==='
cat "logs/nomad_replay/$LAST/chain_ethereum/storage_diffs.jsonl"
echo ''
echo '=== Gas profile ==='
cat "logs/nomad_replay/$LAST/chain_ethereum/gas_profile.jsonl"

Expected output:

=== Events ===
{"chain":"ethereum","event_name":"MessageAccepted","address":"0xB92336759618F55bd0F8313bd843604592E27bd8","topics":["0x8b7c1a1f..."]}

=== Storage diffs ===
{"chain":"ethereum","contract":"0xB92336759618F55bd0F8313bd843604592E27bd8","slot":"0x...","before":"0x0000000000000000000000000000000000000000000000000000000000000000","after":"0x0000000000000000000000000000000000000000000000000000000000000001"}

=== Gas profile ===
{"chain":"ethereum","step":"auto_tx","gas_used":25150,"tx_hash":"0x5ea16a4f9104b901a75662f3900ca8d3d92209d846310237ca65675e2f2e519c"}

The storage diff confirms the forged message status changed from 0 (NONE) to 1 (ACCEPTED/PROCESSED). The gas profile shows exactly 25,150 gas consumed — identical every run.


Step 5: Run a second time (prove determinism)

uv run crucible experiment run experiments/nomad_replay.yaml --no-baseline

Expected output: Same as Step 2 — identical artifact stream, but with a different run ID. Note it down as RUN_B (e.g., DS-2026-00002):

📡 Completed: DS-2026-00002   (experiment run time: 4.9s)

The gas (25,150), storage diffs, events, and balance changes should be identical to the first run. The following procedure validates this assertion.


Step 6: Diff the two runs

Replace DS-2026-00001 and DS-2026-00002 with your actual run IDs:

uv run crucible diff DS-2026-00001 DS-2026-00002

Expected output:

{
  "storage_equal": true,
  "events_equal": true,
  "gas_equal": true,
  "balances_equal": true,
  "gas": {"run_a": 25150, "run_b": 25150, "delta": 0},
  "storage": {"run_a": 2, "run_b": 2},
  "events": {"run_a": 2, "run_b": 2},
  "balances": {"run_a": 2, "run_b": 2}
}

All four must be true for a deterministic reproduction. If any are false, the reproduction is non-deterministic (file a bug).


Step 7: Export the publication bundle

Replace DS-2026-00001 with your first run ID:

uv run crucible export DS-2026-00001

Expected output:

📦 Exporting dataset DS-2026-00001...
[ok] Manifest: datasets/DS-2026-00001/run_manifest.json
[ok] Report:   datasets/DS-2026-00001/report.md
[ok] Events:   datasets/DS-2026-00001/chain_ethereum/events.jsonl
[ok] Gas:      datasets/DS-2026-00001/chain_ethereum/gas_profile.jsonl
[ok] Storage:  datasets/DS-2026-00001/chain_ethereum/storage_diffs.jsonl
[ok] Balances: datasets/DS-2026-00001/chain_ethereum/balance_diffs.jsonl
[ok] Citation: datasets/DS-2026-00001/CITATION.cff
[ok] REPRODUCE.md written
[ok] artifact_bundle_manifest.json written
📦 Export complete: datasets/DS-2026-00001/

Step 8: Verify the bundle integrity

uv run crucible verify datasets/DS-2026-00001

Expected output:

[ok] Verification: PASS (2 checks)
   [ok]  Run integrity    (log_integrity.json)
        4 file(s) verified
   [ok]  Bundle integrity (artifact_bundle_manifest.json)
        12 file(s) verified
All artifacts intact at: ...datasets/DS-2026-00001

The crucible verify command runs two checks automatically: 1. Run integrity — re-computes SHA-256 hashes against the original log_integrity.json 2. Bundle integrity — re-computes SHA-256 hashes against artifact_bundle_manifest.json

To see which specific files were hashed, add the --verbose flag:

uv run crucible verify datasets/DS-2026-00001 --verbose

This proves the exported artifacts haven't been tampered with. Anyone who runs crucible verify on this directory will get the same result — any hash mismatch, missing file, or extra file is reported immediately.


What Just Happened

The Vulnerability

The Nomad bridge's Replica contract at 0xB92336759618F55bd0F8313bd843604592E27bd8 was deployed with its committedRoot (storage slot 1) initialized to 0x00. The process(bytes message, bytes proof) function verifies message authenticity by checking a Merkle proof against this root:

function process(bytes memory _message, bytes memory _proof) external returns (bool) {
    bytes32 _messageHash = keccak256(abi.encodePacked(_message));
    require(messages[_messageHash] == MessageStatus.NONE, "Replica: message already processed");
    require(MerkleProof.verify(_proof, committedRoot, _messageHash), "Replica: proof verification failed");
    // ... execute the message
}

Since a Merkle proof with an all-zeros root still passes verification (a hash-chain of 32 zero bytes remains 0x00), any message can be forged.

What Crucible Did

Phase What Happened
Chain fork Crucible started Anvil with --fork-block-number 15259100, creating a local replica of Ethereum at block 15,259,100 — the block before the first exploit transaction.
Proxy attach Crucible started a transparent RPC proxy between the attack plugin and Anvil. Every RPC call is intercepted.
Precondition check The attack plugin read storage slot 1 of the Replica contract and confirmed committedRoot == 0x00.
Exploit execution The plugin forged a minimal cross-chain message (32 zero bytes for the root + empty fields), encoded it as process(bytes,bytes) calldata, and sent it as a real eth_sendTransaction.
Auto-instrumentation The RPC proxy automatically captured: the transaction receipt (gas), contract events (MessageAccepted), storage diffs (messages[hash] → ACCEPTED), and balance changes (attacker paid gas).
Verification The plugin re-read storage to confirm the message status changed from 0 (NONE) to 1 (PROCESSED).

What Makes This Reproducible

  1. Fork block pinned — Every run forks the same block, ensuring identical starting state
  2. Deterministic Anvil flags — gas_price: 0, order: fifo, timestamp: fork_block — all transactions produce identical results
  3. SHA-256 integrity — Every artifact file is hashed, making tampering detectable
  4. Provenance recording — run_manifest.json captures git commit, Foundry version, Python version, config fingerprint — the full environment identity

The Artifact Streams

Stream Records What to Look For
events.jsonl All emitted events MessageAccepted with root 0x00
storage_diffs.jsonl Every slot that changed messages[hash]: 0x00 → 0x01
gas_profile.jsonl Gas per transaction Exactly 25,150 gas for the exploit
balance_diffs.jsonl ETH balance changes Attacker paid gas
run.jsonl Lifecycle events 18 structured log entries

Cleanup

# Stop any background chains (if you ran fork with &)
pkill -f "crucible fork"

# Clean temp files
uv run crucible clean --all

Next Steps

If you want to... Go here
Run all 6 benchmark attacks docs/BENCHMARKS.md
Understand the architecture docs/ARCHITECTURE.md
Create your own attack plugin docs/ATTACK_PACK_GUIDE.md

References