nula_core/key/mod.rs
1//! Cryptographic identity for the Nostr protocol.
2//!
3//! Nostr uses BIP-340 Schnorr signatures over secp256k1. Each user is
4//! identified by a 32-byte x-only public key; events carry a 64-byte Schnorr
5//! signature over the SHA-256 of the event's serialized form (NIP-01).
6//!
7//! This module exposes three primary types:
8//!
9//! - [`SecretKey`] — a 32-byte secret scalar. Constructed from random bytes
10//! or hex; never serialised to logs in plaintext.
11//! - [`PublicKey`] — a 32-byte BIP-340 x-only public key. This is the value
12//! you'll see on the wire as `pubkey` and `p` tags.
13//! - [`Keys`] — a keypair convenient for signing.
14//!
15//! All three implement `serde` as lowercase 64-char hex strings, matching
16//! NIP-01.
17
18pub mod keys;
19pub mod public_key;
20pub mod secret_key;
21
22pub use self::keys::Keys;
23pub use self::public_key::{PublicKey, PublicKeyError};
24pub use self::secret_key::{SecretKey, SecretKeyError};