{"action":"opened","issue":{"url":"https://api.github.com/repos/NebulousLabs/Sia/issues/638","labels_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/638/labels{/name}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/638/comments","events_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/638/events","html_url":"https://github.com/NebulousLabs/Sia/issues/638","id":91327348,"number":638,"title":"Mining Pool Server Module","user":{"login":"DavidVorick","id":2316841,"avatar_url":"https://avatars.githubusercontent.com/u/2316841?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidVorick","html_url":"https://github.com/DavidVorick","followers_url":"https://api.github.com/users/DavidVorick/followers","following_url":"https://api.github.com/users/DavidVorick/following{/other_user}","gists_url":"https://api.github.com/users/DavidVorick/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidVorick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidVorick/subscriptions","organizations_url":"https://api.github.com/users/DavidVorick/orgs","repos_url":"https://api.github.com/users/DavidVorick/repos","events_url":"https://api.github.com/users/DavidVorick/events{/privacy}","received_events_url":"https://api.github.com/users/DavidVorick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/NebulousLabs/Sia/milestones/6","html_url":"https://github.com/NebulousLabs/Sia/milestones/0.4.0%20Quality","labels_url":"https://api.github.com/repos/NebulousLabs/Sia/milestones/6/labels","id":1182574,"number":6,"title":"0.4.0 Quality","description":"Features for the 0.4.0 milestone are split into two separate categories. The first category is the 'critical' category, which is a set of issues that are considered mandatory given our product and long term goals. Without resolving these, the project will either die or doom itself  to being nothing speical.\r\n\r\nThe second category is 'Quality', which are issues that relate to the overall quality of the currency, project, and experience. These are not to be confused as 'nice to have' or 'luxury' - having a quality currency and user experience is practically mandatory. But as we move forward for the next few weeks, I wanted to distinguish between the live-or-die issues vs. the 'reputation-and-respect' issues. Quality is still incredibly important.","creator":{"login":"DavidVorick","id":2316841,"avatar_url":"https://avatars.githubusercontent.com/u/2316841?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidVorick","html_url":"https://github.com/DavidVorick","followers_url":"https://api.github.com/users/DavidVorick/followers","following_url":"https://api.github.com/users/DavidVorick/following{/other_user}","gists_url":"https://api.github.com/users/DavidVorick/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidVorick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidVorick/subscriptions","organizations_url":"https://api.github.com/users/DavidVorick/orgs","repos_url":"https://api.github.com/users/DavidVorick/repos","events_url":"https://api.github.com/users/DavidVorick/events{/privacy}","received_events_url":"https://api.github.com/users/DavidVorick/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":0,"state":"open","created_at":"2015-06-26T13:02:56Z","updated_at":"2015-06-26T18:26:52Z","due_on":"2015-07-30T04:00:00Z","closed_at":null},"comments":0,"created_at":"2015-06-26T18:26:52Z","updated_at":"2015-06-26T18:26:52Z","closed_at":null,"body":"I realized that, thanks to the way we do payments, it should be really easy to do a mining pool.\r\n\r\n1. Server and miner form a connection, like gateway peers form connections\r\n2. Payment channel created between server and miner, so that the server can pay the miner.\r\n3. A target % is set for the miner. (say 1/256).  Every time the miner finds a block that meets the reduced target (which must be agreed upon ahead of time), the miner tells the server and the miner gets paid.\r\n4. Block is only accepted if the server recognizes the block as extending the longest chain, and also recognizes the block as a valid block. 95% of the miner payout in the block must go to an address belonging to the server. The remaining 5% can go to the miner.\r\n5. Server takes ~5% cut when paying for a partial block. (90% * $targetFraction = reward for block that satisfies $targetFraction difficulty) (the other 5% is in the miner payout and is a bit more of a lottery for the miner, but is necessary to prevent block withholding attacks, where miners just never share the blocks that they find, which would drain the pool of money).\r\n\r\nThe miner is free to choose which transactions, and they agree together to only build on the largest known fork, have disincentives not to be on the largest fork together, makes various mining-pool attacks much more difficult.\r\n\r\n:)"}}