Daemon-Technologies / Mining-Bot

26 stars 14 forks source link

STX Mining Pool Infrastructure #138

Open homiebtc opened 3 years ago

homiebtc commented 3 years ago

This pull request adds the infrastructure for pooled stx mining for the mining bot.

At a high level:

This pooling infrastructure assumes the following:

Formulation

For cycle :

Example:

Pool begins mining in cycle 10. Any BTC sent to the specified address during cycle 9 is counted as a contribution.

Before Cycle 10

For example:

Cycle 10

Cycle 11

Before Cycle 12

Cycle 12

Before Cycle 13

To test this for yourself, I have added two files: tests/testPoolBalances.json and tests/testPoolContributors.json. In these two files, change the first address key to one of the bitcoin addresses you have imported into the mining bot. Then add "poolContributors" as a key to your local storage with the value from tests/testPoolContributors.json, and add "poolBalances" as a key to your local storage with the value from tests/testPoolBalances.json. These values would be normally automatically generated through API calls, but you can manually change them for the sake of testing. Your local storage will look something like this image.

User flow

Thank you for reading and please let me know of any changes I should make; I am open to any and all feedback!

gzelda commented 3 years ago

Here are two obvious issues which will occur in Mining-Pool:

@danosaur98 Here are several suggestions for setting up the mining pool:

  1. The operator should stake something to be trustless
  2. The operator will have a default burning range like 200,000 sats to 700,000 sats. Not too tiny, not too big. The number depends on the current environment and users' commit value.
  3. Setting the depositing cycle not too big, one Pox Cycle is too long for a normal user. 30~50 blocks is good I think.
gzelda commented 3 years ago

Thanks a lot for the contribution to Mining-Bot. It's awesome! Welcome to discuss more detailed information before the PR merge. @danosaur98

SherLzp commented 3 years ago

I think this solution is not flexible enough, and all decisions are in the hands of Operator. According to the current profit distribution formulation, users cannot decide whether I will participate in a certain round of mining.