Smart Pools

codaycoday Member Posts: 3
Here's a rough proposal for a mining pool creation dApp, I'd love to get some feedback. I've started to write some contracts in solidity but I am currently exploring different possibilities for implementation.


"Smart Pools":
A mining pool creation contract(s) on ethereum that allows anybody to create their own (relatively trustless?) pool with unique characteristics that runs from its own contract. There is almost no barrier to entry for pool operators except a willingness to absorb some short term variance risk. Anybody wishing to run a pool can choose the "share" difficulty they want to benchmark, the fee they want to take from each reward, and the initial liquidity they will be providing for their pool.

Initial liquidity is needed because we will be using a "Pay Per Share" payout method. See a list of payout methods here: https://en.bitcoin.it/wiki/Comparison_of_mining_pools and an in depth analysis of their use in Bitcoin mining here: https://bitcoil.co.il/pool_analysis.pdf
"The Pay-per-Share (PPS) approach offers an instant, guaranteed payout for each share that is solved by a miner. Miners are paid out from the pools existing balance and can withdraw their payout immediately. This model allows for the least possible variance in payment for miners while also transferring much of the risk to the pool's operator. Each share costs exactly the expected value of each hash attempt: ShareReward = (BlockReward - %Fee) / Difficulty*
* The difficulty we divide by will need to take into account the current network difficulty and the specific pool's share difficulty, easily done with simple arithmetic*
Reward for share = [BlockReward - fee] / [Current network difficulty/ Share difficulty]

Pay Per Share has been around for a few years but it is rarely used by mining pools today because the pool operator has to absorb a significant amount of risk, so fees are generally much higher when it is used. The PPS payout method is preferred by miners because it provides them with the least variance between payouts since they get paid directly for each share they find.

Why use PPS on ethereum?
No need to "store" shares, takes memory and computational weight off the blockchain
No reason or way a miner can benefit from "Pool hopping" because shares are not saved
Reduced variance of payouts for miners, where eventually miners can practically choose their preferred payout variance given the pools operating and the difficulty of shares they reward.

By using a PPS payout method and allowing anyone to operate a pool with their own fee and difficulty, this will create a network of distributed pools suitable to different strength miners. Long term operators are statistically guaranteed to profit while short term they absorb variance risk. Operators will have the ability to add and withdraw to their pool's liquidity at any time. The pool's funds long term should be growing (~%Fee) so the operator can take profits out, but if the pool has an unlucky streak the operator can add more funds to stop the pool from going bankrupt. If a pool's funds are diminished miners will be able to see this through the contract's public coinbase and can leave or change pools.

Calculations for reserves from https://bitcoil.co.il/pool_analysis.pdf Appendix C:
"If the operator starts with a reserve of R, the probability that the pool will ever go bankrupt is δ = aR/( √pB) ≈ exp [ (−2fR√p) / (√pB) ] = exp [ (−2fR)/ B] . Conversely, to maintain a bankruptcy probability of at most δ, the pool should keep a reserve of at least R = Bln(1/δ) / ( 2f ) . For example, if B = 50 BTC, δ = 1/1000 and f = 0.05 (5% fee), the reserve should be R = [50 BTC · ln 1000]/[ 2 · 0.05] ≈ 3454 BTC. If the operator tries to make do with f = 0.01 but only has a reserve of 500 BTC, then δ = exp [ (−2 · 0.01 · 500 BTC) / (50 BTC) ] ≈ 0.819 so he has 81.9% chance of eventual bankruptcy."
However this "chance of eventual bankruptcy" only considers the original pool reserve, but since operators will have the ability to add to their pool funds when on an unlucky streak the risk of a pool going bankrupt is very much up to the operator (unless he has no external liquid funds whatsoever).

The main contract will be what operators send their initial transaction to. This contract will create a different contract (with a unique coinbase to mine to) for each launched pool, that has the payout algorithm and ways to verify partial proof of work or shares (possibly with help from pool operator). The main contract should keep track of currently running pools, and store basic info on them like coinbase address, operator fee, share difficulty, # of miners, pool funds, and estimated time between payouts for a certain hash rate. Miners can examine this list and choose their preferred pool when deciding which to join.

TO DO: Consider share 'verification'
Cannot be done completely on blockchain, likely will rely on the pool operator to do some verification of partial proof of work for shares and that the miners are mining to the contract coinbase. If we cannot implement this transparently we could use a reputation system for pools and their operators, ideally integrated with the wallet software.

Possible Improvements:
An operator could implement an additional % fee to be taken from each solved block and given directly back to the pool miner who solved the block. This will disincentivize any greedy miners from withholding block solutions. (P2Pool already does this with .5% of a solved block reward returned).
"Streamlined PPS investments" - Having "investors" contribute capital to a pool to share the risk and rewards of the variable payouts. Could potentially get overcomplicated, but could successfully allow users without enough funds to create their own pool to partially contribute and benefit from a pool's collected fees. Chapter 7.9 in https://bitcoil.co.il/pool_analysis.pdf explains this well.

Long term possibilities:
"Pools of pools" where individual pools can join together to further reduce payout variance
Multi-PPS pools where users can mine in multiple pools at the same time, allowing smaller pools to have a better chance of success by reducing variance. See https://bitcointalk.org/index.php?topic=281180.0 http://bitcoin.stackexchange.com/questions/34286/what-is-multi-pps-pay-per-share
"Common interest" pools, where a portion of the funds can go to a kick starter fundraiser, a charity, a corporation, a political campaign, or almost any other individual or organization.
Integration with wallet software so that even the least knowledgable users can easily join a pool and have a consistent stream of income to their wallet.
Universal basic income??
Sign In or Register to comment.