This PR provides a simple example of how to import and use the sv2-ffi
Rust crate which exports the Stratum V2 (Sv2) functions required by a Template Provider as a C library.
Stratum V2
Template Provider
Sv2 defines a service (role) called the Template Provider (TP), whose functionality is defined as follows:
0Generates the custom block templates to be passed to the Job Negotiator for eventual mining.
1This is usually a Bitcoin Core full node (or possibly another node implementation).
Phase 1: PR Goals
This phase encompasses the concepts that must be agreed upon before proceeding with Phase 2.
- Need agreement that implementing a TP in Bitcoin Core is a good idea.
- Need agreement that the implementation of a TP in Bitcoin Core should use the Rust crates in this workspace.
Phase 2: PR Implementation
This phase will commence once the concepts in Phase 1 are agreed upon. Phase 2 is the final goal of this project and encompasses the the implementation steps required for a functional TP in Bitcoin Core.
- Extensive review of the
sv2-ffi
API and other Rust sources. - Review of the guix build process.
- Find a location for the Sv2 crates (possibly under the Bitcoin GitHub Account) to live *1.
- Implement the TP.
If TP in Core gets a concept NACK
A TP can be implemented as an independent service and can communicate with core via RPC.
If Rust in Core gets a concept NACK
A TP can be implemented in core without using any Rust dependency.
*1 Right now the Rust sources are in this PR and are packaged by a script before doing the guix build. Ideally these sources should live in another project repository and should be packaged by the guix script which builds a downloadable binary.