Passer au contenu
Petite équipe, gros carnet, aucune commande abandonnée. Nos réponses sont plus lentes qu’on le voudrait. Lire notre mise à jour → Aucune commande abandonnée. Mise à jour → 📬 Vérifiez vos indésirables — c’est souvent là que nos réponses aboutissent. On répond, promis. Mise à jour → 📬 Vérifiez vos indésirables. Mise à jour →

Référence des messages du protocole Stratum

Réponse rapide

Stratum est le protocole qu'un mineur Bitcoin parle à son pool. Stratum V1 est un ensemble de méthodes JSON-RPC : le mineur envoie mining.subscribe, mining.authorize et mining.submit, et le pool envoie mining.notify (le travail), mining.set_difficulty et client.reconnect. Stratum V2 les remplace par des messages binaires compacts identifiés par un octet de type, ajoute SetupConnection, scinde le travail en NewExtendedMiningJob + SetNewPrevHash, et ajoute un Job Declaration Protocol (AllocateMiningJobToken, DeclareMiningJob) qui laisse les mineurs choisir leurs propres transactions. Cette référence catalogue les 38 messages des deux versions avec leur direction, leurs paramètres clés, leur fonction et le BIP qui les régit.

V1 = JSON-RPC par nom de méthode ; V2 = binaire par octet de type de message. Le version rolling se négocie en V1 via mining.configure (BIP 310) et est natif en V2 (bits BIP 320).

38 messages · 13 méthodes Stratum V1 · 25 types de message Stratum V2 · CC BY 4.0

Télécharger le CSV Télécharger le JSON API REST →

ProtoMessageTypeDirectionParamètres clésFonctionBIP applicable
V1mining.subscribeClient → Serveuruser_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 → Serveurworker_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.notifyServeur → 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_difficultyServeur → Clientdifficulty (pool difficulty / pdiff)Sets the share-difficulty target the miner must meet. Takes effect on the NEXT mining.notify.
V1mining.submitClient → Serveurworker_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_extranonceServeur → Clientextranonce1; extranonce2_sizeRotates the miner's extranonce1 / extranonce2_size mid-session without a reconnect.
V1mining.configureClient → Serveurextensions[] (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.reconnectServeur → 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_versionServeur → Client(none)Asks the miner to report its software / user-agent version string.
V1client.show_messageServeur → Clientmessage (string)Displays an informational operator message on the miner (e.g. a maintenance notice). Informational only.
V1mining.set_version_maskServeur → Clientversion_mask (hex)Dynamically updates the allowed version-rolling bit mask after version rolling has been negotiated.BIP 310
V1mining.suggest_difficultyClient → Serveurdifficulty (hint)Miner hints a preferred starting share difficulty to the pool.
V1mining.ping / mining.pong champs présumésBidirectionnel(none)Keepalive liveness check; the receiver replies with pong.
V2SetupConnection0x00Client → Serveurprotocol (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.Success0x01Serveur → Clientused_version; flags (server-supported intersection)Confirms the connection and reports the negotiated protocol version and the feature flags the server supports.
V2SetupConnection.Error0x02Serveur → Clientflags (unsupported flags from client); error_code (string, e.g. "unsupported-feature-flags")Rejects connection setup and reports which requested flags are unsupported.
V2OpenStandardMiningChannel0x10Client → Serveurrequest_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.Success0x11Serveur → 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 champs présumés0x12Serveur → Clientrequest_id; error_code (string)Rejects a standard-channel open request with an error reason.
V2OpenExtendedMiningChannel0x13Client → Serveurrequest_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.Success0x14Serveur → 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 champs présumés0x15Serveur → Clientrequest_id; error_code (string)Rejects an extended-channel open request with an error reason.
V2NewMiningJob0x1eServeur → 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.
V2NewExtendedMiningJob0x1fServeur → 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)0x20Serveur → 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 → Serveurchannel_id; sequence_number; job_id; nonce; ntime; version (full nVersion incl. rolled bits)Submits a share on a standard channel.
V2SubmitSharesExtended0x1bClient → Serveurchannel_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 champs présumés0x1cServeur → 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 champs présumés0x1dServeur → 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).
V2SetTarget0x21Serveur → 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 champs présumés0x19Serveur → Clientchannel_id; extranonce_prefixChanges the upstream extranonce prefix for a channel mid-session (the V2 analogue of mining.set_extranonce).
V2SetCustomMiningJob0x22Client → Serveurchannel_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 → Serveuruser_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.Success0x51Serveur → 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 → Serveurrequest_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 champs présumés0x57Serveur → Clientrequest_id; new_mining_job_tokenConfirms the pool accepted the declared transaction set and issues the token to mine it.
V2DeclareMiningJob.Error champs présumés0x58Serveur → Clientrequest_id; error_code (string); error_detailsRejects a declared job (e.g. the pool is missing some of the referenced transactions).
V2PushSolution0x60Client → Serveurextranonce; 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 : distillé de la Bitcoin Mining Hack Bible de D-Central (STRATUM_PROTOCOL_BIBLE). Ceci est un catalogue de messages neutre — pour savoir quels pools et firmwares parlent réellement chaque version, voir la matrice de prise en charge Stratum ; pour les codes de rejet numériques V1 et les chaînes d'erreur V2, voir la référence des codes d'erreur Stratum. Voir aussi l'entrée de glossaire du protocole Stratum et la référence de l'API des mineurs. Vérifiez contre la spécification canonique de Stratum V2 et le texte des BIP avant toute implémentation.