-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsimplepool.html
More file actions
2040 lines (1915 loc) · 102 KB
/
Copy pathsimplepool.html
File metadata and controls
2040 lines (1915 loc) · 102 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
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>simplepool — how it works</title>
<meta name="description" content="simplepool: a single-binary C11 stratum server for Bitcoin. How solo, pps-classic and the two pplns modes work, end to end — shares, difficulty, the coinbase, share credit, Thunder and L1 payouts, and how to audit every number.">
<style>
/* ---------------------------------------------------------------------------
One file, no build step, no network. Everything below is deliberately
self-contained so this page can be opened from disk, dropped next to the
dashboard, or mailed to a miner and still render identically.
--------------------------------------------------------------------------- */
:root {
--bg: #fbfaf8;
--bg-sunk: #f2f0ec;
--bg-card: #ffffff;
--fg: #1b1a17;
--fg-muted: #6a665e;
--fg-faint: #918c82;
--rule: #e2ded6;
--rule-firm: #cdc7bb;
--solo: #b45309;
--solo-bg: #fdf5e9;
--pps: #4338ca;
--pps-bg: #eeecfb;
--pplns: #0f766e;
--pplns-bg: #e6f4f1;
--warn: #b91c1c;
--warn-bg: #fdeceb;
--ok: #15803d;
--code-bg: #f4f2ee;
--shadow: 0 1px 2px rgba(28,26,23,.05), 0 4px 16px rgba(28,26,23,.05);
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #16161a;
--bg-sunk: #1d1d22;
--bg-card: #1e1e24;
--fg: #e9e7e3;
--fg-muted: #a7a29a;
--fg-faint: #7d786f;
--rule: #2e2e36;
--rule-firm: #43424c;
--solo: #f0a848;
--solo-bg: #2a2117;
--pps: #a5a0f5;
--pps-bg: #1e1d33;
--pplns: #5eb3a6;
--pplns-bg: #162926;
--warn: #f2837c;
--warn-bg: #2c1a19;
--ok: #6ee7a4;
--code-bg: #23232a;
--shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
margin: 0;
background: var(--bg);
color: var(--fg);
font: 16px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, "Helvetica Neue", Arial, sans-serif;
-webkit-text-size-adjust: 100%;
text-rendering: optimizeLegibility;
}
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo,
Consolas, "Liberation Mono", monospace; }
/* ------------------------------------------------------------ page frame -- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.layout { display: grid; grid-template-columns: 15rem minmax(0,1fr); gap: 3rem; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; gap: 0; } }
/* ------------------------------------------------------------------ nav --- */
nav.toc {
position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
padding: 2.5rem 0 3rem; font-size: .875rem;
}
@media (max-width: 900px) {
nav.toc { position: static; max-height: none; padding: 1rem 0 2rem;
border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
}
nav.toc .toc-title {
font-size: .6875rem; letter-spacing: .11em; text-transform: uppercase;
color: var(--fg-faint); font-weight: 600; margin-bottom: .75rem;
}
nav.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
nav.toc li { counter-increment: toc; }
nav.toc a {
display: block; padding: .3rem 0 .3rem 1.9rem; text-indent: -1.9rem;
color: var(--fg-muted); text-decoration: none; border-radius: 4px;
}
nav.toc a::before {
content: counter(toc, decimal-leading-zero); color: var(--fg-faint);
font-variant-numeric: tabular-nums; margin-right: .7rem; font-size: .8125rem;
}
nav.toc a:hover { color: var(--fg); }
nav.toc a:hover::before { color: var(--solo); }
/* ------------------------------------------------------------- masthead --- */
header.masthead { padding: 4rem 0 2.5rem; border-bottom: 1px solid var(--rule); }
header.masthead .eyebrow {
font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
color: var(--fg-faint); font-weight: 600;
}
header.masthead h1 {
font-size: clamp(2.5rem, 6vw, 3.75rem); line-height: 1.04; margin: .5rem 0 0;
letter-spacing: -.03em; font-weight: 700;
}
header.masthead .lede {
font-size: clamp(1.0625rem, 2vw, 1.25rem); color: var(--fg-muted);
max-width: 44rem; margin: 1.1rem 0 0; line-height: 1.55;
}
.badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.badge {
font-size: .75rem; padding: .28rem .6rem; border-radius: 999px;
border: 1px solid var(--rule-firm); color: var(--fg-muted);
background: var(--bg-card); white-space: nowrap;
}
/* -------------------------------------------------------------- content --- */
main { padding-bottom: 6rem; }
section { padding-top: 3.5rem; }
section > h2 {
font-size: clamp(1.5rem, 3vw, 1.875rem); letter-spacing: -.02em;
margin: 0 0 .35rem; font-weight: 680; line-height: 1.2;
}
section > .section-sub { color: var(--fg-muted); margin: 0 0 1.75rem; max-width: 46rem; }
h3 { font-size: 1.125rem; margin: 2.25rem 0 .6rem; letter-spacing: -.01em; font-weight: 650; }
h4 { font-size: .9375rem; margin: 1.5rem 0 .4rem; font-weight: 650; }
p { margin: 0 0 1rem; max-width: 46rem; }
ul, ol { max-width: 46rem; padding-left: 1.25rem; }
li { margin: .3rem 0; }
a { color: inherit; text-underline-offset: 2px; text-decoration-color: var(--rule-firm); }
a:hover { text-decoration-color: currentColor; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0 0; }
code {
background: var(--code-bg); padding: .1em .36em; border-radius: 4px;
font-size: .875em; border: 1px solid var(--rule);
}
pre {
background: var(--code-bg); border: 1px solid var(--rule); border-radius: 8px;
padding: 1rem 1.1rem; overflow-x: auto; font-size: .8125rem; line-height: 1.6;
margin: 0 0 1.25rem;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
/* ---------------------------------------------------------------- cards --- */
.card {
background: var(--bg-card); border: 1px solid var(--rule); border-radius: 10px;
padding: 1.25rem 1.4rem; margin: 0 0 1.25rem; box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.mode-card { border-top: 3px solid var(--rule-firm); }
.mode-card.solo { border-top-color: var(--solo); }
.mode-card.pps { border-top-color: var(--pps); }
.mode-card.pplns { border-top-color: var(--pplns); }
.mode-card h3 { margin-top: .25rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.mode-card.solo h3 code { color: var(--solo); background: var(--solo-bg); border-color: transparent; }
.mode-card.pps h3 code { color: var(--pps); background: var(--pps-bg); border-color: transparent; }
.mode-card.pplns h3 code { color: var(--pplns); background: var(--pplns-bg); border-color: transparent; }
.mode-card .tagline { font-size: .8125rem; color: var(--fg-faint); font-weight: 400; }
.mode-card dl { margin: 1rem 0 0; display: grid; grid-template-columns: 9rem 1fr; gap: .45rem 1rem; font-size: .875rem; }
.mode-card dt { color: var(--fg-faint); }
.mode-card dd { margin: 0; }
@media (max-width: 480px) { .mode-card dl { grid-template-columns: 1fr; gap: .1rem 0; }
.mode-card dd { margin-bottom: .55rem; } }
.stat { text-align: left; }
.stat .n { font-size: 1.5rem; font-weight: 660; letter-spacing: -.02em; display: block; line-height: 1.15; }
.stat .k { font-size: .75rem; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .08em; margin-top: .3rem; display: block; }
/* --------------------------------------------------------------- callout -- */
.note, .warnbox {
border-left: 3px solid var(--rule-firm); background: var(--bg-sunk);
padding: .9rem 1.1rem; border-radius: 0 8px 8px 0; margin: 0 0 1.25rem;
font-size: .9375rem; max-width: 46rem;
}
.note p:last-child, .warnbox p:last-child { margin-bottom: 0; }
.warnbox { border-left-color: var(--warn); background: var(--warn-bg); }
.note .label, .warnbox .label {
display: block; font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase;
font-weight: 650; color: var(--fg-faint); margin-bottom: .35rem;
}
.warnbox .label { color: var(--warn); }
/* --------------------------------------------------------------- tables --- */
.tablewrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--rule); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--bg-sunk); font-weight: 620; font-size: .75rem;
letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
/* ------------------------------------------------------------- sequence --- */
ol.steps { list-style: none; padding: 0; counter-reset: step; max-width: 46rem; }
ol.steps > li {
counter-increment: step; position: relative; padding: 0 0 1.4rem 2.75rem;
border-left: 1px solid var(--rule); margin-left: .85rem;
}
ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
content: counter(step); position: absolute; left: -.85rem; top: -.15rem;
width: 1.7rem; height: 1.7rem; border-radius: 50%;
background: var(--bg-card); border: 1px solid var(--rule-firm);
display: grid; place-items: center; font-size: .75rem; font-weight: 650;
color: var(--fg-muted); font-variant-numeric: tabular-nums;
}
ol.steps .who {
display: inline-block; font-size: .6875rem; letter-spacing: .07em; text-transform: uppercase;
color: var(--fg-faint); font-weight: 640; margin-bottom: .1rem;
}
ol.steps h4 { margin: 0 0 .25rem; font-size: 1rem; }
ol.steps p { margin: 0 0 .5rem; font-size: .9375rem; }
/* -------------------------------------------------------------- diagram --- */
figure { margin: 0 0 1.75rem; }
figure svg { display: block; width: 100%; height: auto; }
figcaption { font-size: .8125rem; color: var(--fg-faint); margin-top: .6rem; max-width: 46rem; }
.svgbox { border: 1px solid var(--rule); border-radius: 10px; background: var(--bg-card);
padding: 1.25rem; overflow-x: auto; }
/* byte-layout strip */
.bytes { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 .5rem; font-size: .75rem; }
.bytes .f {
padding: .5rem .7rem; border-radius: 5px; background: var(--bg-sunk);
border: 1px solid var(--rule); flex: 1 1 auto; min-width: 5.5rem;
}
.bytes .f b { display: block; font-weight: 620; font-size: .8125rem; }
.bytes .f span { color: var(--fg-faint); }
.bytes .f.pool { background: var(--solo-bg); border-color: transparent; }
.bytes .f.miner { background: var(--pps-bg); border-color: transparent; }
.legend { font-size: .8125rem; color: var(--fg-faint); display: flex; gap: 1.25rem; flex-wrap: wrap; }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; }
/* ---------------------------------------------------------------- footer -- */
footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 4rem; color: var(--fg-muted); font-size: .875rem; }
footer .wrap > p { max-width: 46rem; }
/* ----------------------------------------------------------------- print -- */
@media print {
nav.toc, .badges { display: none; }
.layout { grid-template-columns: 1fr; }
body { background: #fff; color: #000; font-size: 11pt; }
section { page-break-inside: auto; padding-top: 1.5rem; }
h2, h3 { page-break-after: avoid; }
pre, table, figure, .card { page-break-inside: avoid; }
a { text-decoration: none; }
}
</style>
</head>
<body>
<header class="masthead">
<div class="wrap">
<div class="eyebrow">Bitcoin mining infrastructure</div>
<h1>simplepool</h1>
<p class="lede">
A single-binary stratum server in pure C11. It hands work to your ASICs,
checks every submission itself, submits found blocks, and records the whole
thing in a SQLite file you are allowed to read. It runs in four modes,
which differ in who carries the variance — <strong>solo</strong>, where the
miner who finds a block is paid in that block's own coinbase;
<strong>pps-classic</strong>, where every accepted share earns a fixed,
derivable amount and the operator absorbs the difference out of a reserve;
and <strong>pplns-thunder</strong> / <strong>pplns-btc</strong>, where a
matured block is divided among the shares that produced it, so the pool
never owes more than it has just been paid.
</p>
<div class="badges">
<span class="badge">C11 · no runtime dependencies beyond libc, sqlite3, libcurl, hiredis</span>
<span class="badge">stratum v1 on :3334</span>
<span class="badge">SQLite (WAL) ledger</span>
<span class="badge">MIT</span>
</div>
</div>
</header>
<div class="wrap">
<div class="layout">
<nav class="toc">
<div class="toc-title">Contents</div>
<ol>
<li><a href="#what">What it is</a></li>
<li><a href="#modes">The four modes</a></li>
<li><a href="#stack">The stack</a></li>
<li><a href="#lifecycle">Life of a share</a></li>
<li><a href="#nonce">Dividing the search space</a></li>
<li><a href="#difficulty">Difficulty & vardiff</a></li>
<li><a href="#solo">Solo mode</a></li>
<li><a href="#pps">pps-classic mode</a></li>
<li><a href="#fees">Where the fee lands</a></li>
<li><a href="#payouts">Payouts over Thunder</a></li>
<li><a href="#audit">Auditing every number</a></li>
<li><a href="#data">The data model</a></li>
<li><a href="#connect">Connect a miner</a></li>
<li><a href="#config">Configuration</a></li>
<li><a href="#operate">Running one</a></li>
<li><a href="#limits">What it can't do</a></li>
</ol>
</nav>
<main>
<!-- ====================================================== 1. what it is === -->
<section id="what">
<h2>What it is</h2>
<p class="section-sub">
A stratum server, a share ledger, and a read-only dashboard. That is the
whole system.
</p>
<p>
Miners open a TCP connection to port <code>3334</code> and speak stratum v1.
simplepool builds block templates from <code>bitcoind</code>'s
<code>getblocktemplate</code>, hands each connection its own job, re-hashes
every submission it receives, and writes each accepted one into
<code>data/shares.db</code>. If a submission also clears the network target,
it goes straight back out via <code>submitblock</code>.
</p>
<p>
There is no account system. There is no password — the stratum password
field is read and discarded. Your identity on the pool <em>is</em> the
payout address you authorize with, which means there is nothing to register,
nothing to log into, and nothing the operator can quietly change about who
you are.
</p>
<div class="grid-3">
<div class="card stat"><span class="n">2</span><span class="k">payout modes</span></div>
<div class="card stat"><span class="n">1</span><span class="k">binary, no daemon zoo</span></div>
<div class="card stat"><span class="n">1</span><span class="k">writer to the ledger</span></div>
<div class="card stat"><span class="n">0</span><span class="k">accounts to create</span></div>
</div>
<h3>Why "share" and not "work unit"</h3>
<p>
In solo mode a share is not a claim on anything — the block reward goes to
whoever finds the block, and shares exist for hashrate estimation and
per-rig accountability. The word is kept anyway, deliberately: <em>share</em>
is the term every ASIC firmware, monitoring tool and pool dashboard already
uses, and the same column and table names carry through unchanged into
pps-classic, where shares genuinely are the unit of account. The meaning
shifts between modes; the vocabulary does not.
</p>
<div class="note">
<span class="label">The thing this project is actually about</span>
<p>
Auditing your own contribution to a mining pool is normally somewhere
between hard and impossible — you are handed a number and asked to trust
it. simplepool writes down enough per share that the number can be
re-derived from scratch by anyone holding a copy of the database, without
trusting the dashboard that reports it. <a href="#audit">Section 11</a>
is that argument in SQL.
</p>
</div>
</section>
<!-- ========================================================= 2. the modes == -->
<section id="modes">
<h2>The four modes</h2>
<p class="section-sub">
One config key — <code>pool_mode</code> — decides the shape of the coinbase,
what a stratum username must be, when any off-chain balance moves, and
therefore who is exposed when the pool has a bad month.
</p>
<div class="grid-2">
<div class="card mode-card solo">
<h3><code>pool_mode = solo</code> <span class="tagline">the default</span></h3>
<p>
Every block is paid, on-chain, in its own coinbase, to the miner who
found it. Nothing is pooled. If your rig finds the block you get
essentially the whole subsidy plus fees; if it doesn't, nobody on this
pool earns anything at that height.
</p>
<dl>
<dt>Stratum username</dt><dd>your Bitcoin address, <code>bc1q…</code> or base58</dd>
<dt>Who gets paid</dt><dd>the finder, in the block's coinbase</dd>
<dt>When</dt><dd>immediately, with the block — no payout worker exists</dd>
<dt>Variance</dt><dd>all yours</dd>
<dt>Shares are</dt><dd>a record, not a balance</dd>
<dt>Needs</dt><dd>a <code>bitcoind</code>. Nothing else.</dd>
</dl>
</div>
<div class="card mode-card pps">
<h3><code>pool_mode = pps-classic</code></h3>
<p>
Every block's coinbase pays a pool-owned BTC wallet. Every accepted
share credits your balance at a rate derived from the live block
template, whether or not the pool found anything. The operator moves
accumulated BTC into a Thunder reserve, and a payout worker drains that
reserve to miners.
</p>
<dl>
<dt>Stratum username</dt><dd>a bare base58 Thunder address</dd>
<dt>Who gets paid</dt><dd>every miner, per share</dd>
<dt>When</dt><dd>daily batch, once your balance clears the minimum</dd>
<dt>Variance</dt><dd>the pool's</dd>
<dt>Shares are</dt><dd>the unit of account</dd>
<dt>Needs</dt><dd><code>bitcoind</code>, the enforcer, a Thunder node</dd>
</dl>
</div>
<div class="card mode-card pplns">
<h3><code>pool_mode = pplns-thunder</code></h3>
<p>
Every block's coinbase pays a pool-owned BTC wallet, as in
<code>pps-classic</code> — but nothing is credited when a share arrives.
A block that has matured 100 blocks deep is divided among the shares
that produced it, and each miner is credited its proportion of the
reward <em>plus the fees</em>, net of the operator fee.
</p>
<dl>
<dt>Stratum username</dt><dd>a bare base58 Thunder address</dd>
<dt>Who gets paid</dt><dd>everyone in the window of a block actually found</dd>
<dt>When</dt><dd>on maturity, then the same daily payout batch</dd>
<dt>Variance</dt><dd>the miners'</dd>
<dt>Shares are</dt><dd>a claim on blocks the pool finds</dd>
<dt>Needs</dt><dd><code>bitcoind</code>, the enforcer, a Thunder node</dd>
</dl>
</div>
<div class="card mode-card pplns">
<h3><code>pool_mode = pplns-btc</code></h3>
<p>
The same accounting, paid on the mainchain instead. There is no
sidechain in it at all: the payout worker asks the enforcer's own
wallet to send, so the pool holds no keys and builds no transactions.
</p>
<dl>
<dt>Stratum username</dt><dd>your Bitcoin address, <code>bc1q…</code> or base58</dd>
<dt>Who gets paid</dt><dd>everyone in the window of a block actually found</dd>
<dt>When</dt><dd>on maturity, then the same daily payout batch</dd>
<dt>Variance</dt><dd>the miners'</dd>
<dt>Shares are</dt><dd>a claim on blocks the pool finds</dd>
<dt>Needs</dt><dd><code>bitcoind</code>, and the enforcer with <code>--enable-wallet</code></dd>
</dl>
</div>
</div>
<div class="note">
<span class="label">Why a fourth mode at all</span>
<p>
PPS prices a share the moment it arrives, whether or not it ever becomes
a block. Somebody has to fund the gap between what has been promised and
what has been mined, and that somebody is the operator — who therefore
needs a reserve measured in block rewards, and who is ruined by a long
enough run of bad luck. That is a real barrier: a pool that cannot fund
the reserve cannot honestly run PPS.
</p>
<p>
PPLNS removes it by never promising anything in advance. A block is
divided among the work that produced it, so <strong>the pool never owes
more than it has just been paid</strong>. There is no reserve to size and
operator ruin is not a failure mode. The miners carry the variance
instead — which is the trade, stated plainly, and the reason the operator
fee is normally set lower here: there is no risk premium to charge for.
</p>
</div>
<div class="tablewrap">
<table>
<thead><tr><th> </th><th>solo</th><th>pps-classic</th><th>pplns-thunder</th><th>pplns-btc</th></tr></thead>
<tbody>
<tr><td>Coinbase outputs</td>
<td>miner's address + operator fee</td>
<td><code>pool_btc_address</code> + operator fee</td>
<td colspan="2"><code>pool_btc_address</code> + operator fee</td></tr>
<tr><td>Per-connection coinbase</td>
<td>yes — each miner's <code>cb1</code>/<code>cb2</code> pay <em>that</em> miner</td>
<td>no — every miner's coinbase pays the pool</td>
<td colspan="2">no — every miner's coinbase pays the pool</td></tr>
<tr><td>Stratum username</td><td>Bitcoin address</td><td>Thunder address</td>
<td>Thunder address</td><td>Bitcoin address</td></tr>
<tr><td>Off-chain accounting</td><td>none</td><td><code>pps_credits</code></td>
<td colspan="2"><code>pps_credits</code>, same table</td></tr>
<tr><td>When a balance moves</td><td>never — the coinbase is the payment</td>
<td>as each share arrives</td>
<td colspan="2">when a block matures, 100 deep</td></tr>
<tr><td>Paid for work that found nothing</td><td>no</td><td>yes</td>
<td colspan="2">no</td></tr>
<tr><td>Transaction fees shared</td><td>yes, to the finder</td><td>no — subsidy-derived rate</td>
<td colspan="2">yes, to the window</td></tr>
<tr><td>Pool custodies BTC</td><td>never</td><td>yes, between mining and deposit</td>
<td>yes, between mining and deposit</td><td>yes, in the enforcer wallet</td></tr>
<tr><td>Operator reserve needed</td><td>none</td><td>yes — measured in block rewards</td>
<td colspan="2">none</td></tr>
<tr><td>Payout asset</td><td>BTC, on the mainchain</td><td>BTC on Thunder, a BIP300 sidechain</td>
<td>BTC on Thunder</td><td>BTC, on the mainchain</td></tr>
<tr><td>Payout worker</td><td>not installed</td><td><code>simplepool-payout.service</code></td>
<td><code>simplepool-payout.service</code></td>
<td>same, with <code>PAYOUT_RAIL=btc</code></td></tr>
<tr><td>Miner's income</td><td>lumpy and rare, but complete</td><td>smooth and proportional</td>
<td colspan="2">proportional, but only when the pool finds a block</td></tr>
<tr><td>Who eats bad luck</td><td>the miner</td><td>the pool operator</td>
<td colspan="2">the miners, together</td></tr>
</tbody>
</table>
</div>
<div class="warnbox">
<span class="label">A fifth mode existed and was removed</span>
<p>
<code>pool_mode = pps</code> put a BIP300 drivechain deposit directly in
each coinbase, so the pool would never custody BTC at all. It does not
work. Regtest and a live forknet both showed the enforcer <strong>does not
credit coinbase outputs as deposits</strong>: the block confirms, and the
sidechain Ctip never moves — the reward is simply stranded. A canonical
deposit transaction has to spend real, mature, spendable UTXOs, and a
coinbase does not qualify. That is a consensus rule, not a bug, so the
mode was deleted rather than patched. <code>pps-classic</code> is what
every working drivechain pool converges on instead.
</p>
</div>
</section>
<!-- ========================================================== 3. the stack = -->
<section id="stack">
<h2>The stack</h2>
<p class="section-sub">
In solo mode everything to the right of <code>bitcoind</code> is optional.
In pps-classic the enforcer and a Thunder node join the picture, because
that is where miners actually get paid.
</p>
<figure>
<div class="svgbox">
<svg viewBox="0 0 780 330" role="img" aria-labelledby="stackTitle stackDesc"
style="max-width: 780px; margin: 0 auto;">
<title id="stackTitle">simplepool component topology</title>
<desc id="stackDesc">Miner ASICs connect over stratum to simplepool, which talks
to bitcoind for block templates and writes accepted shares into a SQLite file.
The dashboard and the Thunder payout worker read that same file; the payout
worker also talks to a Thunder node.</desc>
<style>
.bx { fill: var(--bg-sunk); stroke: var(--rule-firm); stroke-width: 1.25; rx: 8; }
.bx.core { fill: var(--solo-bg); stroke: var(--solo); }
.bx.side { fill: var(--pps-bg); stroke: var(--pps); }
.t { fill: var(--fg); font: 600 13px ui-sans-serif, system-ui, sans-serif; }
.ts { fill: var(--fg-muted); font: 400 11px ui-monospace, monospace; }
.ln { stroke: var(--rule-firm); stroke-width: 1.5; fill: none; }
.lbl { fill: var(--fg-faint); font: 400 10.5px ui-monospace, monospace; }
</style>
<defs>
<marker id="ar" viewBox="0 0 10 10" refX="9" refY="5"
markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="var(--rule-firm)"/>
</marker>
</defs>
<!-- row 1 -->
<rect class="bx" x="10" y="40" width="150" height="64"/>
<text class="t" x="85" y="66" text-anchor="middle">Miner ASICs</text>
<text class="ts" x="85" y="84" text-anchor="middle">stratum v1</text>
<rect class="bx core" x="210" y="40" width="150" height="64"/>
<text class="t" x="285" y="66" text-anchor="middle">simplepool</text>
<text class="ts" x="285" y="84" text-anchor="middle">:3334</text>
<rect class="bx" x="410" y="40" width="160" height="64"/>
<text class="t" x="490" y="66" text-anchor="middle">bitcoind</text>
<text class="ts" x="490" y="84" text-anchor="middle">(+ enforcer)</text>
<line class="ln" x1="162" y1="72" x2="206" y2="72" marker-end="url(#ar)"/>
<line class="ln" x1="362" y1="72" x2="406" y2="72" marker-end="url(#ar)"/>
<line class="ln" x1="406" y1="88" x2="362" y2="88" marker-end="url(#ar)"/>
<text class="lbl" x="184" y="62" text-anchor="middle">work</text>
<text class="lbl" x="384" y="34" text-anchor="middle">GBT</text>
<text class="lbl" x="384" y="120" text-anchor="middle">submitblock</text>
<!-- row 2 -->
<rect class="bx" x="210" y="160" width="150" height="56"/>
<text class="t" x="285" y="184" text-anchor="middle">shares.db</text>
<text class="ts" x="285" y="201" text-anchor="middle">SQLite · WAL</text>
<line class="ln" x1="285" y1="106" x2="285" y2="156" marker-end="url(#ar)"/>
<text class="lbl" x="296" y="136">one writer</text>
<!-- row 3 -->
<rect class="bx" x="10" y="252" width="150" height="60"/>
<text class="t" x="85" y="277" text-anchor="middle">dashboard</text>
<text class="ts" x="85" y="294" text-anchor="middle">read-only · :8081</text>
<rect class="bx side" x="410" y="252" width="160" height="60"/>
<text class="t" x="490" y="277" text-anchor="middle">payout worker</text>
<text class="ts" x="490" y="294" text-anchor="middle">pps-classic only</text>
<rect class="bx side" x="620" y="252" width="150" height="60"/>
<text class="t" x="695" y="277" text-anchor="middle">Thunder node</text>
<text class="ts" x="695" y="294" text-anchor="middle">sidechain</text>
<path class="ln" d="M228,218 L228,240 Q228,252 214,252 L166,252" marker-end="url(#ar)"/>
<path class="ln" d="M342,218 L342,240 Q342,252 356,252 L406,252" marker-end="url(#ar)"/>
<line class="ln" x1="574" y1="282" x2="616" y2="282" marker-end="url(#ar)"/>
</svg>
</div>
<figcaption>
SQLite is the source of truth and simplepool is its only writer; everything
downstream reads. In pps-classic the operator also drives BTC → Thunder
deposits from the admin dashboard through the enforcer's wallet — the one
arrow left off the diagram, because it is a human pressing a button rather
than a running data path.
</figcaption>
</figure>
<p>
Optionally, setting <code>redis_url</code> mirrors accepted shares, rejects,
blocks, tip changes and PPS credits onto Redis pub/sub channels
(<code>pool:shares</code>, <code>pool:rejects</code>, <code>pool:blocks</code>,
<code>pool:tip</code>, <code>pool:credits</code>). SQLite stays authoritative;
the publish is fire-and-forget and a Redis outage cannot cost you a share.
</p>
</section>
<!-- ====================================================== 4. life of a share -->
<section id="lifecycle">
<h2>Life of a share</h2>
<p class="section-sub">
From plugging in an ASIC to a row in the ledger. Identical in every mode
except where noted.
</p>
<ol class="steps">
<li>
<span class="who">miner → pool</span>
<h4><code>mining.subscribe</code></h4>
<p>
The pool allocates this connection a 4-byte <strong>extranonce1</strong> and
replies with it. The value comes from an atomic counter XORed with the
current millisecond, so two rigs subscribing in the same nanosecond
cannot collide, and a rig reconnecting days later after the counter has
wrapped still gets something fresh.
</p>
</li>
<li>
<span class="who">miner → pool</span>
<h4><code>mining.authorize "<address>[.<rig>]"</code></h4>
<p>
The username is parsed as an address and validated on the spot —
bech32 or base58check where the rail is Bitcoin (solo, pplns-btc), bare
base58 Thunder where it is Thunder (pps-classic, pplns-thunder).
An invalid address is rejected with a clear error and written to the
<code>rejects</code> table rather than silently accepted. The password is
discarded.
</p>
</li>
<li>
<span class="who">pool → miner</span>
<h4><code>mining.set_difficulty</code> + <code>mining.notify</code></h4>
<p>
The connection gets a starting difficulty and the current job. In solo
mode the job's <code>cb1</code>/<code>cb2</code> are rendered against
<em>this</em> miner's address, so two rigs on the same pool are working on
genuinely different coinbases. The merkle branches, previous hash, nbits
and ntime are shared.
</p>
</li>
<li>
<span class="who">pool ↔ bitcoind</span>
<h4>Tip watcher</h4>
<p>
A background thread re-fetches <code>getblocktemplate</code> every
<code>bitcoind_poll_interval_ms</code> (default 30 s). The job is
rebuilt on a new tip, and also on a timer to pick up a fresher ntime
and newly arrived transactions. Only the tip change carries
<code>clean_jobs = true</code>: it is an instruction to throw away work
in flight, and it is true only when the chain has moved under the
miner. The periodic refresh sends <code>clean_jobs = false</code>, and
the pool goes on accepting submits against the older job out of its
retention ring.
</p>
</li>
<li>
<span class="who">miner → pool</span>
<h4><code>mining.submit</code></h4>
<p>
Carries <code>job_id</code>, the miner's <code>extranonce2</code>,
<code>ntime</code>, <code>nonce</code>, and the exact rolled version bits.
The pool does not take the miner's word for the hash: it reassembles the
coinbase from the cached <code>cb1</code>/<code>cb2</code> and the two
extranonces, recomputes the merkle root, rebuilds the 80-byte header, and
double-SHA256s it itself.
</p>
<p>
Three things are checked before that work is spent: the
<code>extranonce2</code> is the width the pool advertised, the
<code>ntime</code> is inside the window the chain would accept (see
<a href="#nonce">Rolling ntime</a>), and the connection is under
its submit ceiling. Each of those describes a header that could never
become a block, so validating one is effort spent to reach the same
answer more slowly.
</p>
</li>
<li>
<span class="who">pool</span>
<h4>Two comparisons, one hash</h4>
<p>
The resulting hash is compared against the <strong>worker target</strong>
— the difficulty <em>this job</em> went out under, not whatever the
connection has drifted to since — and against the <strong>network
target</strong>. Above the worker target it is rejected as
<code>low difficulty</code> and logged in <code>rejects</code>. Below it,
a row lands in <code>shares</code>. Below the network target as well, it
is <em>also</em> a block.
</p>
</li>
<li>
<span class="who">pool → bitcoind</span>
<h4>Block submission</h4>
<p>
A block-shaped share is serialised in full and pushed via
<code>submitblock</code>, then recorded in <code>blocks_found</code> with
the height, hash, finder, reward and fee. What is recorded is a block
<em>candidate</em>: if the node refuses the submission the row is written
<code>rejected</code> with its reason, and if it is accepted the row is
<code>pending</code> until the block is verified to be in the chain — a
later reorg moves it to <code>orphaned</code>. Only
<code>confirmed</code> is counted, and only it pays the pool.
The share itself is unaffected: it met the thresholds it met, and in
pps-classic the pool absorbs the variance either way.
</p>
</li>
<li>
<span class="who">pool</span>
<h4>Vardiff tick, then the write</h4>
<p>
If the vardiff window has elapsed the connection is retargeted and gets a
fresh <code>mining.set_difficulty</code>. Writes are batched: shares queue
into a lock-free ring and a writer thread commits every
<code>commit_window_ms</code> (100 ms) or every
<code>commit_max_shares</code> (100), whichever comes first.
</p>
</li>
</ol>
<div class="note">
<span class="label">One detail that trips people up</span>
<p>
A <code>mining.set_difficulty</code> does <strong>not</strong> invalidate the
job you are working on. The difficulty only changes the threshold each
submitted share is measured against; the current <code>mining.notify</code>
stays valid across it, and the pool does not force a re-notify.
</p>
</div>
</section>
<!-- ===================================================== 5. the nonce space = -->
<section id="nonce">
<h2>Dividing the search space</h2>
<p class="section-sub">
The fairness guarantee simplepool makes is narrow and checkable: no two
connections are ever searching the same
<code>(header, coinbase, nonce)</code> triple.
</p>
<p>
A block header is 80 bytes, and only three parts of it can vary while you
search: the 4-byte <code>nonce</code>, whichever <code>version</code> bits
the pool has permitted you to roll, and the <code>merkle_root</code> — which
you change indirectly, by changing the coinbase transaction.
</p>
<h3>The 80-byte header</h3>
<div class="bytes">
<div class="f"><b>version</b><span>4 B · rollable</span></div>
<div class="f"><b>prev_block_hash</b><span>32 B · fixed</span></div>
<div class="f"><b>merkle_root</b><span>32 B · via coinbase</span></div>
<div class="f"><b>ntime</b><span>4 B</span></div>
<div class="f"><b>nbits</b><span>4 B · network target</span></div>
<div class="f"><b>nonce</b><span>4 B · the sweep</span></div>
</div>
<h3>Where the extranonce lives</h3>
<p>
The coinbase <code>scriptSig</code> is assembled at share-check time and
carries both halves of the standard stratum split:
</p>
<div class="bytes">
<div class="f"><b>height push</b><span>BIP34</span></div>
<div class="f"><b>coinbase_tag</b><span>e.g. <code>/simplepool/</code></span></div>
<div class="f pool"><b>extranonce1</b><span>4 B · pool assigns</span></div>
<div class="f miner"><b>extranonce2</b><span>8 B · miner sweeps</span></div>
</div>
<p class="legend">
<span><i style="background:var(--solo-bg);border:1px solid var(--solo)"></i>assigned once per connection</span>
<span><i style="background:var(--pps-bg);border:1px solid var(--pps)"></i>yours to search</span>
</p>
<p>
Together those give each connection <strong>2<sup>64</sup></strong> distinct
coinbases before it would need to reconnect for a fresh
<code>extranonce1</code> — effectively unbounded at any real hashrate. Each
<code>extranonce2</code> value yields a distinct coinbase, therefore a
distinct coinbase txid, therefore a distinct merkle root, therefore a fresh
2<sup>32</sup> nonce space to sweep.
</p>
<p>
<code>extranonce2</code> is 8 bytes rather than the classic 4, and the
reason is not search space — 4 bytes already outruns any hashrate. It is so
that a stratum proxy in front of the pool can subdivide the field, taking
the high bytes as a downstream-miner id and passing the low bytes down as
that miner's own <code>extranonce2</code>. At 4 bytes a proxy spending 3 on
addressing leaves its miners a single byte, which some firmware refuses to
run with; at 8 it can spend 3 and still hand down the conventional 4.
</p>
<p>
The width is not advisory. <code>cb1</code> ends with the scriptSig length
varint, fixed at render time from the two extranonce sizes, so an
<code>extranonce2</code> of any other width yields a coinbase whose declared
length disagrees with its contents — an invalid transaction that still
hashes like a valid one. The pool rejects such submissions
(<code>wrong extranonce2 size</code>) rather than credit a share for work
that could never become a block.
</p>
<h3>Version rolling</h3>
<p>
If a miner advertises support via <code>mining.configure</code>, the pool
negotiates a version-bit mask — currently <code>0x1fffe000</code>, the 16
bits from position 13 to 28. That multiplies the space behind a single
<code>(extranonce1, extranonce2)</code> pair by 2<sup>16</sup>, so one
<code>extranonce2</code> value covers 2<sup>32</sup> × 2<sup>16</sup> =
2<sup>48</sup> ≈ 280 trillion headers.
</p>
<p>
The pool never re-derives a rolled version on its own. The miner states the
exact version it hashed, the pool reconstructs <em>that</em> header and
re-hashes it, and any bit flipped outside the mask makes the submission
invalid.
</p>
<h3>Rolling ntime</h3>
<p>
A miner may also advance the header's <code>ntime</code> while it holds a
job, which multiplies its space again for free. Nothing has to be
negotiated for this: the pool takes the timestamp the miner submits, puts
it in the header verbatim, and treats every distinct value as a distinct
share.
</p>
<p>
It is bounded, though loosely, and the bound exists for the chain's sake
rather than the pool's. Consensus refuses a block whose timestamp is more
than two hours ahead of network-adjusted time — but such a header still
hashes, still clears a share target, and still looks like perfectly good
work here. Without a check the pool would credit it, and if it happened to
beat the network target, assemble a block that <code>submitblock</code>
then throws out: a solved block lost with nothing but a warning in the log
to show for it.
</p>
<p>
So a submitted <code>ntime</code> must fall within
<strong>−600 s to +7200 s</strong> of the value its own job went out with.
Measuring from the job rather than the wall clock keeps that conservative:
a job only gets older while the miner holds it, so anything inside this
window is inside the consensus window too. The backward tolerance is there
because a stratum proxy that rewrites the field, or a rig with a skewed
clock, can land slightly behind — that is honest work and rejecting it
would cost the miner shares. Both ends are deliberately loose. This is here
to catch a broken client, not to police timestamps.
</p>
<h3>Two rigs, one address</h3>
<p>
Authorizing as <code>bc1q….basement</code> and <code>bc1q….garage</code>
gives you two connections, hence two different <code>extranonce1</code>
values, hence no overlapping work — and two separate rows in
<code>workers</code>, so the leaderboard and the per-worker drilldown can
tell your boxes apart while the dashboard still rolls them up by address.
</p>
</section>
<!-- ====================================================== 6. difficulty ===== -->
<section id="difficulty">
<h2>Difficulty & vardiff</h2>
<p class="section-sub">
Every share is measured against two thresholds. One decides whether it
counts; the other decides whether it is a block.
</p>
<div class="grid-2">
<div class="card">
<h3 style="margin-top:0">Worker target</h3>
<p style="margin-bottom:0">
The difficulty the pool is currently holding <em>this connection</em> at,
announced with <code>mining.set_difficulty</code>. A hash at or below it
is an accepted share. It exists so your rig reports in at a sane rate
instead of once a decade.
</p>
</div>
<div class="card">
<h3 style="margin-top:0">Network target</h3>
<p style="margin-bottom:0">
The real chain difficulty, straight from the block template. A hash at or
below it is a valid block. It is far below any sane worker target, so a
block-finding hash necessarily satisfies the share check too.
</p>
</div>
</div>
<p>Both are 256-bit big-endian numbers, and for a hash <code>h</code>:</p>
<pre><code>share accepted ⇔ h ≤ worker_target
block found ⇔ h ≤ network_target</code></pre>
<h3>What "difficulty 0.016" means</h3>
<p>
Bitcoin's pdiff-1 target is <code>0xffff × 2<sup>208</sup></code>. A share at
difficulty <code>D</code> is one whose hash is below
<code>pdiff_1 / D</code>, so given a worker target the difficulty recorded on
the share row is simply:
</p>
<pre><code>difficulty = pdiff_1_target / worker_target</code></pre>
<h4>Worked example, from a real rig</h4>
<pre><code>worker_target = 0x000003e7fc18… (5 leading hex zeros)
= 0x03e7fc18 × 2^204
difficulty = (0xffff × 2^208) / (0x03e7fc18 × 2^204)
= 65535 × 16 / 65407512
≈ 0.01603</code></pre>
<p>
That is the number stored in <code>shares.difficulty</code> on every row this
connection produces, and — in pps-classic — the number your credit is
computed from. Hashrate follows from the share rate:
</p>
<pre><code>shares_per_second = H / (D × 2^32)
14 shares in a minute at D = 0.016
→ 0.233 shares/s
→ H = 0.233 × 0.016 × 2^32 ≈ 16 MH/s</code></pre>
<p>
The dashboard's hashrate column uses exactly this formula over a rolling
window (24 h by default), which is why it is an estimate with visible
variance rather than a reading off your ASIC.
</p>
<p>
One refinement: the divisor is the span the shares actually cover — first
share in the window to now — not the nominal width of the window. Dividing
by time nothing was mined in reports a rate nobody ran at, and it goes
wrong at exactly the moment someone is most likely to be looking. A pool
eleven hours old reads half its true rate against a 24 h window. A rig ten
minutes into a rented contract reads <sup>1</sup>⁄<sub>144</sub> of what it
is doing, so the arrival an operator most wants to see is the one the
leaderboard flattens into noise. Both heal on their own as the window
fills, which is why it survived so long: by the time anyone doubts the
number, it is right again.
</p>
<p>
The span is clamped at both ends. Never longer than the nominal window — a
share selected by <code>ts >= now − windowSec</code> cannot be older than
it. Never shorter than a minute, because the span of a single share a few
seconds old tends to zero and would turn one lucky submit into a gigahash
spike. With no shares at all it falls back to the nominal window, so an
idle pool divides zero by 24 h and reports zero rather than a clamped
fraction of nothing.
</p>
<h3>A submit is judged at its own job's difficulty</h3>
<p>
A <code>mining.set_difficulty</code> takes effect on the <em>next</em> job the
miner is notified of, not the one already in its hands. So every share for a
job the miner already holds was mined against the difficulty <em>that job</em>
went out under, and on a slow chain those keep arriving long after the
retarget that changed the connection.
</p>
<p>
The pool records the difficulty each job was notified under, per connection,
and judges the submit against that. A share is credited at the difficulty it
was judged under — never at one it did not actually meet.
</p>
<div class="note">
<span class="label">Why not just remember the previous value</span>
<p>
Because vardiff can retarget more than once while a miner still holds one
job, and a single remembered value is gone after the second. Judging
against the job itself needs no time limit either: a job the retention
ring has dropped cannot be submitted against at all, so the job's own
lifetime is the bound.
</p>
</div>
<h3>One difficulty cannot serve everyone</h3>
<p>
A connection's share rate is its hashrate divided by the difficulty it was
assigned. For a home ASIC that wants to be low enough to report regularly.
For rented hashrate it cannot be: a marketplace aggregates a whole fleet
behind a <em>single</em> connection, so 1 PH/s at difficulty 1024 is about
<strong>227 shares per second</strong> down one socket. The marketplaces know
this and refuse to deliver below their own floor — Braiins wants at least