Skip to content

Index

nips

Nostr Implementation Possibilities -- protocol-specific fetch and parse logic.

The NIPs layer sits in the middle of the diamond DAG, depending on bigbrotr.models and bigbrotr.utils. It performs I/O (HTTP, DNS, SSL, WebSocket, GeoIP) and is the most protocol-aware part of the codebase.

Warning

NIP fetch methods (Nip11.create(), Nip66.create()) never raise exceptions. Always check logs.success on the returned metadata to determine whether the operation succeeded.

Attributes:

  • Nip11

    Fetches and parses NIP-11 Relay Information Documents via HTTP. Converts wss/ws URL to https/http, sends Accept: application/nostr+json. SSL fallback: clearnet tries verified first, falls back to insecure if allow_insecure=True; overlay networks always use insecure context.

  • Nip66

    Orchestrates six parallel health tests per relay: RTT (round-trip time), SSL (certificate chain), DNS (A/AAAA/CNAME), Geo (GeoIP location), Net (ASN info), HTTP (response headers). Each test produces a separate RelayMetadata record with the appropriate MetadataType.

  • BaseData, ((BaseLogs, BaseNipMetadata)) –

    Shared abstract base classes inherited by all NIP data, log, and metadata models.

  • BaseNip ((BaseLogs, BaseNipMetadata)) –

    Abstract base class for top-level NIP models with relay, generated_at, and enforced create() / to_relay_metadata_tuple() contract.

  • BaseNipSelection ((BaseLogs, BaseNipMetadata)) –

    Base for selection models controlling which metadata types to retrieve.

  • BaseNipOptions ((BaseLogs, BaseNipMetadata)) –

    Base for options models controlling how metadata is retrieved (provides the common allow_insecure option).

  • BaseNipDependencies ((BaseLogs, BaseNipMetadata)) –

    Base for dependency containers holding external objects (keys, database readers) required by specific NIP tests.

See Also

bigbrotr.models.metadata.MetadataType: Enum with NIP11_INFO, NIP66_RTT, NIP66_SSL, NIP66_GEO, NIP66_NET, NIP66_DNS, NIP66_HTTP variants. bigbrotr.models.metadata.Metadata: Content-addressed metadata model that wraps NIP results for storage. bigbrotr.services.monitor.Monitor: Service that orchestrates NIP-11 and NIP-66 checks per relay.