Bitcoin Forum
December 12, 2024, 03:58:32 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does kimotos gravity work ?  (Read 482 times)
forzendiablo (OP)
Legendary
*
Offline Offline

Activity: 1526
Merit: 1000


the grandpa of cryptos


View Profile
February 15, 2014, 12:19:29 PM
 #1

I see its added to many scrypt coins.
Where can i read more about implementation and this alghoritm itself ?

yolo
Exbuhe27
Newbie
*
Offline Offline

Activity: 27
Merit: 2


View Profile
February 15, 2014, 01:04:57 PM
 #2

Hmmm, I read the MegaCoin forum post on it - but I can't seem to actually find the math they use for it. https://forum.megacoin.in/index.php?topic=893.0
It only explains the problem it's trying to solve.

If I had to guess, it probably is just an algorithm that adjust difficulty based on the last x blocks continuously instead of every 2016 blocks - so every block it looks at the last 2016 blocks and decides what the new difficulty should be.

They probably have it setup so that multiple running averages are taken - say the last 2016 blocks is weighted a bit, and then the last 1008 blocks, and the last 504 blocks, or something like that. You could even have this measure be more continuous, as in take the average from the last n blocks where n runs from 1 to 2016, and say that that calculated average contributes to the weighted average in a way proportional to how many blocks it takes into account.

The problem I see with this is that it gives you too much control over how quickly blocks are generated - I think I read somewhere that the lower the variance is in block generation time, the easier it is to fork the chain? Not sure on that, a quick google search didn't bring up any results.

Either way, I really would like to see what specific algorithm they used for it - I'll have to peek through the source a bit. They shouldn't design a new one from the ground up, because there are already really really good algorithms designed by engineers/physicists who work with signal-response feedback controlled systems, and any one of those could work really well I think. Things like Kalman Filters http://en.wikipedia.org/wiki/Kalman_filter

But still then, the worry I think is it being too good - though I think you could have a filter like this target a desired variance in block-time fairly well.
forzendiablo (OP)
Legendary
*
Offline Offline

Activity: 1526
Merit: 1000


the grandpa of cryptos


View Profile
February 15, 2014, 02:17:35 PM
 #3

thanx! ive also read KDC Klondike has it and something else [cant remember now] but i couldnt understand it. Seems its not as simple as i could expect Smiley Maybe someone will chime in to the thread to explain more

yolo
spartacusrex
Hero Member
*****
Offline Offline

Activity: 718
Merit: 545



View Profile
February 15, 2014, 04:29:29 PM
 #4

I agree with Exbuhe27, it is some kind of 'Simple Moving Average', to smooth out the HASH rate curve.

http://en.wikipedia.org/wiki/Moving_average

Whether it is a Simple, Cumulative, Weighted or Exponential average I'm not sure.

Looking at the algo, it seems similar to the Exponential Moving Average, since it has (1-a)^k which is 'like' the code he uses.. and seems to fit in with the whole 'Gravity Well' thing  Tongue

I have looked for the specific numbers he uses in the code,

https://github.com/megacoin/megacoin/blob/master/src/main.cpp#L1276
 
And the only place 0.7084 seems to appear is..

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.10.7822&rep=rep1&type=pdf

But no concrete answer as to why he chose those particular values..

Life is Code.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!