BIP-324 (Encrypted P2P Transport)
Opportunistic encryption of Bitcoin's peer-to-peer traffic, so a passive observer cannot read node conversations.
Basically
BIP-324 encrypts messages between Bitcoin computers when both support it. Other people on the network can no longer quietly read those messages.
Key Takeaways
- BIP-324 encrypts all traffic between Bitcoin nodes with ChaCha20-Poly1305. It replaces the plaintext v1 protocol, which let ISPs and network observers read every message.
- The handshake uses ElligatorSwift-encoded keys that look like random data. Bitcoin P2P connections are therefore indistinguishable from arbitrary network traffic.
- Bitcoin Core 27.0, released in April 2024, enables BIP-324 by default. Its opportunistic encryption protects against passive eavesdropping without identity verification, and future authentication protocols can build on it.
What Is BIP-324?
BIP-324, also known as the v2 P2P transport protocol, is a Bitcoin Improvement Proposal that adds encrypted communication between Bitcoin nodes. Dhruv Mehta, Tim Ruffing, Jonas Schnelli, and Pieter Wuille authored it to replace the original v1 protocol, which transmitted all peer-to-peer messages in plaintext from Bitcoin's launch in 2009.
The v1 protocol sent every transaction relay, block propagation, and gossip message across the internet as readable text. Any observer on the network path, including an ISP, a state-level actor, or a compromised router, could inspect these messages, identify Bitcoin traffic by its fixed 4-byte magic bytes, and correlate transactions to IP addresses. BIP-324 removes this passive surveillance vector by wrapping all communication in authenticated encryption.
The proposal was merged into Bitcoin Core in October 2023 through PR #28331. Bitcoin Core 26.0 shipped it as an experimental opt-in feature in December 2023, and Bitcoin Core 27.0 enabled it by default in April 2024. Most reachable Bitcoin nodes had adopted v2 transport by early 2026.
How It Works
BIP-324 establishes an encrypted channel through three phases: key exchange, version negotiation, and encrypted application data. The design prioritises preventing passive eavesdropping and making Bitcoin traffic unidentifiable on the wire.
Key Exchange
Two v2-capable nodes perform an Elliptic Curve Diffie-Hellman (ECDH) key exchange on the secp256k1 curve when they connect. Each peer encodes its ephemeral public key with ElligatorSwift instead of sending identifiable raw key bytes. This technique produces a 64-byte string that is indistinguishable from random data.
Variable-length garbage data prevents fingerprinting by packet size. Together with the pseudorandom public key encoding, it leaves no recognisable patterns in the entire handshake bytestream for a network observer to detect.
Encryption Layer
The handshake establishes the encrypted channel. All later communication uses authenticated encryption.
HKDF-SHA256 derives four encryption keys from the shared secret: two per direction, with one for length and one for payload. It also derives a 32-byte session ID for future authentication and two 16-byte garbage terminators.
Message Format
The v2 protocol uses a compact message format. It replaces the v1 protocol's 24-byte header.
The 1-byte short message IDs save 11 bytes per message compared with the v1 protocol's 12-byte ASCII command names. Common messages such as TX, INV, PING, HEADERS, and CMPCTBLOCK all have single-byte assignments.
Decoy Packets
Bit 7 of the header byte marks a packet as a "decoy" when set. The recipient must authenticate the packet by verifying the Poly1305 tag, then discard its contents. Decoy packets are the primary traffic shaping mechanism, letting nodes pad traffic volume and timing to resist analysis of transaction propagation patterns.
Why It Matters
Bitcoin's privacy model has long relied on pseudonymity, so addresses are not directly tied to identities. The plaintext P2P protocol undermined this model at the network layer. Techniques such as Tor or VPNs did not change the fact that most nodes communicated in the clear, creating a rich dataset for surveillance.
BIP-324 shifts the threat model from passive to active. Before v2 transport, an observer could silently collect data at scale; after v2, interception requires a persistent man-in-the-middle position, a fundamentally costlier and more detectable operation. The change has several practical implications.
CoinJoin, silent payments, and Tor integration sit alongside BIP-324 in Bitcoin's evolving privacy toolkit. The 2026 research article on Bitcoin privacy gives you a broader view of how they fit together.
Opportunistic Encryption and Authentication
BIP-324 is intentionally "opportunistic" because it encrypts traffic without verifying peer identity. Encryption activates automatically when both sides support v2, but the connection falls back to plaintext if one side only supports v1. You do not need to configure anything.
The designers chose this approach deliberately. Authentication would require identity infrastructure such as certificate authorities, key registries, or pre-shared keys, which Bitcoin's permissionless network does not have. Opportunistic encryption provides immediate value against the most common threat: passive mass surveillance.
The protocol exports a deterministic 32-byte session ID from the key exchange. You can compare session IDs through an out-of-band channel to detect man-in-the-middle attacks today. A future protocol called Countersign, under development by Pieter Wuille and building on work by Greg Maxwell, aims to add mutual authentication on top of BIP-324's encrypted channel, enabling whitelisted connections between trusted nodes without revealing identities to third parties.
Node Operator Privacy
Individuals and businesses running full nodes gain privacy because their ISPs can no longer build profiles of their Bitcoin activity. The protection is particularly relevant in jurisdictions where Bitcoin usage may attract unwanted attention or where ISPs sell traffic metadata.
Mining Pool Security
Mining pools and large miners relay blocks and block templates between infrastructure nodes. Encrypted transport stops competitors or adversaries from observing block propagation timing, which could be exploited for selfish mining strategies or fee sniping.
Censorship-Resistant Regions
Bitcoin's v1 protocol was trivially blockable in countries that actively filter internet traffic. BIP-324 traffic looks identical to any other encrypted stream, so interference requires deep packet inspection capabilities and a willingness to block all unidentified traffic.
Layer 2 Infrastructure
Layer 2 protocols such as Lightning and Spark rely on the underlying Bitcoin P2P network for settlement and dispute resolution. Encrypted base-layer transport strengthens their security assumptions by reducing the surface area for network-level attacks against the nodes they depend on.
No Protection Against Active Attackers
BIP-324 does not prevent a man-in-the-middle attacker from intercepting the initial handshake because it has no authentication. An attacker in this position could establish separate encrypted sessions with both peers, relaying and potentially modifying messages. The session ID mechanism enables detection but requires manual out-of-band verification.
Backward Compatibility and Downgrade
A v2 node falls back to plaintext when it connects to a v1-only node. An active attacker could force this downgrade by interfering with the initial handshake bytes, stripping encryption from connections that would otherwise be protected. The option to disable v1 fallback entirely becomes more viable as v2 adoption increases and more nodes run Bitcoin Core 27.0+.
Computational Overhead
The ElligatorSwift key encoding and ChaCha20-Poly1305 encryption add computational cost compared with plaintext v1 connections. The overhead is negligible for modern hardware in practice because ChaCha20 was specifically designed for high performance on general-purpose CPUs, and the handshake cost is amortised over long-lived connections. Benchmarks from the Bitcoin Core implementation showed no measurable impact on block relay or transaction propagation latency.
Traffic Analysis Limitations
BIP-324 encrypts message contents but does not fully hide traffic patterns. Network observers can still see connection timing, volume, and the number of peers. Combining BIP-324 with Tor or I2P provides stronger metadata protection. Decoy packets offer some traffic shaping capability, but Bitcoin Core does not yet generate them by default; future releases may add configurable traffic padding.
How to Enable BIP-324
Bitcoin Core 27.0 or later enables v2 transport by default. You can verify and configure it through the following options.
The getpeerinfo RPC includes transport_protocol_type and session_id fields for each connection. You can use these fields to verify which peers use encrypted transport and compare session IDs for MITM detection.
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.