Skip to content

feat: add frigate electrum based RPC methods - #16

Open
sdmg15 wants to merge 5 commits into
bitcoindevkit:masterfrom
sdmg15:master
Open

feat: add frigate electrum based RPC methods#16
sdmg15 wants to merge 5 commits into
bitcoindevkit:masterfrom
sdmg15:master

Conversation

@sdmg15

@sdmg15 sdmg15 commented Apr 29, 2026

Copy link
Copy Markdown

This PR adds supports for additional RPC methods provided by Frigate electrum based RPC server.

The added methods are:

  • server.version: This is the first message sent to establish connection with server
  • blockchain.silentpayments.subscribe: This takes a spend public key and a scan private key and return outputs belonging to the them.
  • blockchain.silentpayments.unsubscribe: This takes a spend public key and a scan private key and unsubscribe from notifications.

Some context:
This is useful for the PR opened at bitcoindevkit/bdk-sp#48 which is doing integration of frigate ephemeral scanning.
Opening this PR in order to receive feedback.

Reference:
https://github.com/sparrowwallet/frigate/

Supported Frigate version 1.3.2

@sdmg15 sdmg15 changed the title feat: add server.version, blockchain.silentpayments.subscribe and blockchain.silentpayments.unsubscribe feat: add frigate electrum based RPC methods Apr 29, 2026
@sdmg15
sdmg15 force-pushed the master branch 2 times, most recently from 225fc0c to 885cd2f Compare April 30, 2026 17:00
@sdmg15
sdmg15 marked this pull request as ready for review May 1, 2026 14:32
@evanlinjin

Copy link
Copy Markdown
Member

Thanks for the PR! Note that it needs a rebase now with the recent merges.

Comment thread src/notification.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/notification.rs Outdated
Comment thread src/notification.rs Outdated
Comment thread src/notification.rs Outdated
Comment thread src/notification.rs Outdated
Comment thread src/request.rs Outdated

@oleonardolima oleonardolima left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In https://github.com/sparrowwallet/frigate#serverfeatures it mentions the new field in server.features, is it not needed by bdk-sp ?

Comment thread src/request.rs Outdated
Comment thread src/request.rs
@oleonardolima oleonardolima added the enhancement New feature or request label May 26, 2026
@sdmg15
sdmg15 requested a review from oleonardolima July 3, 2026 12:44
@oleonardolima

Copy link
Copy Markdown
Contributor

@sdmg15 I just thought this now during the call, but you could also try adding support for these in https://github.com/bitcoindevkit/rust-electrum-client, not sure if the architecture there supports it though.

Comment thread src/notification.rs
Comment thread src/notification.rs Outdated
Comment thread src/request.rs
@sdmg15
sdmg15 requested a review from noahjoeris August 3, 2026 08:26

@noahjoeris noahjoeris left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating @sdmg15 !
I left a few more comments

Comment thread src/request.rs Outdated
Comment thread src/notification.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/pending_request.rs Outdated
Comment thread src/request.rs Outdated
@sdmg15

sdmg15 commented Aug 4, 2026

Copy link
Copy Markdown
Author

@noahjoeris Thanks for the reviews. I've applied the changes.

@noahjoeris noahjoeris left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for updating man. Almost there 🚀

Could you also add doc comments to the pub fields you added?

Comment thread src/pending_request.rs
Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/notification.rs Outdated
Comment thread src/request.rs Outdated
Comment thread src/notification.rs Outdated
@noahjoeris
noahjoeris self-requested a review August 25, 2026 18:31
Comment thread src/response.rs
Comment on lines +324 to +327
pub struct SpSubscribeResp {
pub address: String,
pub labels: Vec<u32>,
pub start_height: u32,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs missing

Comment thread src/response.rs
Comment on lines +332 to +336
pub struct TxTweak {
pub height: u32,
pub tx_hash: bitcoin::Txid,
pub tweak_key: bitcoin::secp256k1::PublicKey,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs missing

Comment thread src/request.rs
Comment on lines +722 to +725
// A 64 character string containing the hex of the scan private key.
pub scan_priv_key: bitcoin::secp256k1::SecretKey,

// A 66 character string containing the hex of the spend public key.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs need ///

Comment thread src/notification.rs
Comment on lines +121 to +124
pub struct SpNotification {
pub subscription: response::SpSubscribeResp,
pub progress: f32,
pub history: Vec<response::TxTweak>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs missing

Comment thread src/request.rs
Comment on lines +671 to +677
// A 64 character string containing the hex of the scan private key.
pub scan_priv_key: bitcoin::secp256k1::SecretKey,

// A 66 character string containing the hex of the spend public key.
pub spend_pub_key: bitcoin::secp256k1::PublicKey,

// Block height or timestamp to start scanning from. Values above 500,000,000 are treated as seconds from the start of the epoch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs need ///

@noahjoeris

Copy link
Copy Markdown

Thanks @sdmg15 . I left some final nits. And I ran a quick manual test and it was looking good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants