P2Pool

提供: tezos-wiki
移動先: 案内検索
P2Pool
Trading nameP2Pool
Founded2011年7月17日
thumb | 350px | right | P2Pool共有チェーンの可視化

P2Pool は分散型の[Bitcoin] マイニングプールであり、これはマイナーノードのピアツーピアネットワークを作成することによって機能します。

P2Poolは新しいブロックチェーンを作成し、難易度を調整して30秒ごとに新しいブロックが見つかるようにします。 P2Poolブロックチェーン(「共有チェーン」と呼ばれる)に入るブロックは、Bitcoinブロックチェーンに入るブロックと同じですが、難易度目標は低いです。ピアが見つけた新しい共有(P2Poolブロックチェーンの新しいブロック)をアナウンスすると、それは他のピアによって受信され、他のピアはこのブロックに共有を見つけた(そして発表した)すべての以前の鉱夫の支払いが含まれていることを確認します。それがP2Pool共有チェーンに組み込まれました。これは、一部のピアがBitcoinネットワークの難易度の目標を満たす難しさを持つブロックを見つけるまで続きます。このピアは、このブロックをBitcoinネットワークにアナウンスし、このブロックの株式を提出した鉱夫は、世代交代で最後に見つけた株式の数に比例して支払われます。 - 不明な著者</ blockquote>

分散型ペイアウトプーリングは、Bitcoinの分散化を悪化させる中央集権プールの問題を解決し、プールオペレータによる盗難を検出しにくいリスクを回避します。

マイナーは、マイナーと並んでローカルに実行できるP2Poolノードに接続するように設定されています。 P2Poolユーザーは、トランザクションとBitcoinブロックチェーンを個別に検証する目的を果たす完全なBitcoinノードを実行する必要があります。 P2Poolは、マージドマイニングといくつかの代替ブロックチェーンもサポートしています。

P2Poolノードは、Bitcoinのブロックチェーンに類似した一連の共有に作用します。各ノードは、以前の共有者の所有者とノード自体への支払いを含むブロックで動作します。これは、P2Poolの難易度に合致する場合にも共有につながります。

Bitcoinの地方分権を強化することの重要性のため、一部のBitcoinサポーターはP2Pool鉱夫に寄付を行い、平均報酬は予想報酬の100%を上回っています。 ただし、同じレベルの分散化を実現できる他のプール(BitPennyや[[Eligius]など)もあります。

概要[編集]

P2Poolの共有は、各共有が前の共有のハッシュを参照する「共有チェーン」を形成します。各共有には標準のBitcoinブロックヘッダー、世代トランザクション(この補助金の合計補助金、この共有の支払いスクリプト、ノンス、以前のシェアのハッシュ、および現在のシェアのターゲット)を計算するために使用されるP2Pool固有のデータと、その生成トランザクションをブロックヘッダのMerkleハッシュにリンクするMerkle分岐。

連鎖はBitcoinが10分ごとに1つのブロックを生成するように規制するのと同じように、30秒ごとに1つのシェアを生成し続けるという目標を継続的に規制しています。 これは、大規模な鉱夫が難易度を上げるオプションを持っているにも関わらず、P2Poolのより多くの人々が鉱山にいるほど株式を見つけることが難しくなる(分散が高まる)ことを意味し、P2Poolの最小難易度に対する鉱業の影響を軽減する。

Bitcoinと違って、ノードはチェーン全体を知りません - 代わりに、最後の8640株(過去3日間の価値)のみを保持します。攻撃者が秘密のチェーンで作業してから解放するのを防ぐために、既存のチェーンを無効にするために、チェーンは過去のポイントからどれだけの作業があるかによって判断されます。その時点から作業が完了したことを確認するために、ノードは共有が参照するBitcoinブロックを調べ、証明可能なタイムスタンプを確立します。 (共有がブロックを指している場合は、そのブロックが作成された後に間違いなく作成されました)。

支払いロジック[編集]

各シェアには、前回の「n」シェアに支払う世代トランザクションが含まれています。ここで、「n」は、総作業時間がブロックを解決するために必要な平均作業時間の3倍に相当するシェア数です。株式24時間)のいずれか小さい方。ペイアウトは、各シェアが解決するために費やした作業量に基づいて重み付けされます。これは、その時点でのp2poolの難易度に比例します。

ブロック報酬(現時点で12.5BTC)と取引手数料は、以下のルールに従って結合され配分されます。

ブロックとなるソリューションを共有しないようにするため、ブロックを解決したノードに0.5%の補助金が送られます。 (他の人を傷つけることを目的とした鉱夫は、ブロックを保留して、誰かが支払いを受けるのを防ぐことができます)。残りの99.5%は最近行われた作業に基づいて鉱夫に均等に配分されます。

シェアがブロックとして認定された場合、この世代トランザクションはBitcoinネットワークに公開され、各ノードに支払いを転送して有効になります。

ストール[編集]

P2Poolの陳腐では、シェアチェーンに入れることができないシェアを指します。共有チェーンはBitcoinチェーンよりも20倍高速であるため、多くの腐敗は一般的で予想されます。ただし、支払いは PPLNSであるため、あなたの失効率は他のノードと比べて相対的です。絶対レートはそうではありません。

P2Poolには、「DEAD ON ARRIVAL」シェアと孤立シェアの2種類の陳腐化が報告されています。デッドシェアは、あなたのローカルP2Poolに到着するまでには古すぎました。死亡率が非常に高いと、誤った構成の誤りがある可能性があります。孤児株は他の鉱山株が最初に受け入れられたため、残りのP2Poolネットワークによって拡張されなかった株式です。非常に高い孤立率は、ネットワーク接続の問題を示している可能性があります。 P2Poolコンソールの出力には、他のP2Poolの鉱夫と比較して相対的な失効率が[Own efficiency]列に表示されます。

2012-01-07 20:57:51.797420プールの汚れ:13%所有:13±2%効率:100±2%
</ pre>

最初にP2Poolを起動すると、効率は低くなり、この見積もりの誤差範囲は大きくなりますが、実行されると数値は正しい値に収束します。

あなたの効率が異常に低い場合は、ネットワーク接続が過負荷になっていないこと、鉱山労働者が長いポーリングをサポートしていること、過度の時間をかけて作業しないこと、ビットコインドに複数の接続があることを確認してください。

==プールへの参加==

Follow these steps to join the pool:

* Run Bitcoin with the RPC interface enabled: edit bitcoin.conf to include:
 rpcuser=USER
 rpcpassword=LONG_RANDOM_SECRET_VALUE
 server=1
**'''Replace LONG_RANDOM_SECRET_VALUE with something long and random like the output of smashing your keyboard for a bit like fju4M78yAj3ds39pak92raK'''. You don't need to be able to remember it. If your RPC port becomes exposed to the internet a thief could steal your bitcoin if they could guess it, or use a brute force attack in order to find it.
** Bitcoin 0.8.5 or later is required
** It's important that your Bitcoin client be fully synchronized before starting. It's also better if you have the Bitcoin port forwarded
* Download p2pool:
** Windows binary: See http://forum.bitcoin.org/index.php?topic=18313.0
** Source download: https://github.com/forrestv/p2pool/tags
** git: git clone git://github.com/forrestv/p2pool.git
* Run p2pool: (See below for additional options.)
** Windows py2exe: run_p2pool.exe
** Source: python run_p2pool.py
* Run a miner daemon with long polling connecting to 127.0.0.1 (or the IP of the host running p2pool if it isn't on the same computer as the miner) on port 9332 with any username and password
** bfgminer -O u:p -o http://127.0.0.1:9332/ --submit-stale
* Subscribe to the [https://groups.google.com/forum/#!forum/p2pool-notifications P2Pool notifications] mailing list for urgent pool status updates

Dependencies if running from source:
* Python 2.6 or higher (but not 3.x)
* python-argparse
* Twisted (Ubuntu package python-twisted)

=== Frequently Asked Questions ===

'''Q:''' "Why does my miner report so many longpoll events when mining on p2pool? - P4Man"<br />
'''A:''' "Once every ~30 seconds is normal. That is how often p2pool shares are generated (as opposed to ~10 min for bitcoin blocks) - cabin"

'''Q:''' "Do the 'orphan' and 'dead' shares in P2Pool's status display hurt me?"<br />
'''A:''' They shouldn't - It's normal for some fraction of everyone's shares to end up orphaned or dead. Because payouts are calculated by counting how many shares you have relative to others, everyone with normal configurations is equally "hurt" by this. However, if you have a large proportion of stales, your payout will be hurt. You can see how well you're doing by looking at P2Pool's "Efficiency" (ex: ''Efficiency: ~110.6% (40-111%)''). If 100% doesn't lie within the [http://en.wikipedia.org/wiki/Confidence_interval confidence interval] at the end, something is probably wrong (with 95% confidence).

'''Q:''' "What do I do if my efficiency is low?"<br />
'''A:''' Make sure the computers you're running P2Pool and the miner on have enough memory and CPU time. If you have a lot of dead shares or the "Local dead on arrival" number is higher than a few percent, that means that something is wrong with your miner. Check to make sure that it is one of the working versions in the ''Miners'' section on this page. Lower the intensity or raise the FPS of your miner. If you have a lot of orphan shares, something is wrong with P2Pool's P2P connection. Decrease the load on your internet connection or enable QoS (Quality of Service) on your router.

'''Q:''' What is PPLNS?<br />
'''A:''' Pay-Per-Last-N-Shares is a payout method that is completely resistant to pool hoppers.

'''Q:''' Why am I not getting very many shares?!<br />
'''A:''' The P2Pool difficulty is hundreds of times higher than on other pools. It can take time to get a share. P2Pool displays an estimate of how long you have to wait in the console output.

'''Q:''' Why does my miner say it has found a lot of shares but p2pool say I have only found a few?!<br />
'''A:''' The real P2Pool difficulty is hundreds of times higher than on normal pools, but p2pool essentially lies to your miner and tells it to work on relatively easy shares so that it submits shares every few seconds instead of every few hours.  P2Pool then ignores any submitted shares that don't match the real share difficulty.  By doing this, P2Pool can more accurately report your local hash rate and you can see if you are having problems with too many stale shares quickly

'''Q:''' Why am I getting so many rejects?<br />
'''A:''' You're using an incompatible miner. See the miners section here, increase your FPS on the miner, decrease the intensity, upgrade your miner, or try a different miner.

'''Q:''' What stops the pool operator or the block finder from stealing a block?<br />
'''A:''' A block solution is only worth anything because its hash matches Bitcoin's target. Altering anything within the block will change its hash and make it worthless. If you are concerned about the pool operator stealing a block, you should try to inspect the source code of each new version.

'''Q:''' Why does it say "Generated?" I want to spend my coins now!<br />
'''A:''' P2Pool includes payouts in generation transactions, which must mature (taking 120 blocks or 20 hours) before they can be spent. The reason for this is that a block could be orphaned, which would make its payout invalid and could reverse transactions.

'''Q:''' Do I get paid transaction fees?<br />
'''A:''' Yes. They are split among P2Pool miners.

'''Q:''' What are these payments I'm getting that aren't generated?<br />
'''A:''' These are subsidies that people who support the idea of P2Pool send to miners.

'''Q:''' Cool Subsidies sound like an awesome idea! How do I send some BTC to these awesome miners?<br />
'''A:''' See end of this page.

'''Q:''' Do I really need the WHOLE blockchain?<br />
'''A:''' Yes. Your node needs to be able to independently make decisions about what transactions to mine.

'''Q:''' How do merged mining payments work?<br />
'''A:''' Merged mining is handled entirely by namecoind, so you're solo mining and payouts will go into namecoind's wallet.


=== Miners ===

This is all for the latest p2pool version, as it includes several new workarounds. 

With all miners, using a HIGH FPS target (100?) or a LOW intensity (8 for bfgminer?) helps a lot with reducing stales.

* bfgminer, cgminer, and ufasoft work perfectly without any extra options.
* DiabloMiner works fine after commit 3b731b9.
* Phoenix works fine after commit a658ef2.
* Poclbm works fine after commit 5e994e7.

P2Pool uses higher difficulty shares than most centralized pools, so you'll see fewer shares reported. This is normal and doesn't reduce your payments.  It's also normal to see longpoll messages once per every ten seconds on average.

====Tips to configure bfgminer to reduce stale/doa:====
* "gpu-threads" : "1", (2 by default)
* "queue" : "0", (1 by default)

Because of fast longpooling in p2pool it is better not NOT fetch work ahead.

On non-dedicated machines intensity=3 allows normal usage of PC, set it to 7 or more to get full hashrate.

On most cards best is diablo and phatk kernel, looks like poclbm kernel have unstable rate.

=== Useful features ===

* If upgrading P2Pool or changing its configuration, you can start another instance of P2Pool in parallel with the first. It will start normally, but realize that the worker and P2P listening ports are busy and keep trying to bind to them in the background. Thus, you can do almost-completely-seamless upgrades of P2Pool.
* If you run multiple P2Pool nodes or have trusted friends that run P2Pool, you can use ''-n'' to establish a constant extra P2P connection to them.
* You can make P2Pool use a configuration file by running run_p2pool.py @FILENAME, with FILENAME being the path to a file containing the command-line arguments (newlines are ignored) Example:
<pre>
--net bitcoin
-n 1.2.3.4
  • Setting the username of your miner connecting to P2Pool to a Bitcoin address will make it mine to that address instead of the one requested from bitcoind or set by -a
  • Appending "/1000" to a miner's username will increase the difficulty of producing a P2Pool share to at most 1000. This is useful to large miners because doing this can make it easier for small miners while minimally impacting the large miners themselves. See recommended values.
    • Appending "+1" (for example) after that will make P2Pool always give your miners work with a difficulty of 1

Web interface[編集]

Lots of data and useful tools are available at http://127.0.0.1:9332/something:

  • /static/ - Lots of information from shares to graphs to payouts.
  • /rate
  • /users
  • /fee
  • /current_payouts
  • /patron_sendmany - Gives sendmany outputs for fair donations to P2Pool
  • /global_stats
  • /local_stats
  • /peer_addresses
  • /payout_addr
  • /recent_blocks
  • /uptime
  • /web/log - Some different stats collected over the last day

Option Reference[編集]

usage: run_p2pool.py [-h] [--version] [--net {bitcoin,litecoin}] [--testnet]
                     [--debug] [-a ADDRESS] [--datadir DATADIR]
                     [--logfile LOGFILE] [--merged MERGED_URLS]
                     [--give-author DONATION_PERCENTAGE] [--iocp]
                     [--irc-announce] [--no-bugreport] [--p2pool-port PORT]
                     [-n ADDR[:PORT]] [--disable-upnp] [--max-conns CONNS]
                     [-w PORT or ADDR:PORT] [-f FEE_PERCENTAGE]
                     [--bitcoind-address BITCOIND_ADDRESS]
                     [--bitcoind-rpc-port BITCOIND_RPC_PORT]
                     [--bitcoind-p2p-port BITCOIND_P2P_PORT]
                     [BITCOIND_RPCUSERPASS [BITCOIND_RPCUSERPASS ...]]

p2pool (version 0.11.1-8-ged9359d)

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --net {bitcoin,litecoin}
                        use specified network (default: bitcoin)
  --testnet             use the network's testnet
  --debug               enable debugging mode
  -a ADDRESS, --address ADDRESS
                        generate payouts to this address (default: <address
                        requested from bitcoind>)
  --datadir DATADIR     store data in this directory (default: <directory
                        run_p2pool.py is in>/data)
  --logfile LOGFILE     log to this file (default: data/<NET>/log)
  --merged MERGED_URLS  call getauxblock on this url to get work for merged
                        mining (example:
                        http://ncuser:ncpass@127.0.0.1:10332/)
  --give-author DONATION_PERCENTAGE
                        donate this percentage of work towards the development
                        of p2pool (default: 0.5)
  --iocp                use Windows IOCP API in order to avoid errors due to
                        large number of sockets being open
  --irc-announce        announce any blocks found on
                        irc://irc.freenode.net/#p2pool
  --no-bugreport        disable submitting caught exceptions to the author
  --disable-upnp        don't attempt to use UPnP to forward p2pool's P2P port
                        from the Internet to this computer

p2pool interface:
  --p2pool-port PORT    use port PORT to listen for connections (forward this
                        port from your router!) (default: bitcoin:9333,
                        litecoin:9338)
  -n ADDR[:PORT], --p2pool-node ADDR[:PORT]
                        connect to existing p2pool node at ADDR listening on
                        port PORT (defaults to default p2pool P2P port) in
                        addition to builtin addresses
  --max-conns CONNS     maximum incoming connections (default: 40)

worker interface:
  -w PORT or ADDR:PORT, --worker-port PORT or ADDR:PORT
                        listen on PORT on interface with ADDR for RPC
                        connections from miners (default: all interfaces,
                        bitcoin:9332, litecoin:9327)
  -f FEE_PERCENTAGE, --fee FEE_PERCENTAGE
                        charge workers mining to their own bitcoin address (by
                        setting their miner's username to a bitcoin address)
                        this percentage fee to mine on your p2pool instance.
                        Amount displayed at http://127.0.0.1:WORKER_PORT/fee
                        (default: 0)

bitcoind interface:
  --bitcoind-address BITCOIND_ADDRESS
                        connect to this address (default: 127.0.0.1)
  --bitcoind-rpc-port BITCOIND_RPC_PORT
                        connect to JSON-RPC interface at this port (default:
                        bitcoin:8332, litecoin:9332 <read from bitcoin.conf if
                        password not provided>)
  --bitcoind-p2p-port BITCOIND_P2P_PORT
                        connect to P2P interface at this port (default:
                        bitcoin:8333, litecoin:9333 <read from bitcoin.conf if
                        password not provided>)
  BITCOIND_RPCUSERPASS  bitcoind RPC interface username, then password, space-
                        separated (only one being provided will cause the
                        username to default to being empty, and none will
                        cause P2Pool to read them from bitcoin.conf)

Interoperability table[編集]

P2pool works fine with most hardware. This lists some of the hardware confirmed to work and any special configuration required.

  • ASICminer blade 10GH/s (Requires adding +1 to username or proxy)
  • Avalon 110nm 60-110 GH/s (All batches)
  • Avalon based 55nm 200 GH/s (specific makers?)
  • Avalon prototype 55nm 120GH/s (~ 20 exist)
  • Icarus FPGA
  • Bitfury strikes back H-card and M-card (instructions)
  • Bitmain Antminer S1 180GH/s (Requires 20131226 firmware.)
  • Bitmain Antminer S3 440GH/s
  • BFL SC Jalapeno, SC Single 30, 50, & 60 GH/s
  • Spondoolies Tech SP 10
  • Spondoolies Tech SP 30

(Various GPU and most FPGAs other than BFL single FPGAs work fine too)

This is a list of hardware with known issues that should not be used on p2pool.

  • Cointerra Terraminer IV (10-20% hash rate loss when mining on p2pool)
  • Btimain Antminer S2 (10-20% hash rate loss when mining on p2pool, the S1 & S3 both work well on p2pool)

Protocol description[編集]

P2Pool's protocol mirrors Bitcoin's P2P protocol in many ways. It uses the same framing (prefix, command, length, checksum, payload) and similar commands:

  • version - sent to establish a connection - contains (version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash)
  • setmode - sent to update the mode sent in the version message - contains (mode)
  • ping - sent to keep connection alive - contains ()
  • addrme - request that the receiving node send out an addr for the sending node - contains (port)
  • addrs - broadcast list of nodes' addresses - contains (addrs)
  • getaddrs - request that the receiving node send count addrs - contains (count)
  • getshares - request that the receiving node send the shares referenced by hashes and parents of their parents, stopping at any share referenced by stops - contains (hashes, parents, stops)
  • shares - broadcast message of the contents of shares - contains (shares)

History[編集]

This project was announced on June 17, 2011 by Forrest Voight[1].

The pool began testing against mainnet in mid-July, 2011. The pool was reviewed on a Bitcoin Miner post on July 26, 2011[2].

The software author's address for donations can be found in the signature section of his forum profile.

Donating to P2Pool miners[編集]

In order to encourage people to mine to P2Pool you can donate to the recent miners in proportion using a sendmany:

For example, a bash script to donate 10 btc is:

~/src/bitcoin/src/bitcoind sendmany "" "$(GET http://127.0.0.1:9332/patron_sendmany/10)"

You can replace "" with "accountname" if you want to pay from some specific bitcoind account, and you need to replace 127.0.0.1 with the address of your P2Pool node if you're not running one locally.

Note that the amount you donate will be allocated to recent miners in proportion to the amount of work they've done in the last 24 hours or so, but all the miner whose shares of the donated amount are less than 0.01 BTC will have their shares combined into a single amount which is awarded to one of them at random, with the chance of winning this 'lottery' weighted by the miner's recent amount of work done. You can change this 0.01 BTC threshold like this, for example, which says to pay 10 BTC, but to share it amongst more miners that the default, cutting off at 0.001 BTC instead of at 0.01 BTC.

~/src/bitcoin/src/bitcoind sendmany "" "$(GET http://127.0.0.1:9332/patron_sendmany/10/0.001)"

If you decide to donate you should announce it on the forums so that your donations provide the most incentive possible.

Sponsors[編集]

Thanks to:

See Also[編集]

External Links[編集]

References[編集]