2011年6月25日星期六

p2pool - Decentralized, Absolutely DoS-Proof, Pool Hopping-Proof Pool

P2Pool is a decentralized pool that works by creating a P2P network of miner nodes. These nodes work on a chain of shares similar to Bitcoin's blockchain. Each node works on a block that includes payouts to the previous shares' owners and the node itself. There is no central point of failure, making it DoS resistant.

P2Pool started as a project of mine with the intent of being completely decentralized, but I realized that some small centralization is required in order to prevent pool hopping without discarding coins.

When a node generates a hash that matches the share-difficulty level, it shares it with all the other nodes in the P2P network. When it generates a hash that matches the block-difficulty level, it pushes it to its local Bitcoin client, and also forwards it to the other nodes, which each push it to their client, maximizing the chance that the block will be accepted.

The difficulty for shares is a fixed fraction of the block difficulty - currently 1/600. This means that there will be an average of 600 attempts in every sharechain before a block is found. In order for the pool to be pool hopping-proof, direct payouts are paid only to the last 600 shares before and including the share that solved the block. This makes the expected value of joining at any time constant, because the probability that you get a payout is equal to the chance that a block is found in the next 600 shares, which is always the same because the hashing process is memoryless.

If a block is found in the first 599 shares, the extra is paid to me. On average, 36% of the subsidy of a block will go to me as a result of this. This is a trade-off between minimizing the payment to some central entity and having lower variance in payouts. If the proportion going to me were reduced by half, variance would double. I believe that this is an acceptable compromise.

If you find a share in the sharechain, there is about a 64% chance that you will get a payout (eg. that a block will be found in the next 599 shares). Using my portion of the payouts (once they mature), as many of the shares that didn't receive a direct payout as possible will be paid, starting from the latest ones in each chain. This process can be done at any time because shares will be recorded (It's an option in the p2pool client) and traced backwards from generated blocks to the first shares that need to be paid.

The program can include transactions besides the generation transaction in generated blocks if your Bitcoin client is patched to have the RPC command 'getrawtransaction'. If you'd like, you can build it yourself; otherwise, it might be pulled into some future release.

The process is completely open – anybody can record shares and examine them to make sure that I am keeping exactly what I say. In addition, anybody can gather statistics such as the pool's hashrate. On that note, I plan to take no fee for myself at the start, but later increase it to .5%.

Orignal From: p2pool - Decentralized, Absolutely DoS-Proof, Pool Hopping-Proof Pool

没有评论:

发表评论