|
| 1 | +# CoinJoin Simulator |
| 2 | + |
| 3 | +Compact simulation toolkit for analyzing CoinJoin privacy under probing and adversarial taker pressure. |
| 4 | + |
| 5 | +This repository is curated for publishing: it keeps the key datasets, a focused GitHub Pages report, and the core simulation code. |
| 6 | + |
| 7 | +## What This Repository Shows |
| 8 | + |
| 9 | +The published report focuses on four high-signal views: |
| 10 | + |
| 11 | +1. Mitigation impact at fixed CoinJoin size (8 makers/CJ) |
| 12 | +2. Long-run sustained attack outcomes (baseline vs recommended policy) |
| 13 | +3. Probe-intensity privacy/cost trade-off |
| 14 | +4. Attack-to-recovery timeline |
| 15 | + |
| 16 | +Published output: |
| 17 | + |
| 18 | +- `docs/index.html` |
| 19 | +- `docs/publish_summary.json` |
| 20 | + |
| 21 | +## Quick Start |
| 22 | + |
| 23 | +```bash |
| 24 | +pip install -e ".[dev]" |
| 25 | +``` |
| 26 | + |
| 27 | +Requires Python 3.11+. |
| 28 | + |
| 29 | +Generate the curated publish page from the tracked datasets: |
| 30 | + |
| 31 | +```bash |
| 32 | +PYTHONPATH=src python -m coinjoin_simulator.publish_site \ |
| 33 | + --mitigation mitigation_experiments.json \ |
| 34 | + --longrun longrun_policy_results.json \ |
| 35 | + --daily daily_cost_study_results.json \ |
| 36 | + --output docs/index.html \ |
| 37 | + --data-output docs/publish_summary.json |
| 38 | +``` |
| 39 | + |
| 40 | +You can also run it through the CLI: |
| 41 | + |
| 42 | +```bash |
| 43 | +PYTHONPATH=src python -m coinjoin_simulator publish-site |
| 44 | +``` |
| 45 | + |
| 46 | +## Reproduce Input Datasets |
| 47 | + |
| 48 | +These scripts regenerate the three datasets consumed by the publish page: |
| 49 | + |
| 50 | +- `run_mitigation_experiments.py` -> `mitigation_experiments.json` |
| 51 | +- `run_longrun_policy_study.py` -> `longrun_policy_results.json` |
| 52 | +- `run_daily_cost_study.py` -> `daily_cost_study_results.json` |
| 53 | + |
| 54 | +Note: these studies sample from the live JoinMarket orderbook URL configured in `src/coinjoin_simulator/network.py`. |
| 55 | + |
| 56 | +## Core CLI Commands |
| 57 | + |
| 58 | +```bash |
| 59 | +# list built-in scenarios |
| 60 | +coinjoin-sim list |
| 61 | + |
| 62 | +# run one scenario |
| 63 | +coinjoin-sim run --scenario naive_baseline |
| 64 | + |
| 65 | +# run all scenarios |
| 66 | +coinjoin-sim benchmark |
| 67 | + |
| 68 | +# run realistic network sweep |
| 69 | +coinjoin-sim network --makers 100 --rounds 1000 --evil-fractions 0.0,0.2,0.4,0.6 |
| 70 | +``` |
| 71 | + |
| 72 | +## Repository Layout |
| 73 | + |
| 74 | +```text |
| 75 | +src/coinjoin_simulator/ |
| 76 | + network.py realistic maker/probing simulator |
| 77 | + publish.py curated metric extraction |
| 78 | + publish_site.py GitHub Pages report generation |
| 79 | + ... core anonymity/sybil/role/surveillance modules |
| 80 | +
|
| 81 | +tests/ unit tests |
| 82 | +docs/ publish-ready report assets for GitHub Pages |
| 83 | +``` |
| 84 | + |
| 85 | +## Development Checks |
| 86 | + |
| 87 | +```bash |
| 88 | +PYTHONPATH=src ruff check . |
| 89 | +PYTHONPATH=src mypy src/ |
| 90 | +PYTHONPATH=src pytest |
| 91 | +``` |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +MIT |
0 commit comments