Repository navigation
Replies: 3 comments 4 replies
|
To clarify the scope: this discussion is not specifically aimed at solving payout distribution, as addressed by PR #195 and PR #203. Payout distribution introduces additional accounting and policy questions, including recipient selection, allocation of amounts, dust handling and accounting-window updates. Both proposals involve JDS in payout management and rely on coordination or shared payout state between JDS and Pool. This does not necessarily require a direct network connection, but it makes payout information part of JDS’s responsibilities. The mechanism discussed here is more general: the pool updates coinbase output requirements through the Mining Protocol, without requiring JDS to track live payout state. Payout distribution is one possible application, alongside other coinbase commitments and ordinary non-JD work. In Full-Template mode, JDS would still validate the declared work and receive the complete solved coinbase for block propagation. The aim is to keep live coinbase-output management in the mining relationship. |
|
before going through the details of this proposal I feel I need to challenge a core assumption, and hopefully reveal a blindspot on how the spec is being interpreted. it seems we're assuming that when the difficulty target of a channel is modified (via that is not true. since the inception of
while some terminology has changed since then (there's no
now, I do understand how DMND SLICE brings the pre-requisite of committing the difficulty target to the coinbase tx, and nothing of what I clarified above dismisses that: committing the difficulty target inside the coinbase tx is still important because shares need to be auditable in a way that vanilla Sv2 does not allow. so yeah, we still need a protocol extension! but it is important that we clarify which problems need a solution, and which problems do not. more specifically, there's no obstacle for share validation. as long as the Mining Server:
it already has everything it needs to validate shares. note: with regards to share validation, now, onto the extension design: hopefully my clarifications above make it clear why there's no need to add a new message, because the same job cannot change its own difficulty target without contradicting some fundamental properties of Sv2 Mining Protocol so I think DMND SLICE could benefit from a much simpler extension: as soon as the extension is enacted via the
where in the coinbase tx the difficulty target is committed remains an open-ended question... during WG call, it was proposed that it was committed to so in this alternative approach, the difficulty target would go into and finally:
note: with regards to creating jobs with non-vanilla Sv2 logic, |
|
Hi @plebhash, thank you for the time spent reviewing. It seems worth exploring whether a common mechanism could support these cases. The whole point here is the actual need for enough flexibility to allow the pool to change a coinbase output on the fly without wasting resources. Finally, at DEMAND we chose coinbase outputs because the 100-byte scriptSig budget is shared by the block height, extranonce, tags and other commitments, and can become tight quickly. Using scriptSig is a valid option for small commitments, but not for general use. Also, compared to using the coinbase outputs, it is likely harder to implement. |
Uh oh!
There was an error while loading. Please reload this page.
A pool may need to change coinbase outputs while miners continue working on exactly the same ordered transactions—for example, to update payout destinations, merged-mining commitments or channel commitments. These changes should not inherently require another transaction declaration or retransmission of all the unchanged mining-job data.
In Full-Template mode, the declared coinbase is part of the approved work. When authorization binds that coinbase, changing its outputs can require another JDS approval even though the selected transactions remain unchanged. This couples live mining management to transaction-template validation. The motivation for this proposal is to provide a lightweight Mining Protocol mechanism for updating coinbase outputs while preserving the transaction-template identity and the client’s ability to include and order its own outputs. Updates within the existing validation and resource constraints could proceed without another JDS round trip. The same mechanism could also reduce redundant job distribution for ordinary pool-selected work.
A broader solution would move coinbase construction, payout requirements and other mining management entirely into the Mining Protocol, leaving JDS responsible for transaction-template validation and block propagation. That would provide a clearer separation, but requires substantial redesign.
A smaller proposal could introduce coinbase output updates while keeping the transaction-template identity stable.
Proposed messages
Introduce two Mining Protocol messages:
SetCoinbaseOutputs (Server → Client)
Updates the pool-specified coinbase outputs for an existing job. For ordinary pool-selected work, the message supplies the complete output list and its ordering. For JD work, including Coinbase-only, it replaces the pool's previous output requirements. The downstream combines these requirements with its miner-owned outputs and TP requirements.
channel_idU32job_idU32coinbase_tx_outputsB0_64KSetCoinbaseOutputsSuccess (Client → Server)
Only used for Custom Jobs introduced through
SetCustomMiningJob, in either Full-Template or Coinbase-only mode. This response communicates the final ordered output list after the downstream combines the pool’s requirements with its miner-owned outputs and TP requirements. For ordinary pool-selected work,SetCoinbaseOutputsalready supplies the complete ordered output list. NoSetCoinbaseOutputsSuccessresponse is exchanged, and the pool MUST NOT wait for one.channel_idU32job_idU32coinbase_tx_outputsB0_64KFor this proposal, job_id identifies the ordered non-coinbase transaction template. Updating only the coinbase outputs would not increment the job counter, repeat transaction exchange, or require another SetCustomMiningJob / SetCustomMiningJobSuccess exchange.
Output ownership and ordering
The interpretation would depend on the work being updated:
• Ordinary pool-selected work: The pool supplies the complete output list and its ordering. The proxy reconstructs the coinbase using the existing job data and distributes updated work downstream, without requiring another full
NewExtendedMiningJobfrom the pool.• JD work, including Coinbase-only: The message replaces the pool’s output requirements. JDC combines them with its miner-owned outputs and TP requirements, then returns the exact resulting output list in
SetCoinbaseOutputsSuccess.JD clients would retain the ability to reorder and interleave outputs. There would be no mandatory pool outputs + client outputs concatenation. The previous pool outputs are replaced; they are not retained alongside the new ones. Coinbase output updates MUST preserve the validated witness commitment and the coinbase witness reserved value. Outputs MAY be reordered, but the effective BIP141 commitment after the update MUST remain the validated commitment. The downstream and pool MUST check
this before activating the updated work. Changes to the non-coinbase transactions or their witnesses require normal template validation. The pool checks that its required outputs are included with the appropriate amounts and multiplicity. The completed coinbase must also preserve the applicable commitments and satisfy reward, weight, sigops and witness-commitment constraints. These are checks on the coinbase change, without repeating validation of unchanged transactions. Coinbase output updates must fit within the resources reserved by TP. An update exceeding that reservation may require JDC to contact TP and obtain a compatible template before activating the updated work. This could change the selected transactions and require another declaration. How reservations can be increased during a session remains a design question. JDC remains responsible for constructing work that preserves its own and TP’s requirements. The payout-output convention must distinguish an adjustable payout amount from genuinely zero-valued outputs.
Approval and block propagation
When accepting the initial
SetCustomMiningJob, the pool verifies the JDS token and records the accepted job. Subsequent coinbase updates are authorized throughSetCoinbaseOutputsand completed bySetCoinbaseOutputsSuccess. The pool checks these updates against the accepted job’s constraints, without requesting another JDS approval or verifying the original coinbase-bound token against the modified coinbase. The pool must be able to verify that authorization without contacting JDS.For Full-Template operation, replace:
PushSolution.extranonce: B0_32with:
PushSolution.coinbase_tx: B0_64KThis carries the actual complete solved coinbase, including extranonce and witness data, following TDP’s
SubmitSolution.PushSolutionshould also include an explicit reference to the approved declaration. JDS can then reconstruct the block from the supplied coinbase and retained transactions, rather than relying on its most recent declaration or cached coinbase. Consequently, it is not needed to forward the every coinbase output update to JDS.Properties to preserve
• No direct Pool–JDS communication: JDC carries the approval to the pool and the solved coinbase to JDS.
• JDS retains declaration recognition, validation and block propagation in Full-Template mode.
• Optimistic startup remains available: Once the initial template, output requirements and extranonce assignment are known, downstream work can begin as before, with shares buffered until initial Mining acceptance.
• Coinbase-only retains its privacy tradeoff: JDS does not receive or validate the transactions, and JDC/TP continue handling block propagation.
For a smaller first change,
AllocateMiningJobTokenSuccess.coinbase_tx_outputscould remain the initial advertisement, with subsequent Mining messages replacing those requirements. Moving the initial advertisement into a channel-scoped Mining message would make that allocation field redundant, but needs a bootstrap rule before a custom job_id exists.Activation and compatibility
Keeping the same job ID requires an explicit rule for activating updated coinbases and handling shares already in flight.
SetCoinbaseOutputsSuccesscould provide an ordered cutover boundary, but then late shares using the previous coinbase would need to be discarded. Retaining older coinbases for validation is another possibility, with additional processing and retention costs. These semantics require an explicitly negotiated extension or protocol revision.Use cases
• Channel-difficulty commitment: Update the commitment without redeclaring unchanged transactions. This is relevant to DEMAND’s transparency system.
• Merged mining: Refresh an auxiliary-chain commitment independently of Bitcoin transaction selection, as needed for Rootstock (https://dev.rootstock.io/node-operators/merged-mining/getting-started/).
• Direct coinbase payouts: Update recipients and amounts as a P2Pool-style accounting window (https://en.bitcoin.it/wiki/P2Pool#Payout_logic) advances.
• Payout address or script rotation: Change the reward destination or custody arrangement during a session.
• Lighter work selection: Update outputs while reusing the existing coinbase prefix, Merkle path and other job parameters instead of retransmitting an entire
NewExtendedMiningJobor another round of declaration for JD downstreams.All reactions