ProofWork

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinimumWork = uint64(0xffffffc000000000)

Functions

func GenerateProof

func GenerateProof(blockHash []byte) []byte

GenerateProof will generate the proof of work, the nonce itself is one uint64 in BigEndian, it's generate as follows: Pick one unique Nonce and concatenate with the Blockhash: [LittleEndian UINT64 Nonce][BlockHash] Now computes the hash of the previous concatenation: Blake2(size = 8, message = [LittleEndian UINT64 Nonce][BlockHash]) Now you need to use this value as one UINT64 and compare against the minimum work: LitleEndian(Blake2(...)) > MinimumWork If it's correct then you have in hand one correct nonce/pow, you need to reverse it so use the BigEndian.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL