Skip to content

About

decentralised bitcoin mining

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

sharechains

A decentralized, non-custodial mining pool for Bitcoin and for Bitcoin BLAKE2b (BTCB2): a sharechain with uncle blocks, no pool operator, and every payout written directly into the block's coinbase.

Status: skeleton. Parameters are frozen, the consensus crate has its types and hashing, everything else is a stub. See STATUS.md.

What it is

  • Each share is a complete block candidate for the parent chain whose coinbase already pays every miner in the PPLNS window. Whichever share meets the network target is the block; no one holds funds.
  • Shares that lose a propagation race become uncles and are paid at 80%, with 20% going to the share that includes them, so work is not lost.
  • Miners build their own templates from their own Bitcoin node and connect through a DATUM Gateway or a Stratum v2 job-declaration client; the node only prescribes coinbase outputs and validates what comes back.
  • One codebase, two chain families: Bitcoin (SHA256d, 80-byte header) and Bitcoin BLAKE2b (Knots 164-byte v2 header).

The full design is in docs/protocol.md. It is a port of Monero P2Pool's consensus rules to Bitcoin, with the changes Bitcoin forces (dust and 10-minute blocks, 1–4 MB shares, a coinbase OP_RETURN commitment, header-hash share IDs) spelled out section by section.

Chains and parameters

Chain Share time Window Uncle depth Penalty Port
btc-main 15 s 2 160 shares 5 20% 9333
btc-mini 30 s 2 160 shares 5 10% 9334
btc-nano 60 s 2 160 shares 5 10% 9335
btcb2-main 30 s 720 shares 3 20% 9343

Every parameter is hashed into a consensus ID; chains never mix shares.

Build

cargo build --release
./target/release/sharechains --chain btcb2-main

Rust 1.85 or newer. The skeleton has no external dependencies; see docs/dependencies.md for what each crate will take on.

Layout

crates/consensus   share format, DAG, uncles, retarget, PPLNS, tip selection (pure)
crates/store       stored-form shares, disk cache, pruning
crates/p2p         relay, sync, bans, delta encoding, prefill
crates/bitcoin     RPC + ZMQ, getblocktemplate, proposal validation, submitblock
crates/coinbase    payout outputs, SHAR commitment, witness commitment
crates/datum       pool side of the DATUM protocol
crates/sv2         Stratum v2 Pool + Job Declarator Server roles
crates/api         JSON stats, Prometheus metrics, lost-share lists
crates/cli         the `sharechains` binary
docs/              protocol.md (the spec), dependencies.md
tests/vectors/     consensus test vectors (CI gates)

Licence

GPL-3.0-only. See LICENSE.

About

decentralised bitcoin mining

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages