threenine.io
How to manage keys for nostr

How to manage keys for nostr

A Guide to Staying Secure and In Control of your Nostr Keys

Gary WoodfineGary Woodfine Dec 15, 2025

In what is Nostr we provided a high level overview of Nostr an open, decentralised protocol designed for censorship-resistant communication and data sharing on the internet, which essentially operates without centralised servers or corporations, allowing users to publish and retrieve content through a network of independent relays—servers that store and distribute data but cannot alter it due to cryptographic signing.

Each user on Nostr is identified as a set of Public & Private key pairs, which act in a similar way to the Username & Password, to grant them access to the network. However, the key difference is that there is no Central Server or organisation that manages these Public & Private keys, and it is entirely up the user themselves to manage them. The user has full control and responsibility for these keys, if they are lost there is no way for the user to recover them. We have previously discussed these keys keys in How to get started with Nostr and stressed the importance of ensuring they are backed up and secured.

What are Nostr Keys

It is really important to stress that Nostr operates on a simple yet powerful concept, that your identity is tied to a pair of cryptographic keys—a public key and a private key. We provide an introduction to Public and Private key cryptography which may be worth a read at this point if you are unfamiliar with the concepts.

Public/Private key cryptography, also known as asymmetric cryptography, is a fundamental security concept that utilizes a pair of mathematically linked keys to secure data. Unlike symmetric systems that rely on a single shared secret, this method employs two distinct keys: a public key and a private key. These keys work in tandem through complex mathematical algorithms, such as RSA or Elliptic Curve Cryptography (ECC), ensuring that what is encrypted by one key can only be decrypted by its counterpart.

The public key is designed to be freely distributed to anyone, acting much like an open address or a lock. It allows senders to encrypt messages intended for a specific recipient or to verify digital signatures created by that recipient. The private key, however, must remain strictly confidential and known only to the owner. It functions like the unique key to that lock or the pen used to sign a document. If a private key is ever compromised or lost, the security of the system is permanently breached.

This architecture solves the critical challenge of secure communication over insecure networks. In a typical transaction, a sender encrypts data using the recipient's public key. Once encrypted, the data becomes unintelligible gibberish to anyone who intercepts it, and it can only be decrypted using the recipient's private key. Additionally, the process is reversible for authentication; a sender can "sign" a message with their own private key, allowing anyone with the corresponding public key to verify the sender's identity and ensure the message has not been tampered with. This dual capability makes asymmetric cryptography the backbone of modern internet security, powering SSL/TLS protocols, cryptocurrencies, and secure email.

## Public key 
abc333d6b1b8ca9e9563b69411110b99abc78b06da6af8fa28af123456a1b111

## Private Key 
def123d6b1b8ca9e9999b69419999b99def78b06da6af8fa28af222227a1b222

#### The above are only illustrative examples of keys the are not genuine keys

NIP 19

NIP-19 (Nostr Improvement Proposal 19) is a crucial standard within the Nostr ecosystem that defines specific encoding formats for human-readable keys, identifiers, and other data structures. Since native cryptographic keys and internal event identifiers are typically long, hexadecimal strings that are difficult for users to read, type, or memorise, NIP-19 converts these into more compact formats called "Bech32" codes.

These encodings typically start with a specific prefix that indicates the type of data contained within, followed by the encoded data. The most common prefixes include:

  • npub: Encodes a user's public key. This acts as a user's public identity or username on the network.
  • nsec: Encodes a user's private key. This is sensitive data that allows the user to sign events and log in, and therefore should never be shared.
  • note: Encodes the identifier of a specific event (such as a text note or post).
  • nprofile: Encodes a user's profile. This includes the public key and optionally a list of relay servers where the user's data can be found, making it easier to find and follow them.
  • nevent: Encodes a specific event along with optional relay information, making it easier to retrieve a specific post from different clients.

By standardising these formats, NIP-19 allows different Nostr clients (applications) to easily share identities and links. For example, instead of asking for a difficult hex string, you can simply share your npub to be followed, or click an nprofile link to open a user's profile in any compatible app.

# Public Key (npub)
npub1abcd0000hr9fa9trk62zqq9ent8h3vrd56hclg5272qcs7sm0zrwxyzabc

# Private Key (nsec)
nsec1abdefg01nsm9v9c0jt0fyznrsvpeeedx5karwmjr5864p3zwvmmnq8abcd2

#### The above are only illustrative examples of keys the are not genuine keys

Best Practices for Managing Nostr Keys

It is absolutely crucial to develop a strategy to effectively maintain control and safety of your Nostr keys, because there is no password recovery mechanism or third party that can assist you. You are the master and protector over your Digital Identity. Although this can be both daunting and intimidating, it is also exciting, liberating, independent and entirely self sovereign.

The following are some best practice approaches you can take for key management.

Offline Backup

A great first approach to take is to make a note of your Private Key or Seed phrase and store it offline in secure location such as a safe, fireproof box or on metal stamp plate for durability.

Whichever approach you take it is important to create multiple physical copies to prevent loss due to disaster like fire, flooding or theft.

Avoid storing keys in plain text files or unencrypted formats

Encrypted Digital Storage

  • Use a trusted password manager (e.g. Proton Password Manager) to store an encrypted copy of your private key as a secondary backup
  • Ensure the password manager itself is secured with a strong passphrase and two-factor authentication
  • Never rely solely on digital storage, as password managers can be hacked or fail

Browser Extensions for Key Management

  • Use signing extensions like Alby or nos2x to manage keys securely, reducing the need to paste private keys into clients
  • These extensions isolate keys from direct exposure to web clients, mitigating the "hot key"
  • For added security, use a separate browser profile or browser dedicated to Nostr activities

Hardware and Advanced Solutions

  • NsecBunker: Keeps your private key offline and delegates access securely, solving the "hot key" problem
  • Frostr: Addresses the single-point-of-failure issue by distributing control across multiple keys (experimental)
  • BIP-85 Derivation: Generate child keys from a master seed (e.g., using a ColdCard), allowing easy backup and isolation of compromised keys
  • Hardware Wallets: For maximum security, consider hardware wallets or encrypted USB drives

Multi-Device and Multi-Key Strategies

  • Import your private key into trusted clients on multiple devices, but ensure each device is secure
  • Use multiple keys for different purposes (e.g., professional vs. personal) to limit exposure if one key is compromised
  • For advanced users, implement multi-signature setups (M-of-N shares) distributed to trusted parties

Testing and Recovery

  • Test your backups by logging in from a fresh device using your stored nsec
  • Verify that your recovery process works before becoming highly active on Nostr
  • If a key is lost or compromised, create a new key pair and announce the migration socially

Security Hygiene

  • Never share your private key via email, messaging, or untrusted applications
  • Keep your OS and extensions updated to patch vulnerabilities
  • Use a dedicated browser or profile for Nostr to minimise cross-contamination with other activities

Long-Term Considerations

  • Treat your private key like the PIN to a safety deposit box—its loss is irreversible
  • Consider the trade-offs between security and convenience; choose methods you can consistently maintain

Nostr keys and Digital Wallets

Nostr keys are often associated with crypto wallets through two primary mechanisms: technical architectural similarities and specific integration protocols known as NIP-07 and NIP-61.

Architectural Overlap (Schnorr Signatures)

The core reason for the strong association is that Nostr utilises the same cryptographic standards as modern blockchains. Nostr uses Schnorr signatures on the secp256k1 curve, which is the exact same mathematical algorithm used by Bitcoin and many other cryptocurrencies. Because the cryptography is identical, a private key generated for a Bitcoin wallet can technically be used as a Nostr identity key (known as a "key pair"). This allows for "key reuse," where a user's on-chain identity (their wallet) and their social identity (their Nostr account) are mathematically identical. This concept is foundational to the idea of "social signing," where your cryptocurrency holdings act as proof of your identity without needing a separate login.

NIP-07 (Browser Extension Signing)

NIP-07 is a standard that allows web applications to interact with a user's keys via a browser extension. Many crypto wallet extensions, such as the popular Alby wallet or various Nostr-specific extensions, implement NIP-07. When you log into a Nostr client (like a web-based social media app), the client asks the extension to sign a message. The wallet manages the private key securely and approves the signature, effectively acting as your "login" for Nostr. This means the wallet software serves double duty: managing your crypto assets and managing your Nostr identity.

NIP-61 (Wallet Connectivity)

NIP-61 is a more recent standard designed specifically to bridge Nostr and Bitcoin wallets (often called "Nostr Wallet Connect" or "NWC"). It allows a Nostr client (like a social media app or game) to request payments from a wallet without having direct access to the wallet's private keys. The wallet holds the keys and signs payment requests pushed to it via Nostr messages. This creates a seamless user experience where you can tip creators, pay for services, or subscribe to content directly within a Nostr app, using a compatible wallet that runs in the background.

Zaps (Lightning Network Integration)

The most common user-facing example of this association is the "Zap." Zaps are instant micro-payments sent over the Bitcoin Lightning Network. Because Nostr profiles often have a Lightning Network invoice (or a wallet address attached via NIP-57), users can send money directly to a public key (npub) or a specific note. While this doesn't necessarily mean the Nostr key is the Wallet key, the ecosystem is designed to treat the Nostr identifier and the crypto payment address as tightly coupled components of a single digital identity.

Securing Nostr Keys for business

For businesses operating on Nostr, securing keys requires a shift from simple single-key storage to enterprise-grade cryptographic custody. The following best practices ensure operational continuity, security, and regulatory compliance.

Utilise Multi-Signature and MPC Configurations

Enterprises should avoid relying on a single private key. Multi-signature wallets and Multi-Party Computation (MPC) are now standard for enterprise deployments, allowing multiple parties to control access through programmable authorisation schemes.

This creates sophisticated governance structures where transactions require approval from multiple stakeholders, eliminating single points of failure.

 If one key share is compromised, the assets remain secure without the other required signatures.

Implement Hot, Warm, and Cold Storage Strategy

Operational efficiency must be balanced with security by segmenting storage types. Maintain minimal balances in hot wallets for daily liquidity and immediate payments, while storing the bulk of assets in cold storage (offline) for long-term security.

Institutional-grade custody often integrates these seamlessly, moving funds automatically between environments to reduce exposure windows.

Enforce Role-Based Access Control (RBAC)

Business operations demand granular control over who can initiate, approve, and execute transactions.

 Implement role-based access systems so that team members only have permissions relevant to their specific roles, such as traders moving funds between accounts without access to cold storage reserves.

 This should be paired with Multi-Factor Authentication (MFA) and regular key rotation policies to further mitigate insider threats.

Leverage Hardware Security Modules (HSMs) and Compliance

For the highest level of security, use Hardware Security Modules (HSMs) to store keys and manage cryptographic operations.

 Enterprises must also adhere to regulatory standards like FIPS 140-2, which mandate secure storage, audit logs, and recovery plans.

 Modern enterprise wallets integrate with compliance tools (KYC/AML) and provide rigorous audit trails to satisfy legal obligations