Why LearnNostr?
-
True Digital Identity
Own your identity with cryptographic keys. No central authority can delete your account, censor your content, or control your digital presence.
-
Censorship Resistant
Built on a decentralized network of relays that no single entity controls. Your voice can't be silenced by corporations or governments.
-
Lightning Integration
Seamless Bitcoin payments through Lightning Network integration. Send and receive value instantly across the protocol.
🎯 Learning Path
Master Nostr in 4 Progressive Steps — From understanding the basics to building your own applications, this guided learning path will take you from beginner to developer.
Start Here: Protocol Fundamentals
New to Nostr? Begin with the basics. Learn what makes Nostr different from traditional social platforms and understand the core concepts that power this decentralized protocol.
What you'll learn:
• Protocol architecture and design principles
• Decentralization vs. centralized platforms
• Basic terminology and concepts
Master: Identity & Security
Essential Skills. Dive deep into cryptographic keys, digital signatures, and identity management. These concepts are fundamental to everything you'll build on Nostr.
What you'll learn:
• Public/private key cryptography
• Digital identity and signatures
• Security best practices
Build: Your First Application
Hands-on Development. Put theory into practice by building real Nostr applications. Learn to connect to relays, publish events, and create interactive experiences.
What you'll build:
• Simple Nostr client
• Event publishing system
• Relay communication
Reference: Complete Definitions
Deep Dive Resources. Access comprehensive definitions and explanations of all Nostr concepts, protocols, and technical specifications in one organized location.
What you'll find:
• Technical definitions and explanations
• Protocol specifications (NIPs)
• Development tools and libraries
Code Example
Here's how to publish your first event to the Nostr network:
import { generatePrivateKey, getPublicKey, finishEvent, relayInit } from 'nostr-tools'
// Generate your identity
const sk = generatePrivateKey()
const pk = getPublicKey(sk)
// Create an event
const event = finishEvent({
kind: 1,
created_at: Math.floor(Date.now() / 1000),
tags: [],
content: 'Hello Nostr!',
}, sk)
// Publish to relay
const relay = relayInit('wss://relay.damus.io')
await relay.connect()
await relay.publish(event)
from nostr.key import PrivateKey
from nostr.event import Event
from nostr.relay_manager import RelayManager
import time
# Generate identity
private_key = PrivateKey()
public_key = private_key.public_key
# Create event
event = Event(
kind=1,
content="Hello Nostr!",
created_at=int(time.time())
)
private_key.sign_event(event)
# Publish 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<()> {
// Generate keys
let keys = Keys::generate();
// Connect to relay
let client = Client::new(&keys);
client.add_relay("wss://relay.damus.io", None).await?;
client.connect().await;
// Publish event
let event = EventBuilder::new_text_note("Hello Nostr!", &[])
.to_event(&keys)?;
client.send_event(event).await?;
Ok(())
}