-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The goal here is to be able to use any cryptographic hash for a blockchain, but only replace how PoW is measured.
In traditional blockchains, PoW is generally calculated by taking the leading bits of the hash and considering the smaller integer value of those bits as being a higher difficulty. PegNet considers the higher integer value of those bits as being a higher difficulty, but this isn't too different.
By adding two functions, LxrPoW() and PoW(), the LXRHash can be used with any Hash function to do a more complex PoW calculation that makes PoW most reasonable for CPU mining.
LxrPoW() makes computation of PoW CPU hard
PoW() takes a hash of a higher integer value can compresses it to a uniform 8 bytes.
The compression of PoW() first counts how many of the leading bytes have a value of 0xFF. If the difficulty is defined where the leading bit is 0 and the last bit is 63, then:
Bits 0-3 is the count of leading 0xFF
Bits 4-63 are the following bits of the hash
This allows Difficulty to be represented by 60 to 180 bits of a hash in 64 bits.