Bitcoin Forum
June 21, 2025, 08:31:19 PM *
News: Pizza day contest voting
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Doge Coin Difficulty  (Read 107 times)
cle333 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
May 23, 2025, 12:15:55 AM
 #1

Hello everyone

Can someone explain to me how the algorithm works and how DOGE's difficulty is adjusted? Or does can read up on how it currently works?
At the moment I use the following Code.


Code:
def calculate_next_difficulty(current_difficulty, time_delta_to_previous_block):
    target_blocktime = 60

    # Digishield Amplituden-Filter
    modulated_timespan = target_blocktime + (time_delta_to_previous_block - target_blocktime) / 8

    min_timespan = target_blocktime * 0.75
    max_timespan = target_blocktime * 1.5
    modulated_timespan = max(min(modulated_timespan, max_timespan), min_timespan)

    # Calc new diff
    new_diff = current_difficulty * (target_blocktime / modulated_timespan)

    return new_diff

This uses the difficulty of the last block and the time difference between the last two blocks. However, the formula is off by 0% - 5%. I tested it with the blocks that are then in the blockchain. Does anyone know the correct formula? (It might have something to do with the fact that most people mine Dogecoin and Litecoin together.)

Thanks in advance

Best regards
Clemens
cle333 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
May 26, 2025, 07:38:32 PM
 #2

Does anyone have any idea how this works?
nc50lc
Legendary
*
Offline Offline

Activity: 2814
Merit: 7318


Self-proclaimed Genius


View Profile
May 30, 2025, 04:59:51 AM
 #3

There seem to be more in DogeCoin's DigiShield algorithm than what's included in your code,
Check these lines for the actual formula used by DogeCoin.

Link: github.com/dogecoin/dogecoin/blob/master/src/dogecoin.cpp#L50

Does anyone have any idea how this works?
It'll be hard to find Dogecoin specialists in this forum since we're on Bitcointalk, you can try their official Dogecoin forum for more elaborate answers.

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!