Skip to content

feat!: Add Electrum protocol v1.6 method support#11

Open
evanlinjin wants to merge 2 commits intobitcoindevkit:masterfrom
evanlinjin:feature/electrum_protocol_v1_6
Open

feat!: Add Electrum protocol v1.6 method support#11
evanlinjin wants to merge 2 commits intobitcoindevkit:masterfrom
evanlinjin:feature/electrum_protocol_v1_6

Conversation

@evanlinjin
Copy link
Copy Markdown
Member

Summary

Add support for Electrum protocol v1.6 methods and response format changes.

  • ServerVersion request type for server.version (version negotiation)
  • EstimateFee gains an optional mode parameter ("ECONOMICAL", "CONSERVATIVE", etc.)
  • blockchain.block.headers responses now support both pre-1.6 (concatenated hex "hex" field) and v1.6 (list of hex strings "headers" field) formats
  • BroadcastPackage request type for blockchain.transaction.broadcast_package (package relay)
  • GetMempoolInfo request type for mempool.get_info (replaces blockchain.relayfee)
  • RelayFee deprecated in favor of GetMempoolInfo
  • Added missing Features to gen_pending_request_types! macro

Breaking changes

  • EstimateFee has a new mode: Option<CowStr> field
  • New enum variants in CompletedRequest / FailedRequest for the added request types

Test plan

  • cargo test passes
  • cargo clippy clean
  • cargo doc clean (no warnings)
  • Integration test against a v1.6 Electrum server

Closes #8

🤖 Generated with Claude Code

Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
@evanlinjin evanlinjin force-pushed the feature/electrum_protocol_v1_6 branch from 39ba059 to 5836c20 Compare May 6, 2026 16:20
- Add `ServerVersion` request type (`server.version`)
- Add optional `mode` parameter to `EstimateFee` (breaking: new field)
- Support both pre-1.6 (concatenated hex) and v1.6 (list of hex strings)
  response formats for `blockchain.block.headers`
- Add `BroadcastPackage` request type (`blockchain.transaction.broadcast_package`)
- Add `GetMempoolInfo` request type (`mempool.get_info`)
- Add missing `Features` to `gen_pending_request_types!` macro

Closes bitcoindevkit#8

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@evanlinjin evanlinjin force-pushed the feature/electrum_protocol_v1_6 branch from 5836c20 to 581156d Compare May 6, 2026 16:38
Cover both the pre-1.6 concatenated-hex path and the v1.6 array-of-hex
path, asserting they produce equal `Vec<Header>`, plus a sanity check
that non-string/non-array inputs are rejected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oleonardolima oleonardolima self-requested a review May 7, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update client to support Electrum protocol v1.6 methods

1 participant