Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers. https://crates.io/crates/electrum-client
  • Rust 99.4%
  • Just 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-20 19:04:38 -04:00
.cargo ci(audit): add new cargo audit job 2026-04-21 10:32:07 -03:00
.github fix(ci): pin jobserver for MSRV 2026-07-22 14:22:11 -03:00
examples chore: add SPDX-License-Identifier on all source files 2026-04-23 11:49:03 -03:00
src Drop a compromised CA root 2026-10-20 19:04:38 -04:00
.gitignore Release 0.1.0-beta.1 2020-02-06 18:15:22 +01:00
Cargo.toml Drop a compromised CA root 2026-10-20 19:04:38 -04:00
CHANGELOG.md chore(release): bump electrum-client to 0.25.0 2026-04-21 11:06:19 -03:00
clippy.toml ci(msrv): bump rust MSRV to 1.75 2025-01-20 13:57:25 -03:00
justfile chore: Update justfile 2026-02-11 14:27:18 -05:00
LICENSE-APACHE feat(doc): add LICENSE-APACHE 2026-04-22 19:37:18 -03:00
LICENSE-MIT feat(doc): add LICENSE-APACHE 2026-04-22 19:37:18 -03:00
LICENSE.md feat(doc): add LICENSE-APACHE 2026-04-22 19:37:18 -03:00
README.md Document the fork 2026-09-06 15:51:32 -04:00
SECURITY.md docs: add SECURITY.md file 2026-08-05 16:51:33 -03:00

rust-electrum-client with BLAKE2b proof of work

This is an unofficial fork of rust-electrum-client that follows the BLAKE2b proof-of-work hardfork of Bitcoin. It is not affiliated with the Bitcoin Dev Kit project. Upstream has not adopted the fork, so use upstream instead if that is what you want.

Not reviewed by upstream. Everything below the divider is upstream's documentation and describes rust-electrum-client rather than this fork.

What differs from upstream

  • Concatenated headers are split by length, not by a fixed stride. The protocol 1.4 blockchain.block.headers response packs the headers into one blob, and upstream splits it with i * 80. Past the hardfork a header may be 164 bytes, so a fixed stride desyncs the moment an extended header appears. Each header is now parsed and the buffer advanced by what it actually consumed.
  • Two bugs fall out of that, both reachable from a remote server. A short response used to panic on the slice index, which is a denial of service from any server the client talks to. A blob that did not tile into count headers used to be accepted silently and return wrong headers, because any 80 bytes parse as a header. Both are errors now.
  • The server-supplied count is bounded before it sizes an allocation. Unchecked, {"count":1000000000000} reaches Vec::with_capacity and aborts the process with an uncatchable allocation failure.
  • A build guard. bitcoin must be the fork carrying hardfork support. Cargo honours [patch] only in the workspace root, so a consumer that forgets it would otherwise compile clean and mis-parse headers at runtime, past the activation height only.

Everything else needs no change: the single-header paths hand a complete byte string to deserialize, which is length-agnostic, and the protocol 1.6 response sends an array rather than a blob.

Branches

Branch Base Use
master upstream master The fork's line. Carries the changes above.

Releases are tagged so a dependent can pin an immutable rev rather than a moving branch.

Using it

[patch.crates-io]
bitcoin = { git = "https://github.com/privkeyio/rust-bitcoin", rev = "<pinned rev>" }
electrum-client = { git = "https://github.com/privkeyio/rust-electrum-client", rev = "<pinned rev>" }

Both are needed: this crate's fix is the header splitting, and the header parsing itself lives in bitcoin.


rust-electrum-client

Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers.

Security Policy

To report a security issue, please refer to the security policy.

Minimum Supported Rust Version (MSRV)

This library should compile with any combination of features with Rust 1.75.0.

To build with the MSRV you will need to pin dependencies by running:

cargo update -p openssl --precise "0.10.78"
cargo update -p openssl-sys --precise "0.9.114"
cargo update -p zeroize --precise "1.8.2"
cargo update -p jobserver --precise "0.1.34"

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.