<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/index.php?action=history&amp;feed=atom&amp;title=BIP_0151</id>
	<title>BIP 0151 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/index.php?action=history&amp;feed=atom&amp;title=BIP_0151"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;action=history"/>
	<updated>2026-05-24T13:32:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=70160&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/51b2d131bea737bc/bip-0151.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=70160&amp;oldid=prev"/>
		<updated>2024-04-30T22:02:57Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/51b2d131bea737bc/bip-0151.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:02, 30 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l89&quot;&gt;Line 89:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 89:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;256 bit secret key.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;256 bit secret key.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The chacha20-poly1305@openssh.com specified and defined by openssh [5] combines these two primitives into an authenticated encryption mode. The construction used is based on that proposed for TLS by Adam Langley [6], but differs in the layout of data passed to the MAC and in the addition of &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;encyption &lt;/del&gt;of the packet lengths.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The chacha20-poly1305@openssh.com specified and defined by openssh [5] combines these two primitives into an authenticated encryption mode. The construction used is based on that proposed for TLS by Adam Langley [6], but differs in the layout of data passed to the MAC and in the addition of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;encryption &lt;/ins&gt;of the packet lengths.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;K_1&amp;lt;/code&amp;gt; must be used to only encrypt the payload size of the encrypted message to avoid leaking information by revealing the message size.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;K_1&amp;lt;/code&amp;gt; must be used to only encrypt the payload size of the encrypted message to avoid leaking information by revealing the message size.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key db_bitcoin_en:diff:1.41:old-69661:rev-70160:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=69661&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b3144df7aded3c65/bip-0151.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=69661&amp;oldid=prev"/>
		<updated>2023-03-29T09:53:42Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b3144df7aded3c65/bip-0151.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:53, 29 March 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Comments-Summary: Controversial; some recommendation, and some discouragement&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Comments-Summary: Controversial; some recommendation, and some discouragement&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0151&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0151&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Status: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Withdrawn&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Status: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Replaced&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Type: Standards Track&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Type: Standards Track&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Created: 2016-03-23&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Created: 2016-03-23&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key db_bitcoin_en:diff:1.41:old-69601:rev-69661:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=69601&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/2361582f0b921977/bip-0151.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=69601&amp;oldid=prev"/>
		<updated>2023-01-05T02:30:56Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/2361582f0b921977/bip-0151.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:30, 5 January 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Created: 2016-03-23&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   Created: 2016-03-23&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   License: PD&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   License: PD&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  Superseded-By: 324&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key db_bitcoin_en:diff:1.41:old-66770:rev-69601:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=66770&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b5723035e23896d0/bip-0151.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0151&amp;diff=66770&amp;oldid=prev"/>
		<updated>2019-09-24T17:58:36Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b5723035e23896d0/bip-0151.mediawiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{bip}}&lt;br /&gt;
{{BipMoved|bip-0151.mediawiki}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  BIP: 151&lt;br /&gt;
  Layer: Peer Services&lt;br /&gt;
  Title: Peer-to-Peer Communication Encryption&lt;br /&gt;
  Author: Jonas Schnelli &amp;lt;dev@jonasschnelli.ch&amp;gt;&lt;br /&gt;
  Comments-Summary: Controversial; some recommendation, and some discouragement&lt;br /&gt;
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0151&lt;br /&gt;
  Status: Withdrawn&lt;br /&gt;
  Type: Standards Track&lt;br /&gt;
  Created: 2016-03-23&lt;br /&gt;
  License: PD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
This BIP describes an alternative way that a peer can encrypt their communication between a selective subset of remote peers.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Bitcoin network does not encrypt communication between peers today. This opens up security issues (eg: traffic manipulation by others) and allows for mass surveillance / analysis of bitcoin users. Mostly this is negligible because of the nature of Bitcoin&amp;#039;s trust model, however, for SPV nodes this can have significant privacy impacts [1] and could reduce the censorship-resistance of a peer.&lt;br /&gt;
&lt;br /&gt;
Encrypting peer traffic will make analysis and specific user targeting much more difficult than it currently is. Today it&amp;#039;s trivial for a network provider or any other men-in-the-middle to identify a Bitcoin user and its controlled addresses/keys (and link with his Google profile, etc.). Just created and broadcasted transactions will reveal the amount and the payee to the network provider.&lt;br /&gt;
&lt;br /&gt;
This BIP also describes a way that data manipulation (blocking commands by a intercepting TCP/IP node) would be identifiable by the communicating peers.&lt;br /&gt;
&lt;br /&gt;
Analyzing the type of p2p communication would still be possible because of the characteristics (size, sending-interval, etc.) of the encrypted messages.&lt;br /&gt;
&lt;br /&gt;
Encrypting traffic between peers is already possible with VPN, tor, stunnel, curveCP or any other encryption mechanism on a deeper OSI level, however, most mechanisms are not practical for SPV or other DHCP/NAT environment and will require significant knowhow in how to setup such a secure channel.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&lt;br /&gt;
A peer that supports encryption must accept encryption requests from all peers.&lt;br /&gt;
&lt;br /&gt;
An independent ECDH negotiation for both communication directions is required and therefore a bidirectional communication will use two symmetric cipher keys (one per direction).&lt;br /&gt;
&lt;br /&gt;
Both peers must only send encrypted messages after a successful ECDH negotiation in &amp;#039;&amp;#039;both directions&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Encryption initialization must happen before sending any other messages to the responding peer (&amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt; message after a &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; message must be ignored).&lt;br /&gt;
&lt;br /&gt;
=== Symmetric Encryption Cipher Keys ===&lt;br /&gt;
&lt;br /&gt;
The symmetric encryption cipher keys will be calculated with ECDH/HKDF by sharing the pubkeys of an ephemeral key. Once the ECDH secret is calculated on each side, the symmetric encryption cipher keys must be derived with HKDF [2] after the following specification:&lt;br /&gt;
&lt;br /&gt;
1. HKDF extraction&lt;br /&gt;
&amp;lt;code&amp;gt;PRK = HKDF_EXTRACT(hash=SHA256, salt=&amp;quot;bitcoinecdh&amp;quot;, ikm=ecdh_secret|cipher-type)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. Derive Key1&lt;br /&gt;
&amp;lt;code&amp;gt;K_1 = HKDF_EXPAND(prk=PRK, hash=SHA256, info=&amp;quot;BitcoinK1&amp;quot;, L=32)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Derive Key2&lt;br /&gt;
&amp;lt;code&amp;gt;K_2 = HKDF_EXPAND(prk=PRK, hash=SHA256, info=&amp;quot;BitcoinK2&amp;quot;, L=32)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is important to include the cipher-type into the symmetric cipher key derivation to avoid weak-cipher-attacks.&lt;br /&gt;
&lt;br /&gt;
=== Session ID ===&lt;br /&gt;
&lt;br /&gt;
Both sides must also calculate the 256bit session-id using &amp;lt;code&amp;gt;SID = HKDF_EXPAND(prk=PRK, hash=SHA256, info=&amp;quot;BitcoinSessionID&amp;quot;, L=32)&amp;lt;/code&amp;gt;. The session-id can be used for linking the encryption-session to an identity check.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt; message type ===&lt;br /&gt;
&lt;br /&gt;
To request encrypted communication, the requesting peer generates an EC ephemeral-session-keypair and sends an &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt; message to the responding peer and waits for an &amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; message. The responding node must do the same &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; interaction for the opposite communication direction.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 33bytes || ephemeral-pubkey || comp.-pubkey || The session pubkey from the requesting peer&lt;br /&gt;
|-&lt;br /&gt;
| 1bytes || symmetric key cipher type  || int8 || symmetric key cipher type to use&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Possible symmetric key ciphers types&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Number !! symmetric key ciphers type&lt;br /&gt;
|-&lt;br /&gt;
| 0 || chacha20-poly1305@openssh.com&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ChaCha20-Poly1305 Cipher Suite ===&lt;br /&gt;
&lt;br /&gt;
ChaCha20 is a stream cipher designed by Daniel Bernstein [3]. It operates by permuting 128 fixed bits, 128 or 256 bits of key,&lt;br /&gt;
a 64 bit nonce and a 64 bit counter into 64 bytes of output. This output is used as a keystream, with any unused bytes simply discarded.&lt;br /&gt;
&lt;br /&gt;
Poly1305, also by Daniel Bernstein [4], is a one-time Carter-Wegman MAC that computes a 128 bit integrity tag given a message and a single-use&lt;br /&gt;
256 bit secret key.&lt;br /&gt;
&lt;br /&gt;
The chacha20-poly1305@openssh.com specified and defined by openssh [5] combines these two primitives into an authenticated encryption mode. The construction used is based on that proposed for TLS by Adam Langley [6], but differs in the layout of data passed to the MAC and in the addition of encyption of the packet lengths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;K_1&amp;lt;/code&amp;gt; must be used to only encrypt the payload size of the encrypted message to avoid leaking information by revealing the message size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;K_2&amp;lt;/code&amp;gt; must be used in conjunction with poly1305 to build an AEAD.&lt;br /&gt;
&lt;br /&gt;
Optimized implementations of ChaCha20-Poly1305 are very fast in general, therefore it is very likely that encrypted messages require less CPU cycles per byte then the current unencrypted p2p message format. A quick analysis by Pieter Wuille of the current &amp;#039;&amp;#039;standard implementations&amp;#039;&amp;#039; has shown that SHA256 requires more CPU cycles per byte then ChaCha20 &amp;amp; Poly1304.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; message type ===&lt;br /&gt;
&lt;br /&gt;
The responding peer accepts the encryption request by sending an &amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 33bytes || ephemeral-pubkey || comp.-pubkey || The session pubkey from the responding peer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At this point, the shared secret key for the symmetric key cipher must be calculated by using ECDH (own privkey x remote pub key).&lt;br /&gt;
Private keys will never be transmitted. The shared secret can only be calculated if an attacker knows at least one private key and the remote peer&amp;#039;s public key.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; interaction must be done from both sides.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Each communication direction uses its own secret key for the symmetric cipher.&lt;br /&gt;
* The second &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt; request (from the responding peer) must use the same symmetric cipher type.&lt;br /&gt;
* All unencrypted messages before the second &amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; response (from the responding peer) must be ignored.&lt;br /&gt;
* After a successful &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; interaction, the &amp;quot;encrypted messages structure&amp;quot; must be used. Non-encrypted messages from the requesting peer must lead to a connection termination.&lt;br /&gt;
&lt;br /&gt;
After a successful &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; interaction from both sides, the messages format must use the &amp;quot;encrypted messages structure&amp;quot;. Non-encrypted messages from the requesting peer must lead to a connection termination (can be detected by the 4 byte network magic in the unencrypted message structure).&lt;br /&gt;
&lt;br /&gt;
=== Encrypted Messages Structure  ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || length || uint32_t || Length of ciphertext payload in number of bytes&lt;br /&gt;
|-&lt;br /&gt;
| ? || ciphertext payload || ? || One or many ciphertext command &amp;amp; message data&lt;br /&gt;
|-&lt;br /&gt;
| 16 || MAC tag || ? || 128bit MAC-tag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Encrypted messages do not have the 4byte network magic.&lt;br /&gt;
&lt;br /&gt;
The maximum message length needs to be chosen carefully. The 4 byte length field can lead to a required message buffer of 4 GiB.&lt;br /&gt;
Processing the message before the authentication succeeds must not be done.&lt;br /&gt;
&lt;br /&gt;
The 4byte sha256 checksum is no longer required because the AEAD.&lt;br /&gt;
&lt;br /&gt;
Both peers need to track the message sequence number (uint32) of sent messages to the remote peer for building a 64 bit symmetric cipher IV. Sequence numbers are allowed to overflow to zero after 4294967295 (2^32-1).&lt;br /&gt;
&lt;br /&gt;
The encrypted payload will result decrypted in one or many unencrypted messages:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || command || varlen || ASCII string identifying the packet content, we are using varlen in the encrypted messages.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || length || uint32_t || Length of plaintext payload&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || ? || The actual data&lt;br /&gt;
|}&lt;br /&gt;
If more data is present, another message must be deserialized. There is no explicit amount-of-messages integer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Re-Keying ===&lt;br /&gt;
&lt;br /&gt;
A responding peer can inform the requesting peer over a re-keying with an &amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; message containing 33byte of zeros to indicate that all encrypted message following after this &amp;lt;code&amp;gt;encack&amp;lt;/code&amp;gt; message will be encrypted with &amp;#039;&amp;#039;the next symmetric cipher key&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The new symmetric cipher key will be calculated by &amp;lt;code&amp;gt;SHA256(SHA256(session_id || old_symmetric_cipher_key))&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Re-Keying interval is a peer policy with a minimum timespan of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
The Re-Keying must be done after every 1GB of data sent or received (recommended by RFC4253 SSH Transport).&lt;br /&gt;
&lt;br /&gt;
=== Risks ===&lt;br /&gt;
&lt;br /&gt;
The encryption does not include an identity authentication scheme. This BIP does not cover a proposal to avoid MITM attacks during the encryption initialization.&lt;br /&gt;
&lt;br /&gt;
Identity authentication will be covered in another BIP and will presume communication encryption after this BIP.&lt;br /&gt;
&lt;br /&gt;
== Compatibility ==&lt;br /&gt;
&lt;br /&gt;
This proposal is backward compatible. Non-supporting peers will ignore the &amp;lt;code&amp;gt;encinit&amp;lt;/code&amp;gt; messages.&lt;br /&gt;
&lt;br /&gt;
== Reference implementation ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [1] https://e-collection.library.ethz.ch/eserv/eth:48205/eth-48205-01.pdf&lt;br /&gt;
* [2] HKDF (RFC 5869) https://tools.ietf.org/html/rfc5869&lt;br /&gt;
* [3] ChaCha20 https://cr.yp.to/chacha/chacha-20080128.pdf&lt;br /&gt;
* [4] Poly1305 https://cr.yp.to/mac/poly1305-20050329.pdf&lt;br /&gt;
* [5] https://github.com/openssh/openssh-portable/blob/05855bf2ce7d5cd0a6db18bc0b4214ed5ef7516d/PROTOCOL.chacha20poly1305&lt;br /&gt;
* [6] &amp;quot;ChaCha20 and Poly1305 based Cipher Suites for TLS&amp;quot;, Adam Langley https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-03&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
* Pieter Wuille and Gregory Maxwell for most of the ideas in this BIP.&lt;br /&gt;
&lt;br /&gt;
== Copyright ==&lt;br /&gt;
This work is placed in the public domain.&lt;/div&gt;</summary>
		<author><name>934</name></author>
	</entry>
</feed>