Nostr
Description
Rust implementation of Nostr protocol.
If you're writing a typical Nostr client or bot, you may be interested in nostr-sdk.
Getting started
[]
= "0.19"
= { = "0.18", = ["rustls-tls-webpki-roots"]}
use *;
use ;
More examples can be found in the examples/ directory.
WASM
This crate supports the wasm32 targets.
On macOS you need to install llvm:
brew install llvm
LLVM_PATH=$(brew --prefix llvm)
AR="${LLVM_PATH}/bin/llvm-ar" CC="${LLVM_PATH}/bin/clang" cargo build --target wasm32-unknown-unknown
NOTE: Currently you must disable nip03 feature to allow compilation on wasm targets.
Crate Feature Flags
The following crate feature flags are available:
| Feature | Default | Description |
|---|---|---|
blocking |
No | Needed to use NIP-05 and NIP-11 features in not async/await context |
vanity |
No | Enable vanity public key mining module |
all-nips |
Yes | Enable all NIPs |
nip03 |
Yes | Enable NIP-03: OpenTimestamps Attestations for Events |
nip04 |
Yes | Enable NIP-04: Encrypted Direct Message |
nip05 |
Yes | Enable NIP-05: Mapping Nostr keys to DNS-based internet identifiers |
nip06 |
Yes | Enable NIP-06: Basic key derivation from mnemonic seed phrase |
nip11 |
Yes | Enable NIP-11: Relay Information Document |
nip19 |
Yes | Enable NIP-19: bech32-encoded entities |
nip46 |
Yes | Enable NIP-46: Nostr Connect |
Supported NIPs
State
This library is in an ALPHA state, things that are implemented generally work but the API will change in breaking ways.
License
This project is distributed under the MIT software license - see the LICENSE file for details
Donations
⚡ Tips: https://getalby.com/p/yuki
⚡ Lightning Address: yuki@getalby.com