Teylersf/satoshi-cracker

GitHub: Teylersf/satoshi-cracker

这是一个基于浏览器的Next.js应用,通过暴力破解尝试发现中本聪早期比特币钱包的私钥,用于安全研究和教育目的。

Stars: 2 | Forks: 0

# ₿ 中本聪钱包破解器 ### 基于浏览器的暴力破解,针对所有 21,953 个已知的 Patoshi 时代比特币钱包 **真实 `secp256k1` 密码学 · 多线程 Web Workers · NVIDIA GPU 支持 (BitCrack)** [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/31b7acb135171633.svg)](https://github.com/Teylersf/satoshi-cracker/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Next.js](https://img.shields.io/badge/Next.js-15-black?logo=next.js)](https://nextjs.org/) [![React](https://img.shields.io/badge/React-19-61DAFB?logo=react&logoColor=white)](https://react.dev/) [![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Teylersf/satoshi-cracker/pulls)
## 这是什么 一个 Next.js + React 网页应用,可在您的浏览器中使用真实的 `secp256k1` 椭圆曲线生成比特币私钥,派生出相应的 P2PKH 地址,并检查其是否属于中本聪在 2009 至 2010 年间挖矿生成的所有 **21,953 个已知钱包**(由 Sergio Lerner 识别的 *Patoshi 模式*)。总余额:**约 1,097,650 BTC** —— 自创世区块时代以来从未动过。 如果找到匹配项,私钥将作为 `.txt` 文件下载,保存到 `localStorage`,并 POST 到 Next.js API 路由,该路由会将其追加到项目根目录的 `found_keys.txt` 中。 为了提供真正的算力,该项目还附带了一个 **BitCrack**(开源 CUDA 比特币暴力破解器)的配套设置,包含一个 PowerShell 包装脚本,通过 `nvidia-smi` 来强制执行 GPU 温度预算。实时仪表板卡片会将 `nvidia-smi` + BitCrack 的进度拉取到同一个用户界面中。 ## 功能特性 - **🔐 真实密码学** —— 非模拟。`@noble/secp256k1` + `@noble/hashes` (SHA-256, RIPEMD-160),以独立 ESM 包形式获取并在模块 Web Workers 内运行。 - **🧵 多线程** —— 每个 CPU 逻辑核心一个 worker(可通过滑块配置,最多可达核心数的 2 倍)。 - **💾 O(1) 查找** —— 所有 21,953 个 hash160 指纹都预加载到一个 `Map` 中。每个生成的密钥都以恒定成本检查全部目标集。 - **🎮 GPU 配套组件(可选)** —— `BitCrack` CUDA 二进制文件在 3090 上可驱动 NVIDIA 显卡达到约 350 M+ 密钥/秒。实时统计信息通过 `/api/gpu-status` 流入 Web UI。 - **🌡️ 温度监控** —— PowerShell 包装脚本监控 `nvidia-smi`,如果温度超过目标(默认 70 °C)则降低 GPU 功率限制。退出时恢复。 - **📥 匹配处理** —— 找到的密钥将作为 `.txt` 下载,保存到 `localStorage`,并在服务端追加到 `found_keys.txt`。 - **💵 实时 BTC 价格** —— Binance API,每 10 秒刷新。美元奖池实时更新。 - **⚙️ 设置抽屉** —— 实时更改线程数(重启工作线程池),查看 WebGPU 设备信息,切换匹配时保存选项。 - **🎨 现代深色 UI** —— Inter + JetBrains Mono 字体,分层阴影,立体表面。无 CRT 模仿。 ## 快速开始 需要 **Node.js 20+**。 ``` git clone https://github.com/Teylersf/satoshi-cracker.git cd satoshi-cracker npm install npm run dev ``` 打开 。 用于生产环境: ``` npm run build && npm start ``` ## 架构 ``` ┌───────────────────────────────────────────────────────────────────────┐ │ Browser │ │ ┌─────────────────────┐ spawns N module workers │ │ │ tsx │ ──▶ each worker imports the bundled @noble │ │ │ (React 19) │ libs from blob: URLs (fetched once on │ │ │ │ the main thread to avoid CORS issues) │ │ │ - settings drawer │ │ │ │ - live stats UI │ │ │ │ - match overlay │ │ │ └─────────┬───────────┘ │ │ │ │ │ │ poll every 2 s │ │ ▼ │ │ ┌────────────────────────────┐ nvidia-smi ┌──────────────────┐ │ │ │ /api/gpu-status (Node) │ ──────────────▶│ RTX 3090 / etc. │ │ │ └────────────────────────────┘ └──────────────────┘ │ │ ┌────────────────────────────┐ │ │ │ /api/save-match (Node) │ ──▶ appends to ./found_keys.txt │ │ │ /api/found-keys (Node) │ ──▶ reads ./found_keys.txt │ │ └────────────────────────────┘ │ └───────────────────────────────────────────────────────────────────────┘ ▲ │ POSTs any match ┌───────────────┴────────────────┐ │ scripts/gpu-watcher.mjs │ │ tails gpu/gpu_found.txt │ └───────────────┬────────────────┘ │ ┌───────────┴────────────┐ │ cuBitCrack.exe │ │ driven by │ │ scripts/run-bitcrack │ │ with temp watchdog │ └────────────────────────┘ ``` ## 项目布局 ``` satoshi-cracker/ ├── app/ │ ├── layout.tsx # SEO metadata, fonts, JSON-LD │ ├── page.tsx # Page entry → renders │ ├── Cracker.tsx # Main client component (engine + UI) │ ├── globals.css # All styles (dark / dimensional) │ ├── sitemap.ts # /sitemap.xml │ ├── robots.ts # /robots.txt │ ├── opengraph-image.tsx # /opengraph-image (dynamic OG card) │ └── api/ │ ├── save-match/route.ts # POST: append match to found_keys.txt │ ├── found-keys/route.ts # GET: read found_keys.txt │ └── gpu-status/route.ts # GET: nvidia-smi + BitCrack log ├── public/ │ └── satoshi-data.js # 21,953 hash160 → [address, btc] map ├── scripts/ │ ├── export-addresses.mjs # gpu/addresses.txt extractor │ ├── setup-gpu.ps1 # Clone+build BitCrack │ ├── run-bitcrack.ps1 # Temp-guarded runner │ ├── gpu-watcher.mjs # GPU output → /api/save-match │ └── fix-cuda-integration.ps1# Copies CUDA props into VS BuildTools ├── gpu/ │ └── SETUP_GPU.md # GPU mode walkthrough ├── .github/ │ ├── workflows/ci.yml # Build & type-check on push/PR │ └── dependabot.yml # Weekly npm + monthly actions updates ├── package.json ├── tsconfig.json └── next.config.mjs ``` ## 引擎工作原理 1. 挂载时,`` 会注入 `/satoshi-data.js` 作为 `