Skip to content

Learn Nostr.

The simple, open protocol for identity, notes, and payments, without a company in the middle.

Start learning

  • Your keys, your identity


    You hold the cryptographic keys. No company can delete your account or speak for you.

    Keys →

  • Relays, not platforms


    Notes live on a network of servers anyone can run. No single operator is the network.

    What is Nostr? →

  • Bitcoin built in


    Lightning zaps send value over the same protocol as notes and identity.

    Build a client →

Learning path

Four short steps, from first note to a working client.

  1. What is Nostr?
    How the protocol works, and why it is not a social network.
    Start →

  2. Keys & identity
    Signatures, npubs, and how accounts stay yours.
    Read →

  3. Build a client
    Connect to a relay and publish an event.
    Tutorial →

  4. Reference
    Terms, NIPs, and tools in one place.
    Browse →

Publish a note

import { generateSecretKey, getPublicKey, finalizeEvent, Relay } from 'nostr-tools'

const sk = generateSecretKey()
const pk = getPublicKey(sk)

const event = finalizeEvent({
  kind: 1,
  created_at: Math.floor(Date.now() / 1000),
  tags: [],
  content: 'Hello Nostr!',
}, sk)

const relay = await Relay.connect('wss://relay.damus.io')
await relay.publish(event)
from nostr.key import PrivateKey
from nostr.event import Event
from nostr.relay_manager import RelayManager
import time

private_key = PrivateKey()
event = Event(kind=1, content="Hello Nostr!", created_at=int(time.time()))
private_key.sign_event(event)

relay_manager = RelayManager()
relay_manager.add_relay("wss://relay.damus.io")
relay_manager.publish_event(event)
use nostr_sdk::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    let keys = Keys::generate();
    let client = Client::new(&keys);
    client.add_relay("wss://relay.damus.io").await?;
    client.connect().await;
    client.publish_text_note("Hello Nostr!", []).await?;
    Ok(())
}