Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zawy12 opened this issue Oct 31, 2017 · 0 comments
Open

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

zawy12 opened this issue Oct 31, 2017 · 0 comments

Comments

@zawy12
Copy link

zawy12 commented Oct 31, 2017

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)
@zawy12 zawy12 changed the title WT-30 with timestamp limits WT-50 (zawy modification of WT-144) Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant