Skip to content

Bitcoin accepted at checkout  |  Ships from Laval, QC, Canada  |  Expert support since 2016

Stratum Protocol Message Reference

A neutral, citable reference for the Stratum mining protocol: every Stratum V1 JSON-RPC method and every Stratum V2 binary message type, with direction, key parameters, purpose and the governing BIP where one applies. This describes the protocol itself — for which firmware and pools support each version, see the Stratum protocol support matrix.

Quick answer

Stratum is the protocol a Bitcoin miner speaks to its pool. Stratum V1 is a JSON-RPC method set: the miner sends mining.subscribe, mining.authorize and mining.submit, and the pool sends mining.notify (work), mining.set_difficulty and client.reconnect. Stratum V2 replaces these with compact binary messages identified by a type byte, adds SetupConnection, splits work into NewExtendedMiningJob + SetNewPrevHash, and adds a Job Declaration Protocol (AllocateMiningJobToken, DeclareMiningJob) that lets miners choose their own transactions. This reference catalogues all 38 messages across both versions with their direction, key parameters, purpose and governing BIP.

V1 = JSON-RPC by method name; V2 = binary by message-type byte. Version rolling is negotiated in V1 via mining.configure (BIP 310) and is native in V2 (BIP 320 bits).

38 messages · 13 Stratum V1 methods · 25 Stratum V2 message types · CC BY 4.0

Download CSV Download JSON REST API →

ProtoMessageTypeDirectionKey parametersPurposeGoverning BIP
V1mining.subscribeClient → Serveruser_agent; [prev_extranonce1] (optional, session resume)Registers the miner with the pool and obtains its per-connection extranonce1 prefix and the extranonce2_size (byte width) the miner may roll.
V1mining.authorizeClient → Serverworker_name (username.worker); password (often "x")Authenticates a worker with the pool. A worker must be authorized before any share it submits is credited.
V1mining.notifyServer → Clientjob_id; prev_hash; coinbase_1; coinbase_2; merkle_branches[]; version; nbits; ntime; clean_jobsThe core work-distribution message: carries everything the miner needs to assemble the block header for a job.
V1mining.set_difficultyServer → Clientdifficulty (pool difficulty / pdiff)Sets the share-difficulty target the miner must meet. Takes effect on the NEXT mining.notify.
V1mining.submitClient → Serverworker_name; job_id; extranonce2; ntime; nonce; [version_bits] (BIP 310)Submits a share — a nonce that meets the current share target — to the pool for credit.BIP 310 (optional version_bits param)
V1mining.set_extranonceServer → Clientextranonce1; extranonce2_sizeRotates the miner's extranonce1 / extranonce2_size mid-session without a reconnect.
V1mining.configureClient → Serverextensions[] (e.g. version-rolling, minimum-difficulty, subscribe-extranonce); extension params{} (e.g. version-rolling.mask, version-rolling.min-bit-count)Negotiates optional protocol extensions before subscription — most importantly version rolling (overt ASICBoost).BIP 310
V1client.reconnectServer → Clienthostname (empty = same host); port (0 = same port); wait_secondsInstructs the miner to reconnect to a (possibly different) stratum endpoint — used for pool migration or load-balancing.
V1client.get_versionServer → Client(none)Asks the miner to report its software / user-agent version string.
V1client.show_messageServer → Clientmessage (string)Displays an informational operator message on the miner (e.g. a maintenance notice). Informational only.
V1mining.set_version_maskServer → Clientversion_mask (hex)Dynamically updates the allowed version-rolling bit mask after version rolling has been negotiated.BIP 310
V1mining.suggest_difficultyClient → Serverdifficulty (hint)Miner hints a preferred starting share difficulty to the pool.
V1mining.ping / mining.pong rumored fieldsBidirectional(none)Keepalive liveness check; the receiver replies with pong.
V2SetupConnection0x00Client → Serverprotocol (0=Mining,1=JobDeclaration,2=TemplateDistribution); min_version; max_version; flags; endpoint_host; endpoint_port; vendor; hardware_version; firmware; device_idOpens and negotiates a Stratum V2 connection (which sub-protocol, version range, feature flags) before any channel is opened.
V2SetupConnection.Success0x01Server → Clientused_version; flags (server-supported intersection)Confirms the connection and reports the negotiated protocol version and the feature flags the server supports.
V2SetupConnection.Error0x02Server → Clientflags (unsupported flags from client); error_code (string, e.g. "unsupported-feature-flags")Rejects connection setup and reports which requested flags are unsupported.
V2OpenStandardMiningChannel0x10Client → Serverrequest_id; user_identity; nominal_hash_rate (h/s); max_target (U256)Opens a standard mining channel. Standard-channel miners receive complete merkle roots ready to hash.
V2OpenStandardMiningChannel.Success0x11Server → Clientrequest_id; channel_id; target (U256); extranonce_prefix; group_channel_idConfirms the standard channel and assigns its channel_id, initial share target and extranonce prefix.
V2OpenStandardMiningChannel.Error rumored fields0x12Server → Clientrequest_id; error_code (string)Rejects a standard-channel open request with an error reason.
V2OpenExtendedMiningChannel0x13Client → Serverrequest_id; user_identity; nominal_hash_rate (h/s); max_target (U256); min_extranonce_sizeOpens an extended mining channel — used by proxies and for transaction selection; the miner assembles the coinbase from prefix/suffix parts.
V2OpenExtendedMiningChannel.Success0x14Server → Clientrequest_id; channel_id; target (U256); extranonce_size; extranonce_prefix; group_channel_idConfirms the extended channel and assigns its channel_id, target and the extranonce bytes the miner controls.
V2OpenExtendedMiningChannel.Error rumored fields0x15Server → Clientrequest_id; error_code (string)Rejects an extended-channel open request with an error reason.
V2NewMiningJob0x1eServer → Clientchannel_id; job_id; min_ntime (OPTION[U32], empty = future job); version; merkle_root (U256)Distributes a job to a STANDARD channel with the complete merkle root already computed.
V2NewExtendedMiningJob0x1fServer → Clientchannel_id; job_id; min_ntime (OPTION[U32]); version; version_rolling_allowed; merkle_path (SEQ[U256]); coinbase_tx_prefix; coinbase_tx_suffixDistributes a job to an EXTENDED / group channel; the miner builds the coinbase from prefix/suffix and computes the merkle root itself.BIP 320 (version bits); BIP 141 (SegWit-stripped coinbase)
V2SetNewPrevHash (Mining)0x20Server → Clientchannel_id; job_id; prev_hash (U256); min_ntime; nbitsActivates a previously-sent future job by supplying the new previous-block hash — cleanly separating the job from the prev-hash (which V1 bundled into mining.notify).
V2SubmitSharesStandard0x1aClient → Serverchannel_id; sequence_number; job_id; nonce; ntime; version (full nVersion incl. rolled bits)Submits a share on a standard channel.
V2SubmitSharesExtended0x1bClient → Serverchannel_id; sequence_number; job_id; nonce; ntime; version; extranonce (miner's contribution)Submits a share on an extended channel, including the miner's own extranonce.
V2SubmitShares.Success rumored fields0x1cServer → Clientchannel_id; last_sequence_number; new_submits_accepted_count; new_shares_sumBatch-acknowledges accepted shares up to a sequence number, rather than one reply per share.
V2SubmitShares.Error rumored fields0x1dServer → Clientchannel_id; sequence_number; error_code (string, e.g. too-low-difficulty, stale-share)Rejects a submitted share with a descriptive string reason (V2 uses strings where V1 used numeric codes 20-25).
V2SetTarget0x21Server → Clientchannel_id; maximum_target (U256)Updates the share-difficulty target for a channel, expressed as a full 256-bit target (the V2 replacement for mining.set_difficulty).
V2SetExtranoncePrefix rumored fields0x19Server → Clientchannel_id; extranonce_prefixChanges the upstream extranonce prefix for a channel mid-session (the V2 analogue of mining.set_extranonce).
V2SetCustomMiningJob0x22Client → Serverchannel_id; request_id; mining_job_token; version; prev_hash; min_ntime; nbits; coinbase_tx_version; coinbase_prefix; coinbase_tx_input_nSequence; coinbase_tx_outputs; coinbase_tx_locktime; merkle_pathOn an extended channel, submits a miner-selected block template (its own transaction set) using a token obtained from a Job Declaration Server.
V2AllocateMiningJobToken0x50Client → Serveruser_identifier (pool auth); request_idJob Declaration Protocol: the miner-side declarator asks the pool-side declarator to reserve a token for a future self-declared job.
V2AllocateMiningJobToken.Success0x51Server → Clientrequest_id; mining_job_token; coinbase_tx_outputs (pool-required outputs)Returns a reserved token plus the coinbase outputs (e.g. pool-fee outputs) that MUST appear in any job declared with it.
V2DeclareMiningJob0x55Client → Serverrequest_id; mining_job_token; version; coinbase_tx_prefix; coinbase_tx_suffix; wtxid_list (SEQ[U256]); excess_dataDeclares a miner-selected set of transactions to the pool for validation before mining on it.BIP 141 (full SegWit coinbase)
V2DeclareMiningJob.Success rumored fields0x57Server → Clientrequest_id; new_mining_job_tokenConfirms the pool accepted the declared transaction set and issues the token to mine it.
V2DeclareMiningJob.Error rumored fields0x58Server → Clientrequest_id; error_code (string); error_detailsRejects a declared job (e.g. the pool is missing some of the referenced transactions).
V2PushSolution0x60Client → Serverextranonce; prev_hash (U256); nonce; ntime; nbits; versionSends a found block solution for a self-declared job back to the pool-side declarator for propagation.

Source: distilled from D-Central's Bitcoin Mining Hack Bible (STRATUM_PROTOCOL_BIBLE). This is a neutral message catalogue — for which pools and firmware actually speak each version, see the Stratum protocol support matrix; for the numeric V1 reject codes and V2 error strings, see the Stratum error-code reference. See also the Stratum protocol glossary entry and the miner API reference. Verify against the canonical Stratum V2 specification and BIP text before implementation.