nostr icon indicating copy to clipboard operation
nostr copied to clipboard

Rust implementation of the nostr protocol, high-level client library, Nostr Wallet Connect and more.

Nostr

Project structure

The project is split up into several crates in the crates/ directory:

  • Libraries:
    • nostr: Rust implementation of Nostr protocol.
    • nostr-database: Database for Nostr apps
      • nostr-ndb: nostrdb storage backend
      • nostr-rocksdb: RocksDB Storage backend
      • nostr-sqlite: SQLite Storage backend
      • nostr-indexeddb: IndexedDB Storage backend
    • nostr-relay-pool: Nostr Relay Pool
    • nostr-signer: Signer for Nostr apps
    • nostr-zapper: Zapper abstraction for Nostr apps
      • nostr-webln: WebLN zapper backend for Nostr apps
    • nostr-sdk: High level client library.
    • nwc: NWC client and zapper backend for Nostr apps
  • Binaries (tools):
    • nostr-cli: Nostr CLI

Bindings

nostr and nostr-sdk crates can be embedded inside other environments, like Swift, Kotlin, Python and JavaScript. Please, explore the bindings/ directory to learn more.

Embedded

nostr crate can be used in no_std environments. Check the example in the embedded/ directory.

Book

Learn more about rust-nostr at https://rust-nostr.org.

Available packages

  • nostr:
    • Rust: https://crates.io/crates/nostr
    • Python: https://pypi.org/project/nostr-protocol
    • Kotlin: https://central.sonatype.com/artifact/org.rust-nostr/nostr
    • Swift: https://github.com/rust-nostr/nostr-swift
    • JavaScript: https://www.npmjs.com/package/@rust-nostr/nostr
  • nostr-sdk:
    • Rust: https://crates.io/crates/nostr-sdk
    • Python: https://pypi.org/project/nostr-sdk
    • Kotlin: https://central.sonatype.com/artifact/org.rust-nostr/nostr-sdk
    • Swift: https://github.com/rust-nostr/nostr-sdk-swift
    • JavaScript: https://www.npmjs.com/package/@rust-nostr/nostr-sdk

State

These libraries are in ALPHA state, things that are implemented generally work but the API will change in breaking ways.

Donations

rust-nostr is free and open-source. This means we do not earn any revenue by selling it. Instead, we rely on your financial support. If you actively use any of the rust-nostr libs/software/services, then please donate.

License

This project is distributed under the MIT software license - see the LICENSE file for details