For Stratum v2 custom job declaration to be bandwidth efficient, the pool can request1 only the transactions that it doesn’t know about.
The spec doesn’t specify how this is achieved, but one method is to call getrawtransaction on each of the transaction ids listed in DeclareMiningJob (or a subset if the pool software maintains a cache).
Unfortunately this RPC only supports txid, not wtxid.
I think the easiest change would be:
- have
getrawtransactionaccept eithertxidorwtxidas the first positional argument - add a
GetTransactionthat takes aWtxid - try with
Txidfirst,Wtxidif that fails - optionally add a “hash_type” argument:
txid,txidor*
See also:
-
there’s two reasons the pool requests these transactions: to approve the template and to broadcast the block if a solution is found (the miner will also broadcast via their template provider) ↩︎