MCPcopy Create free account
hub / github.com/SChernykh/p2pool

github.com/SChernykh/p2pool @v4.17.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.17.1 ↗ · + Follow
8,624 symbols 12,544 edges 129 files 721 documented · 8% updated 2d agov4.17.1 · 2026-06-28★ 1,4642 open issues

Browse by type

Functions 7,210 Types & classes 1,413 Endpoints 1
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Monero P2Pool

Decentralized pool for Monero mining.

Pool status and monitoring pages can be found at:

P2Pool
main https://p2pool.io/

https://p2pool.observer/| |mini|https://p2pool.io/mini/

https://mini.p2pool.observer/| |nano|https://p2pool.io/nano/

https://nano.p2pool.observer/|

These are 3rd-party pages. If they are down, it doesn't mean there is a problem with P2Pool itself - it keeps mining always thanks to its decentralized nature.

Build Status

C/C++ CI test-sync

CodeQL msvc-analysis cppcheck Coverity Scan Build Status clang-tidy

Contents

Pool mining vs Solo mining vs P2Pool mining

Here's the comparison table of the different ways of mining. While pool mining is the easiest to set up, it centralizes the Monero network and the pool admin gets full power over your hashrate and your unpaid funds. Solo mining is 100% independent and the best for the network. P2Pool mining has all the advantages of solo mining, but also makes regular payouts possible.

Pool type Payouts Fee Min. payout Centralized? Stability Control Setup
Centralized pool Regular 0-3% 0.001-0.01 XMR Yes Less stable due to pool server outages The pool admin controls your mined funds and what you mine, and can execute attacks against the network Only miner software is required
Solo Rare 0% 0.6 XMR or more No As stable as your Monero node 100% under your control Monero node + optional miner
P2Pool Regular 0% ~0.00027 XMR No Very stable: node failover and multiple Monero nodes are supported 100% under your control Monero node(s) + P2Pool node(s) + optional miner(s)

Features

  • Decentralized: no central server that can be shut down/blocked. P2Pool uses a separate blockchain to merge mine with Monero. Pool admin can't go rogue or be pressured to do an attack on the network because there is no pool admin!
  • Permissionless: there is no one to decide who can mine on the pool and who can't.
  • Trustless: there is no pool wallet, funds are never in custody. All pool blocks pay out to miners directly.
  • PPLNS payout scheme
  • 0% fee
  • 0 XMR payout fee
  • ~0.00027 XMR minimal payout
  • Fast block times, down to 1 second
  • Uncle blocks are supported to avoid orphans - all your shares will be accounted for!
  • Configurable PPLNS window size and block time
  • Advanced mempool picking algorithm: it creates blocks with better rewards than what monerod solo mining does
  • Password protected private pools
  • Highly reliable configurations are supported (multiple P2Pool nodes mining to the same wallet, each P2Pool node can use multiple Monero nodes and switch on the fly if an issue is detected)
  • Mining through TOR and I2P is fully supported

How payouts work in P2Pool

First you need to find a pool share. This share will stay in PPLNS window for up to 2160 pool blocks (6 hours, auto adjustable to balance payout sizes and frequency). The moment P2Pool finds a Monero block and you have at least 1 pool share in PPLNS window, you'll get a payout! Monero block reward is split between all miner wallets in PPLNS window. Each miner gets a part of the block reward proportional to the total difficulty of his/her shares in PPLNS window.

NOTE If P2Pool doesn't have enough hashrate to find Monero blocks faster than every 6 hours on average (~15 MH/s), not all your pool shares will result in a payout. Even if pool hashrate is higher, bad luck can sometimes result in a share going through PPLNS window without a payout. But in the long run it will be compensated by other shares receiving multiple payouts - your payouts will average out to what you'd get with regular pool mining.

Default P2Pool parameters

  • Block time: 10 seconds
  • PPLNS window: up to 2160 blocks (6 hours, auto adjustable to balance payout sizes and frequency)
  • Minimum payout = Monero block reward/2160, ~0.00027 XMR

Monero version support

  • The latest Monero network upgrade happened on August 13th, 2022 (block 2,688,888).
  • The latest P2Pool network upgrade happened on October 12th, 2024 at 20:00 UTC.

In order to continue mining on P2Pool, you must update both Monero and P2Pool software to the latest available versions as soon as they are released.

Monero protocol version Required Monero software version Required P2Pool version
v15, v16 (active after August 13th, 2022) v0.18.0.0 or newer, v0.18.4.6 or newer is recommended v4.0 or newer

How to mine on P2Pool

General Considerations

  • In order to mine on P2Pool, a synced Monero node using monerod v0.18.0.0 or newer is required. If you don't currently have one, you can download the official Monero binaries, start monerod on your PC and wait until it's fully synced. Advanced Monero node setup instructions are here.
  • It is highly recommended that you create a separate restricted user account (in your OS) for mining. While P2Pool has been battle-tested for a long time now, any software may have unknown bugs/vulnerabilities.
  • You can mine to a primary wallet address (the one starting with 4). If you want to mine to a subaddress, you will need to provide both the main address (starting with 4) and the subaddress (starting with 8) using --wallet and --subaddress command line parameters.
  • You can add the --mini or --nano parameter to your P2Pool command to connect to the respective sidechain.

    [!NOTE] You cannot use both --mini and --nano together

Using --mini will change the p2p port to 37888.

Using --nano will change the p2p port to 37890.

  • Check that ports 18080 (Monero p2p port) and 37889/37888/37890 (P2Pool default/mini/nano p2p port) are open in your firewall to ensure better connectivity. If you're mining from a computer behind NAT (like a router) you could consider forwarding the ports to your local machine.
  • You can connect multiple miners to the same P2Pool node. The more the better!
  • The steps below assume that you run everything on the same machine. If it's not the case, change 127.0.0.1 to appropriate IP addresses for your setup.
  • It is highly recommended to create a new mainnet wallet for P2Pool mining because wallet addresses are public on P2Pool.

Wallet software compatible with P2Pool payouts - Official Monero CLI and GUI v0.18.0.0 and newer - Monerujo v3.0.2 "Fluorine Fermi" and newer - Cake Wallet v4.4.5 and newer - Monero.com by Cake Wallet - Feather Wallet v2.1.0 and newer

GUI for P2Pool

  • Gupax project aims to provide an easy to use cross-platform GUI to configure and run P2Pool & XMRig.

Merge mining

Merge mining is available in P2Pool since the fork that happened on October 12th, 2024. Version 4.0 or newer is required to use it.

Blockchains that will support Merge mining RPC API: - Townforge supports merge mining (but Townforge is still in testnet phase) - DarkFi supports it in their testnet

p2pool.exe --wallet YOUR_MONERO_WALLET_ADDRESS --merge-mine IP:port YOUR_WALLET_ADDRESS_ON_ANOTHER_BLOCKCHAIN

Blockchains that support merge mining already: Tari

Tari uses their own gRPC API and requires a different command line:

./p2pool --wallet YOUR_MONERO_WALLET_ADDRESS --merge-mine tari://TARI_NODE_IP:18102 TARI_WALLET_ADDRESS

and on the Tari side

./minotari_node --grpc-enabled --mining-enabled

TARI_NODE_IP is 127.0.0.1 if you run both on the same machine (recommended).

Merge mining is available on Tari's mainnet: - Download Tari suite for your OS - Run Minotari node and wait until it synchronizes - Run Minotari console wallet to create a Tari wallet - Copy the "Tari Address one-sided" from the "Receive" tab of the wallet - Paste it into the P2Pool command line above - Everything is ready now to start merge mining Monero and Tari!

Note that Tari will be mined in solo mode (only full Tari blocks can be mined for now). This doesn't affect P2Pool payouts - they will stay the same.

Mining on GNU/Linux

  1. Download the latest P2Pool binaries here.
  2. Alternatively, grab the latest source code for P2Pool and build it.
  3. Download the latest XMRig (linux-static-x64) binary here.
  4. Prepare enough huge pages (each of monerod/P2Pool/XMRig needs them):
sudo sysctl vm.nr_hugepages=3072
  1. Check that ports 18080 (Monero p2p port) and 37889/37888/37890 (P2Pool default/mini/nano p2p port) are open in your local firewall to ensure better connectivity.
  2. Start monerod with the following command/options:
./monerod --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist

Note: The --zmq-pub option is required for P2Pool to work properly.

--out-peers 32 --in-peers 64 is needed to (1) have many connections to other nodes and (2) limit incoming connection count because it can grow uncontrollably and cause problems when it goes above 1000 (open files limit in Linux). If your network connection's upload bandwidth is less than 10 Mbit, use --out-peers 8 --in-peers 16 instead.

--add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 is needed to have guaranteed good working nodes in your connected peers.

--enforce-dns-checkpointing is needed to combat the selfish mining attempts by malicious actors

--enable-dns-blocklist is needed to ban known bad nodes

  1. Start P2Pool with the following command/options:
./p2pool --host 127.0.0.1 --wallet YOUR_WALLET_ADDRESS --mini
  1. Wait until the initial P2Pool sync is finished (shouldn't take more than 5-10 minutes).
  2. Start XMRig with the following command/options: ./xmrig -o 127.0.0.1:3333
  3. Note that you don't need to specify your wallet address for XMRig. Wallet addresses set in XMRig config will be ignored!
  4. To set a custom fixed difficulty for your miner (for example, 10000), instead start XMRig with the following options: ./xmrig -u x+10000 -o 127.0.0.1:3333
  5. XMRig should connect and start mining!

Additional Information: - For a more in-depth beginner-friendly walk-through with the option of using Docker, please see SethForPrivacy's guide at: https://sethforprivacy.com/guides/run-a-p2pool-node/ - You can check the p2pool.log for any warnings or errors using the following command:

grep -E 'WARNING|ERROR' p2pool.log
  • P2Pool has verbose logging by default, you can reduce it by using "loglevel N" command where N is between 0 and 6. Default loglevel is 3.
  • You can use logrotate with a config like this to control logfile growth: <path-to-logfile> { rotate 7 daily missingok delaycompress nocreate }

Mining on Windows

Note: Windows SmartScreen may block incoming connections by files that are "Downloaded from the Internet". You can allow 'p2pool.exe' and 'monerod.exe' by double-clicking them, clicking "More Info", then clicking "Run Anyway" and then closing them immediately so you can run them from the command line. Advanced users can use the PowerShell cmdlet Unblock-File to remove this flag.

  1. Download the latest P2Pool binaries here.
    • Alternatively, grab the latest source code for P2Pool and build it.
  2. Download the latest XMRig binary here.
  3. Expand the P2Pool binaries into an appropriate location (%USERPROFILE%/bin or C:/bin/ are good options)
  4. Expand XMRig binary into an appropriate location (the same folder as P2Pool is fine).
  5. Prepare huge pages to work properly (each of monerod/P2Pool/XMRig needs them):
  6. On Windows 10 or above, run XMRig at least once as Administrator (right-click, "Run As Administrator")
  7. On earlier versions of Windows, you'll need to run XMRig as Administrator at least once per

Core symbols most depended-on inside this repo

Shape

Method 6,737
Class 1,379
Function 473
Enum 34
Route 1

Languages

C++97%
TypeScript2%
C1%
Python1%

Modules by API surface

external/src/Tari/proto/gRPC/base_node.pb.h2,282 symbols
external/src/Tari/proto/gRPC/base_node.grpc.pb.h1,508 symbols
external/src/Tari/proto/gRPC/sidechain_types.pb.h855 symbols
external/src/Tari/proto/gRPC/types.pb.h627 symbols
external/src/Tari/proto/gRPC/base_node.pb.cc375 symbols
external/src/Tari/proto/gRPC/transaction.pb.h370 symbols
external/src/Tari/proto/gRPC/network.pb.h362 symbols
external/src/Tari/proto/gRPC/block.pb.h307 symbols
external/src/Tari/proto/gRPC/sidechain_types.pb.cc148 symbols
external/src/Tari/proto/gRPC/base_node.grpc.pb.cc138 symbols
external/src/Tari/proto/gRPC/types.pb.cc88 symbols
src/log.h84 symbols

For agents

$ claude mcp add p2pool \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page