Skip to content

Conversation

@roeierez
Copy link
Member

@roeierez roeierez commented Dec 17, 2025

Refactors the signing architecture by introducing a unified BreezSigner trait and specialized adapter implementations:

  • BreezSignerImpl: Core signer with BIP32 key derivation
  • SparkSigner: Adapter for spark-wallet operations
  • NostrSigner: Adapter for Nostr event signing
  • RTSyncSigner: Adapter for real-time sync signing/encryption

@roeierez roeierez marked this pull request as ready for review December 22, 2025 12:18
Copy link
Collaborator

@danielgranhao danielgranhao left a 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

Comment on lines +42 to +44
let builder =
lnurl_models::nostr::create_zap_receipt(zap_request, invoice, preimage.clone())
.map_err(NostrError::ZapReceiptCreationError)?;
Copy link
Collaborator

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

Suggested change
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
Copy link
Collaborator

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

Comment on lines -338 to -346
// 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
};
Copy link
Collaborator

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>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be async?

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.

3 participants