Skip to content

Instantly share code, notes, and snippets.

@bladedoyle
Last active October 10, 2019 14:41
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bladedoyle/421d3f508945bdf59c93d515ee420fc9 to your computer and use it in GitHub Desktop.
Save bladedoyle/421d3f508945bdf59c93d515ee420fc9 to your computer and use it in GitHub Desktop.
grin share value notes
Pool finds block 4300 - https://grinscan.net/block/4300
Secondary scale = 529
scale = factor = Scaling difficulty =
for primary pow (cuckatooN solution) where N>=31 = 2^(1+EDGEBITS-24)*N
for secondary pow - (cuckatoo29 solution) = variable, retargeted every block, stored as header field "secondary_scaling"
Example: Three workers contributed shares:
Worker A submitted 50 cuckaroo29 shares
Worker B submitted 25 cuckaroo29 shares and
10 cuckatoo31 shares
Worker C submitted 5 cuckatoo32 shares
How much is eash share type worth compared with the others?
A cuckaroo29 share has scale:
max(share target, solution scale)
= max(29, 529) (where 529 is the blocks "secondary_scaling")
= 529
A cuckatoo31 share has scale:
2^(N-23)*N
= 2^(31-23)*31
= 2^8 * 31
= 7936
A cuckatoo32 share has scale:
2^(N-23)*N
= 2^(32-23)*32
= 2^9 * 32
= 16384
so, total share value submitted is:
cuckaroo29 shares: 529 * 75 = 39675
+ cuckatoo31 shares: 7936 * 10 = 79360
+ cuckatoo32 shares: 16384 * 5 = 81920
= 200955
The block reward is 60 grin (assume no tx fees)
The pool will pay Worker A:
((50 * 529) / 200955) * 60
= (26450 / 200955) * 60
= 0.131621507 * 60
= 7.89729042 Grin
The pool will pay Worker B:
(((25 * 529) + (10 * 7936)) / 200955) * 60
= 0.460725038 * 60
= 27.64350228 Grin
The pool will pay Worker C:
((5 * 16384) / 200955) * 60
= 0.407653455 *60
= 24.459207285 Grin
@lebed2045
Copy link

that's the reason behind this complexity? How did you get exactly this numbers? Is any simple explanation? thanks

@bladedoyle
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment