-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I'll continually edit this. This is my current belief about what is the "best difficulty algorithm".
# WT-50
# Degnr8's WT algo, modified by zawy
# N=50
# T=600
# k=N*(N+1)/2
# limit =10^(3/N)
# adjust = (1+1.3/N) # keeps avg solvetime for N < 200
def next_bits_WMA(N):
target = 0
weight=0
for i in range(-N+1, 0):
weight++
st = (states[i].timestamp - states[i-1].timestamp)
target += st * bits_to_target(states[i].bits) * weight
target *= adjust / k
target_prev= bits_to_target(states[0].bits)
# use the following if bitcoin's -6\*T (MTP of 11) and +12*T of nodes' time are not the limits on the timestamps.
# if target > prev_target*limit: target=prev_target*limit
# if target < prev_target/limit: target=prev_target/limit
return target_to_bits(target)
Metadata
Metadata
Assignees
Labels
No labels