<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Mar 27, 2016 at 5:49 AM Jonas Schnelli via bitcoin-dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
&gt;     I guess my question didn&#39;t get across.<br>
&gt;<br>
&gt;     Why would you want to make your usecase do connections over the<br>
&gt;     peer2peer<br>
&gt;     (net.cpp) connection at all?<br>
&gt;<br>
&gt;     Mixing messages that are being sent to everyone and encrypted<br>
&gt;     messages is<br>
&gt;     asking for trouble.<br>
&gt;     Making your private connection out-of-band would work much better.<br>
&gt;<br>
&gt;<br>
&gt; I agree doing it out-of-band is the easiest solution for people who need<br>
&gt; this privacy right now, but I do like the idea of adding this feature as<br>
&gt; the number of SPV wallets is going to increase. I think the best way to<br>
&gt; organize things would be to give encrypted messages their own port<br>
&gt; number, similar to how http vs. https works.<br>
<br>
I&#39;m not sure if different ports would make sense. I can&#39;t see a benefit<br>
(happy if someone can convince me).<br>
How would this affect p2p address management (address relay)? Wouldn&#39;t<br>
this require to extend the current address message to support two port<br>
numbers?<br>
<br></blockquote><div>I&#39;m assuming clients that connect with encryption don&#39;t want to use unencrypted connections, and are only interested in other peers that support encryption. From their perspective, it is quite inefficient to get a generic list of peers and then have to connect to each one searching for those that accept encryption. If we use port numbers, we can assume any connection that comes on the encrypted port is only interested in encrypted communication, so a getaddr to an encrypted port would only return a list of other encryption-capable peers.<br><br>This isn&#39;t an issue if the plan is to require all peers to support encryption, and we assume the majority of the network will upgrade before too long.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
&gt; We don&#39;t want two networks to develop, separated by which nodes support<br>
&gt; encryption and which don&#39;t, so ideally nodes would rebroadcast messages<br>
&gt; they receive on both (encrypted and non-encrypted) channels. This would<br>
&gt; essentially double the required bandwidth of the network, which is<br>
&gt; something to think about.<br>
<br>
It can be the same &quot;p2p network&quot;. The only difference would be, that<br>
once two peers has negotiated encryption, the whole traffic between<br>
_these two peers_, and _only_ these two pears, would be encrypted (would<br>
_not_ affect traffic to/from other peers).<br>
<br></blockquote><div><br></div><div>You&#39;re right, there would not be an increase in bandwidth. Please forget I said that :) But following the logic I wrote above, it would be possible for peers to become segregated (those who require encryption would only connect to each other). It wouldn&#39;t be a problem as long as there are enough peers that provide both encrypted and non-encrypted connections; or, as I said above, if we can assume every peer will support it. Maybe the issues I&#39;m thinking of are just growing pains that will be solved once the majority of people upgrade?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A simplified example:<br>
1. Peer Alice connects to peer Bob<br>
2. Alice asks Bob: &quot;lets do encrypted communication, here is my session<br>
pubkey&quot;<br>
3. Bob also supports encryption and answers &quot;Yes, let&#39;s do this, here is<br>
my session pubkey&quot;<br>
4. Alice tells Bob (encrypted now): &quot;Perfect. Here I prove that I&#39;m<br>
Alice by signing the session ID with my identity pubkey&quot;<br>
5. Bob checks his &quot;authorized-peers&quot; database and look-up Alices pubkey<br>
and verifies the signatures.<br>
6. Bob tells Alice: &quot;Good! I trust you now Alice, here is my identity<br>
pubkey with a signature of our session-ID&quot;<br>
7. Alice looks up Bobs pubkey in her &quot;known-peers&quot; database and verifies<br>
the signature.<br>
8. Alice response to bob: &quot;Perfect. Indeed, you are Bob!&quot;<br>
---<br>
At this point, the communication is encrypted and the identities has<br>
been verified (MITM protection).<br>
<br>
<br>
(simplified negotiation [only one-way, missing dh explanation, missing<br>
KDF, session-ID, cipher suite nego., missing re-keying, etc.])<br>
<br>
<br>
&lt;/jonas&gt;<br>
<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</blockquote></div></div>