You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current verify() API takes boundary = 2^256 / difficulty instead of difficulty. The boundary is commonly used in mining for efficiency. However, for block hash verification this is not optimal because clients have to compute 2^256 / difficulty inversion for every block hash.
We propose to add additional function which takes difficulty argument directly: verify_against_difficulty().
Internally, we can perform much more efficient check:
final_hash * difficulty <= 2^256
This has been tested and the formula is also valid for difficulty 0 and 1.
We also propose to rename verify() to verify_against_boundary() to disambiguate.
And change verify_final_hash() to verify_final_hash_against_difficulty() as this function is suppose to be used for quick block hash verification.
The text was updated successfully, but these errors were encountered:
The final hash verification is
The current verify() API takes
boundary = 2^256 / difficulty
instead ofdifficulty
. Theboundary
is commonly used in mining for efficiency. However, for block hash verification this is not optimal because clients have to compute2^256 / difficulty
inversion for every block hash.We propose to add additional function which takes
difficulty
argument directly:verify_against_difficulty()
.Internally, we can perform much more efficient check:
This has been tested and the formula is also valid for difficulty 0 and 1.
We also propose to rename
verify()
toverify_against_boundary()
to disambiguate.And change
verify_final_hash()
toverify_final_hash_against_difficulty()
as this function is suppose to be used for quick block hash verification.The text was updated successfully, but these errors were encountered: