System and method for bitcoin mining with reduced power
A circuit and corresponding method enable bitcoin mining in a blockchain network. The circuit comprises a nonce generator that generates a nonce value, on a cycle-by-cycle basis, and changes only one binary digit of the nonce value per cycle. The circuit further comprises a hash engine that inserts, on the cycle-by-cycle basis, the nonce value into a block header of a block candidate and generates a digest by applying a hash function to the block header. The block header includes a representation of a target value. The circuit further comprises a validator that compares, on the cycle-by-cycle basis, the digest to the target value. In an event the digest satisfies the target value, the validator submits the block candidate to the blockchain network, causing newly minted bitcoin to be mined from the blockchain network. Changing only one binary digit of the nonce value, per cycle, reduces the circuit's power consumption.
1 . A circuit comprising:
a hash engine configured to insert a gray code as a nonce value into a block header of a block candidate and generate a digest by applying a hash function to the block header, the block header including a representation of a target value; and
a validator circuit configured to compare the generated digest to the target value toward submission of the block candidate with the gray code as the nonce value to a blockchain network, the submission based on the generated digest satisfying the target value.
2 . The circuit of claim 1 , further comprising a gray code counter and wherein the nonce value is output from the gray code counter.
3 . The circuit of claim 1 , wherein the nonce value is a 32-bit gray code value.
4 . The circuit of claim 1 , wherein, to apply the hash function to the block header, the hash engine is further configured to:
compute a first hash value by hashing the block header via the hash function; and
compute a second hash value by hashing the first hash value via the hash function, wherein the generated digest is the second hash value.
5 . The circuit of claim 1 , wherein a length of the generated digest is 256 bits.
6 . The circuit of claim 1 , wherein, the validator circuit is further configured to convert the representation to the target value and, in an event the generated digest is less than or equal to the target value, the validator circuit is further configured to conclude that the generated digest satisfies the target value based on comparing the generated digest to the target value.
7 . The circuit of claim 1 , further comprising a reset controller and a gray code counter, wherein the nonce value is output from the gray code counter and wherein the reset controller is configured to reset the gray code counter responsive to the validator circuit concluding that the generated digest satisfies the target value.
8 . The circuit of claim 1 , wherein the circuit further comprises a block generator configured to generate the block candidate for input to the hash engine and, in the event the validator circuit concludes that the generated digest satisfies the target value, the block generator is further configured to change the block candidate generated to a different block candidate for use by the hash engine.
9 . A method comprising:
inserting a gray code generated as a nonce value into a block header of a block candidate and generating a digest by applying a hash function to the block header, the block header including a representation of a target value; and
comparing the generated digest to the target value toward submission of the block candidate with the gray code as the nonce value to a blockchain network, the submission based on the generated digest satisfying the target value.
10 . The method of claim 9 , wherein the generating includes incrementing a gray code counter and wherein the nonce value is output from the gray code counter.
11 . The method of claim 9 , wherein the nonce value is a 32-bit gray code value.
12 . The method of claim 9 , wherein the generating consumes less power relative to generating the nonce value via a binary counter.
13 . The method of claim 9 , wherein applying the hash function includes:
computing a first hash value by hashing the block header via the hash function; and
computing a second hash value by hashing the first hash value via the hash function, wherein the generated digest is the second hash value.
14 . The method of claim 9 , wherein a length of the generated digest is 256 bits.
15 . The method of claim 9 , further comprising converting the representation to the target value and wherein, in an event the generated digest is less than or equal to the target value, the comparing includes concluding that the generated digest satisfies the target value.
16 . The method of claim 9 , further comprising outputting the nonce value from a gray code counter and resetting the gray code counter responsive to the generated digest satisfying the target value.
17 . The method of claim 9 , wherein the method further comprises generating the block candidate and, in the event the generated digest satisfies the target value, changing the block candidate generated to a different block candidate for the inserting.
18 . An apparatus comprising:
means for inserting a gray code generated as a nonce value into a block header of a block candidate;
means for generating a digest by applying a hash function to the block header, the block header including a representation of a target value; and
means for comparing the generated digest to the target value toward submission of the block candidate with the gray code as the nonce value to a blockchain network, the submission based on the generated digest satisfying the target value.