---
title: "Noise Protocol Framework — definition | Nuri Glossary"
description: "A handshake framework for encrypted peer connections, used by Lightning and other P2P systems."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/noise-protocol"
---

# Noise Protocol Framework

A handshake framework for encrypted peer connections, used by Lightning and other P2P systems.

## Basically

The Noise Protocol Framework helps two computers create a private connection. The Lightning Network and other peer-to-peer systems use it to keep their messages secret.

## Key Takeaways

- The Noise Protocol Framework is a toolkit for building cryptographic handshake protocols from Diffie-Hellman key exchanges. Protocol designers can choose the security properties they need, including mutual authentication, forward secrecy, identity hiding and zero round-trip encryption.
- The Lightning Network uses Noise_XK, defined in BOLT #8, to authenticate and encrypt every peer-to-peer connection. This prevents eavesdropping and tampering with node communications.
- Noise suits peer-to-peer protocols because it is simpler than TLS, avoids certificate authorities and provides predictable security guarantees without cipher-suite negotiation or downgrade attacks.

## What Is the Noise Protocol Framework?

The Noise Protocol Framework is a system for designing cryptographic handshake protocols. Trevor Perrin created it, with contributions from Moxie Marlinspike, to provide a structured way to build secure communication channels between two parties using Diffie-Hellman key agreement. Noise is a framework of building blocks and composition rules rather than a single protocol, letting designers assemble custom protocols with well-understood security properties.
The current specification is revision 34, published in July 2018. Each Noise protocol has a name that encodes its full configuration: the handshake pattern, the DH function, the cipher and the hash function. For example, the Lightning Network uses Noise_XK_secp256k1_ChaChaPoly_SHA256, which identifies every cryptographic choice in use.
Noise is widely adopted in peer-to-peer systems. Beyond Lightning, it secures WireGuard VPN connections, WhatsApp client-server communications, libp2p, which is used by IPFS and Ethereum's networking layer, and the I2P anonymity network. Its appeal comes from its simplicity, auditability and suitability for systems that operate without centralised trust anchors such as certificate authorities.

## How It Works

A Noise handshake establishes a shared secret between two parties through a sequence of Diffie-Hellman operations. Each party may have a long-lived static keypair as its identity and a fresh ephemeral keypair generated per session for forward secrecy. The handshake mixes the results of DH operations between various combinations of these keys into a chaining key using HKDF, which then derives symmetric encryption keys for the session.

## Cryptographic Building Blocks

Every Noise protocol selects one option from each of three categories. The selected options define the protocol's full cryptographic configuration.

## Handshake Patterns

The core innovation of Noise is its pattern system. Each handshake pattern is named with two letters that describe what each party knows or transmits about their static key.
The first letter describes the initiator, while the second describes the responder. These letters create a matrix of patterns: NN, where neither side authenticates; KK, where both sides' keys are pre-known; XX, where both sides transmit keys; and XK, where the initiator transmits its key and the responder's key is pre-known, among others. Noise has 12 fundamental two-party interactive patterns plus 3 one-way patterns.

## Message Tokens

Inside each pattern, message contents are described by tokens. The tokens specify the operations performed at each step.
Each DH result is mixed into the chaining key via HKDF. This incremental mixing builds security properties progressively through the handshake, so early messages may lack authentication while later messages gain forward secrecy and mutual authentication.

## The XK Pattern (Lightning Network)

The Lightning Network uses the XK pattern defined in BOLT #8. In XK, the initiator knows the responder's static public key beforehand, which is the node's public key from the network graph, while the initiator's own key is transmitted encrypted during the handshake. The three-act handshake proceeds as follows.
After these three acts, both sides share symmetric encryption keys derived from three DH operations, and every subsequent message is encrypted with ChaCha20-Poly1305. Lightning also implements key rotation every 1,000 encryption operations, deriving fresh keys from the chaining key and resetting nonces to zero. This provides ongoing forward secrecy, so compromising a current key does not reveal past traffic.

## Noise vs. TLS

TLS, or Transport Layer Security, is the dominant encryption protocol on the web, but it was designed for a client-server model with certificate authorities. Several properties make Noise a better fit for peer-to-peer networks.
The absence of cipher-suite negotiation matters because both sides in TLS must agree on algorithms at connection time, which has historically introduced downgrade vulnerabilities. In Noise, the protocol name itself fixes every cryptographic choice. If a peer does not support the same Noise protocol, the connection simply fails, with no fallback to weaker cryptography.

## Lightning Network Peer Transport

Every connection between Lightning nodes is secured by Noise_XK, and a connecting node already knows its peer's public key from the gossip protocol or a connection URI. The XK pattern lets the initiator authenticate the responder without transmitting the responder's key over the wire, while the initiator's identity is encrypted. This protects against both eavesdropping and man-in-the-middle attacks on HTLC routing messages, channel updates and onion-routed payments.

## WireGuard VPN

WireGuard uses Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s, a two-message handshake where the initiator immediately sends its static key, the responder's key is pre-known and a pre-shared symmetric key is mixed in at the second stage. These steps correspond to I, K and psk2. The result is a VPN tunnel established in a single round trip with approximately 4,000 lines of code, compared to hundreds of thousands for OpenVPN with OpenSSL.

## Bitcoin Mining (Stratum V2)

The Stratum V2 mining protocol uses Noise_NX_Secp256k1+EllSwift_ChaChaPoly_SHA256. The NX pattern means mining clients do not authenticate, represented by N, while pools transmit their identity, represented by X. This fits the model where miners need to verify they are connecting to the correct pool, but pools do not need to verify individual miner identities during the handshake.

## Decentralised Networking

The libp2p networking stack, used by IPFS, Filecoin and Ethereum's discovery layer, uses Noise_XX for peer connections. The XX pattern is appropriate because neither peer knows the other's key in advance in a fully decentralised discovery model.

## Relationship to BIP 324

BIP 324, Bitcoin's v2 transport protocol enabled by default in Bitcoin Core 27.0, shares conceptual similarities with Noise. Both use ECDH-based key exchange, HKDF key derivation and ChaCha20-Poly1305 for authenticated encryption. However, BIP 324 is a custom protocol and is not built on the Noise framework.
The BIP 324 authors specifically rejected Noise and TLS because Bitcoin's P2P network has unique requirements that neither framework addresses natively. BIP 324 uses ElligatorSwift encoding to make public keys indistinguishable from random data, making Bitcoin traffic resistant to censorship by deep packet inspection, while neither Noise nor TLS produces a pseudorandom bytestream by default. BIP 324 also provides encryption without mandatory authentication, known as opportunistic encryption, which fits Bitcoin's permissionless model where nodes connect to unknown peers.
The research article on Bitcoin P2P network topology and resilience offers a deeper comparison of Bitcoin transport security approaches. It provides more detail on these design choices and their network context.

## Why It Matters

Without transport encryption, every message between peers travels in plaintext. An ISP, state actor or network-level attacker could read channel balances, track payment routes, identify which nodes are opening or closing channels, and correlate onion-routed payment paths. Noise eliminates this entire class of attack by making the transport layer opaque to observers.
For protocols like Lightning that carry financial data, transport encryption is a fundamental privacy and security requirement rather than an optional feature. The Noise framework lets protocol designers achieve this without inheriting the complexity, attack surface or trust assumptions of TLS. Platforms building on Lightning infrastructure, including Spark, inherit these transport security guarantees at the network layer.

## No Built-in Key Distribution

Noise authenticates peers using raw public keys, but it does not solve the problem of how you learn a peer's public key in the first place. In Lightning, the gossip protocol and connection URIs serve this role, while other systems need out-of-band key exchange or a directory service. If you connect to the wrong public key, Noise will faithfully encrypt your session with the wrong party.

## Fixed Cryptographic Choices

The same property that prevents downgrade attacks, the absence of cipher negotiation, also means that upgrading cryptography requires deploying an entirely new protocol version. If a vulnerability is found in ChaCha20-Poly1305 or secp256k1, every node must upgrade to a new Noise protocol name. This is a deliberate tradeoff: cryptographic agility introduces complexity and attack surface, so Noise favours simplicity at the cost of harder upgrades.

## Quantum Vulnerability

Noise relies entirely on Diffie-Hellman key agreement, which is vulnerable to quantum computers running Shor's algorithm. The framework supports pre-shared keys through psk tokens that can add quantum resistance if the PSK is securely established, but pure-DH Noise protocols do not provide post-quantum security. Research into post-quantum Noise extensions is ongoing, but no standard exists yet.

## Implementation Correctness

The Noise specification is compact and auditable, but implementers must still handle subtle details correctly, including nonce management, key rotation timing, zeroing sensitive memory and proper error handling on authentication failures. A bug in any of these areas can undermine the security guarantees the framework provides. Production implementations should use well-tested Noise libraries rather than hand-rolling the protocol.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
