Skip to main content

ExternalSigner

Trait ExternalSigner 

Source
pub trait ExternalSigner: Send + Sync {
    // Required methods
    fn capabilities(&self) -> ExternalSignerCapabilities;
    fn public_key(&self) -> Result<NostrPublicKey, ExternalSignerFailure>;
    fn sign_event(
        &self,
        request: &ExternalEventSigningRequest,
    ) -> Result<String, ExternalSignerFailure>;

    // Provided methods
    fn nip44_encrypt(
        &self,
        _recipient: &NostrPublicKey,
        _plaintext: &str,
    ) -> Result<String, ExternalSignerFailure> { ... }
    fn nip44_decrypt(
        &self,
        _sender: &NostrPublicKey,
        _payload: &Nip44Payload,
    ) -> Result<String, ExternalSignerFailure> { ... }
}
Expand description

A keyless external signing and NIP-44 provider.

Providers expose only high-level operations. There is deliberately no private-key export method and no local-identity erasure semantic. Provider lifecycle, user prompts, cancellation, and transport remain host-owned.

Required Methods§

Source

fn capabilities(&self) -> ExternalSignerCapabilities

Advertise the provider’s independently available capabilities.

Source

fn public_key(&self) -> Result<NostrPublicKey, ExternalSignerFailure>

Return the canonical identity public key.

Source

fn sign_event( &self, request: &ExternalEventSigningRequest, ) -> Result<String, ExternalSignerFailure>

Sign the explicit event ID in request and return a Schnorr signature.

Provided Methods§

Source

fn nip44_encrypt( &self, _recipient: &NostrPublicKey, _plaintext: &str, ) -> Result<String, ExternalSignerFailure>

Encrypt UTF-8 through the provider’s NIP-44 capability.

Source

fn nip44_decrypt( &self, _sender: &NostrPublicKey, _payload: &Nip44Payload, ) -> Result<String, ExternalSignerFailure>

Authenticate and decrypt UTF-8 through the provider’s NIP-44 capability.

Implementors§