Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 159C574 for ; Sun, 27 Mar 2016 17:04:42 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 06341AF for ; Sun, 27 Mar 2016 17:04:40 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id r187so147703597oih.3 for ; Sun, 27 Mar 2016 10:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=LWN4V4Kws3ejpsWizw0vfS09ar+cHwLW7fFLVdUzs5I=; b=HQVfZxOYeHeBS63bN6Up6hLvZF5+9cPjcTLX/R+MI+7vrE8ETEFWJ/0dmEKqzAFMgq at5PRrNGyYMsDh79UHBNu5tOcGzGjxAAvDuhn9g4UyJqIllE+tjFFyjpGfHnVULTatmE PqdViCgiKxOYRiljnv1XrKhaYBggR+uXuMSozUzY8SIrskjo7wjk2XVHAueN0ouR2TEW cZHodauJ3rl2m3dXul4XJV5BZRWT9+a+7QWyEWsVNsZ2pW0dXAFBSDRgZ/ad6QoT/lPS sRQASIuHSrLswUXjBEzxp6AJqjAnFdQ38Pdsx+CumoOjDK5ynbA3RgCg4Ype71LEjzNN kUfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=LWN4V4Kws3ejpsWizw0vfS09ar+cHwLW7fFLVdUzs5I=; b=e5SduyU3uj+PYXfMY7rKZT2ESBfqs+nxjcktPxj6pJXOFx4vlL16u2/0dmtulXekx4 LpehhayLsbgvNTPU7T4FQIMFzyRUfCGMp/fJV1c6xzZmf2hyz5amzhNLTGg3bXgTRMeq vCvBUmY7Cwjomn1o5L7QDZG6YDOwHux06S7zjOZJHY89b8wHxVSj9gQFQw/bN3JLjzNb mMG3vP1cQKsimcy799cY6yBZFY0KTDqfrCWrRJZpqbptuHDI5VWON9cHSKHrgq4uxeu+ vbNlze01ZHaUPfGwIJ54PA/tLjRUEl/4abIkbz0aHiZJEpYzxrw4AODeuKnGXZ4Yfh7l /mEg== X-Gm-Message-State: AD7BkJJ7W+ysyS+n4YgYxR2PsJ+pfdnh2rrFw2C+10JiFGgX4Tox/Koqcn24INBC39DLLJpo6ihzOAEikqKVWw== X-Received: by 10.157.47.181 with SMTP id r50mr505937otb.107.1459098280211; Sun, 27 Mar 2016 10:04:40 -0700 (PDT) MIME-Version: 1.0 References: <56F2B51C.8000105@jonasschnelli.ch> <2590065.B4dTBeyc1A@garp> <56F586B4.8020507@jonasschnelli.ch> <4517402.JLxTDjem5X@garp> <56F7CAD3.9080809@jonasschnelli.ch> In-Reply-To: <56F7CAD3.9080809@jonasschnelli.ch> From: James MacWhyte Date: Sun, 27 Mar 2016 17:04:30 +0000 Message-ID: To: Jonas Schnelli , bitcoin-dev@lists.linuxfoundation.org Content-Type: multipart/alternative; boundary=001a113dc29caf3948052f0aca0d X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Tue, 29 Mar 2016 14:34:44 +0000 Subject: Re: [bitcoin-dev] p2p authentication and encryption BIPs X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Development Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 17:04:42 -0000 --001a113dc29caf3948052f0aca0d Content-Type: text/plain; charset=UTF-8 On Sun, Mar 27, 2016 at 5:49 AM Jonas Schnelli via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > > > I guess my question didn't get across. > > > > Why would you want to make your usecase do connections over the > > peer2peer > > (net.cpp) connection at all? > > > > Mixing messages that are being sent to everyone and encrypted > > messages is > > asking for trouble. > > Making your private connection out-of-band would work much better. > > > > > > I agree doing it out-of-band is the easiest solution for people who need > > this privacy right now, but I do like the idea of adding this feature as > > the number of SPV wallets is going to increase. I think the best way to > > organize things would be to give encrypted messages their own port > > number, similar to how http vs. https works. > > I'm not sure if different ports would make sense. I can't see a benefit > (happy if someone can convince me). > How would this affect p2p address management (address relay)? Wouldn't > this require to extend the current address message to support two port > numbers? > > I'm assuming clients that connect with encryption don'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. This isn'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. > > > We don't want two networks to develop, separated by which nodes support > > encryption and which don't, so ideally nodes would rebroadcast messages > > they receive on both (encrypted and non-encrypted) channels. This would > > essentially double the required bandwidth of the network, which is > > something to think about. > > It can be the same "p2p network". The only difference would be, that > once two peers has negotiated encryption, the whole traffic between > _these two peers_, and _only_ these two pears, would be encrypted (would > _not_ affect traffic to/from other peers). > > You'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'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'm thinking of are just growing pains that will be solved once the majority of people upgrade? > A simplified example: > 1. Peer Alice connects to peer Bob > 2. Alice asks Bob: "lets do encrypted communication, here is my session > pubkey" > 3. Bob also supports encryption and answers "Yes, let's do this, here is > my session pubkey" > 4. Alice tells Bob (encrypted now): "Perfect. Here I prove that I'm > Alice by signing the session ID with my identity pubkey" > 5. Bob checks his "authorized-peers" database and look-up Alices pubkey > and verifies the signatures. > 6. Bob tells Alice: "Good! I trust you now Alice, here is my identity > pubkey with a signature of our session-ID" > 7. Alice looks up Bobs pubkey in her "known-peers" database and verifies > the signature. > 8. Alice response to bob: "Perfect. Indeed, you are Bob!" > --- > At this point, the communication is encrypted and the identities has > been verified (MITM protection). > > > (simplified negotiation [only one-way, missing dh explanation, missing > KDF, session-ID, cipher suite nego., missing re-keying, etc.]) > > > > > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev > --001a113dc29caf3948052f0aca0d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Sun= , Mar 27, 2016 at 5:49 AM Jonas Schnelli via bitcoin-dev <bitcoin-dev@lists.linuxfoundatio= n.org> wrote:

>=C2=A0 =C2=A0 =C2=A0I guess my question didn't get across.
>
>=C2=A0 =C2=A0 =C2=A0Why would you want to make your usecase do connecti= ons over the
>=C2=A0 =C2=A0 =C2=A0peer2peer
>=C2=A0 =C2=A0 =C2=A0(net.cpp) connection at all?
>
>=C2=A0 =C2=A0 =C2=A0Mixing messages that are being sent to everyone and= encrypted
>=C2=A0 =C2=A0 =C2=A0messages is
>=C2=A0 =C2=A0 =C2=A0asking for trouble.
>=C2=A0 =C2=A0 =C2=A0Making your private connection out-of-band would wo= rk much better.
>
>
> I agree doing it out-of-band is the easiest solution for people who ne= ed
> this privacy right now, but I do like the idea of adding this feature = as
> the number of SPV wallets is going to increase. I think the best way t= o
> organize things would be to give encrypted messages their own port
> number, similar to how http vs. https works.

I'm not sure if different ports would make sense. I can't see a ben= efit
(happy if someone can convince me).
How would this affect p2p address management (address relay)? Wouldn't<= br> this require to extend the current address message to support two port
numbers?

I'm assuming clients that connect with encryption= don't want to use unencrypted connections, and are only interested in = other peers that support encryption. From their perspective, it is quite in= efficient to get a generic list of peers and then have to connect to each o= ne searching for those that accept encryption. If we use port numbers, we c= an assume any connection that comes on the encrypted port is only intereste= d in encrypted communication, so a getaddr to an encrypted port would only = return a list of other encryption-capable peers.

This isn't an i= ssue if the plan is to require all peers to support encryption, and we assu= me the majority of the network will upgrade before too long.
=C2= =A0

> We don't want two networks to develop, separated by which nodes su= pport
> encryption and which don't, so ideally nodes would rebroadcast mes= sages
> they receive on both (encrypted and non-encrypted) channels. This woul= d
> essentially double the required bandwidth of the network, which is
> something to think about.

It can be the same "p2p network". The only difference would be, t= hat
once two peers has negotiated encryption, the whole traffic between
_these two peers_, and _only_ these two pears, would be encrypted (would _not_ affect traffic to/from other peers).


You're right, there would not be a= n increase in bandwidth. Please forget I said that :) But following the log= ic I wrote above, it would be possible for peers to become segregated (thos= e who require encryption would only connect to each other). It wouldn'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'm thinking of are just growin= g pains that will be solved once the majority of people upgrade?
<= div>=C2=A0
A simplified example:
1. Peer Alice connects to peer Bob
2. Alice asks Bob: "lets do encrypted communication, here is my sessio= n
pubkey"
3. Bob also supports encryption and answers "Yes, let's do this, h= ere is
my session pubkey"
4. Alice tells Bob (encrypted now): "Perfect. Here I prove that I'= m
Alice by signing the session ID with my identity pubkey"
5. Bob checks his "authorized-peers" database and look-up Alices = pubkey
and verifies the signatures.
6. Bob tells Alice: "Good! I trust you now Alice, here is my identity<= br> pubkey with a signature of our session-ID"
7. Alice looks up Bobs pubkey in her "known-peers" database and v= erifies
the signature.
8. Alice response to bob: "Perfect. Indeed, you are Bob!"
---
At this point, the communication is encrypted and the identities has
been verified (MITM protection).


(simplified negotiation [only one-way, missing dh explanation, missing
KDF, session-ID, cipher suite nego., missing re-keying, etc.])


</jonas>

_______________________________________________
bitcoin-dev mailing list
= bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mail= man/listinfo/bitcoin-dev
--001a113dc29caf3948052f0aca0d--