brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
bitcoin-libraries-corepccorepc: the rust-bitcoin org's Bitcoin Core JSON-RPC stack. `corepc-types` (per-Core-version response types + version-agnostic `model` types), `corepc-client` (blocking/async test client), `bitcoind` (spin up regtest nodes for integration tests). USE WHEN: talking to bitcoind from Rust, or integration-testing Rust code against a real Bitcoin Core binary.
Independent GitHub snapshot · Automated classification · Original documentation governs
corepc-types (per-Core-version response types + version-agnostic
model types), corepc-client (blocking/async test client),
bitcoind (spin up regtest nodes for integration tests).
USE WHEN: talking to bitcoind from Rust, or integration-testing Rust
code against a real Bitcoin Core binary.
allowed-tools: Read, Grep, GlobBitcoin Core JSON-RPC support for Rust. Replaces the archived
rust-bitcoincore-rpc.
Repo: github.com/rust-bitcoin/corepc. As of September 2026 the GitHub
README carries a "This repository has moved" banner pointing at the
org's own Forgejo instance, git.rust-bitcoin.org/rust-bitcoin/corepc;
issues and PRs belong there, crates still publish to crates.io as
normal.
The README is explicit and unusual, so do not skip it:
If you require a JSON RPC client in production software it is expected you write your own and only use the
corepc-typescrate in your dependency graph.Please do not use
corepc-clientin production and raise bugs, issues, or feature requests.
So the supported split is: corepc-types is the production
dependency; corepc-client exists to exercise those types and to
drive nodes in tests. Meanwhile the archived rust-bitcoincore-rpc
README (archived 25 November 2025) tells its users to switch to
corepc-client. Both statements are upstream; reconcile them by taking
the types crate plus a thin client of your own for a service, and
corepc-client for tests and tooling.
| Crate | Version | Released | Role |
|---|---|---|---|
corepc-types | 0.15.0 | 18 June 2026 | RPC response types |
corepc-client | 0.16.0 | 18 June 2026 | Blocking / async client |
bitcoind | 0.41.0 | 18 June 2026 | Regtest node harness |
jsonrpc | 0.20.1 | 27 May 2026 | JSON-RPC 2.0 plumbing |
bitreq | 0.3.7 | 28 May 2026 | Minimal HTTP client |
electrsd | 0.41.0 | 18 June 2026 | Regtest electrs harness |
MSRV across the workspace is Rust 1.75.0; the crates build against
bitcoin = "0.32.0". Releases came roughly fortnightly from April to
June 2026 (client 0.11.0 → 0.16.0); nothing has been tagged since the
18 June 2026 wave.
The whole point of the repo is that a Core RPC response shape depends on
which Core you are talking to. corepc-types therefore has one module
per Core major - v17 through v31 - holding the literal JSON shape
that version returns, plus a model module of version-agnostic types.
Convert with into_model():
use corepc_client::client_sync::v31::Client;
use corepc_client::client_sync::Auth;
// cargo add corepc-client --features client-sync
let client = Client::new_with_auth(
"http://127.0.0.1:8332",
Auth::UserPass("user".into(), "pass".into()),
)?;
let json = client.get_blockchain_info()?; // corepc_types::v31 shape
let info = json.into_model()?; // corepc_types::model shape
println!("{} at height {}", info.chain, info.blocks);
Client::new(url) exists for unauthenticated endpoints. Features:
client-sync (blocking) and client-async; neither is on by default.
The v31 client asserts the server version it was built for
(impl_client_check_expected_server_version!({ [310000] })), so pointing
a v31::Client at a v29 node fails loudly instead of mis-deserialising.
No crate here sniffs the peer's version for you - picking the right
module is the application's job.
bitcoind[dev-dependencies]
bitcoind = { version = "0.41", features = ["latest", "download"] }
use bitcoind::BitcoinD;
let node = BitcoinD::from_downloaded()?; // needs the `download` feature
let info = node.client.get_blockchain_info()?;
assert_eq!(info.chain, "regtest");
// node killed on drop; datadir is a tempfile::TempDir
BitcoinD::new(exe) / BitcoinD::with_conf(exe, &conf) use a binary
already on the host instead. The crate re-exports version-specific types
as vtype and the model types as mtype.
Version features select which Core the harness expects, and they cascade downwards:
default = ["0_17_2"], latest = ["31_0"].31_0 → 31.0, 30_2 →
30.2, 29_0 → 29.0, then 28_2, 27_2, 26_2, ... back to
0_17_2 (as of bitcoind 0.41.0, June 2026). There is no 30_0
or 30_1 feature, excluded upstream because of a wallet migration
bug.Cargo.toml
comment about supporting every minor of the latest three majors is
stale; bitcoind/src/versions.rs is the authority.rust-bitcoin/rust-bitcoincore-rpc was archived on 25 November 2025 with
bitcoincore-rpc frozen at 0.19.0 (May 2024) and its README recommending
corepc-client. The bitcoind crate name is the same crate lineage: it
was renamed to corepc-node and then renamed back to bitcoind in
0.37.0 (16 April 2026, PR #542), with the version number bumped past the
old standalone bitcoind releases. corepc-node is frozen at 0.12.0
(April 2026) - move to bitcoind 0.37.0+.
Shape differences to expect when porting:
into_model() hop, or read the v3x fields directly.into_model() is fallible - Core returns -1 in fields typed as
numeric, and amounts have to survive the float round trip.corepc-client in a production service. Upstream says not to
and will not take bug reports for it.corepc-client
0.16.0 pins corepc-types 0.15.0 and bitcoind 0.41.0 pins
corepc-client 0.16.0 - take one wave.bitcoind's default feature targets a modern node: the
default is 0_17_2. Pass latest or an explicit version feature.download pulls a Core binary over the network at build time, which
most sealed CI images will refuse. Pre-fetch and use
BitcoinD::new(exe) there.getnetworkinfo once at
startup and fail fast if the node is not the major you compiled for.