Mission: Replace pool operators with miners
P2Poolv2 is a peer-to-peer Bitcoin mining pool where miners coordinate directly and verify their rewards without centralized operators.
-
Share chain with uncles - all your work is accounted for.
-
Pay large miners in coinbase - non custodial solution for top N miners.
-
Support transactions - pay all miners with atomic swaps by market makers.
-
Market makers buy shares from smaller miners - earning virgin coins.
We chat on Matrix.
We use github wiki for most design documents and tools for developers.
We are tracking progress using our Github project: Reboot P2Pool.
See detailed Developer Setup Notes on the wiki.
To run your local p2pool node you need to run a bitcoin node and then a p2poolv2 node configured to talk to your bitcoind node to fetch blocktemplates and submit blocks.
For signet we provide a docker/bitcoin-signet.conf that you can use
as your bitcoin.conf. We also provide a docker compose service that
will start signet bitcoind with enough blocks to start mining. If you
just want to run a signet network run bitcoin as
cd docker
docker compose up -d bitcoindThe important details you want from your bitcoin.conf are:
-
rpcuser
-
rpcpassword
Another important detail is to set your bitcoin config file to allow for 500 coinbase outputs. This is required before we ship our atomic swap based payout mechanism. With space to accomodate 500 miners, we can start running P2Poolv2 with direct payments from coinbase.
For 500 P2WPKH outputs use blockmaxweight to 3930000.
blockmaxweight=3930000Finally, you need to mine 32 blocks before you can run p2poolv2 node to talk to bitcoind. This is because BIP34 requires coinbase to include height using varint format, which conflicts with how these first 32 heights are encoded. The bitcoind docker service takes care of this by bootstrapping the signet with first 32 blocks.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/p2poolv2/p2poolv2/releases/latest/download/p2poolv2_node-installer.sh | sh
curl --proto '=https' --tlsv1.2 -LsSf -o config.toml https://github.com/p2poolv2/p2poolv2/releases/latest/download/config.sample.tomlThe above will install p2poolv2 and p2poolv2_cli in your PATH and download a config.toml for you to edit as required.
The location where the binaries are installed will be echoed by the installer.
p2poolv2 --help
p2poolv2_cli --help-
Edit the
config.tomlas required.-
At the very least you need to provide the bitcoind rpc details under the
[bitcoinrpc]section.
-
-
Run P2Poolv2
p2poolv2 config.toml -
Point your miners to
<yourhost>:<your stratum port in config.toml>
P2Poolv2 includes a web dashboard for monitoring your node. The static
assets are distributed as a separate dashboard.tar.gz archive.
-
Download and extract the dashboard assets:
curl --proto '=https' --tlsv1.2 -LsSf -o dashboard.tar.gz https://github.com/p2poolv2/p2poolv2/releases/latest/download/dashboard.tar.gz tar xzf dashboard.tar.gz -
Set the
P2POOL_STATIC_DIRenvironment variable to point to the extracted directory:export P2POOL_STATIC_DIR=/path/to/static -
Access the dashboard at
http://<your api hostname>:<your api port>/dashboard
If P2POOL_STATIC_DIR is not set, the dashboard is not available when
running from a release binary.
To setup as a systemd service, use the systemd service file provided p2poolv2@.service. You can edit that service file to require your bitcoind service, if you use one.
-
Update the service file to point to where you installed your binaries. Use
which p2poolv2to find where it is installed. -
Setup
p2poolv2user/group. -
/var/lib/p2poolv2,/var/log/p2poolv2,/etc/p2poolv2/directories with permissions for p2poolv2 user.
The above service file can be used for different networks, like so:
sudo systemctl daemon-reload
sudo systemctl enable --now p2poolv2@testnet4
sudo systemctl enable --now p2poolv2@mainnet-
Install rust from rustup
-
Install just
-
Build P2Poolv2
-
Get latest source
git clone git@github.com:p2poolv2/p2poolv2.git -
Build
just build-release
-
We also provide dockerfiles and a docker compose to run the node as a docker service.
Our recommended way to run a node is using the provided installer and using the systemd service.
If you still want to run a node using docker services, see docker/README.adoc for details.
Both the API and CLI crates provide detailed documentation on how to use them in their individual crates.