Skip to content

WT-50 (zawy modification of WT-144) #21

@zawy12

Description

@zawy12

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions