Script and UTXO Txs

Miners on the original P2Pool were paid in the coinbase. Coinbase size limits, imposed by some firmware and by block space economics, kept the pool from growing to more miners and so from lowering their variance further.

P2Poolv2 still pays larger miners directly from the bitcoin coinbase. Smaller miners get paid by selling their shares to other miners or to market makers, who then earn the shares' rewards in the bitcoin coinbase. The Sell Shares for Payouts section describes payouts through share trading.

To support share trading, and other payout mechanisms in the future, the sharechain has a UTXO- and Script-based transaction system.

Transactions and blocks follow bitcoin’s validation rules, with these differences:

  1. Coinbase maturity is 6,048 shares rather than 100 blocks; see PPLNS Share Accounting.

  2. A shareblock’s transactions total at most 200 KB, and a shareblock holds at most 100 transactions.

  3. The coinbase pays a fixed one share unit, with no block subsidy. Fees go to the miner who creates the share.

  4. Outputs expire by root height; see Spending UTXOs.

  5. Share outputs use the P2Poolv2 address type; see Addresses in Sharechain.

Share Coinbase and Its Value

Each shareblock has a coinbase that pays the miner who found it. The share commitment in the bitcoin coinbase’s scriptSig commits to this payout; see Share Commitments.

The coinbase pays one share unit, which equals 108 of the sharechain’s smallest unit of account.

Addresses in Sharechain

The sharechain uses its own address type so that its addresses never clash with bitcoin addresses. The human-readable part of a P2Poolv2 address depends on the bitcoin network:

Network Human-readable part

Mainnet

p2pool

Testnet4

tp2pool

Signet

sp2pool

Regtest

rp2pool

Handling Fees

A transaction that spends a UTXO pays a fee set by the fee market. The fee goes only to the miner who mines the share, not to all miners. Each fee output retains root height as per the splitting UTXOs rules. Rules for merging and splitting UTXOs apply to fee outputs too. The share’s miner earns rewards for fee outputs until the tracked root height falls out of the PPLNS window.

Crates Used

rust-bitcoin builds transactions, and bitcoinconsensus validates them. Block validation checks every transaction’s validity, double spends, and the other rules above.

P2Poolv2 will switch to rust-miniscript for building and verifying sharechain scripts. The rust-miniscript version will be part of sharechain consensus, so upgrading the crate will require a consensus version change.

Share Coinbase Value Lifecycle

A miner creates sharechain value by mining a share: the share’s coinbase output holds that value. The miner can keep the output and collect its rewards from bitcoin coinbases, provided the miner has enough hashrate to earn a slot in the bitcoin coinbase. The miner can instead transfer the output to another miner, who then collects the future bitcoin rewards for the work the share represents. Each transfer pays a transaction fee to the miner who found the shareblock, and that miner collects the bitcoin reward for the fee in future bitcoin coinbases. Transfers can continue until the root coinbase that created the value falls out of the PPLNS window.

share lifecycle
Figure 1. A share’s coinbase output from mining to expiry

Back to top

Copyright © 2024-2026 P2Poolv2 Developers. Distributed under the MIT or Apache-2.0 license.

This site uses Just the Docs, a documentation theme for Jekyll.