Skip to main content

Crate nula_core

Crate nula_core 

Source
Expand description

Protocol primitives for the Nostr protocol used across the nula workspace.

nula-core is the lowest layer of the workspace. It defines the on-the-wire data model (events, filters, tags, messages), the cryptographic identity (keys, signatures), and a small set of shared value types. It performs no I/O, has no async runtime dependency, and is safe to reuse from tests, relays, signers, and offline tooling.

Higher-level crates layer pool management, transports, databases, gossip, signers, and relay servers on top of these primitives.

§Hard limits

Every byte size, length cap, and tunable bound the protocol mandates lives in limits. The table below summarises the most common values; consult the cited NIPs for the binding spec text.

Re-exports§

pub use self::boxed::BoxFuture;
pub use self::boxed::BoxStream;
pub use self::event::Coordinate;
pub use self::event::Event;
pub use self::event::EventBuilder;
pub use self::event::EventId;
pub use self::event::Kind;
pub use self::event::SingleLetterTag;
pub use self::event::Tag;
pub use self::event::TagKind;
pub use self::event::Tags;
pub use self::event::UnsignedEvent;
pub use self::event::compute_event_id;
pub use self::filter::Filter;
pub use self::key::Keys;
pub use self::key::PublicKey;
pub use self::key::SecretKey;
pub use self::message::ClientMessage;
pub use self::message::RelayMessage;
pub use self::message::SubscriptionId;
pub use self::metadata::Metadata;
pub use self::nips::nip19::FromBech32;
pub use self::nips::nip19::Nip19Entity;
pub use self::nips::nip19::ToBech32;
pub use self::signer::NostrSigner;
pub use self::types::ImageDimensions;
pub use self::types::RelayUrl;
pub use self::types::Timestamp;
pub use self::types::Url;
pub use self::util::JsonUtil;

Modules§

boxed
Boxed, type-erased async return shapes used across object-safe trait surfaces in nula-* crates.
event
Nostr events.
filter
NIP-01 subscription filter.
key
Cryptographic identity for the Nostr protocol.
limits
Hard limits enforced by the Nostr protocol primitives.
message
Wire messages exchanged over a relay WebSocket.
metadata
NIP-01 user metadata (kind 0 event content).
nips
NIP modules — one Rust module per Nostr Implementation Possibility.
observe
Observability field conventions for tracing spans.
parser
Single-pass content parser for Nostr text-bearing events.
prelude
Convenience re-exports for the most common Nostr types.
signer
NostrSigner trait — the universal signing interface used by every higher-level crate.
types
Shared value objects used across the Nostr protocol.
util
Utility helpers shared by every other nula-core module.