Skip to content

Latest commit

 

History

134 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitCrack

A tool for brute-forcing Bitcoin private keys. The main purpose of this project is to contribute to the effort of solving the Bitcoin puzzle transaction: A transaction with 32 addresses that become increasingly difficult to crack.

Features

  • CUDA and OpenCL support for GPU acceleration
  • Multi-GPU support with automatic keyspace partitioning
  • Bidirectional (pincer) scanning - scan from both ends simultaneously for 2x faster average discovery
  • Optimized for modern GPUs (RTX 4090, RTX 4070, etc.)
  • Checkpoint/resume capability for long-running searches

Quick Start

# Build (CUDA)
make BUILD_CUDA=1

# Single GPU search
./bin/cuBitCrack -d 0 --keyspace 20000000000000000:3ffffffffffffffff -i addresses.txt -o found.txt

# Multi-GPU search (4 GPUs)
./bin/cuBitCrack --devices 0,1,2,3 --keyspace 20000000000000000:3ffffffffffffffff -i addresses.txt

# Bidirectional search (4 GPUs = 2 partitions, scanning from both ends)
./bin/cuBitCrack --devices 0,1,2,3 --bidir --keyspace 20000000000000000:3ffffffffffffffff -i addresses.txt

Bidirectional (Pincer) Scanning

Bidirectional mode pairs GPUs to scan each partition from both ends simultaneously. This provides a 2x speedup on average because the key is found when either GPU reaches it.

Partition 0:                    Partition 1:
START ──────────── MID          MID ──────────── END
   │                │             │                │
  GPU 0 ─────►  ◄── GPU 1       GPU 2 ─────►  ◄── GPU 3
  (FWD)         (BWD)           (FWD)         (BWD)

Usage

# Requires EVEN number of GPUs
./bin/cuBitCrack --devices 0,1 --bidir --keyspace START:END -i addresses.txt

# 4 GPUs = 2 partitions
./bin/cuBitCrack --devices 0,1,2,3 --bidir --keyspace START:END -i addresses.txt

# 8 GPUs = 4 partitions
./bin/cuBitCrack --devices 0,1,2,3,4,5,6,7 --bidir --keyspace START:END -i addresses.txt

Why Bidirectional is Faster

Mode Average keys to find target Speedup
Forward-only 50% of partition 1x
Bidirectional 25% of partition 2x

For uniformly distributed keys, bidirectional scanning finds the target in half the average time.

Command Line Options

cuBitCrack [OPTIONS] [TARGETS]

Options:
  -i, --in FILE         Read addresses from FILE
  -o, --out FILE        Write found keys to FILE
  -d, --device N        Use device N (single GPU mode)
  --devices N,N,N,...   Use multiple devices (multi-GPU mode)
  --bidir               Enable bidirectional scanning (requires even GPU count)
  -b, --blocks N        Number of CUDA blocks
  -t, --threads N       Threads per block
  -p, --points N        Keys per thread
  --keyspace START:END  Search range in hex
  --compression MODE    'compressed', 'uncompressed', or 'both'
  --continue FILE       Save/resume progress
  --list-devices        Show available GPUs
  --stride N            Increment by N (default: 1)
  --share M/N           Process Mth share of N total shares

Performance

RTX 4070 (tested)

  • Single GPU: ~1.38 GKey/s
  • Dual GPU: ~2.76 GKey/s
  • Quad GPU: ~5.5 GKey/s

Recommended Parameters

GPU Blocks Threads Points Keys/iter
RTX 4090/4080 128 512 1024 67M
RTX 4070/3080 128 256 512 16M
RTX 3060/2080 64 256 256 4M

Examples

Search Bitcoin Puzzle #66

# Single GPU
./bin/cuBitCrack -d 0 -b 128 -t 256 -p 512 \
    --keyspace 20000000000000000:3ffffffffffffffff \
    -i puzzle66.txt -o found.txt --continue checkpoint.txt

# 4 GPUs with bidirectional scanning
./bin/cuBitCrack --devices 0,1,2,3 --bidir -b 128 -t 256 -p 512 \
    --keyspace 20000000000000000:3ffffffffffffffff \
    -i puzzle66.txt -o found.txt

Search with checkpoint (resume on crash)

./bin/cuBitCrack --keyspace 20000000000000000:3ffffffffffffffff \
    --continue checkpoint.txt -i puzzle.txt

Building

Linux (CUDA)

# Default build (optimized for RTX 4090, compute capability 8.9)
make BUILD_CUDA=1

# For other GPUs
make BUILD_CUDA=1 COMPUTE_CAP=86   # RTX 3090
make BUILD_CUDA=1 COMPUTE_CAP=75   # RTX 2080
make BUILD_CUDA=1 COMPUTE_CAP=61   # GTX 1080

Linux (OpenCL) - Experimental

make BUILD_OPENCL=1

Windows

Open BitCrack.sln in Visual Studio 2019 and build:

  • cuKeyFinder for CUDA
  • clKeyFinder for OpenCL

Requirements

  • CUDA Toolkit 12.x (for CUDA build)
  • OpenCL SDK (for OpenCL build)
  • g++ with C++17 support (Linux)
  • Visual Studio 2019 (Windows)

Notes

  • OpenCL is experimental - known bugs on some AMD/Intel devices
  • Addresses can be compressed or uncompressed (use --compression option)
  • Checkpoint files store search state for resumable searches
  • Use --list-devices to see available GPUs

Supporting this project

If you find this project useful, consider making a donation:

BTC: 1LqJ9cHPKxPXDRia4tteTJdLXnisnfHsof

LTC: LfwqkJY7YDYQWqgR26cg2T1F38YyojD67J

ETH: 0xd28082CD48E1B279425346E8f6C651C45A9023c5

Contact

Send questions or comments to bitcrack.project@gmail.com


Support

If this work helped you, you can support me:

  • USDT (ERC-20): 0xfba2de3360ae0d98ec44216191d143bc28676af5
  • USDC (ERC-20): 0xfba2de3360ae0d98ec44216191d143bc28676af5
  • BTC: 14EVe4ejvXrSS6s34AUBP9TMoSsuzShJ8o

Have a vibe-coding project you'd like to collaborate on? Get in touch: rawanaholdingslk@gmail.com

About

bidirectional (pincer) scanning strategy for BitCrack

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages