After much discussion in #29432 it appears there’s currently little support for directly supporting Stratum v2 in Bitcoin Core, with most contributors favouring the creation of a Mining IPC interface that external applications can use.
The only such application currently is the Template Provider implemented by me in https://github.com/Sjors/bitcoin/pull/48. This also serves to illustrate how the interface is used and that it’s complete. The folks working on SRI should be able to build a Template Provider as well, once the interface is complete and shipped in a release.
Needed for (hopefully) v29
To complete the interface:
- #31318
- #31283 (replaces #31003)
- #31346
- #31196
- #31197
- #31288
- https://github.com/chaincodelabs/libmultiprocess/issues/122 (not used by Stratum v2)
For multiprocess release binaries
- #31375
- #30983
- #30975 (one possible approach)
- https://github.com/chaincodelabs/libmultiprocess/pull/119
- https://github.com/chaincodelabs/libmultiprocess/issues/117
- https://github.com/chaincodelabs/libmultiprocess/pull/120
- https://github.com/chaincodelabs/libmultiprocess/pull/121
- #31455
Libmultiprocess bugfixes
Can wait for later releases
- #30437
- #31002 DATUM developers are currently uninterested in taking advantage of the more performant interface, preferring to use the
getblocktemplate
RPC instead, despite an earlier concept ACK on Stratum v2 support #27854 (comment). - new interface methods:
createFutureBlock()
for faster work switching, see #31109waitNewPowBlock()
for SPV mining, see #31109verifyBlock(CBlock block, bool allow_rollback, bool check_pow, uint256 target)
- for Stratum v2 pools to verify a proposed block, ignoring PoW
- can also be used to verify weak blocks in P2pool like systems
- can use the mempool to accelerate validation, but doesn’t update it
- (maybe) can optionally roll back, to inspect older templates
Current Template Provider users
As a stop-gap measure I plan to maintain https://github.com/Sjors/bitcoin/pull/68 which is a continuation of #29432, since people are currently using that. Once the Mining interface makes it into a release, along with multiprocess enabled Guix binaries, I plan to drop that in favour of https://github.com/Sjors/bitcoin/pull/48.
Additionally I plan to convert the latter from a patch set on top of Bitcoin Core into a standalone application, to make it easier for others to contribute. That should make it less dependent on my own effort. The Bitcoin Core project could decide in the future to “adopt” this project, but that is entirely uncertain and most contributors seems averse to this idea.