Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The bitcoincore-rpc dependency has problems in our specific use case #350

Open
DanGould opened this issue Aug 20, 2024 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers payjoin-cli

Comments

@DanGould
Copy link
Contributor

DanGould commented Aug 20, 2024

bitcoincore-rpc presents us with a few problems

1. It depends on a different HTTP client stack than the rest of the project, minreq

Everywhere else in this project we use reqwest. There is an ecosystem-wide call for an async capable http crate with minimal dependencies which we discussed at rust-bitcoin summit. This crate does not exist as of writing, so we use reqwest for async requests in payjoin-cli and bitcoincore-rpc depends on minreq

2. It has no TLS support out of the box

Though minreq supports TLS, but afaict TLS is not exposed in bitcoincore-rpc and can't easily be enabled.

@thebrandonlucas ran into this problem trying to connect to a remote MutinyNet node hosted by voltage over HTTPS.

3. bitcoincore-rpc isn't really meant for production nor maintained

I've had this discussion with @tcharding: the maintainers intend that crate to be used for integration testing only and suggest production implementations depend on bitcoin-json-rpc-types and build their own application-specific client. There is a rust-miniscript PR for this dependency swap but I haven't found more specific documentation of best practice yet.

@DanGould DanGould added enhancement New feature or request good first issue Good for newcomers payjoin-cli labels Aug 20, 2024
@tcharding
Copy link

tcharding commented Aug 20, 2024

Just to clarify, because all these crates are a bit confusing:

  • miniscript has now moved to using bitcoind-json-rpc-regtest to run integration tests (miniscript/bitcoind-tests/) against Core versions 17.1 through to 25.0.
  • bitcoind-json-rpc-regtest is a blessed fork of bitcoind that uses bitcoind-json-rpc-client - with no other meaningful changes.
  • bitcoind-json-rpc-client depends on bitcoind-json-rpc-types
  • bitcoind-json-rpc-client is not meant for production, but is explicitly provided for use with bitcoind-json-rpc-regtest for integration testing.
  • It is intended, as you say, that bitcoind-json-rpc-types can be used in production so folks don't have to re-write all the json types
  • Currently only a small subset of all types are done

The next steps are:

  • Move rust-jsonrpc crate into the rust-bitcoin-json-rpc repository
  • Move the rust-bitconi-json-rpc repository into the rust-bitcoin org
  • EOL (archive) the bitcoind repository (currently in Ricardo's github account)
  • Decide how to handle the rust-bitcoincore-rpc repo (archive or at least mention why there are two in the org)
  • Grind out all the other types and JSONRPC methods

Applications should write their own rpc client that supports just the subset of JSONRPC methods they need. There is nobody among the rust-bitcoin devs that is interested in supporting feature requests and bug reports against a production client. We do, however, feel obligated to provide the types and testing stuff. This obligation is the motivation for putting all these crates in a single repo so they can be more easily managed and isolated.

ref: https://crates.io/search?q=bitcoind-json-rpc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers payjoin-cli
Projects
None yet
Development

No branches or pull requests

2 participants