Skip to main content

Cryptography Overview

Nostr and Bitcoin share the same cryptographic foundation: secp256k1 with Schnorr signatures. This isn't coincidence - it's what makes Nostr "Taproot Native."

The Shared Stack​

LayerSpecificationUsed By
Curvesecp256k1Bitcoin, Nostr, Ethereum
SignaturesSchnorr (BIP-340)Bitcoin Taproot, Nostr
Pubkey formatx-only (32 bytes)Taproot, Nostr
EncodingBech32/Bech32mbc1p..., npub1...

One keypair, two networks. Your nsec signs Nostr events AND Bitcoin transactions. Your npub is your identity AND your P2TR address.

Why secp256k1?​

Bitcoin chose secp256k1 in 2009. Key properties:

  • Efficient: Faster than NIST curves
  • No backdoor concerns: Parameters are "nothing up my sleeve" numbers
  • Battle-tested: Secures billions in value
  • Tooling: Mature libraries everywhere

Nostr adopted it for Bitcoin compatibility, not because it's theoretically optimal.

Why Schnorr?​

Schnorr signatures (BIP-340) replaced ECDSA for Taproot:

PropertyECDSASchnorr
Signature size71-72 bytes64 bytes
Batch verificationNoYes
LinearityNoYes (enables MuSig)
ComplexityHigherSimpler

Linearity is the key advantage: signatures can be aggregated, enabling:

  • Multi-signatures that look like single-sig
  • Adapter signatures for atomic swaps
  • Threshold signatures

The Taproot Native Insight​

No bridges. No wrapping. No conversion. The same 32 bytes serve both purposes.

What This Section Covers​

TopicWhy It Matters
X-Only PubkeysThe 1-byte tradeoff and lifting problem
Schnorr SecurityNonce attacks, key safety
TweaksPrivacy via key derivation
Silent PaymentsBIP-352 + Nostr notifications

Key Reuse: Feature, Not Bug​

Some argue for separate derivation paths (m/44'/1237'/... for Nostr). We disagree.

The whole point is unified identity. Your npub IS your Bitcoin key. Separate paths fragment this:

  • Two keys to backup
  • Two identities to manage
  • Lost interoperability

If you need isolation, use testnet for testing. For mainnet, one key rules both.

Security Foundations​

The security of both Nostr and Bitcoin rests on:

  1. Discrete log hardness: Can't derive private key from public key
  2. Hash function security: SHA-256, used in signatures and tweaks
  3. Proper randomness: Nonce generation is critical (see Schnorr Security)

Break any of these, break everything.

See Also​


Same Keys, Same Security

Your Nostr security IS your Bitcoin security. Protect your nsec like it holds your life savings - because via P2TR, it can.