Skip to main content

Crate nostro2_traits

Crate nostro2_traits 

Source
Expand description

§nostro2-traits

Signing surface for the nostro2 ecosystem. Two traits, no data structures, no curve dependencies — nostro2 (data), nostro2-nips (protocols), and nostro2-signer (impls) all depend on this crate.

  • NostrSigner: minimum signing surface (sign a 32-byte prehash, expose the x-only pubkey, generate a fresh signer). Hardware wallets, NIP-46 remote signers, and browser extensions can implement this without ever exposing key material.
  • NostrKeypair: extends NostrSigner with raw secret-key export and ECDH for in-process keypairs.
  • hex: minimal hex encode/decode traits (Hexable, FromHex).

Modules§

bech32
Minimal bech32 encode/decode (BIP-173) with no external dependencies.
hex
Minimal hex encode/decode — replaces the hex crate.

Enums§

SignerError
Errors returned by signing and key-derivation operations.

Traits§

NostrKeypair
Extended interface for signers that hold raw secret material in process, adding key export, ECDH, and local key generation.
NostrSigner
Minimal signing surface: produce a Schnorr signature over a 32-byte prehash and expose the x-only public key. All hex/bech32 conversions are default methods on top.

Type Aliases§

Result
Convenience alias.