diff --git a/docs/protocol-v0.md b/docs/protocol-v0.md index 1f0cef5..412e489 100644 --- a/docs/protocol-v0.md +++ b/docs/protocol-v0.md @@ -145,6 +145,36 @@ A "block transfer" message is sent back in response to a "block request" message |---|---| | protocol version = 0 (BE) | 2 | | capable version = 0 (BE) | 2 | -| type = 4 (BE) | 1 | +| type = 6 (BE) | 1 | | list position (0 <= x < 1024) (BE) | 2 | | transaction | 148 | + +## Client to Node message packet formats + +### Mining task request (Client -> Node) + +| content | size (bytes) | +|---|---| +| protocol version = 0 (BE) | 2 | +| capable version = 0 (BE) | 2 | +| type = 7 (BE) | 1 | + +The node should answer to a "Mining task request" with a "Mining task response" + +### Mining task response (Node -> Client) + +| content | size (bytes) | +|---|---| +| protocol version = 0 (BE) | 2 | +| capable version = 0 (BE) | 2 | +| type = 8 (BE) | 1 | +| timestamp (unix time in seconds, BE) | 8 | +| previous hash | 32 | +| difficulty sum (BE) | 32 | +| transaction (optional) | 148 | + +The node tells the miner "timestamp", "previous hash", "difficulty sum" and "transaction" for the new block. + +The miner fills "nonce", "message" and "miner pubkey" on its own. + +When a miner finds a block, it sends a "block transfer" message to the node.