Skip to content

Instantly share code, notes, and snippets.

@asn-d6
Created May 4, 2020 14:22
Show Gist options
  • Save asn-d6/1cdd43931aeff0be9a1f7ce65f4fb626 to your computer and use it in GitHub Desktop.
Save asn-d6/1cdd43931aeff0be9a1f7ce65f4fb626 to your computer and use it in GitHub Desktop.
Equihash parameters & requirements
$ python3 equihash_params.py
Equihash<125,4>:
Memory requirements: 536 MB
Solution size: 72 bytes
Time requirements: 167772160 calls to H()
Verification cost: 16 calls to H()
Equihash<144,5>:
Memory requirements: 536 MB
Solution size: 120 bytes
Time requirements: 100663296 calls to H()
Verification cost: 32 calls to H()
Equihash<150,5>:
Memory requirements: 1073 MB
Solution size: 124 bytes
Time requirements: 201326592 calls to H()
Verification cost: 32 calls to H()
Equihash<200,9>:
Memory requirements: 536 MB
Solution size: 1364 bytes
Time requirements: 10485760 calls to H()
Verification cost: 512 calls to H()
$ cat equihash_params.py
EQUIHASH_PARAMS = [ (125,4), (144,5), (150,5), (200,9)]
for params in EQUIHASH_PARAMS:
n, k = params
d = 0
memory_reqs = pow(2,(n/(k+1) + k))
time_reqs = (k+1) * pow(2,(n/(k+1) + d))
proof_size = pow(2,k)*(n/(k+1) + 1) + 160 # bits
verification_cost = pow(2,k)
print("Equihash<%d,%d>:" % (n,k))
print("\t Memory requirements: %d MB" % (memory_reqs/pow(10,6)))
print("\t Solution size: %d bytes" % (proof_size/8))
print("\t Time requirements: %d calls to H()" % time_reqs)
print("\t Verification cost: %d calls to H()" % verification_cost)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment