Skip to content

Commit

Permalink
Update Decred_NiceHash.txt
Browse files Browse the repository at this point in the history
Updated with stake version
  • Loading branch information
nicehashdev committed Apr 23, 2017
1 parent 499a411 commit 832b109
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Decred_NiceHash.txt
Expand Up @@ -3,7 +3,7 @@
=========================================================================
Decred mining used on NiceHash
=========================================================================
revision of this document: R2
revision of this document: R3

I. Introduction & Concept
II. Specifications (RFC)
Expand Down Expand Up @@ -44,7 +44,7 @@ Following block header is used in Decred:
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x03 // Stake version 3

There are 36 bytes in ExtraData field that can be used for random user-
defined data.
Expand All @@ -70,7 +70,8 @@ ExtraNonce2, then block header would look like:
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ExtraNonce2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // remaining ExtraData
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03 // Stake version

Remaining ExtraData must always be padded with nulls!

Expand All @@ -79,7 +80,7 @@ parameters:
params[0] = Job ID.
params[1] = PrevBlock (32 bytes).
params[2] = MerkleRoot, StakeRoot,... Height, Size (together 100 bytes).
params[3] = Unused. Set to "".
params[3] = Stake version (4 bytes).
params[4][] = Unused. Set to [].
params[5] = Version.
params[6] = Unused. Set to "".
Expand All @@ -90,7 +91,7 @@ Miner generates work for hashing by combining:
Version (params[5]) + PrevBlock (params[1]) + MerkleRoot, StakeRoot,...
Height, Size (params[2]) + Timestamp (params[7] + Nonce (selected by
miner) + ExtraNonce1 (send by the pool at start) + ExtraNonce2 (selected
by miner)
by miner) + padding (if needed) + Stake version (params[3])


II. Specifications (RFC)
Expand All @@ -104,6 +105,9 @@ mining on NiceHash.
R2 update: It is allowed to send coinbase1 being more than 100 bytes.
In that case, miners just take first 100 bytes and discard the rest.

R3 update: Stake version added at the end of Extra data. Stake version
is provided as third parameter in mining.notify.


III. Contact
-----------
Expand Down

0 comments on commit 832b109

Please sign in to comment.