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. [s]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.[/s] 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%. [s]Setup: You must be running the Bitcoin client, and it must have its RPC interface enabled and be able to receive IP transactions. Open the Bitcoin data folder. See https://en.bitcoin.it/wiki/Data_directory Make a new file named bitcoin.conf (not bitcoin.conf.txt! You might have to go into Control Panel > Appearance and Personalization > Folder Options > View and uncheck 'Hide extensions for known file types'). Paste this into it: [tt] rpcuser=user rpcpassword=password server=1 allowreceivebyip=1 [/tt] You can change the user and password if you'd like. :P Download p2pool. Windows version: [b]Look at top of post for link to newest release![/b] Linux version: [b]Look at top of post for link to newest release![/b] Repository: svn://forre.st/p2pool Dependencies: Python 2.6, Twisted (The Windows version has these bundled thanks to py2exe.) [tt] # For Linux apt-get install python-twisted [/tt] Running it: [tt] # For Windows: main.exe user password # For Linux python main.py user password [/tt][/s] By default, it will listen on port 9332 for connections from mining workers. Connect them to http://127.0.0.1:9332/, using any username and password. Options of interest: -l: Minimize bandwidth. This will very slightly decrease efficiency, but will decrease bandwidth usage a lot. This flag makes peers send your node the hash of a share first, and then you can request the share, minimizing duplication. -w PORT: Listen for workers on a port other than 9332. Last, forward port 9333 through your firewall to the host running p2pool!