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).
Télécharger le CSV Télécharger le JSON API REST →
| Proto | Message | Type | Direction | Paramètres clés | Fonction | BIP applicable |
|---|---|---|---|---|---|---|
| V1 | mining.subscribe | — | Client → Serveur | user_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. | — |
| V1 | mining.authorize | — | Client → Serveur | worker_name (username.worker); password (often "x") | Authenticates a worker with the pool. A worker must be authorized before any share it submits is credited. | — |
| V1 | mining.notify | — | Serveur → Client | job_id; prev_hash; coinbase_1; coinbase_2; merkle_branches[]; version; nbits; ntime; clean_jobs | The core work-distribution message: carries everything the miner needs to assemble the block header for a job. | — |
| V1 | mining.set_difficulty | — | Serveur → Client | difficulty (pool difficulty / pdiff) | Sets the share-difficulty target the miner must meet. Takes effect on the NEXT mining.notify. | — |
| V1 | mining.submit | — | Client → Serveur | worker_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) |
| V1 | mining.set_extranonce | — | Serveur → Client | extranonce1; extranonce2_size | Rotates the miner's extranonce1 / extranonce2_size mid-session without a reconnect. | — |
| V1 | mining.configure | — | Client → Serveur | extensions[] (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 |
| V1 | client.reconnect | — | Serveur → Client | hostname (empty = same host); port (0 = same port); wait_seconds | Instructs the miner to reconnect to a (possibly different) stratum endpoint — used for pool migration or load-balancing. | — |
| V1 | client.get_version | — | Serveur → Client | (none) | Asks the miner to report its software / user-agent version string. | — |
| V1 | client.show_message | — | Serveur → Client | message (string) | Displays an informational operator message on the miner (e.g. a maintenance notice). Informational only. | — |
| V1 | mining.set_version_mask | — | Serveur → Client | version_mask (hex) | Dynamically updates the allowed version-rolling bit mask after version rolling has been negotiated. | BIP 310 |
| V1 | mining.suggest_difficulty | — | Client → Serveur | difficulty (hint) | Miner hints a preferred starting share difficulty to the pool. | — |
| V1 | mining.ping / mining.pong champs présumés | — | Bidirectionnel | (none) | Keepalive liveness check; the receiver replies with pong. | — |
| V2 | SetupConnection | 0x00 | Client → Serveur | protocol (0=Mining,1=JobDeclaration,2=TemplateDistribution); min_version; max_version; flags; endpoint_host; endpoint_port; vendor; hardware_version; firmware; device_id | Opens and negotiates a Stratum V2 connection (which sub-protocol, version range, feature flags) before any channel is opened. | — |
| V2 | SetupConnection.Success | 0x01 | Serveur → Client | used_version; flags (server-supported intersection) | Confirms the connection and reports the negotiated protocol version and the feature flags the server supports. | — |
| V2 | SetupConnection.Error | 0x02 | Serveur → Client | flags (unsupported flags from client); error_code (string, e.g. "unsupported-feature-flags") | Rejects connection setup and reports which requested flags are unsupported. | — |
| V2 | OpenStandardMiningChannel | 0x10 | Client → Serveur | request_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. | — |
| V2 | OpenStandardMiningChannel.Success | 0x11 | Serveur → Client | request_id; channel_id; target (U256); extranonce_prefix; group_channel_id | Confirms the standard channel and assigns its channel_id, initial share target and extranonce prefix. | — |
| V2 | OpenStandardMiningChannel.Error champs présumés | 0x12 | Serveur → Client | request_id; error_code (string) | Rejects a standard-channel open request with an error reason. | — |
| V2 | OpenExtendedMiningChannel | 0x13 | Client → Serveur | request_id; user_identity; nominal_hash_rate (h/s); max_target (U256); min_extranonce_size | Opens an extended mining channel — used by proxies and for transaction selection; the miner assembles the coinbase from prefix/suffix parts. | — |
| V2 | OpenExtendedMiningChannel.Success | 0x14 | Serveur → Client | request_id; channel_id; target (U256); extranonce_size; extranonce_prefix; group_channel_id | Confirms the extended channel and assigns its channel_id, target and the extranonce bytes the miner controls. | — |
| V2 | OpenExtendedMiningChannel.Error champs présumés | 0x15 | Serveur → Client | request_id; error_code (string) | Rejects an extended-channel open request with an error reason. | — |
| V2 | NewMiningJob | 0x1e | Serveur → Client | channel_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. | — |
| V2 | NewExtendedMiningJob | 0x1f | Serveur → Client | channel_id; job_id; min_ntime (OPTION[U32]); version; version_rolling_allowed; merkle_path (SEQ[U256]); coinbase_tx_prefix; coinbase_tx_suffix | Distributes 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) |
| V2 | SetNewPrevHash (Mining) | 0x20 | Serveur → Client | channel_id; job_id; prev_hash (U256); min_ntime; nbits | Activates 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). | — |
| V2 | SubmitSharesStandard | 0x1a | Client → Serveur | channel_id; sequence_number; job_id; nonce; ntime; version (full nVersion incl. rolled bits) | Submits a share on a standard channel. | — |
| V2 | SubmitSharesExtended | 0x1b | Client → Serveur | channel_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. | — |
| V2 | SubmitShares.Success champs présumés | 0x1c | Serveur → Client | channel_id; last_sequence_number; new_submits_accepted_count; new_shares_sum | Batch-acknowledges accepted shares up to a sequence number, rather than one reply per share. | — |
| V2 | SubmitShares.Error champs présumés | 0x1d | Serveur → Client | channel_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). | — |
| V2 | SetTarget | 0x21 | Serveur → Client | channel_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). | — |
| V2 | SetExtranoncePrefix champs présumés | 0x19 | Serveur → Client | channel_id; extranonce_prefix | Changes the upstream extranonce prefix for a channel mid-session (the V2 analogue of mining.set_extranonce). | — |
| V2 | SetCustomMiningJob | 0x22 | Client → Serveur | channel_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_path | On an extended channel, submits a miner-selected block template (its own transaction set) using a token obtained from a Job Declaration Server. | — |
| V2 | AllocateMiningJobToken | 0x50 | Client → Serveur | user_identifier (pool auth); request_id | Job Declaration Protocol: the miner-side declarator asks the pool-side declarator to reserve a token for a future self-declared job. | — |
| V2 | AllocateMiningJobToken.Success | 0x51 | Serveur → Client | request_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. | — |
| V2 | DeclareMiningJob | 0x55 | Client → Serveur | request_id; mining_job_token; version; coinbase_tx_prefix; coinbase_tx_suffix; wtxid_list (SEQ[U256]); excess_data | Declares a miner-selected set of transactions to the pool for validation before mining on it. | BIP 141 (full SegWit coinbase) |
| V2 | DeclareMiningJob.Success champs présumés | 0x57 | Serveur → Client | request_id; new_mining_job_token | Confirms the pool accepted the declared transaction set and issues the token to mine it. | — |
| V2 | DeclareMiningJob.Error champs présumés | 0x58 | Serveur → Client | request_id; error_code (string); error_details | Rejects a declared job (e.g. the pool is missing some of the referenced transactions). | — |
| V2 | PushSolution | 0x60 | Client → Serveur | extranonce; prev_hash (U256); nonce; ntime; nbits; version | Sends 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.
Produits, réparations et guides connexes
- comment D-Central diagnostique les réparations ASIC
- bibliothèque de dépannage ASIC
- manuels ASIC et guides de réparation
- hashboards de remplacement
- cartes de contrôle ASIC
- blocs d’alimentation ASIC
- hashboard de remplacement pour la famille S19
- carte de contrôle de remplacement C52
- bloc d’alimentation APW12 pour S19
- comparer les specs dans la base de mineurs ASIC
- comparer les specs des mineurs ASIC
- base de mineurs ASIC
- services de réparation ASIC
- specs et rentabilité de l’Antminer S19
- acheter un Antminer S19 testé
- guide d’entretien Antminer S19
- service de réparation Antminer S19
- specs de l’Antminer S21
- Bitmain Antminer S21
- guide d’entretien Antminer S21
- puce BM1370BC pour S21 Pro
Dernière révision: 27 juillet 2026.
