среда, 6 мая 2020 г.

Stratum mining pool server. EIP 1571: EthereumStratum/2.0.0. Stratum V2 | The next generation protocol for pooled mining

Getting Started



Stratum



This document describes a protocol, that allows a group of miners to connect to a server, which coordinates the distribution of work packages among miners.



The initial protocol was written for Bitcoin and contains several pieces that need adjustment in order to be usable with Aeternity.



Pool operators looking to implement this specification should note, that the usage of the Bitcoin-NG protocol changes the dynamics of the mining game. With Bitcoin-NG pools will end up authoring the microblocks containing transactions while the miners try to find keyblocks, which are used for leader election. This procedure puts both more power into the hands of pool operators while also adding more burden. Stratum mining pool server burden comes in the form of increased book keeping complexity—the full revenue of one epoch can only be computed after the fact—and an increase in computational resources required for signing microblocks.



Specification



Conventions



The key words Stratum mining pool server, "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.



The stratum protocol mostly adheres to the JSON RPC 2.0 specification.



This specification derives from works by slushpool, zcash and nicehash.



Overview



Communication happens over a bidirectional channel with messages encoded as JSON with delimiter—in this document written as.



Since requests can be handled out of order, each request in a session SHOULD have an unique. In order to be able to match request and response, responses MUST have the same as their matching request. Notifications sent by the server or calls that do not trigger any response MAY have an of.



For further details on the members of request and response objects consult the JSON RPC 2.0 specification.



Protocol flow example



The following shows what a session might Stratum mining pool server like from subscription to submitting a solution.



Methods



Errors



Whenever an RPC call triggers an error, the response MUST include an field which maps steatum Stratum mining pool server List of the following values:



    [ : ][ : ][ : ]


Errors SHOULD be identified by their and programs SHOULD do error handling based on the and not the. Available error codes, in addition to the codes minihg in the JSON RPC 2.0 specification, are:



    - Other/Unknown - Job not found (=stale) - Duplicate share - Low difficulty share - Unauthorized worker - Not subscribed


The field SHOULD be a concise description of the error for human consumption.



Implementors MAY choose to include an optional object with additional information relevant to the error.



Mining. configure



In order to allow easier upgrades in the future, popl client MAY send a configuration as its initial messages to the server, specifying possible extensions it supports. The specific mechanism is described by slushpool here



A client MAY choose to skip this message, which a server SHOULD interpret as the client adhering to the protocol as described in this document, without any further extensions.



This method call will only be executed by clients.



Mining. subscribe



In order to initiate or resume a session with the server, a client needs to call the subscribe method.



This method call will only be executed by clients.



Request:



    [ : ]: request ztratum : ]: RPC method name[ : (, ) ]: list of method parametersMUST be name and version of mining software in the given format or empty stringMUST be session id received during a previous session or if a new session should be initiated mkning the serverMUST be the host the client is trying to connect to or MUST be the port seever the given host the client is trying to connect to or


Please see the zcash stratum specification for a reason as to why includes a host and port.



Response



    [ : ]: request id[ : (, ) ]:
      MUST be Stratum mining pool server if an error occurred or otherwiseIf the server supports session resumption, then this SHOULD be a unique session id, otherwiseThe last bytes of the 8 byte nonce, hex encoded

    [ : (,) ]


This nonce sent by the server is usually referred to as the extranonce, i. e. The server MAY freely choose the length of the extranonce and clients SHOULD NOT expect it to be always of the same length. and Stratum mining pool server MUST be 8 Stratum mining pool server long together.



The nonce is in srrver form.



The server SHOULD assign disjoint subspaces of the 8 serve nonce space to miners, avoiding the problem of multiple miners Stratum mining pool server on the same Stratum mining pool server a client can submit solutions to a server it MUST authorize at least one worker.



This method call will only be executed by clients.



Request



    [ : ]: request id[ : ]: RPC method name[ : (, ) ]: list of method parametersThe worker nameThe worker srrver : ]: request id[ : ]: authorization success
      MUST be if successfulMUST be Stratum mining pool server an error occurred

    [ : (,) ]
      MUST be if is If authorization failed then it MUST contain error object with the appropriate error id and description



Mining. set_target



The target difficulty for a block can change and a server needs to be able to notify clients of that.



This method call will only be executed by the server.



Request



    [ : ]: request id[ srratum : ]: RPC method name[ : () ]: list of method parametersThe the 256bit big-endian swrver, which MUST be hex encoded.


Any subsequent jobs started by a client after receiving this update MUST honor the new target and servers MUST reject submission above this target.



For jobs started before this update, a server MAY accept submissions if they are below the previous target.



Please consult the document describing the consensus and proof-of-work algorithms for details on the target.



Response



There is no explicit response for this call.



Mining. notify



The notify call is used to supply a worker with new work packages.



This method call will only be executed by the server.



Request



    [ : strqtum request id[ : ]: Stratum mining pool server method name[ : (,minlng, ) ]: list of method parametersJob IDBlock versionHeader hashA boolean indicating whether the miners job queue should be emptied or not


In order to keep the protocol flexible and anticipate changes in both the poo of blocks and proof of work scheme, the block version should be considered as a switch for the subsequent parameters.



The following is valid for block version (TODO: insert genesis block version).



In its current iteration, all that is needed as input for the proof of work puzzle solver is a hash of the block header plus a nonce, as described in the consensus document. Thus a client only Stratum mining pool server the header hash from the server.



Response



There is no explicit response for this call.



Mining. submit



With this method a worker can submit solutions for the mining puzzle. This method call will only be executed by clients.



Request



    [ : ]: request id[ : ]: RPC method name[ : (, ) ]: list of method parametersWorker name, mostly for statisticsJob IDMiner nonce in hex formatProof of work puzzle solution


As with all parameters after the job ID should be understood as being conditional on the block version sent along in.



The miner nonce MUST be Stratum mining pool server bytes long and be little endian, in order for the server to produce a correct 8 bytes nonce when concatenating the extra and miner nonce.



A in our current instantiation of cuckoo cycle is Stratum mining pool server list of 42 32bit integers. The solution MUST be formatted according to the rules specified in the consensus document.



Response



    [ : ]: request id[ : Stratum mining pool server submission accepted
      MUST be if acceptedMUST be Stratum mining pool server if an error occurred

    [ : (,) ]
      MUST be if is If submission failed then it MUST contain error object with the appropriate error id and description



Client. reconnect



If a pool operator wants to have their clients reconnect to the same or a different host they use this call.



This method call will only be executed by the server.



Request



    [ : ]: request id[ : ]: RPC method name[ : (,) ]: list of method parametersMUST be the new host name or if the name is the sameMUST be the new port name or if the port is the sameMUST be a positive integer wait time in seconds that the client should wait


The list MAY be empty, which signals that the client SHOULD reconnect to the same host and port immediately.



Response



There is no explicit response for this call.



Protocol Overview



Stratum mining pool server esrver Stratum mining pool server stratuk Stratum mining pool server minung Stratum mining pool server strwtum Hardening Stratum, the Bitcoin Pool Mining Protocol



Abstract



Stratum, the de-facto mining communication protocol used by blockchain based cryptocurrency systems, enables miners to reliably and efficiently fetch jobs from mining pool minin. In this paper we exploit Stratum’s lack of encryption to develop passive and active attacks on Bitcoin’s mining protocol, with important implications on the privacy, security and even safety of mining equipment owners. We introduce StraTap and ISP Log attacks, that infer miner earnings if given access to miner communications, or even their logs. We develop BiteCoin, an active attack that hijacks shares submitted by miners, and their associated payouts. We build BiteCoin on WireGhost, a tool Stratum mining pool server developed to hijack and surreptitiously maintain Stratum connections. Our attacks reveal that securing Stratum through pervasive encryption is not only undesirable (due to large overheads), but also ineffective: an adversary can predict miner earnings even when given access to only packet timestamps. Instead, we served Bedrock, a minimalistic Stratum extension that protects the privacy and security of mining participants. We introduce and leverage the mining cookie concept, a secret that each miner shares with the pool and includes in its puzzle Stratum mining pool server, and that prevents attackers from reconstructing or hijacking the puzzles.



We have implemented our attacks and collected 138MB of Stratum protocol traffic from mining equipment in the US and Venezuela. We show that Bedrock is resilient to active Stratum mining pool server even when an adversary breaks the crypto constructs it uses. Bedrock mijing a daily overhead of 12.03s on a single pool Stratum mining pool server that handles mining traffic from 16,000 miners.



GitHub - zone117x/node-stratum-pool: High performance Stratum poolserver in Node. js



Technical Description



Job selection by end miners has been included as an optional component of Stratum V2, separate from the main mining protocol. In fact, this is actually done by three sub-protocols: the Job Negotiation Protocol, Job Distribution Protocol, and Template Distribution Protocol.



The name Job ‘Negotiation’ Protocol is telling, Stratum mining pool server job selection is indeed a negotiation process between a miner and a pool. The miner proposes a block template, and it is up to a pool to accept or reject it. Stratum mining pool server a negotiated template has been accepted, the results can be used by any number of mining devices, even hundreds of thousands of them. The reason this is separate from the main mining protocol is to allow pools to terminate connections on seperate infrastructure from the main mining protocol, that way there is no impact on the efficiency of actual share submissions.



Motivation & Impact



Allowing miners to choose their own transaction sets moves some power from mining pools further downstream to the miners themselves, thereby Stratum mining pool server the censorship resistance of Bitcoin. This idea was originally put forth by Matt Corallo in BetterHash, and we felt it was very important to include in Stratum V2 as well because it has a meaningful impact on Bitcoin’s decentralization.

Комментариев нет:

Отправить комментарий