No description
  • Rust 84.2%
  • WGSL 15.2%
  • Just 0.6%
Find a file
2026-03-19 07:25:28 -05:00
.cargo perf: back to normal 2026-03-17 23:22:11 -05:00
docs chore: various goodies 2026-03-18 20:54:15 -05:00
src fix: gpu backend not respecting max_len 2026-03-19 07:25:28 -05:00
.gitignore chore: allow dids 2026-03-18 07:03:27 -05:00
Cargo.lock feature/gpu-compute (#2) 2026-03-18 18:21:14 -05:00
Cargo.toml feature/gpu-compute (#2) 2026-03-18 18:21:14 -05:00
CLAUDE.md chore: add color output 2026-03-18 21:38:18 -05:00
justfile chore: various goodies 2026-03-18 20:54:15 -05:00
README.md chore: various goodies 2026-03-18 20:54:15 -05:00

hash.haus hasher

brute-force miner for hash.haus — finds the {did}/{suffix} whose SHA-256 (or MD5) hash has the most leading zero bits.

the input is an atproto DID. both did:plc and did:web are supported.

requirements

  • rust (stable, edition 2024)
  • for GPU mode: a vulkan-capable GPU and driver

build

cargo build --release

usage

./target/release/hash-haus-hasher [OPTIONS] --username <USERNAME>

options:
  -d, --did <DID>                  atproto DID (e.g. did:plc:2grdruc2p6fjhksrfpt366yl or did:web:taxborn.com)
  -o, --output <FILE>              output file for best result [default: out.txt]
  -t, --threads <N>                worker threads [default: logical CPU count]
      --algo <ALGO>                hash algorithm: sha256 | md5 [default: sha256]
      --max-len <N>                max suffix length, 132 [default: 32]
      --device <DEVICE>            compute device: cpu | gpu [default: cpu]
      --gpu-workgroups <N>         GPU workgroups per dispatch (256 threads each) [default: 4096]
  -h, --help

cpu — all cores:

./target/release/hash-haus-hasher -d did:plc:2grdruc2p6fjhksrfpt366yl

cpu — did:web, fixed thread count:

./target/release/hash-haus-hasher -d did:web:taxborn.com -t 4

gpu:

./target/release/hash-haus-hasher -d did:plc:2grdruc2p6fjhksrfpt366yl --device gpu

gpu — tune workgroup count for throughput:

./target/release/hash-haus-hasher -d did:plc:2grdruc2p6fjhksrfpt366yl --device gpu --gpu-workgroups 8192

md5 instead of sha256:

./target/release/hash-haus-hasher -d did:plc:2grdruc2p6fjhksrfpt366yl --algo md5

press Ctrl-C to stop. the best result is printed to stdout and appended to the output file.

nixos / vulkan

on NixOS the vulkan ICD files are not on the default library path. the GPU backend will fail to find a vulkan adapter unless you expose them. the justfile wraps both approaches:

just run-gpu did:plc:2grdruc2p6fjhksrfpt366yl       # LD_LIBRARY_PATH via nix-build
just run-gpu-shell did:plc:2grdruc2p6fjhksrfpt366yl  # nix-shell

manually:

LD_LIBRARY_PATH=$(nix-build '<nixpkgs>' -A vulkan-loader --no-out-link)/lib \
  ./target/release/hash-haus-hasher -d did:plc:2grdruc2p6fjhksrfpt366yl --device gpu

tech stack

concern crate
CLI parsing clap 4 (derive)
SHA-256 compression sha2 0.10 (compress feature)
MD5 compression md-5 0.10 (used in tests; production path is hand-rolled)
GPU compute wgpu 24 (Vulkan backend, WGSL shaders)
async GPU polling pollster 0.4
GPU buffer casting bytemuck 1 (derive)
RNG rand 0.8 (SmallRng)
thread count num_cpus 1
Ctrl-C handling ctrlc 3

release profile uses lto = true and codegen-units = 1 for maximum throughput.

architecture

see docs/ARCHITECTURE.md.