Expand description
§Stratum V2 Mining Protocol Messages Crate
mining_sv2
is a Rust crate that implements a set of messages defined in the Mining protocol
of Stratum V2.
The Mining protocol enables the distribution of work to mining devices and the submission of proof-of-work results.
For further information about the messages, please refer to Stratum V2 documentation - Mining.
§Build Options
This crate can be built with the following features:
§Usage
To include this crate in your project, run:
$ cargo add mining_sv2
For further information about the mining protocol, please refer to Stratum V2 documentation - Mining Protocol.
Structs§
- Close
Channel - Message used by a downstream to close a mining channel.
- Extended
Extranonce - Downstream and upstream are relative to user P. In simple terms, upstream is the part of the protocol that a user P sees when looking above, and downstream is what they see when looking below.
- Extranonce
- Extranonce bytes which need to be added to the coinbase to form a fully valid submission.
- NewExtended
Mining Job - Message used by an upstream to provide an updated mining job to the downstream through Extended or Group Channel only.
- NewMining
Job - Message used by an upstream to provide an updated mining job to downstream.
- Open
Extended Mining Channel - Message used by a downstream to request opening an Extended Channel with an upstream role.
- Open
Extended Mining Channel Success - Message used by upstream to accept [
OpenExtendedMiningChannel
request from downstream. - Open
Mining Channel Error - Message used by upstream to reject
OpenExtendedMiningChannel
or [OpenStandardMiningchannel
] request from downstream. - Open
Standard Mining Channel - Message used by a downstream to request opening a Standard Channel.
- Open
Standard Mining Channel Success - Message used by upstream to accept
OpenStandardMiningChannel
request from downstream. - SetCustom
Mining Job - Message used by downstream role to set a custom job to an upstream (Pool).
- SetCustom
Mining JobError - Message used by upstream to reject
SetCustomMiningJob
request. - SetCustom
Mining JobSuccess - Message used by upstream to accept
SetCustomMiningJob
request. - SetExtranonce
Prefix - Message used by upstream to change downstream node’s extranonce prefix.
- SetGroup
Channel - Message used by upstream to associate a set of Standard Channel(s) to a Group Channel.
- SetNew
Prev Hash - Message used by upstream to share or distribute the latest block hash.
- SetTarget
- Message used by upstream to control the downstream submission rate by adjusting the difficulty target on a specified channel.
- Submit
Shares Error - Message used by upstream to reject
SubmitSharesStandard
orSubmitSharesExtended
. - Submit
Shares Extended - Message used by downstream to send result of its hashing work to an upstream.
- Submit
Shares Standard - Message used by downstream to send result of its hashing work to an upstream.
- Submit
Shares Success - Message used by upstream to accept
SubmitSharesStandard
orSubmitSharesExtended
. - Target
- Target is a 256-bit unsigned integer in little-endian
- Update
Channel - Message used by downstream to notify an upstream about changes on a specified channel.
- Update
Channel Error - Message used by upstream to notify downstream about an error in the
UpdateChannel
message.
Enums§
- Extended
Extranonce Error - Error type for ExtendedExtranonce operations