Exported from the living design document on claude.ai on 2026-10-16. The doc remains the editable source; this file is the snapshot the code is built against. Parameters here are frozen as of the Open decisions section.
Oct 16, 2026
The design is a Bitcoin sharechain: a separate proof-of-work chain of shares, each share a complete Bitcoin block candidate whose coinbase already pays every miner in the PPLNS window. There is no operator and no pool wallet, and each miner builds its own block template. Orphaned shares become uncles, included by later shares at a 20% penalty, so work lost to propagation delay is paid instead of discarded.
What carries over from Monero P2Pool unchanged:
- One sidechain per consensus config (block time, window, penalty); shares are full parent-chain block candidates.
- Uncle depth 5 on Bitcoin (Monero and BTCB2 use 3); the uncle's miner gets 80% of the share weight, the including share's miner gets the other 20%.
- Chain tip = highest cumulative work including uncle work; difficulty retargets every share over a trimmed window.
- Dynamic PPLNS window: it stops once accumulated weight reaches 2× the parent chain's difficulty, so payouts stay a sensible size.
What has to change for Bitcoin:
- Commitment lives in a coinbase
OP_RETURN, and the share ID is the Bitcoin block-header hash (this is also what closes the June 2026 duplicate-share hole). - Shares are 1–4 MB of transactions, so relay uses BIP152-style short IDs plus delta encoding against the parent share; SHA256d makes verification free, bandwidth is the limit.
- A 6-hour share window is 180 Monero blocks but only 36 Bitcoin blocks, so below ~5% of network hashrate the window never holds two expected blocks and payouts become a lottery. v1 accepts that (expected income stays fair); v2 adds a consensus carry-forward ledger (TIDES-style) so the window can be two blocks long for any pool size.
- Mainchain reorg handling is tuned to 10-minute blocks (2-block staleness rule, 7200-second timestamp tolerance).
- Miners connect only through a DATUM Gateway or a Stratum v2 job-declaration client; the node acts as the "pool" that dictates coinbase outputs and never builds templates or speaks Stratum v1.
Monero P2Pool never discards a late share: a share that lost the race is referenced as an uncle by a later share and still earns 80% of its weight. These are the rules as they stand in side_chain.cpp (v4.x, October 2026), not the README summary.
| Rule | Main / mini | Nano | Where |
|---|---|---|---|
| Target share time | 10 s | 30 s | m_targetBlockTime |
| PPLNS window cap | 2160 shares | 2160 shares | m_chainWindowSize |
| Uncle penalty | 20% | 10% | m_unclePenalty |
| Max uncle depth | 3 | 3 | UNCLE_BLOCK_DEPTH |
| Minimum share difficulty | 100 000 | 100 000 | MIN_DIFFICULTY |
| Max nominal window | 30 h | 30 h | MAX_PPLNS_WINDOW_HOURS |
Uncle validity. An uncle must sit at height h−1 to h−3 below the including share, must not already appear as a block or uncle in the last 3 heights of the parent chain, and must share a common ancestor with the parent within 3 heights ("same chain" check). Uncle hashes are sorted ascending and must be unique, which blocks the trick of listing one uncle three times.
Reward split. Walking back from the tip, each main share adds its full difficulty to its miner. Each uncle adds diff × 0.8 to the uncle's miner and diff × 0.2 to the miner of the share that included it. The include-bonus is what makes nodes want to reference uncles instead of ignoring them.
Dynamic PPLNS window (since v2). The walk stops as soon as accumulated weight exceeds 2 × Monero network difficulty, or after 2160 shares, whichever comes first. Uncles that would push the total past the cap are skipped; a main share is always added so the window is never empty. Effect: when pool hashrate is high the window shrinks to roughly two expected blocks, keeping each payout meaningful.
Chain-tip rule. Cumulative difficulty = parent's cumulative + own difficulty + the difficulty of every uncle included. Among shares on the same chain the higher cumulative difficulty wins. A competing chain with no common ancestor within the window is compared on total difficulty over the last 2160 shares and must also: be built on Monero blocks no more than 10 behind the current tip, reference at least half as many known Monero blocks as the current chain, have timestamps within 10 800 s of the Monero blocks it builds on, and have a timestamp span between 2/3 and 4/3 of the Monero span it covers. Those four checks stop fake high-difficulty chains with forged timestamps.
Difficulty retarget. Every share recomputes difficulty from the last 2160 shares plus their uncles: discard the 10% oldest and 10% newest by timestamp, then diff = Δ(cumulative difficulty) × target_time / Δt, floored at 100 000. A share's declared difficulty must equal this value exactly or the share is invalid.
Payout verification. The verifier recomputes the PPLNS set, requires the share's coinbase to have exactly that many outputs, splits the reward with integer arithmetic so the sum is exact, shuffles payees with a deterministic PRNG seeded from the share's tx-key seed, and checks every output's stealth key against the expected wallet. Any mismatch invalidates the share.
Anti-spam and pruning. Incoming shares with difficulty below the expected value (with a 2× allowance against any recent share, to tolerate alternate chains) are ignored before PoW is checked. Shares deeper than 2×W−1+U skip re-verification, and everything older than about 2W + 2U + one Monero block of shares is pruned, so a node holds roughly 4 300 shares.
Commitment. The sidechain data (parent, uncles, height, difficulty, payouts) is hashed into Monero's merge-mining tag in the coinbase tx_extra, so the RandomX proof of work covers it.
The uncle mechanism ports almost unchanged; what does not port is the economics. Bitcoin's reward is spread over a window sized to 2× a difficulty of 132.7 T (as of 3 October 2026, source), and every payout must clear the dust limit, so the smallest useful share is enormous by Monero standards.
| Property | Monero (P2Pool) | Bitcoin (this design) | Consequence |
|---|---|---|---|
| Parent block time | 120 s | 600 s | Window of 2× difficulty spans ~20 min of pool luck at 1% of network, hours when smaller |
| Proof of work | RandomX, ~1 ms to verify, CPU | SHA256d, microseconds, ASIC | Verification is free; bandwidth and latency set the share time |
| Parent block size | tens of kB | 1–4 MB | Shares must relay as short IDs + deltas, never full blocks |
| Payout output | 38 B stealth output, needs tx-key crypto per payee | 31 B (P2WPKH) to 43 B (P2TR) plain script, no crypto | Cheaper to build; no stealth privacy, addresses are public either way |
| Dust rule | none | 294 sat (P2WPKH) / 330 sat (P2TR) standardness floor, plus ~50–100 sat/vB to spend later | Minimum payout must be set well above dust |
| Commitment slot | tx_extra merge-mining tag |
coinbase OP_RETURN output (or scriptSig, 100-byte cap) |
One extra 43 B output per block |
| Template source | monerod | Bitcoin Core / Knots getblocktemplate, DATUM Gateway, Stratum v2 |
Node must accept externally built templates and only dictate coinbase outputs |
| Miner interface | XMRig, Stratum-like JSON | DATUM Gateway or Stratum v2 job declaration, miner-built templates | Node implements the DATUM pool side and the SV2 Pool + JDS roles; no Stratum v1 |
| Block-withholding exposure | same | same | PPLNS limits damage; no protocol fix exists |
The window-to-block-time ratio is the design driver. Monero P2Pool's window is at most 2 160 shares, 6 hours at 10 s, against a 2-minute block: 180 blocks of parent-chain time. The same share cap at this design's 15 s target is a 9-hour window, only 54 Bitcoin blocks. The window reaches its 2 × D target (two expected pool blocks) only when the pool holds about 3.7% of the network (~35 EH/s); below that, a share sits in the window for 9 hours and is paid only if the pool finds a block in those 9 hours. Expected income is still exactly share_work / D × reward — the maths is fair — but the payout is a lottery ticket whose odds depend on pool size:
| Pool hashrate | Share difficulty at 15 s | Pool block interval | Chance a 9-hour share is paid | Payout per paid share |
|---|---|---|---|---|
| 100 PH/s | 3.5 × 10^8 | 66 days | 0.6% | ≥ 144 700 sat |
| 1 EH/s | 3.5 × 10^9 | 6.6 days | 5.7% | ≥ 144 700 sat |
| 10 EH/s | 3.5 × 10^10 | 15.8 h | 57% | ≥ 144 700 sat |
| 35 EH/s | 1.2 × 10^11 | 4.5 h | ~2 payouts per share (window = 2×D) | ≥ 144 700 sat |
| 100 EH/s | 3.5 × 10^11 | 1.6 h | ~2 payouts per share | ≥ 412 000 sat |
Payout size is never a dust problem: with at most 2 160 payees, each paid share gets at least reward / 2160 ≈ 144 700 sat. The lottery odds are the problem, and they are why original p2pool shrank and why p2poolv2 and Braidpool reach for sub-pools or share trading (p2poolv2, Braidpool). A longer window would fix the odds but multiplies coinbase outputs: a 30-hour window at 15 s is 7 200 payees, over a fifth of a block. That is exactly the gap a TIDES-style carry-forward ledger closes (section 6), which is the one place this design goes beyond Monero P2Pool. How often a given miner finds a share at all is a separate question: in a 1 EH/s pool a 200 TH/s rig finds one every ~21 h and a 1 TH/s Bitaxe every ~174 days.
Uncle rate expectation. With global share propagation of 0.5–2 s and a 15 s target, 3–13% of shares will be uncles. Depth 5 leaves 75 s for inclusion, so true orphans stay under 0.2%. Because SHA256d verification is free, the share time is bounded only by relay: 15 s is the loss-minimising choice; 10 s remains possible once delta relay is proven.
Shares must be real block candidates. As in Monero P2Pool, a share that could never be a valid Bitcoin block (bad transactions, over-claimed fees) still passes PoW and payout checks. The validation section adds a fee-sum check and optional full validation through getblocktemplate proposal mode to close most of that gap.
A share is a Bitcoin block candidate plus the sidechain record it commits to. The share ID is the block-header hash, so a share is exactly one proof of work over exactly one set of sidechain fields; nothing can be varied after the fact.
Wire format of a share (share message)
| Field | Size | Notes |
|---|---|---|
header |
80 B | Standard Bitcoin header; sha256d(header) is the share ID and must meet the share target (and may meet the network target) |
coinbase_tx |
variable | Full coinbase with witness; carries BIP34 height, the witness commitment, the PPLNS payout outputs and the sharechain commitment output |
sidechain |
~150 B + uncles | The record below; its sha256d must equal the hash in the commitment output |
tx_count |
varint | Number of non-coinbase transactions |
short_ids |
6 B each | BIP152 short IDs keyed by header (SipHash-2-4 of wtxid), in block order |
prefilled |
variable | Full transactions the sender thinks peers lack (indexes + raw tx), as in BIP152 |
Sidechain record (sidechain)
| Field | Type | Rule |
|---|---|---|
version |
u8 | 1 |
consensus_id |
32 B | sha256d of the config tuple (network, name, password, target time, min diff, window, penalty, max payees, min payout); shares with another ID are dropped |
parent_id |
32 B | Share ID of the parent; zero only for genesis |
uncle_count |
u8 | 0–4 |
uncle_ids |
32 B × n | Share IDs, strictly ascending |
side_height |
u64 | parent height + 1 |
share_bits |
u32 | nBits encoding of the share target; must equal the retarget result for this parent |
cumulative_work |
32 B | parent + own + Σ uncle work, as a 256-bit integer |
miner_script |
varbytes ≤ 40 B | scriptPubKey this miner is paid to (P2WPKH, P2WSH or P2TR only) |
ledger_root |
32 B | Merkle root of the carry-forward ledger after applying this share (section 6); all zero in v1 |
lost_root |
32 B | Merkle root of the lost-share list this node knows when it builds the share: orphan share IDs since the last pool block plus its own dead-share headers (see Lost-work record under section 7). Opaque to consensus: any 32 bytes are valid; all zero when the list is empty |
software |
u32 + u32 | Implementation ID and version, for upgrade signalling |
extra |
varbytes ≤ 64 B | Optional: onion/I2P peer hint, DATUM tag |
Commitment output. Exactly one coinbase output must be OP_RETURN <0x24> 0x53484152 <32-byte sha256d(sidechain)> (SHAR tag + hash, 0 sat). It sits before the BIP141 witness-commitment output, which stays the last OP_RETURN beginning aa21a9ed as BIP141 requires. Cost: 43 bytes, 172 weight units per block. The coinbase scriptSig keeps BIP34 height + miner extranonce space only, so a DATUM Gateway's or SV2 JDC's own coinbase handling works unchanged.
Coinbase outputs, in order: (1) PPLNS payees in deterministic shuffled order, (2) in v2 only, carried-forward payouts that crossed the threshold, (2a) at most two optional zero-value OP_RETURN outputs of ≤ 83 bytes chosen by the finder (used for the optional lost_root runestone), (3) the SHAR commitment, (4) the witness commitment. The sum of (1)+(2) must equal subsidy + fees of the included transactions exactly; a verifier that cannot see every transaction treats the share as unverified until it has fetched them.
What is deliberately not in the record. No timestamp (the header has one), no transaction root (the header's merkle root already covers the coinbase, hence the record), no payout list (every node recomputes it from the parent, uncles and ledger). Keeping the record small keeps the commitment unforgeable and the share cheap to relay.
Uncle handling is Monero P2Pool's rule set with Bitcoin-tuned constants. A share that lost a race is paid 80% if any share within the next five heights (three on BTCB2) references it, and the referencing miner is paid the other 20%, so including uncles is always the profitable move.
A share may list an uncle only if all of these hold:
- The uncle's height is between
side_height − UNCLE_DEPTHandside_height − 1(UNCLE_DEPTH= 5 on the Bitcoin chain, 3 on BTCB2). - The uncle is not the parent, an ancestor, or already listed as an uncle by the parent chain within the last
UNCLE_DEPTHheights ("can't mine the same uncle twice"). - The uncle shares a common ancestor with the parent within
UNCLE_DEPTHheights (same chain). - The uncle is itself a verified, valid share on the same consensus ID.
- At most 4 uncles per share, IDs strictly ascending, no duplicates.
- A share that lists an invalid or unknown uncle is held until the uncle arrives, then validated or rejected with it.
Weight and work. PPLNS weight: uncle miner w × (1 − penalty), including miner + w × penalty, with penalty 20% on the main chain. Cumulative work: parent.cumulative + own_work + Σ uncle_work at full value, so the chain with the most proof of work, uncles included, wins ties on height.
(Diagram: uncle inclusion — a share U that lost the race at height h−1 is listed as an uncle by share S at h+1; U's miner gets 80% of U's work, S's miner 20%, and S's cumulative work counts U in full. See the design doc on claude.ai for the drawing.)
The same shape repeats at every height: any share up to five heights back on Bitcoin (three on BTCB2) that is not already on the parent chain, or listed by it, may be referenced once.
Tip selection, same chain. Higher cumulative work wins. On exact equality the node keeps its current tip (first seen), which removes the incentive to spam equal-work siblings.
Tip selection, competing chain (no common ancestor inside the window). The candidate replaces the current chain only if all five pass:
| Check | Rule | Why |
|---|---|---|
| Work | Σ work over last W shares + their uncles is higher | basic longest-chain |
| Freshness | newest Bitcoin block the candidate builds on is ≥ current Bitcoin height − 2 | a chain mined on stale templates cannot pay anyone |
| Anchoring | candidate references ≥ half as many known Bitcoin blocks as the current chain | stops chains mined against a fake or private Bitcoin fork |
| Timestamps | every share timestamp within 7 200 s of the Bitcoin block it builds on | matches Bitcoin's own 2-hour future-time tolerance |
| Span | 80% timestamp span between 2/3 and 4/3 of (Bitcoin blocks covered × 600 s × 0.8) | forged timestamps cannot fake a high-difficulty chain |
Bitcoin tip discipline. A share's prevhash must be the node's current Bitcoin tip, or the tip's parent if the share arrived within 30 s of the newer block (propagation grace). Anything older is ignored, not banned: the sender may be lagging. A share built on a Bitcoin block that is later reorged out keeps its sharechain weight (the work was real and honest), but any Bitcoin block it would have been can no longer be submitted.
Block found. Any node that sees a share whose header meets the network target calls submitblock on its own Bitcoin node at once, before sidechain validation, exactly as Monero P2Pool submits to monerod. The finder cannot keep a block to itself by delaying its own submission, and the payout list in that block was fixed by consensus before it was mined.
Every share's coinbase pays the PPLNS window that ends at that share, so whichever share meets the Bitcoin target already carries the right payout list. Version 1 uses Monero's window rule unchanged; version 2 adds a consensus carry-forward ledger so a small pool can run a window of two expected blocks without 10 000 coinbase outputs.
v1: computing the payout set for a new share S (every node runs the same walk):
D= work implied by thenBitsof the Bitcoin blockS.prevhashpoints to.cap = 2 × D.- Start at
Sitself (a miner always pays its own share), then walk parents. - For each share: add each listed uncle as
uncle.work × 0.8to the uncle'sminer_scriptanduncle.work × 0.2to the including share's miner, skipping an uncle that would push the running total pastcapor that lies more thanW_MAXheights belowS; then add the share's own work to its miner. - Stop when the running total exceeds
cap, afterW_MAX = 2 160shares, or at genesis. One main share may overshoot the cap, so the set is never empty. reward = subsidy(height) + Σ feesof S's transactions. Payfloor(cumulative_weight × reward / total_weight)differences in satoshis so the amounts sum torewardexactly.- Sort payees by
miner_script, then shuffle with xorshift64* seeded fromsha256d(parent_id), so output order leaks nothing and every node agrees on it.
Minimum share difficulty is 10^8 (anti-spam only; the retarget normally sits far above it). With at most 2 160 payees every output is at least reward / 2160, about 144 700 sat today, so there is no dust case and no ledger in v1. The cost is the one described above: below ~35 EH/s of pool hashrate, the window is 9 hours of shares rather than two expected blocks.
Output cost. 2 160 P2WPKH outputs = 67 kB, about 268 000 weight units or 6.7% of a block. At 5 sat/vB that displaces roughly 335 000 sat of fees, 0.1% of a 3.125 BTC block. MAX_PAYEES = W_MAX.
v2: carry-forward ledger (TIDES-style, consensus-enforced). The ledger lets the window be 2 × D of work for any pool size while the coinbase stays small:
- Window = walk back until
2 × Dof work (uncles included at their penalised weight), with no share cap. A 100 PH/s pool holds about 130 days of shares; pruned to header + sidechain record (~250 B) that is under 300 MB. - Due = each miner's PPLNS amount for this block, computed as in v1.
- Balance = a consensus map
miner_script → sat, carried share to share and committed asledger_root(Merkle root of the sorted entries).balance += duefor every miner in the window. - Pay every miner whose balance ≥
MIN_PAYOUT(default 20 000 sat), largest first, at mostMAX_PAYEES(default 512) per block; set those balances to 0. Paid outputs replace the per-share payout list. - Conservation: the coinbase must claim the whole reward, so the unpaid remainder is handed pro rata to the miners paid in this block as an advance, and recorded as
liability. Liabilities are settled off the top of the next blocks' rewards before step 2, capped at 25% of a block's reward per block so a run of small blocks cannot starve current miners. - Expiry: a balance untouched for 8 064 Bitcoin blocks (8 weeks) is dropped and its liability cancelled. This bounds state; the figure is a consensus parameter.
What the ledger buys: a 1 EH/s pool goes from a 3.8% chance per share to a near-certain, smaller, later payout, and payee count no longer scales with window length. What it costs: a state snapshot new nodes must fetch and verify against ledger_root (headers alone no longer suffice), a liability that is only as good as the pool's future blocks, and more consensus surface. That is why it is v2, after v1 has run on signet and mainnet.
Mini / nano tiers (30 s and 60 s targets) remain useful in v1 for the same reason as Monero's: a slower target makes W_MAX cover 18 or 36 hours, so a mid-sized pool reaches 2 × D without the ledger. They are chosen by pool size, not miner size; a 1 TH/s miner's expected income is the same on every tier.
The retarget is Monero P2Pool's, applied to Bitcoin header timestamps: every share sets the next difficulty from the trimmed last window, so the sharechain tracks pool hashrate within a few minutes and a declared difficulty that differs from the computed one by even one unit invalidates the share.
Retarget for the share after tip T:
- Collect
(timestamp, cumulative_work)for the lastW_MAXshares from T and for every uncle they include that lies inside the window. - Sort by timestamp; drop the oldest 10% and newest 10% (
ceil(n/10)each side). Δt = max(t_90 − t_10, number_of_entries_between)seconds; one second per share is the floor, so timestamp games cannot push difficulty to zero.next_work = (cum_90 − cum_10) × TARGET_SHARE_TIME / Δt, floored atMIN_DIFFICULTY.- Encode as
share_bits(Bitcoin nBits); the share target is2^256 / next_work.
Timestamps come from the 80-byte header, which miners roll (ntime rolling) and which Bitcoin only constrains to be above the median of the last 11 blocks and under local time + 2 h. The 10% trim and the per-share floor absorb that; a share whose timestamp is more than 7 200 s from the Bitcoin block it builds on is invalid.
Consensus parameters. Everything in the first column goes into the consensus ID, so changing any of them creates a separate sharechain, as Monero's --mini does.
| Parameter | Main | Mini | Nano | Notes |
|---|---|---|---|---|
TARGET_SHARE_TIME |
15 s | 30 s | 60 s | Window of W_MAX shares = 9 h / 18 h / 36 h |
W_MAX |
2 160 | 2 160 | 2 160 | Share cap on the PPLNS window and on payees |
PPLNS_CAP |
2 × D | 2 × D | 2 × D | D from the nBits of the Bitcoin parent block |
UNCLE_DEPTH |
5 | 5 | 5 | Same-chain check uses the same depth; the BTCB2 chain keeps 3 |
MAX_UNCLES |
4 | 4 | 4 | Per share |
UNCLE_PENALTY |
20% | 10% | 10% | Lower on slow chains where races are rarer |
MIN_DIFFICULTY |
10^8 | 10^8 | 10^8 | Anti-spam floor only |
MAX_PAYEES |
2 160 | 2 160 | 2 160 | Equals W_MAX |
MIN_PAYOUT |
— | — | — | v2 ledger only |
BTC_STALE_BLOCKS |
2 | 2 | 2 | Competing chain must build within 2 Bitcoin blocks of the tip |
PREVHASH_GRACE |
30 s | 30 s | 30 s | Shares on the previous Bitcoin tip accepted this long after the new block |
TS_DEVIATION |
7 200 s | 7 200 s | 7 200 s | Share vs Bitcoin block timestamp |
COMMIT_TAG |
SHAR |
SHAR |
SHAR |
4-byte tag before the 32-byte hash |
PRUNE_DEPTH |
4 369 | 4 349 | 4 339 | 2(W_MAX−1) + 2·UNCLE_DEPTH + 600/T + 1 shares kept |
| Payout scripts | P2WPKH, P2WSH, P2TR | same | same | Legacy scripts rejected; keeps outputs ≤ 43 B |
| P2P port | 9333 | 9334 | 9335 | DATUM listener 7777 and SV2 pool 34254 locally |
Non-consensus knobs (per node): peer limits, DATUM and SV2 listeners on/off, how many prefilled transactions to attach, whether to run full template validation.
Three different things get lost, each with its own cause and its own knob. At the settings below a miner on the Bitcoin chain should see roughly 6% uncles, under 0.2% orphans and under 1% dead work; on BTCB2 about 1–2% uncles and under 0.1% orphans. The uncle penalty on 6% of shares is about 1% of income, so these configs minimise losses without changing what anyone earns by more than that.
What is lost, and why
| Loss | Meaning here | Cause | What converts it |
|---|---|---|---|
| Dead share | work that was unusable when it reached the node | the Bitcoin block changed under it beyond PREVHASH_GRACE, or it arrived more than UNCLE_DEPTH heights late; in original p2pool mostly miner-side latency (a dead rate above a few percent meant a misconfigured miner, bitcoin.it) and ASICs losing hashrate on 30-second job switches |
most late work is not dead in this design: a share on a parent 1–3 heights back is an uncle |
| Uncle | a valid share that lost a race | propagation time τ against target T: fraction ≈ 1 − e^(−τ/T) | paid at 80%; the includer gets 20% |
| Orphan | a share nobody referenced within UNCLE_DEPTH |
more than MAX_UNCLES siblings at one height; arrival later than UNCLE_DEPTH × T; a node that cannot reconstruct the share's transaction list in time, so it never validates it and never lists it (p2poolv2 treats a compact-share miss rate above 3% as a redesign trigger, bnoc.xyz) |
nothing; this is the loss to drive to zero |
Knobs
| Loss | Main lever | Secondary levers |
|---|---|---|
| Dead | gateway or JDC on the same host or LAN as the node; the node pushes new coinbase outputs within milliseconds of a tip change; PREVHASH_GRACE 30 s so work on the previous Bitcoin tip still counts |
modern ASICs switch jobs in under 100 ms; avoid 5 s targets that make older rigs churn |
| Uncle | lower τ: delta relay against the parent share, prefill transactions the peer is likely to lack, 8–16 outbound peers ranked by latency, clearnet peers beside Tor | longer T: 30 s cuts uncles about 3× versus 10 s |
| Orphan | depth and width: UNCLE_DEPTH 5 instead of 3 gives 75 s of inclusion slack at a 15 s target; MAX_UNCLES 4 absorbs bursts |
mempool consistency: every node must see the same transactions or shares stall on getsharetxn fetches; prefill anything outside the majority policy's mempool |
Loss-minimising configuration per chain (adopted as the base parameters above; the regtest latency phase confirms them):
| Parameter | Bitcoin chain | BTCB2 chain | Why |
|---|---|---|---|
TARGET_SHARE_TIME |
15 s | 30 s | 15 s halves Bitcoin uncles versus 10 s with little variance cost (9-hour window at W_MAX 2 160); BTCB2 is fixed by the 800 000 WU cap |
UNCLE_DEPTH |
5 | 3 | 75 s of inclusion slack where shares carry 1–4 MB of transactions; 90 s is already enough where blocks are ≤ 300 kB |
MAX_UNCLES |
4 | 4 | enough for any burst short of a network split |
PREVHASH_GRACE |
30 s | 30 s | turns most work caught by a new Bitcoin block into a valid share |
| Relay | delta encoding + prefill from v1.0, not v1.1 | short IDs suffice | the single largest uncle reducer on Bitcoin |
| Peers | 12 outbound, latency-ranked, 2 of them Tor | 8 outbound | fan-out over depth |
| Mempool policy | match the majority of the chain's miners and prefill the rest | all nodes are Knots | consistent mempools mean no stalled validation |
| Expected losses | uncles ~6%, orphans < 0.2%, dead < 1% (τ ≈ 1 s) | uncles 1–2%, orphans < 0.1%, dead < 1% (τ ≈ 0.3 s) | measured, not assumed: the regtest phase with injected latency confirms these |
The node exposes per-miner dead, uncle and orphan counters on its status line and API, as Monero P2Pool does, so every miner can see their own rates and tune their side (gateway placement, peers) without guessing.
Every share on the Bitcoin chain carries a lost_root: a 32-byte Merkle root of the lost shares the building node knows about, committed inside the existing SHAR output at zero extra cost and published in full through the node's API. It is opaque to consensus, so it never affects share validity. Optionally, a node can also surface the same root in a Runestone in the coinbase, which is the subject of the research below; putting the full lost-share data in a Runestone was examined and rejected.
What lost_root commits to
| Item | Rule |
|---|---|
| Orphans | share IDs of every share this node holds at heights since the last block the pool found, that is neither on its main chain nor listed as an uncle by it |
| Dead shares | the 80-byte headers of work this node's own miners submitted that met the share target but was unusable (Bitcoin tip changed beyond PREVHASH_GRACE, or later than UNCLE_DEPTH heights); only the node that received them can know these |
| Leaves | sha256d(0x01 ‖ share_id) for orphans, sha256d(0x02 ‖ header) for dead shares, sorted ascending; Bitcoin-style Merkle (odd leaf duplicated); empty list → 32 zero bytes |
| Scope | the building node's view at build time. Two honest nodes will produce different roots for the same height; that is expected and is why it is opaque |
| Publication | GET /lost/<share_id> returns the leaf list and proof material; the store keeps the list for every share the node built and for every share that became a Bitcoin block |
| Cost | none on chain beyond the 32 bytes already inside the record hashed into SHAR; ~40 bytes per share on the wire and in the store |
What the Runes protocol allows (from the ord specification, which is normative only insofar as it matches ord's code):
- A runestone is the first output whose script begins
OP_RETURN OP_13; one per transaction. All following data pushes (opcodes 0–78, soPUSHDATA2/4count) are concatenated into one payload. - The payload is a sequence of LEB128 varints, read as tag–value pairs. A varint longer than 18 bytes or over 128 bits makes the runestone a cenotaph.
- Unrecognised odd tags are ignored; unrecognised even tags make it a cenotaph. The spec adds that all unused tags are reserved and should not be used.
- Runes move only by etching (one-off premine to the etcher), minting (a fixed
Amountper mint transaction, under terms) and edicts (moving runes already held). There is no operation that issues an arbitrary amount to an arbitrary list of addresses.
Putting the full lost-share data in a Runestone (rejected). Each 32-byte share ID or 80-byte header splits into 16-byte chunks, each written as an unrecognised odd tag plus a u128 varint, about 20 bytes on the wire per 16 bytes of data (~25% overhead). Every orphan since the last pool block (headers + records, ~270 B each) and every dead share the finder knows of would be chunked this way. At the loss-minimising settings that is a few hundred bytes to a few kilobytes per found block. As the miner of the block, nothing but consensus limits the output size (relay policy never applies to a coinbase), and ord would decode it as a runestone with no etching, mint or edicts: a valid, empty runestone with ignored payload.
Why it does not work as consensus
| Problem | Detail |
|---|---|
| The data is not shared knowledge | Orphans are seen by whichever nodes happened to receive them; dead shares never leave the miner's own node. No other node can recompute the set, so the runestone cannot be a validation rule. The coinbase is rebuilt by every verifier from parent, uncles and ledger (section 9, step 12); a finder-specific output can only be allowed as an opaque, size-capped extra, never checked. |
| It pays nothing | Lost work cannot be compensated with runes: mints are fixed-amount per transaction and edicts need runes already owned. A "lost work" rune could be etched and premined only to one address, which means an operator, which the design has none of. |
| It costs the window | Coinbase bytes displace fee-paying transactions. A 2 kB runestone is ~8 000 WU, roughly 0.2% of a block; the loss is spread across every payee in the window for data only the finder chose. |
| Reserved-tag risk | Stuffing data into unassigned odd tags is explicitly discouraged; a future ord assignment could turn the block's runestone into a cenotaph. Harmless to the coinbase, but it would burn any runes that ever reached a coinbase input, and it leaves the record at ord's mercy. |
| Coinbase indexing | Whether ord indexes a runestone in a coinbase transaction identically to any other is not stated in the prose spec; it must be confirmed in ord's index_runes path before anything depends on it. |
Carrying lost_root in a Runestone (optional, off by default). The 32-byte root fits a runestone without bending any rule, so a node that wants its lost-work record visible in Runes explorers can add one coinbase output. This is the full design:
- Output. A second zero-value
OP_RETURNin the coinbase, placed after the payouts and before theSHARoutput:OP_RETURN OP_13 <push>. It is one of the two opaque extra outputs the coinbase shape rule allows (section 9, step 6), so verifiers carry it verbatim and never parse it. - Payload. Four LEB128 varints:
tag, hi, tag, lo, wherehiandloare the first and last 16 bytes oflost_rootread as big-endian u128.ordappends repeated tags into one field, so the field holds a two-element list that reassembles to the root. Each u128 is at most 19 LEB128 bytes. - Tag. 21321 (
0x5349, odd, LEB128C9 A6 01), chosen so it is odd, far from the assigned range (1–127), and recognisable. Odd unrecognised tags are ignored byord; an even tag would make a cenotaph. The spec reserves all unused tags, so ifordever assigns 21321 the node must switch tags (a config value, not consensus). - Size. Script ≤ 1 + 1 + 1 + 3 + 19 + 3 + 19 = 47 bytes, output 56 bytes, 224 weight units: 0.006% of a block, about 280 sat of displaced fees at 5 sat/vB.
- What
orddoes with it. Deciphers the firstOP_RETURN OP_13output of the coinbase, builds a runestone with no etching, mint or edicts and one ignored field, and, since a coinbase has no inputs carrying runes, changes no balances. The share's otherOP_RETURNoutputs (SHAR, witness commitment) do not begin withOP_13, so they are never mistaken for the runestone.ord's updater callsindex_runes(tx_index, …)for every transaction in the block, the coinbase at index 0 included, so the runestone is indexed like any other; this is to be confirmed on regtest withord --index-runesbefore the option ships. - Failure modes. None for the sharechain: the output is opaque. For
ord: a future assignment of the tag, or a malformed varint, turns it into a cenotaph, which in a coinbase burns nothing (no input runes) but would mark any etching in it unmintable, which is why the output carries no etching. - Node config.
lost_root_runestone = falseby default; when true, the node adds the output to every template it prescribes. Because the coinbase is rebuilt by the finder's gateway, the output is part of the prescribed set alongsideSHAR.
Related possibilities that were considered and set aside
| Idea | Finding |
|---|---|
| Whole lost-share list in the runestone | Works mechanically (chunked u128 values, ~25% overhead, kilobytes per block) but cannot be consensus, costs every payee block space for finder-only data, and leans on reserved tags. Rejected; the root plus the API gives the same auditability. |
| A "lost work" rune paid to the affected miners | Not expressible: mints are a fixed amount per transaction and edicts need runes already held; proportional issuance to a list of addresses would require a premined supply held by an operator. |
| A pool badge rune split across all payees | Expressible: a coinbase runestone with Mint and an edict whose output equals the output count divides a fixed mint equally across every non-OP_RETURN output, i.e. every payee. Harmless, equal rather than proportional, and it gives the pool a token it does not need. Not planned. |
Replacing SHAR with a runestone that carries both commitments |
Possible, but it ties the sharechain's own commitment format to ord's parsing rules for no gain. Rejected. |
A share is relayed in under 20 kB and stored in under 1 kB, because everything deterministic is recomputed by the receiver rather than sent. The two things a receiver cannot derive are the miner's proof (header, coinbase scriptSig, witness) and which transactions were in the template.
What goes on the wire. The share message from section 4, with two reductions:
- The coinbase is sent without its payout outputs. The receiver rebuilds them from the parent, uncles and (v2) ledger, inserts the
SHARand witness-commitment outputs, and must arrive at the sender'srewardtotal and merkle root. Payout outputs are 67 kB at full window; the rest of the coinbase is ~200 B. - The transaction list is sent as BIP152 short IDs (6 B each) in v1.0, and in v1.1 as a delta against the parent share:
base = parent_id, a list of removed indexes, and the added short IDs with their positions. Consecutive templates overlap almost entirely, so the delta is a few hundred bytes.
What is stored. Header (80 B), coinbase without outputs (~200 B), reward (8 B), the coinbase's merkle branch (≤ 13 × 32 B), and the sidechain record. That proves the coinbase sits in the header's merkle root without keeping any txids, so a node can verify history without transaction data, exactly as original p2pool's coinbase merkle link did. Transaction lists are kept only for the live tip region (last ~60 shares), where a share might still become a Bitcoin block or need fee checking.
Messages
| Message | Direction | Purpose |
|---|---|---|
version / verack |
both | consensus ID, software, listen port, best tip ID and cumulative work |
addr / getaddr |
both | peer exchange; onion and I2P addresses allowed |
share |
broadcast | a new share at depth < UNCLE_DEPTH from the sender's tip |
getshares [ids] / shares |
request | fetch specific shares (missing parent or uncle) |
getsharetxn id [indexes] / sharetxn |
request | fetch transactions the receiver could not match from its mempool (BIP152 getblocktxn semantics) |
getheaders from to / headers |
request | initial sync of stored-form shares, newest first, up to PRUNE_DEPTH |
ping / pong |
both | liveness |
Relay rules. A node relays a share only after it is verified and valid (section 9), and only if its depth below the node's tip is less than UNCLE_DEPTH; deeper shares are useless to everyone. A share with an unknown parent or uncle is queued, its missing ancestors requested, and dropped after 10 minutes if they never arrive. Seen-share IDs are cached for 10 minutes to stop re-relay loops.
Initial sync. A new node asks each peer for its tip, picks the highest cumulative work, pulls PRUNE_DEPTH stored-form shares, verifies proof of work and chain linkage for all of them, and verifies difficulty and payouts for the newest W_MAX; everything deeper is accepted on the strength of the work on top of it. That is Monero P2Pool's "deep block" rule and keeps sync under a minute. v2 adds a ledger snapshot message, checked against the tip's ledger_root.
Pruning. Shares deeper than PRUNE_DEPTH (≈ 4 400 shares, ≈ 18 h on main) are dropped, except that a node keeps every share its own miner produced and every share that became a Bitcoin block, for its own statistics. Stored-form shares are also cached to disk so a restart does not need a full resync.
Bandwidth, 8 peers, main chain at 15 s: ~1.3 kB/s upload with short IDs, ~0.3 kB/s with deltas, plus occasional sharetxn fetches. A Bitcoin block found by the pool is submitted locally by every node, not relayed as a full block over the sharechain network.
Checks run cheapest first, and a share is relayed only after the last one passes. Every rule marked invalid is a consensus rule: any node that accepts a share failing it is on a different chain.
- Consensus ID matches ours, else drop silently (another sharechain).
- Not already seen: the share ID (
sha256d(header)) is new; duplicates are dropped. - Anti-spam difficulty:
share_bits≥MIN_DIFFICULTYand at least half the difficulty of any share in our window, else ignore without penalty. - Proof of work:
sha256d(header)≤ target fromshare_bits, else invalid and ban the peer 10 min. If it also meets the header'snBits, reconstruct the full block (fetch missing transactions with priority) and callsubmitblockbefore continuing. - Bitcoin parent:
prevhashis our Bitcoin tip, or the tip's parent insidePREVHASH_GRACE; otherwise ignore without penalty (sender may lag). HeadernBitsequals Bitcoin's for that height; header time withinTS_DEVIATIONof the Bitcoin parent's time; version bits outside BIP 310's rolling range match the template's, else invalid. - Coinbase shape: first and only input is null; BIP34 height = Bitcoin parent height + 1; scriptSig ≤ 100 B; at most two extra zero-value
OP_RETURNoutputs of ≤ 83 bytes (carried verbatim from the sender, never interpreted); exactly oneSHARoutput; witness-commitment output last and well-formed, else invalid. - Record:
sidechainparses,sha256d(sidechain)equals theSHARhash,versionsupported,miner_scriptis P2WPKH, P2WSH or P2TR, uncle count ≤MAX_UNCLESand IDs strictly ascending (lost_rootis opaque: any 32 bytes), else invalid. - Parent share known and verified, else hold the share, request the parent, and resume; an invalid parent makes this share invalid.
side_height= parent height + 1. - Uncles: each known and verified (else hold and request, at most two outstanding per share), each valid, at depth 1 to `UNCLE_DEPTH`, not already mined in the last `UNCLE_DEPTH` heights, and on the same chain; any failure is invalid.
- Cumulative work equals
parent + own + Σ uncles, else invalid. - Difficulty: for a share within
W_MAXof our tip,share_bitsequals the retarget computed from its parent, else invalid. Deeper shares skip this and the next check (deep-block rule). - Payouts: recompute the PPLNS set from parent and uncles (v2: and the ledger), rebuild the coinbase outputs with the sender's
reward, compute the coinbase txid, and check the merkle root in the header against it and the transaction list (or the stored merkle branch), else invalid. - Transactions: resolve short IDs against the mempool, fetch the rest with
getsharetxn; if the Bitcoin parent is our tip, submit the full block throughgetblocktemplatein proposal mode and require a null result; otherwise requirereward ≤ subsidy + Σ known fees. Failure is invalid. A share whose transactions cannot be fetched within 60 s stays unverified and is never relayed or built on. - Ledger (v2): recompute the carry-forward ledger and compare with
ledger_root, else invalid. - Accept: insert into the DAG, update depths of ancestors, run tip selection (section 5), relay if depth <
UNCLE_DEPTH, and push a new template to local miners when the tip changed or a new uncle became available.
Steps 11–13 are the ones Monero P2Pool does not do beyond its own template rules; step 13 is the Bitcoin-specific guard against shares that could never be blocks, and it is the main reason every node needs its own Bitcoin node (Core or Knots) with a mempool.
The sharechain node speaks no Stratum v1. Miners reach it through a DATUM Gateway or a Stratum v2 job-declaration client, both of which build the block template from the miner's own Bitcoin node; the sharechain node only prescribes the coinbase outputs and validates what comes back. ASICs that speak only Stratum v1 still work, because the gateway (or an SV2 translator) handles them locally; that is their concern, not the node's.
A miner runs: a Bitcoin node (Core or Knots, pruned is fine, mempool required), the sharechain node, a DATUM Gateway or SV2 JDC, and the ASICs.
1. DATUM Gateway (v1.0). The node implements the pool side of the DATUM protocol on a local port, so a gateway on the same Umbrel points at it instead of a remote pool. The gateway builds the template from its own Bitcoin node and asks the "pool" what the coinbase must contain; the node answers with the current PPLNS output list, the SHAR commitment output and the extranonce layout, and receives the gateway's work. Every submission at or above the sharechain target becomes a share, validated like any other, inserted and broadcast; at or above network target the gateway submits the block itself and the node submits it too. The gateway's configured mining address becomes the miner_script of every share it finds, so one node can serve several gateways and each is paid to its own address. The message set must be checked against the current DATUM Gateway and DATUM Prime sources before implementation; the only thing required of the protocol is that the pool can prescribe arbitrary coinbase outputs, which it already does for pool payouts. If the gateway's own coinbase tag squeezes the 100-byte scriptSig, the tag is shortened, never the extranonce.
2. Stratum v2 job declaration (v1.1). The node runs the SV2 Pool and Job Declarator Server roles. A miner runs a Job Declarator Client with its own template provider (Bitcoin Core's SV2 template provider or sv2-tp); the JDC opens an extended mining channel, declares its own jobs, and receives the mandatory coinbase outputs in AllocateMiningJobToken.Success, exactly the slot SV2 reserves for pool payouts. The share's transaction list comes from the declared job. user_identity on the channel must be a bech32 address and becomes the share's miner_script; anything else falls back to the node's configured address. Shares that meet network target are submitted by the JDC directly and by the node.
Template refresh triggers. New Bitcoin block (ZMQ), new sharechain tip, a new candidate uncle at depth below `UNCLE_DEPTH`, and a 30 s timer. The node pushes a new coinbase-output set on the first three immediately; the gateway or JDC rebuilds its template and restarts work, since stale work would be an orphan or a stale share.
What a miner controls. Transaction selection and ordering (through their Bitcoin node's policy, Knots filters included), fee claiming, nVersion bits, timestamp rolling, which sharechain tier to join, and the payout address. What they do not control: coinbase payout outputs, which are fixed by consensus for the share they build on.
The attacks that matter are the ones a sharechain cannot outsource to Bitcoin: share identity, payout accounting, timestamps and spam. Each item below names the Monero incident or the classic pool attack it answers.
Counterfeit shares (Monero P2Pool, June 2026). A consensus bug let an attacker turn one legitimate share into thousands of copies that older nodes accepted as distinct, crowding honest miners out of the PPLNS window; it was patched in v4.16 and actively exploited against nodes that had not updated (coinidol, securitylab.ru). This design makes the share ID the Bitcoin block-header hash and commits every sidechain field under the merkle root through the SHAR output. Two shares with different IDs are different proofs of work by construction, and no field outside the header can be varied without changing the ID. Duplicate detection is a set of header hashes.
Block withholding. A miner can submit shares but discard any that meet the Bitcoin target, costing the pool a block while still being paid. No protocol stops it; PPLNS limits the gain to the attacker's own share of the window, and every node submits any network-target share it sees, so withholding requires never broadcasting the winning share at all, which also forfeits the share's own weight. This is the same exposure Monero P2Pool and every centralised pool carry.
Uncle farming. Mining deliberately on a stale parent to generate uncles earns 80% instead of 100% and hands 20% to a competitor; there is no profit in it. Listing the same uncle twice or an uncle from another branch is a consensus violation (section 5).
Timestamp games. The retarget trims 10% at each end and floors Δt at one second per share; competing chains must sit within 7 200 s of the Bitcoin blocks they build on and inside the 2/3–4/3 span rule. Rolling nTime forward on ASICs stays inside these bounds.
Spam and resource exhaustion. Shares below half the window's difficulty are dropped before PoW is checked; unknown-ancestor shares are queued for 10 minutes at most; at most two missing uncles are requested per share; peers that send invalid PoW or consensus-invalid shares are banned for 10 minutes; getsharetxn fetches are rate-limited per peer.
Fake Bitcoin chain. A competing sharechain mined on a private Bitcoin fork is rejected by the anchoring rule (at least half as many known Bitcoin blocks) and the 2-block staleness rule.
Template validity. A share whose transactions would make an invalid Bitcoin block is caught by the proposal-mode check when built on the tip and by the fee-sum check otherwise (section 9). The residual risk is a share on the previous tip with an invalid non-fee transaction; it is bounded by the 30 s grace window.
Upgrade discipline. As Monero P2Pool does, shares carry a software ID and version; when 20% of window work runs a newer version the node prints an upgrade warning. Consensus changes are new consensus IDs scheduled at a Bitcoin height, so old and new nodes never mix shares.
Recommended: a new Rust node, with the sidechain rules ported line-for-line from Monero P2Pool's side_chain.cpp and verified against shared test vectors before any networking exists. Rust gives rust-bitcoin for headers, scripts, merkle and coinbase work, Tokio for the P2P and listeners, and the Stratum Reference Implementation crates for the SV2 Pool and JDS roles. The DATUM pool side has no library and is written from the DATUM Gateway and DATUM Prime sources.
Alternatives considered
| Option | For | Against |
|---|---|---|
| Fork Monero P2Pool (C++) | battle-tested sidechain, P2P and pruning code | everything else is Monero and RandomX specific; no Bitcoin, SV2 or DATUM libraries in C++ worth reusing |
| Fork p2poolv2 (Rust, AGPL) | already has a share chain with uncles, compact-share relay work, TLA+ specs | different goals (share accounts, trading, top-N coinbase), Stratum v1 miner side, pre-MVP; licence binds the fork |
| Extend c2pool (your DOGE lane) | you know it | p2pool-era design without uncles; C++ |
| New Rust node | clean consensus module, modern libraries, one codebase for Umbrel apps | more code to write up front |
Modules (each a crate in one workspace): consensus (share, record, DAG, uncle rules, retarget, PPLNS, tip selection: pure functions, no I/O), store (stored-form shares, disk cache, pruning), p2p (messages, relay, sync, bans, Tor/I2P via SOCKS), bitcoin (RPC + ZMQ client, proposal-mode validation, submitblock), coinbase (output builder, SHAR commitment, extranonce layout), datum (pool-side listener), sv2 (Pool + JDS roles), api (JSON stats for a website, Prometheus metrics, the lost-share list behind each share's lost_root), cli.
(Diagram: one miner's machine — ASICs → DATUM Gateway or SV2 JDC → sharechain node, both the gateway and the node talking to the same Bitcoin node; the sharechain node relays shares to peers on port 9333. See the design doc on claude.ai for the drawing.)
The gateway or JDC builds templates from the Bitcoin node; the sharechain node validates shares against the same Bitcoin node and relays them to peers.
Phases
- Spec freeze and vectors (2–3 weeks). Turn sections 4–9 into a protocol document in the repo and a set of JSON test vectors: shares with uncles at every depth, invalid-uncle cases, retarget sequences with trimmed timestamps, PPLNS sets with cap overshoot, competing-chain decisions. Property tests on the
consensuscrate; a TLA+ model of tip selection is optional but p2poolv2 has one to start from. - v1.0 regtest (6–8 weeks).
consensus,store,p2p,bitcoin,coinbase,datum. Three to ten nodes on one regtest with a DATUM Gateway and a CPU miner on each; measure uncle and orphan rates under injected latency. - v1.0 signet / testnet4 (4 weeks). Public test chain, reproducible builds, the Umbrel app and the StartOS package (node + gateway in one entry, as your DATUM apps are packaged), native packages for Debian/Ubuntu, Fedora, Arch and Alpine plus a static tarball (see Packaging below), stats page. Load test against 10 000 simulated peers as p2poolv2 did with ns-3.
- v1.1 (4 weeks). SV2 Pool + JDS, delta relay, onion/I2P peer hints.
- Mainnet main chain. Launch with a fixed consensus ID and a Bitcoin activation height; mini and nano only when a pool-size case appears.
- v2 ledger. Design review first, then a new consensus ID; never a soft change to a live chain.
Packaging and distribution. One release pipeline produces every target from the same tagged commit, so a DIY node builder on Alpine runs the same bytes as an Umbrel user. All release artefacts are built reproducibly in a pinned container and signed; the checksums are published with each release as Monero P2Pool does.
| Target | Form | Build and install | Notes |
|---|---|---|---|
| Umbrel (umbrelOS) | community app store entry, Docker image | docker-compose.yml + umbrel-app.yml, node and DATUM Gateway as two services, Bitcoin node from the Umbrel Bitcoin app |
same packaging pattern as your DATUM apps |
| StartOS (Start9) | .s9pk package |
Start9 SDK, config wizard for payout address and tier, dependency on the StartOS Bitcoin Core (or Knots) service, Tor address exposed for P2P | Start9 reviews community packages before listing in their marketplace |
| Debian / Ubuntu | .deb for amd64 and arm64 |
cargo-deb, systemd unit, /etc/sharechain/config.toml; signed apt repository on the project site |
covers Raspberry Pi OS |
| Fedora | .rpm |
cargo-generate-rpm or a spec file, published through Fedora COPR |
COPR builds from the tag automatically |
| Arch Linux | AUR package | PKGBUILD building from the release tarball (sharechain) and a -bin variant |
user installs with an AUR helper |
| Alpine Linux | .apk |
APKBUILD against musl; the same musl build is the static tarball below |
smallest image, good for DIY ARM boards |
| Any Linux (DIY) | static tarball tar.gz, amd64 and arm64 |
x86_64-unknown-linux-musl and aarch64-unknown-linux-musl targets, one binary, no dependencies; install.sh writes a systemd unit |
same artefact the Docker image wraps |
| Docker / Podman | multi-arch image on GHCR | built from the static binary; this is what Umbrel and the Compose quick-start use |
Every package installs the same three things: the sharechain binary, a default config.toml (Bitcoin RPC/ZMQ endpoints, payout address, tier, DATUM and SV2 listeners) and a service unit. The DATUM Gateway is a separate package on the native targets (it already ships its own builds) and is bundled only in the Umbrel and StartOS entries, where one-click matters. CI runs the consensus test vectors on every target before publishing, so a musl build cannot drift from the glibc one.
Test plan. Consensus test vectors run in CI on every commit; fuzzing of the share parser, record parser and short-ID reconstruction; a network simulator that replays recorded share timings with configurable peer latency; signet soak of at least four weeks with deliberate chain splits, node restarts, and a Bitcoin reorg induced by two signet signers; a public bug bounty before mainnet.
A BTCB2 sharechain is the same design run as a second chain family in the same binary, and it is the one where the design pays off first: on a network of about 17 PH/s a 1 PH/s pool is 6% of hashrate, so the window reaches two expected blocks within hours and the lottery problem of the Bitcoin version largely disappears. What changes is the header, the proof of work, and the size parameters forced by the 800 000 weight-unit block cap.
The chain as it stands (figures dated; this chain changes weekly):
| Fact | Value | Source |
|---|---|---|
| Split / PoW change | split at 961 632 (8 Aug 2026), BLAKE2b from 961 640 (30 Aug 2026) | Bitcoin Takeover |
| Header | 164-byte "header v2", version bit 31 set: the classic 80 bytes plus nonce2, nonce3, 128-bit extranonce, time offset, tx count, flags (ASIC profile), XOR-mask count, 128-bit XOR key, height, 32-byte merge-mining field | sidestr-header, bip110-miner |
| Proof of work | tagged hash + two BLAKE2b rounds, four ASIC input profiles, Sia-style miner work; 128 grindable bits that never touch the merkle root | same |
| Retarget, reward | Bitcoin's 2 016-block retarget kept; 3.125 coins per block, same halvings | Bitcoin Takeover |
| Block cap | 800 000 weight units (~300 kB) and reduced-data rules (output scripts ≤ 34 B, OP_RETURN ≤ 83 B) until 1 Sep 2027 | Bitcoin Takeover |
| Coinbase maturity | 6 480 blocks (~45 days) for blocks 973 440–979 920, enforced by Knots 29.4.2 | Bitcoin Takeover, bip110-miner |
| Hashrate, pools | ~17 PH/s across 27 pools on 8 Sep 2026; one pool briefly above 50% | Bitcoin Takeover |
| Implied difficulty | ~2.4 × 10^9 at 17 PH/s (approximate) | computed |
| Node | Bitcoin Knots 29.4.2 or later; getblocktemplate must be called with the blake2b rule |
bip110-miner |
| DATUM | CONVOY DATUM Gateway v0.5.0beta supports BLAKE2b and BLAKE2b-Sia miners; a type-4 multi-output coinbaser is already in use on this chain | CONVOY releases, Maveth StartOS build |
| Packaging precedent | Knots BLAKE2b and DATUM Gateway already packaged for StartOS; your own DATUM BTCB2 Umbrel app | knots-blake2b-startos |
| Identity | addresses, network magic and ports unchanged from Bitcoin | Bitcoin Takeover |
What the second chain family changes in the design
| Design element | Bitcoin sharechain | BTCB2 sharechain |
|---|---|---|
| Share ID | sha256d(80-byte header) |
the Knots v2 block hash of the 164-byte header; same role, same duplicate rule |
| PoW check | sha256d ≤ target |
the Knots BLAKE2b pipeline (profile from flags), ported from Knots PR 359 and checked against src/test/data/block_header_v2.json |
| Share target | share_bits compact target |
identical; D still comes from the parent block's nBits |
| Timestamp | header time |
consensus time = time_on_wire + time_offset when flag bit 2 is set; retarget and TS_DEVIATION use that |
| Extra header fields | none | txcount must equal the real transaction count (bad-txnlist-size otherwise); height must match; XOR key is the miner's own and is simply carried |
| Commitment | SHAR OP_RETURN output |
same in v1; the 32-byte merge-mining field in the header is a future option once Knots pins its format, which would make the commitment verifiable from the header alone |
| Window and payees | W_MAX 2 160, 15 s, uncle depth 5 |
W_MAX 720, uncle depth 3, and TARGET_SHARE_TIME 30 s (6-hour window); 720 P2WPKH outputs ≈ 89 000 WU, 11% of the 800 000 cap |
| Payout scripts | P2WPKH, P2WSH, P2TR | same; all three satisfy the 34-byte reduced-data rule |
| Consensus ID, port | btc/main, 9333 |
btcb2/main, 9343; separate seeds; the two networks never mix |
| Template validation | proposal mode on Core or Knots | proposal mode on Knots with the blake2b rule; confirm it accepts v2 headers before relying on it |
Economics on BTCB2 (D ≈ 2.4 × 10^9, reward 3.125, W_MAX 720 at 30 s):
| Pool hashrate | Share of network | Pool block interval | Window | Payout per paid share |
|---|---|---|---|---|
| 100 TH/s | 0.6% | ~28 h | 6 h of shares, ~21% chance per share | ≥ 434 000 sat |
| 500 TH/s | 3% | ~5.7 h | 6 h of shares, ~1 payout per share | ≥ 434 000 sat |
| 1 PH/s | 6% | ~2.8 h | reaches 2 × D (5.6 h), ~2 payouts per share | ≥ 434 000 sat |
| 3 PH/s | 18% | ~56 min | 2 × D in under 2 h | larger |
A 2 TH/s BLAKE2b rig in a 1 PH/s pool finds a share about every 4 hours; in a 100 TH/s pool about every 25 minutes. Payouts are spendable only after the 45-day maturity window while that soft fork is in force, which the sharechain does not need to know about.
How to build it. One codebase, one ChainFamily abstraction, two chains:
ChainFamilytrait in theconsensuscrate: header length and parser, block hash, PoW check, consensus timestamp, template rules (segwitvssegwit + blake2b), weight cap, allowed payout scripts, default parameters. Two implementations:btc-sha256dandbtcb2-blake2b-v2. Everything else (DAG, uncles, PPLNS, retarget, tip selection, P2P, DATUM and SV2 listeners) is shared and tested once.- The BLAKE2b pipeline is ported from Knots (PR 359) with the Knots vectors; the Rust ports in
sidestr-header,jasonsopko/electrs(src/knots.rs) andbip110-minerare references, not dependencies. --chain btcb2selects the family, consensus ID, port and seeds. The share wire format gains only a longer header; the sidechain record is unchanged.- DATUM pool side: the multi-output coinbaser (type 4) that BLAKE2b pools already use is the prescription hook; verify the message shapes against CONVOY v0.5.0beta.
- Packaging: the BTCB2 Umbrel and StartOS entries pair the node with the Knots BLAKE2b build and the BLAKE2b-capable gateway, mirroring your existing DATUM BTCB2 app.
Risks specific to this chain. Consensus is a moving target (the maturity soft fork landed in a week, a "non-miner" reward-forfeiture phase is announced, the reduced-data rules expire in 2027), so the node must track Knots releases and the family's rules must be versioned; hashrate is small and rentable, so the 2-block staleness and anchoring rules matter more than on Bitcoin; the market is thin and the ticker contested. The upside is political: under the Knots definition, a miner who builds their own template is the only real miner, and a sharechain is the non-custodial form of exactly that, which should make it welcome where your BTCB2 pools already operate.
Recommendation. Launch BTCB2 first. It is a small, forgiving mainnet with real demand, your miners and gateway apps are already there, and every consensus component is identical to the Bitcoin chain, so the Bitcoin mainnet launch inherits months of live evidence. The Bitcoin signet soak can run in parallel.
- Name and repo. Decided: the project is named sharechains, in the
fossminingGitHub besidedogesharechain(fossmining/sharechains). Licence decided: GPL-3.0, as Monero P2Pool and DATUM Gateway, not MIT/Apache likerust-bitcoin? - Language: new Rust node (recommended) or a C++ fork of Monero P2Pool? Decided: Rust. The consensus port is the same either way; Rust gives rust-bitcoin and the SRI crates for SV2.
- Main-chain target: 10 s or 30 s? Decided: 15 s with `UNCLE_DEPTH` 5 (loss-minimising). For reference, 10 s gives finer accounting and ~10% uncles; 15 s with `UNCLE_DEPTH` 5 is the loss-minimising middle (see Loss minimisation); 30 s gives an 18-hour window and a
2 × Dwindow from ~18 EH/s instead of ~53 EH/s. - Uncle penalty 20% or 10% on main? Decided: 20% on main, 10% on mini and nano. Monero main uses 20%, nano 10%, p2poolv2 proposes 10%. Lower is kinder to badly connected miners, higher discourages latency games.
-
W_MAX2 160 or 3 000? Decided: 2 160. 3 000 payees would be 9.3% of a block in outputs for a 40% wider window. - Allow P2PKH payout scripts? Decided: no, to keep outputs ≤ 43 B; revisit only if a target miner needs it.
- DATUM first or SV2 first? Decided: DATUM in v1.0, SV2 in v1.1, because DATUM is your miners' stack.
- Ship v2 ledger at all? Decided: deferred to v2 after a design review; v1 accepts lottery variance below ~3.7% of network and points small pools at the mini and nano tiers.
- Website framing. Same honest line as the DOGE pool: solo-like variance while the pool is small, no operator, payouts in the coinbase, uncles mean no lost work.
- Which chain goes to mainnet first? Decided: BTCB2 first (small network, your miners already there, same consensus code); Bitcoin follows after its signet soak.
- BTCB2 window: 720 shares at 30 s, or 1 080 at 20 s? Decided: 720 at 30 s (11% of the 800 000 WU cap; 1 080 would be 17%).
- Commit in the header's merge-mining field on BTCB2 once Knots fixes its format? Saves the
OP_RETURNand makes the commitment header-only, at the cost of diverging from the Bitcoin chain's share format.
- SChernykh/p2pool, side_chain.cpp — uncle, PPLNS, retarget and tip-selection rules as implemented
- SChernykh/p2pool README — defaults, dynamic window note, mini/nano
- Moneropedia: P2Pool — uncle depth 3, 20% penalty, 2 160-block window
- p2poolv2 wiki: Uncle Blocks — 3 uncles, depth 3, 90% weight, chain-work rule
- p2poolv2 wiki home — compact-block shares, delta encoding, SV2 pages
- p2poolv2 on delving bitcoin — weak compact blocks, uncles, share trading
- Braidpool spec and Braidpool on sub-pools — DAG alternative, 4 MB share problem, sub-pools
- Monero P2Pool v4.16 vulnerability, coinidol and securitylab.ru — June 2026 counterfeit-share attack
- Bitcoin difficulty at block 969 696 — 132.72 T as of 3 October 2026
- FiberPool paper, arXiv 2501.15459 — P2Pool share-chain security below critical mass
- Bitcoin Takeover: Bitcoin BLAKE2b, the fork that fired the miners — fork heights, header summary, 800 000 WU cap, maturity rule, hashrate and pool count as of September 2026
- sidestr-header crate and bip110-miner — 164-byte header v2 layout, BLAKE2b pipeline, nonce space,
blake2btemplate rule - CONVOY DATUM Gateway v0.5.0beta — BLAKE2b and BLAKE2b-Sia miner support
- Maveth DATUM Gateway for StartOS pow_0.4.1_20 — type-4 multi-output coinbaser on the BLAKE2b chain
- knots-blake2b-startos and jasonsopko/electrs — Knots BLAKE2b packaging and header v2 handling
- Runes specification (ord docs) — runestone location, LEB128 payload, tag parity rules, etching/mint/edict semantics