-
Notifications
You must be signed in to change notification settings - Fork 12
Breez signer #487
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
base: main
Are you sure you want to change the base?
Breez signer #487
Conversation
4620bbf to
44d1dae
Compare
7dff500 to
37035fa
Compare
danielgranhao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Just a few comments
| let builder = | ||
| lnurl_models::nostr::create_zap_receipt(zap_request, invoice, preimage.clone()) | ||
| .map_err(NostrError::ZapReceiptCreationError)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, but IMO helps with readability
| let builder = | |
| lnurl_models::nostr::create_zap_receipt(zap_request, invoice, preimage.clone()) | |
| .map_err(NostrError::ZapReceiptCreationError)?; | |
| let builder = | |
| lnurl_models::nostr::create_zap_receipt_event_builder(zap_request, invoice, preimage.clone()) | |
| .map_err(NostrError::ZapReceiptCreationError)?; |
| .map_err(|e| SdkError::Generic(e.to_string()))?, | ||
| ); | ||
|
|
||
| // Create the signer from seed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: comment should be moved up
| // Use legacy master key when using default key set and default derivation path for backwards compatibility | ||
| let master_key = | ||
| if self.key_set_type == KeySetType::Default && self.account_number.is_none() { | ||
| let bitcoin_network: bitcoin::Network = self.config.network.into(); | ||
| Xpriv::new_master(bitcoin_network, &seed_bytes) | ||
| .map_err(|e| SdkError::Generic(e.to_string()))? | ||
| } else { | ||
| key_set.identity_master_key | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does something replace this to maintain backwards compatibility?
| path: &DerivationPath, | ||
| ) -> Result<secp256k1::schnorr::Signature, SdkError>; | ||
|
|
||
| fn derive_public_key(&self, path: &DerivationPath) -> Result<secp256k1::PublicKey, SdkError>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be async?
Refactors the signing architecture by introducing a unified
BreezSignertrait and specialized adapter implementations:BreezSignerImpl: Core signer with BIP32 key derivationSparkSigner: Adapter for spark-wallet operationsNostrSigner: Adapter for Nostr event signingRTSyncSigner: Adapter for real-time sync signing/encryption