-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
735 lines (682 loc) · 26.6 KB
/
index.html
File metadata and controls
735 lines (682 loc) · 26.6 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bitcoin Self-Custody Tutorials</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: #0a0a0a;
color: rgba(255,248,230,0.85);
font-family: 'Inter', system-ui, sans-serif;
font-weight: 300;
line-height: 1.7;
font-size: 15px;
}
/* Nav */
nav {
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
background: rgba(10,10,10,0.95);
backdrop-filter: blur(12px);
border-bottom: 1px solid rgba(251,220,123,0.08);
padding: 0 24px;
}
.nav-inner {
max-width: 1100px; margin: 0 auto;
display: flex; align-items: center; justify-content: flex-start;
height: 56px;
padding-left: 8px;
}
.nav-brand {
display: flex; align-items: center; gap: 10px;
font-family: 'Playfair Display', serif;
font-size: 18px; font-weight: 400; font-style: italic;
background: linear-gradient(90deg, #FF9125, #FBDC7B, #FDA24A);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
cursor: pointer;
text-decoration: none;
}
.nav-brand img {
height: 28px; width: auto; border-radius: 4px;
}
/* Layout */
main {
max-width: 800px; margin: 0 auto;
padding: 80px 24px 60px;
}
/* Home */
.home-hero {
text-align: center;
padding: 60px 0 40px;
}
.home-hero h1 {
font-family: 'Playfair Display', serif;
font-size: 42px; font-weight: 400; font-style: italic;
margin-bottom: 16px;
}
.home-hero h1 span {
background: linear-gradient(90deg, #FF9125, #FBDC7B, #FDA24A);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.home-hero p {
font-size: 16px; color: rgba(255,248,230,0.6); max-width: 520px; margin: 0 auto;
}
.home-tagline {
font-size: 13px; letter-spacing: 3px; color: rgba(251,220,123,0.5);
margin-top: 24px; text-transform: uppercase;
}
/* Card grid */
.card-grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 16px; margin: 32px 0;
}
.card {
background: rgba(251,220,123,0.02);
border: 1px solid rgba(251,220,123,0.08);
border-radius: 12px; padding: 24px;
cursor: pointer;
transition: border-color 0.2s, background 0.2s;
}
.card:hover {
border-color: rgba(251,220,123,0.25);
background: rgba(251,220,123,0.04);
}
.card h3 { font-size: 15px; font-weight: 600; color: #f5f5f5; margin-bottom: 6px; }
.card p { font-size: 13px; color: rgba(255,248,230,0.55); line-height: 1.5; }
.card .badge {
display: inline-block; margin-top: 10px;
font-size: 11px; font-weight: 500; letter-spacing: 1px;
color: #FBDC7B; background: rgba(251,220,123,0.08);
padding: 3px 10px; border-radius: 4px; text-transform: uppercase;
}
.home-section-title {
font-family: 'Playfair Display', serif;
font-size: 42px; font-weight: 400; font-style: italic;
text-align: center;
margin: 48px 0 4px;
}
.home-section-title span {
background: linear-gradient(90deg, #FF9125, #FBDC7B, #FDA24A);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-label {
font-size: 11px; font-weight: 500; letter-spacing: 4px;
text-transform: uppercase; color: rgba(251,220,123,0.5);
margin: 28px 0 12px;
}
.section-subtitle {
font-family: 'Playfair Display', serif;
font-size: 28px; font-weight: 400; font-style: italic;
text-align: center;
margin: 40px 0 8px;
}
.section-subtitle span {
background: linear-gradient(90deg, #FF9125, #FBDC7B, #FDA24A);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.home-section-title + .section-subtitle { margin-top: 16px; }
/* Guide content (rendered markdown) */
.guide-content { display: none; }
.guide-content.active { display: block; }
.guide-content h1 {
font-family: 'Playfair Display', serif;
font-size: 36px; font-weight: 400; font-style: italic;
margin-bottom: 8px; line-height: 1.2;
color: #f5f5f5;
}
.guide-content h2 {
font-size: 20px; font-weight: 600; color: #FBDC7B;
margin: 36px 0 12px;
padding-bottom: 6px;
border-bottom: 1px solid rgba(251,220,123,0.1);
}
.guide-content h3 {
font-size: 16px; font-weight: 600; color: #f5f5f5;
margin: 24px 0 8px;
}
.guide-content h4 {
font-size: 14px; font-weight: 600; color: rgba(251,220,123,0.8);
margin: 16px 0 6px;
}
.guide-content p { margin-bottom: 14px; }
.guide-content a { color: #FBDC7B; text-decoration: none; }
.guide-content a:hover { text-decoration: underline; }
.guide-content strong { font-weight: 600; color: #f5f5f5; }
.guide-content em { font-style: italic; color: rgba(255,248,230,0.7); }
.guide-content ul, .guide-content ol { margin: 0 0 14px 20px; }
.guide-content li { margin-bottom: 6px; }
.guide-content blockquote {
border-left: 3px solid rgba(251,220,123,0.3);
padding: 12px 20px; margin: 16px 0;
background: rgba(251,220,123,0.03);
border-radius: 0 8px 8px 0;
color: rgba(255,248,230,0.75);
}
.guide-content code {
background: rgba(251,220,123,0.08);
padding: 2px 6px; border-radius: 4px;
font-size: 13px; color: #FBDC7B;
font-family: 'SF Mono', 'Fira Code', monospace;
}
.guide-content pre {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(251,220,123,0.08);
border-radius: 8px; padding: 16px;
overflow-x: auto; margin: 16px 0;
}
.guide-content pre code {
background: none; padding: 0;
color: rgba(255,248,230,0.8);
}
.guide-content table {
width: 100%; border-collapse: collapse; margin: 16px 0;
}
.guide-content th {
background: rgba(251,220,123,0.06);
color: #FBDC7B; font-weight: 600; font-size: 13px;
padding: 10px 14px; text-align: left;
border-bottom: 1px solid rgba(251,220,123,0.15);
}
.guide-content td {
padding: 10px 14px; font-size: 14px;
border-bottom: 1px solid rgba(251,220,123,0.06);
}
.guide-content hr {
border: none;
border-top: 1px solid rgba(251,220,123,0.08);
margin: 32px 0;
}
.guide-content img { max-width: 100%; border-radius: 8px; }
/* Device selector dropdown */
.device-selector {
margin: 20px 0;
}
.device-selector select {
appearance: none;
background: rgba(251,220,123,0.06);
border: 1px solid rgba(251,220,123,0.2);
color: #FBDC7B;
font-family: 'Inter', sans-serif;
font-size: 15px; font-weight: 500;
padding: 12px 40px 12px 16px;
border-radius: 8px;
cursor: pointer;
width: 100%;
max-width: 320px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FBDC7B' stroke-width='2' fill='none'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 14px center;
}
.device-selector select:hover {
border-color: rgba(251,220,123,0.4);
}
.device-selector select:focus,
.device-selector select:active {
outline: none;
border-color: rgba(251,220,123,0.5);
box-shadow: 0 0 0 2px rgba(251,220,123,0.1);
}
.device-selector select option {
background: #1a1a1a;
color: #f5f5f5;
}
.device-panel {
border: 1px solid rgba(251,220,123,0.1);
border-radius: 10px;
background: rgba(251,220,123,0.02);
padding: 20px 24px;
margin: 16px 0;
}
.device-panel[hidden] { display: none; }
/* Glossary tooltips */
.glossary-term {
border-bottom: 1px dotted rgba(251,220,123,0.4);
cursor: help;
position: relative;
}
.glossary-term:hover::after {
content: attr(data-tooltip);
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
background: #1a1a1a;
border: 1px solid rgba(251,220,123,0.2);
color: rgba(255,248,230,0.85);
font-size: 13px;
font-weight: 300;
padding: 8px 12px;
border-radius: 6px;
white-space: normal;
width: max-content;
max-width: 280px;
z-index: 200;
line-height: 1.4;
margin-top: 6px;
pointer-events: none;
}
@media (max-width: 600px) {
.glossary-term:hover::after {
left: 0; transform: none;
max-width: 220px;
}
}
/* Guide header with back button + title */
.guide-header {
display: flex; align-items: center; gap: 16px;
margin-bottom: 28px;
}
.back-btn {
display: flex; align-items: center; justify-content: center;
width: 36px; height: 36px; flex-shrink: 0;
background: none; border: none;
color: rgba(255,248,230,0.6); font-size: 18px;
cursor: pointer;
transition: all 0.15s;
}
.back-btn:hover { color: #FBDC7B; }
.guide-title {
font-family: 'Playfair Display', serif;
font-size: 32px; font-weight: 400; font-style: italic;
line-height: 1.2;
}
.guide-title .category {
background: linear-gradient(90deg, #FF9125, #FBDC7B, #FDA24A);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.guide-title .name {
color: #f5f5f5;
}
@media (max-width: 600px) {
.guide-title { font-size: 24px; }
}
/* Emulator embed */
.emulator-embed {
margin: 32px 0;
border: 1px solid rgba(251,220,123,0.12);
border-radius: 16px;
overflow: hidden;
background: #111;
}
.emulator-embed iframe {
width: 100%; height: 520px; border: none;
}
.emulator-label {
padding: 12px 20px;
font-size: 12px; font-weight: 500; letter-spacing: 2px;
text-transform: uppercase; color: rgba(251,220,123,0.5);
border-bottom: 1px solid rgba(251,220,123,0.08);
}
@media (max-width: 600px) {
.emulator-embed iframe { height: 640px; }
}
/* Footer */
footer {
text-align: center; padding: 40px 24px;
font-size: 13px; color: rgba(255,248,230,0.3);
border-top: 1px solid rgba(251,220,123,0.05);
margin-top: 60px;
}
footer a { color: rgba(251,220,123,0.5); text-decoration: none; }
footer a:hover { color: #FBDC7B; }
/* Checkbox styling for checklists */
.guide-content input[type="checkbox"] {
accent-color: #FBDC7B;
margin-right: 8px;
transform: scale(1.1);
}
</style>
</head>
<body>
<nav>
<div class="nav-inner">
<a class="nav-brand" onclick="showHome(); return false;" href="#">
<img src="assets/logo.png" alt="Bitcoin Butlers" onerror="this.style.display='none'">
Bitcoin Butlers
</a>
</div>
</nav>
<main>
<!-- Home -->
<div id="home">
<div class="home-hero">
<h1><span>Self-Custody</span> Tutorials</h1>
<p>Free, open-source guides for securing your own Bitcoin. Device in hand, step by step. No tracking. No paywalls.</p>
<div class="home-tagline">We hold your hand, not your keys</div>
<a href="concierge.html" style="display:inline-block; margin-top:24px; padding:12px 28px; background:#FBDC7B; color:#0a0a0a; font-weight:600; font-size:14px; border-radius:8px; text-decoration:none; transition:background 0.2s;" onmouseover="this.style.background='#fce79f'" onmouseout="this.style.background='#FBDC7B'">Build Your Custom Self-Custody Plan →</a>
<p style="font-size:13px; color:rgba(255,248,230,0.35); margin-top:10px;">Or browse individual guides below</p>
</div>
<h1 class="home-section-title"><span>Seeds</span></h1>
<h2 class="section-subtitle"><span>Generation</span></h2>
<div class="card-grid">
<div class="card" onclick="showGuide('gen-hardware-wallet')">
<h3>Hardware Wallet</h3>
<p>Let your device generate the seed. Easiest, requires trust in the manufacturer.</p>
</div>
<div class="card" onclick="showGuide('gen-seed-picker')">
<h3>Seed Picker Cards</h3>
<p>Shuffle a physical deck of BIP-39 words. Verifiable, no electronics needed.</p>
</div>
<div class="card" onclick="showGuide('gen-dice-rolls')">
<h3>Dice Rolls</h3>
<p>99 rolls on SeedSigner or manual binary. Maximum verifiability.</p>
</div>
<div class="card" onclick="showGuide('gen-entropia-pills')">
<h3>Entropia Pills</h3>
<p>3D-printed capsules with BIP-39 words. Tactile and educational.</p>
</div>
<div class="card" onclick="showGuide('gen-camera-entropy')">
<h3>Camera Entropy</h3>
<p>SeedSigner hashes a photo for entropy. Fast and open source.</p>
</div>
<div class="card" onclick="showGuide('gen-codex32')">
<h3>Codex32</h3>
<p>Generate, verify, and split your seed entirely by hand. Zero electronic trust.</p>
</div>
</div>
<h2 class="section-subtitle"><span>In Use</span></h2>
<div class="section-label">Signing Devices</div>
<div class="card-grid">
<div class="card" onclick="showGuide('seedsigner')">
<h3>SeedSigner+</h3>
<p>DIY, stateless, air-gapped. Build from parts or buy pre-built.</p>
<span class="badge">Emulator</span>
</div>
<div class="card" onclick="showGuide('coldcard-q')">
<h3>ColdCard Q</h3>
<p>Full QWERTY keyboard, camera, large display. Dual secure elements.</p>
<span class="badge" style="opacity:0.5;">Emulator Coming Soon</span>
</div>
<div class="card" onclick="showGuide('jade')">
<h3>Jade Plus</h3>
<p>Budget-friendly, travel-sized. Virtual secure element.</p>
<span class="badge" style="opacity:0.5;">Emulator Coming Soon</span>
</div>
<div class="card" onclick="showGuide('passport')">
<h3>Passport</h3>
<p>Premium machined aluminum. QR air-gap. Best looking device.</p>
</div>
<div class="card" onclick="showGuide('choosing-a-device')">
<h3>Compare All Devices</h3>
<p>Side-by-side comparison to help you choose.</p>
</div>
</div>
<div class="section-label">Software</div>
<div class="card-grid">
<div class="card" onclick="showGuide('sparrow-wallet')">
<h3>Sparrow Wallet</h3>
<p>Desktop coordinator. Coin control, PSBT signing, multisig.</p>
</div>
<div class="card" onclick="showGuide('bull-bitcoin')">
<h3>Bull Bitcoin</h3>
<p>Single-sig hot wallet. Non-custodial. Buy, sell, and spend.</p>
</div>
<div class="card" onclick="showGuide('multisig-sparrow')">
<h3>Multisig with Sparrow</h3>
<p>2-of-3 multisig setup. The gold standard for large amounts.</p>
</div>
</div>
<h2 class="section-subtitle"><span>At Rest</span></h2>
<div class="card-grid">
<div class="card" onclick="showGuide('steel-backup')">
<h3>Single-Sig Steel Backup</h3>
<p>Stamp your 24 words into steel. Fire-proof, flood-proof, forever.</p>
</div>
<div class="card" onclick="showGuide('steel-backup')">
<h3>Multi-Sig Steel Backup</h3>
<p>Seed phrases + wallet descriptor on distributed plates. 2-of-3 recovery.</p>
</div>
</div>
<div class="section-label">Checklists</div>
<div class="card-grid">
<div class="card" onclick="showGuide('checklists/first-setup')">
<h3>First Setup</h3>
<p>Just got a device? Start here.</p>
</div>
<div class="card" onclick="showGuide('checklists/backup-verification')">
<h3>Backup Verification</h3>
<p>Prove your backup works before you need it.</p>
</div>
<div class="card" onclick="showGuide('checklists/inheritance-planning')">
<h3>Inheritance Planning</h3>
<p>Make sure your Bitcoin doesn't die with you.</p>
</div>
</div>
</div>
<!-- Guide content area -->
<div id="guide" class="guide-content"></div>
</main>
<footer>
<a href="https://github.com/Bitcoin-Butlers/bitcoin-self-custody">GitHub</a>
· <a href="https://bitcoinbutlers.com">bitcoinbutlers.com</a>
· CC BY-SA 4.0 (docs) / MIT (code)
</footer>
<script>
const guideEl = document.getElementById('guide');
const homeEl = document.getElementById('home');
const cache = {};
// Devices that have emulators
const emulatorDevices = {
'seedsigner': {
url: 'emulators/seedsigner/web/pyodide.html',
label: 'SeedSigner+ Emulator',
note: 'The emulator runs real SeedSigner firmware through a local Python server. To try it, clone this repo and follow the setup instructions.',
noteLink: 'https://github.com/Bitcoin-Butlers/bitcoin-self-custody/tree/main/emulators/seedsigner'
}
};
let navDepth = 0;
function goBack() {
if (navDepth > 0) {
history.back();
} else {
showHome();
}
}
function showHome() {
homeEl.style.display = '';
guideEl.classList.remove('active');
navDepth = 0;
window.scrollTo(0, 0);
history.pushState(null, '', '#');
}
async function showGuide(slug, skipHistory) {
// Determine file path
let path;
if (slug.startsWith('checklists/')) {
path = slug + '.md';
} else {
path = 'guides/' + slug + '.md';
}
homeEl.style.display = 'none';
guideEl.classList.add('active');
// Load markdown
if (!cache[slug]) {
try {
const resp = await fetch(path);
if (!resp.ok) throw new Error('Not found');
cache[slug] = await resp.text();
} catch (e) {
guideEl.innerHTML = '<div class="guide-header"><button class="back-btn" onclick="goBack()">←</button><div class="guide-title"><span class="name">Guide not found</span></div></div>';
return;
}
}
// Parse the title from the first markdown h1 line: "# Category - Name"
const mdLines = cache[slug].split('\n');
let titleHtml = '';
let mdBody = cache[slug];
const h1Match = mdLines[0] && mdLines[0].match(/^#\s+(.+)/);
if (h1Match) {
const fullTitle = h1Match[1];
const dashIdx = fullTitle.indexOf(' - ');
if (dashIdx > -1) {
const category = fullTitle.slice(0, dashIdx);
const name = fullTitle.slice(dashIdx + 3);
titleHtml = `<span class="category">${category}</span> <span class="name">${name}</span>`;
} else {
titleHtml = `<span class="name">${fullTitle}</span>`;
}
// Remove the h1 line from markdown so it doesn't render twice
mdBody = mdLines.slice(1).join('\n');
}
// Render
let html = `<div class="guide-header"><button class="back-btn" onclick="goBack()">←</button><div class="guide-title">${titleHtml}</div></div>`;
// Add emulator if this device has one
if (emulatorDevices[slug]) {
const emu = emulatorDevices[slug];
html += `<p style="color:rgba(255,248,230,0.7); margin:24px 0 16px; font-size:14px;">Run real SeedSigner firmware entirely in your browser. No server, no installation.</p>
<iframe src="${emu.url}" style="width:100%; height:700px; border:none; background:#0a0a0a; border-radius:8px;" allow="camera" allowfullscreen></iframe>
<p style="color:rgba(255,248,230,0.35); margin-top:8px; font-size:12px;">First load: ~25MB (cached after). Requires modern desktop browser. <a href="${emu.url}" target="_blank" style="color:#FBDC7B; text-decoration:none; opacity:0.8;">Open in new tab ↗</a></p>`;
}
html += marked.parse(mdBody);
// Convert markdown checkboxes
html = html.replace(/\[ \]/g, '<input type="checkbox">');
html = html.replace(/\[x\]/g, '<input type="checkbox" checked>');
// Rewrite internal links to use hash routing
// .md links like "coldcard-mk4.md" or "../guides/coldcard-mk4.md" -> showGuide('coldcard-mk4')
html = html.replace(/href="(?:\.\.\/guides\/)?([a-z0-9_-]+)\.md"/gi, (_, slug) => {
return `href="#${slug}" onclick="showGuide('${slug}'); return false;"`;
});
// Emulator links like "../emulators/seedsigner/" -> showGuide('seedsigner')
html = html.replace(/href="\.\.\/emulators\/([a-z0-9_-]+)\/?"/gi, (_, device) => {
return `href="#${device}" onclick="showGuide('${device}'); return false;"`;
});
// Internal hash links like "#steel-backup" or "#gen-dice-rolls" -> showGuide('slug')
html = html.replace(/href="#([a-z0-9_-]+)"/gi, (match, slug) => {
// Skip anchors that already have onclick
if (match.includes('onclick')) return match;
return `href="#${slug}" onclick="showGuide('${slug}'); return false;"`;
});
guideEl.innerHTML = html;
convertDetailsToDropdowns(guideEl);
applyGlossary(guideEl);
window.scrollTo(0, 0);
if (!skipHistory) {
navDepth++;
history.pushState(null, '', '#' + slug);
}
}
// Handle back/forward
window.addEventListener('popstate', () => {
navDepth = Math.max(0, navDepth - 1);
const hash = location.hash.slice(1);
if (hash) {
showGuide(hash, true);
} else {
homeEl.style.display = '';
guideEl.classList.remove('active');
navDepth = 0;
window.scrollTo(0, 0);
}
});
const glossary = {
'seed phrase': 'A list of 12 or 24 words that is the master backup of your Bitcoin wallet. Anyone with these words controls your Bitcoin.',
'seed': 'Short for seed phrase. The 12 or 24 words that back up your wallet.',
'BIP-39': 'The standard word list used for seed phrases. Contains 2,048 English words. The first 4 letters of each word are unique.',
'entropy': 'Randomness. The raw random data used to generate your seed. More entropy means a more secure seed.',
'xpub': 'Extended public key. A read-only key that can generate all your wallet addresses. Safe to share with wallet software, but reveals your balance and transaction history.',
'checksum': 'The last word in your seed phrase. It is calculated from the other words and proves the seed is valid.',
'TRNG': 'True Random Number Generator. A hardware chip that produces randomness from physical noise like electrical fluctuations.',
'air-gapped': 'A device that never connects to the internet. It communicates only via QR codes, MicroSD cards, NFC, or manual entry.',
'secure element': 'A tamper-resistant chip that stores your seed phrase encrypted. Designed to resist physical attacks.',
'virtual secure element': 'A security model used by Jade where the device encrypts your seed locally, but needs a remote server (or your own server) to provide a blinding key for decryption. The server never sees your seed.',
'multisig': 'A wallet that requires multiple keys from different devices to authorize a transaction. For example, 2-of-3 means any 2 out of 3 keys must sign. Eliminates single points of failure - no single compromised device can steal your funds.',
'single-sig': 'A wallet controlled by one key. Simpler than multisig but has a single point of failure.',
'PSBT': 'Partially Signed Bitcoin Transaction. A standard format for passing unsigned or partially signed transactions between devices.',
'derivation path': 'A numbering scheme that tells wallet software which addresses to generate from your seed. Different paths produce different addresses from the same seed.',
'wallet descriptor': 'A text string that fully describes how to reconstruct a wallet, including all keys, derivation paths, and the signing policy.',
'stateless': 'A device that does not store any data between sessions. When powered off, everything is erased.',
'hot wallet': 'A wallet on a device connected to the internet (phone, computer). Convenient but less secure than hardware wallets.',
'PIN': 'Personal Identification Number. A short code that locks your device. Not the same as your seed phrase.',
};
function applyGlossary(container) {
const walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT);
const nodes = [];
while (walker.nextNode()) nodes.push(walker.currentNode);
const sortedTerms = Object.keys(glossary).sort((a, b) => b.length - a.length);
const pattern = new RegExp('\\b(' + sortedTerms.map(t => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|') + ')\\b', 'gi');
nodes.forEach(node => {
// Skip titles, code, links, and the guide header
if (node.parentElement.closest('.glossary-term, code, pre, a, h1, h2, h3, h4, select, summary, .guide-header, .guide-title')) return;
const text = node.textContent;
if (!pattern.test(text)) return;
pattern.lastIndex = 0;
const frag = document.createDocumentFragment();
let last = 0;
let match;
while ((match = pattern.exec(text)) !== null) {
const term = match[1].toLowerCase();
const key = sortedTerms.find(t => t.toLowerCase() === term) || term;
if (match.index > last) frag.appendChild(document.createTextNode(text.slice(last, match.index)));
const span = document.createElement('span');
span.className = 'glossary-term';
span.setAttribute('data-tooltip', glossary[key] || glossary[term]);
span.textContent = match[0];
frag.appendChild(span);
last = match.index + match[0].length;
}
if (last === 0) return;
if (last < text.length) frag.appendChild(document.createTextNode(text.slice(last)));
node.parentNode.replaceChild(frag, node);
});
}
function convertDetailsToDropdowns(container) {
// Find groups of consecutive <details> elements and convert to select + panels
const allDetails = container.querySelectorAll('details');
if (!allDetails.length) return;
// Group consecutive details elements
const groups = [];
let current = [];
allDetails.forEach((d, i) => {
if (i === 0 || d.previousElementSibling === allDetails[i - 1]) {
current.push(d);
} else {
if (current.length) groups.push([...current]);
current = [d];
}
});
if (current.length) groups.push(current);
groups.forEach((group, gi) => {
const wrapper = document.createElement('div');
wrapper.className = 'device-selector';
const select = document.createElement('select');
select.id = 'device-select-' + gi;
const panels = [];
group.forEach((details, di) => {
const label = details.querySelector('summary').textContent.trim();
const opt = document.createElement('option');
opt.value = di;
opt.textContent = label;
select.appendChild(opt);
const panel = document.createElement('div');
panel.className = 'device-panel';
panel.id = 'device-panel-' + gi + '-' + di;
// Get all content except the summary
const clone = details.cloneNode(true);
clone.querySelector('summary').remove();
panel.innerHTML = clone.innerHTML;
if (di > 0) panel.hidden = true;
panels.push(panel);
});
select.addEventListener('change', () => {
panels.forEach((p, pi) => { p.hidden = pi !== parseInt(select.value); });
});
// Insert before the first details in this group
group[0].parentNode.insertBefore(wrapper, group[0]);
wrapper.appendChild(select);
panels.forEach(p => wrapper.parentNode.insertBefore(p, group[0]));
// Remove original details elements
group.forEach(d => d.remove());
});
}
// Load from hash on page load
// Load from hash on page load (skipHistory so navDepth stays 0)
if (location.hash.length > 1) {
showGuide(location.hash.slice(1), true);
}
</script>
</body>
</html>