-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_example.sh
More file actions
221 lines (204 loc) · 7.32 KB
/
run_example.sh
File metadata and controls
221 lines (204 loc) · 7.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/usr/bin/env bash
##############################################################
# Keyhunt-Cyclone — scripts/run_example.sh (v2 — 2025)
# Common usage examples for EPYC 7773X / Threadripper 7000
##############################################################
set -euo pipefail
BIN="./keyhunt-cyclone"
if [ ! -f "$BIN" ]; then
echo "ERROR: $BIN not found. Run 'make epyc' or 'make threadripper' first."
exit 1
fi
THREADS=$(nproc)
echo "Detected $THREADS logical CPUs"
echo ""
show_help() {
echo "Usage: $0 [example_name]"
echo ""
echo "Available examples:"
echo " bsgs_basic - BSGS with bit-range 65, all cores"
echo " bsgs_save - BSGS with table save (-S) for fast restart"
echo " bsgs_kfactor - BSGS with k=4 (4x RAM, 4x speed)"
echo " bsgs_dance - BSGS dance submode"
echo " bsgs_middleout - BSGS middleout from range center"
echo " bsgs_rangefile - BSGS from deep.txt range file"
echo " bsgs_restart - BSGS fast restart (tables on disk)"
echo " rmd_mode - RMD160 mode (2x faster than address)"
echo " kangaroo - Pollard's Lambda on narrow range"
echo " vanity - Vanity address search"
echo " wif_mask - WIF partial key search"
echo " benchmark - Run hardware benchmark"
echo ""
}
# ── Example: basic BSGS ──────────────────────────────────────
run_bsgs_basic() {
echo "=== BSGS Basic (bit-range 65, $THREADS threads) ==="
$BIN -m bsgs \
-f addresses.txt \
-b 65 \
-t "$THREADS" \
--cyclone \
-s 5 \
-o found_keys.txt
}
# ── Example: BSGS with table persistence ────────────────────
run_bsgs_save() {
echo "=== BSGS with table save (-S) ==="
echo "First run builds bloom/bP tables, saves to disk."
echo "Subsequent runs load from disk instantly (-6 skips verify)."
$BIN -m bsgs \
-f addresses.txt \
-b 24 \
-t "$THREADS" \
--cyclone \
-S \
-s 5 \
-o found_keys.txt
}
# ── Example: BSGS fast restart ───────────────────────────────
run_bsgs_restart() {
echo "=== BSGS fast restart (tables already on disk) ==="
$BIN -m bsgs \
-f addresses.txt \
-b 24 \
-t "$THREADS" \
--cyclone \
-S -6 \
-s 5 \
-o found_keys.txt
}
# ── Example: BSGS k-factor 4 ────────────────────────────────
run_bsgs_kfactor() {
echo "=== BSGS k=4 (4x baby steps = ~4x giant-step throughput) ==="
echo "Uses ~4x more RAM. Best for systems with 256+ GB RAM."
$BIN -m bsgs \
-f addresses.txt \
-b 24 \
-k 4 \
-t "$THREADS" \
--cyclone \
-S \
-s 5 \
-o found_keys.txt
}
# ── Example: BSGS dance submode ─────────────────────────────
run_bsgs_dance() {
echo "=== BSGS dance submode (forward then backward) ==="
$BIN -m bsgs \
-f addresses.txt \
-b 65 \
-t "$THREADS" \
--cyclone \
--submode dance \
-s 5 \
-o found_keys.txt
}
# ── Example: BSGS middleout ──────────────────────────────────
run_bsgs_middleout() {
echo "=== BSGS middleout (expands from range center) ==="
$BIN -m bsgs \
-f addresses.txt \
-b 65 \
-t "$THREADS" \
--cyclone \
--submode middleout \
-s 5 \
-o found_keys.txt
}
# ── Example: BSGS from range file ───────────────────────────
run_bsgs_rangefile() {
echo "=== BSGS from deep.txt range file ==="
# Create example deep.txt if missing
if [ ! -f deep.txt ]; then
echo "Creating example deep.txt..."
cat > deep.txt << 'EOF'
8000000000000000:9000000000000000
9000000000000000:A000000000000000
A000000000000000:B000000000000000
B000000000000000:C000000000000000
C000000000000000:D000000000000000
D000000000000000:E000000000000000
E000000000000000:F000000000000000
F000000000000000:FFFFFFFFFFFFFFFF
EOF
echo "deep.txt created with 8 ranges."
fi
$BIN -m bsgs \
-f addresses.txt \
-b 24 \
-t "$THREADS" \
--cyclone \
-D deep.txt \
-S \
-s 10 \
-o found_keys.txt
echo "Completed ranges written to: checked-deep.txt"
}
# ── Example: RMD160 mode ─────────────────────────────────────
run_rmd_mode() {
echo "=== RMD160 mode (~2x faster than address mode) ==="
echo "Target file should contain 40-char hex hash160 values."
$BIN -m rmd \
-f hashes.txt \
-r 8000000000000000:FFFFFFFFFFFFFFFF \
-t "$THREADS" \
--cyclone \
-s 5 \
-o found_keys.txt
}
# ── Example: Kangaroo ────────────────────────────────────────
run_kangaroo() {
echo "=== Kangaroo mode (narrow range) ==="
$BIN -m kangaroo \
-f addresses.txt \
-r 1000000000:2000000000 \
--cyclone \
--kangaroo-dp 20 \
-t "$THREADS" \
-s 5 \
-o found_keys.txt
}
# ── Example: Vanity ──────────────────────────────────────────
run_vanity() {
echo "=== Vanity address search (prefix: 1Key) ==="
$BIN -m vanity \
--prefix 1Key \
-t "$THREADS" \
-s 5 \
-o found_keys.txt
}
# ── Example: WIF mask ────────────────────────────────────────
run_wif_mask() {
echo "=== WIF mask search ==="
echo "Replace underscores with the unknown characters of your WIF key."
$BIN -m wif \
-f addresses.txt \
-w "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFYigEAa____" \
-t "$THREADS" \
-s 5 \
-o found_keys.txt
}
# ── Example: Benchmark ───────────────────────────────────────
run_benchmark() {
echo "=== Hardware Benchmark ==="
if [ ! -f ./benchmark ]; then
make bench
fi
./benchmark
}
# ── Dispatch ─────────────────────────────────────────────────
case "${1:-help}" in
bsgs_basic) run_bsgs_basic ;;
bsgs_save) run_bsgs_save ;;
bsgs_restart) run_bsgs_restart ;;
bsgs_kfactor) run_bsgs_kfactor ;;
bsgs_dance) run_bsgs_dance ;;
bsgs_middleout) run_bsgs_middleout ;;
bsgs_rangefile) run_bsgs_rangefile ;;
rmd_mode) run_rmd_mode ;;
kangaroo) run_kangaroo ;;
vanity) run_vanity ;;
wif_mask) run_wif_mask ;;
benchmark) run_benchmark ;;
help|*) show_help ;;
esac