Expand description
Stratum V1 on the wire, for both roles: newline-delimited JSON-RPC messages, and the share arithmetic a pool and a miner must agree on byte for byte — the coinbase a job describes, the block header a share commits to, its double SHA-256, and its difficulty.
Structs§
- Job
- One unit of work: what
mining.notifycarries. - Lines
- Newline-delimited JSON values from one side of a connection.
Enums§
Constants§
- DIFF1
- Difficulty 1: the target 0x00000000FFFF0000…, as a number.
- EXTRANONC
E1_ SIZE - Bytes of extranonce1 the pool assigns each connection.
- EXTRANONC
E2_ SIZE - Bytes of extranonce2 the pool asks miners to roll.
- IO_
TIMEOUT - MAX_
BRANCHES - Merkle branches a job may carry (a block of 2^16 transactions).
- MAX_
COINBASE - Coinbase halves are at most this long.
- MAX_
COINBASE_ MESSAGE - The coinbase message a pool job carries, in bytes.
- MAX_
LINE - One JSON-RPC line, at most.
- NTIME_
ROLL - How far past the job’s ntime a share may roll its timestamp, in seconds.
Functions§
- difficulty
- The difficulty a header hash meets: difficulty 1’s target over the hash as a number.
- display_
hex - A hash as block explorers and RPC show it: byte-reversed hex.
- error
[code, message, null], Stratum’s error shape (20 other, 21 job not found, 22 duplicate, 23 low difficulty, 24 unauthorized worker, 25 not subscribed).- line
- parse
- parse_
prev_ display - A previous block hash as RPC writes it (64 hex digits), or zero when absent.
- parse_
u32_ hex - pool_
job - A pool’s job: a coinbase carrying the block height (BIP 34) and
message, paying nothing to an OP_RETURN output, with room for the extranonces; no other transactions. - sha256d
- u32_hex
- A 32-bit field as Stratum writes it: big-endian hex of the number.