From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id BAEAE1642 for ; Sat, 2 Jun 2018 02:02:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E3B79136 for ; Sat, 2 Jun 2018 02:02:50 +0000 (UTC) Received: by mail-qt0-f195.google.com with SMTP id y89-v6so9043943qtd.10 for ; Fri, 01 Jun 2018 19:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sIJ0v/V/Wuilj+A0iUqiYexrS20egilzl/wJ9Lqg41s=; b=LNHm4T76h03whQYT2CQiPWYlU4/0vWVhi2K7DwbdPN9kzt/Pt6uvNe1YpZjAvBa5VR kOhvtIFkfN9nvZW2g0TGNs15c8JNNATWiHiBRH6i74ArSNqGpDeb5N3QvOCRWGAmfrae qXZkQoD/+NUT6Ex4IhF5qXTbbEvTFZlLWxE+8rSz079opOHepFcQo8uaNmUwgtktu5Av vTno04m3KHIoGVQY+qXNdBqm2p8LRWidgY1ALBO0e7U9cs5mwFF2c5pC5a1L3ANX0CYm GhZCdOl25WL5MiinPXhmGZa+FxZUP/VTuZn4oh6vciYv9pRsevdC4p10V5bTPj6KR4uq +lww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sIJ0v/V/Wuilj+A0iUqiYexrS20egilzl/wJ9Lqg41s=; b=c8fnMxVlktuebAQpkEBAWUSPsi1ZP+CEdkDuZfdZn6EB9acVLH1j/eyH6cqsIPOV1e r8jgG+rA/0GB3nWaJvCDZ4qiKe15fxOoZTVj9dF/AbWIKXDqsA0ujAJw0KV5DIf0T+Bd glrFJ9LYudg21rDeY7xD1/dvQLSeCrpnWKxgP8OYW89Owrk2gplmcl9w1HrmF4fKXUYE S2qeS/p0k5vFjgQzmqaGrdy82v+sze7Y42ZUP+N+o2l75m6ppVFxtcr1+Zs4FKrNRdW3 BE5XP4PZmj7rYXks1FaG7F4Z+x0550ec2W+BUdRSVtFisuSXV3IkfjjvwiLEpKT/IkBM uwUg== X-Gm-Message-State: APt69E0NOvWvxTwpkSS2xn86sbphrpW6SGGn/CGrU4YAylddBe1tPt+d rf462M5c2sfyzSCckMYz1HD6BN9vTSSULF5vMAQ= X-Google-Smtp-Source: ADUXVKI8I/Vdq3Az4gCNEpYppLPWKX3zdBz86H18LuiV8fODB6gLkX01/iHxEmA1tx1mzfw7BPzMXhKwimH6++VgNLI= X-Received: by 2002:ac8:2f47:: with SMTP id k7-v6mr13192156qta.363.1527904969906; Fri, 01 Jun 2018 19:02:49 -0700 (PDT) MIME-Version: 1.0 References: <22d375c7-a032-8691-98dc-0e6ee87a4b08@mattcorallo.com> <7E4FA664-BBAF-421F-8C37-D7CE3AA5310A@gmail.com> In-Reply-To: From: Jim Posen Date: Fri, 1 Jun 2018 19:02:38 -0700 Message-ID: To: Gregory Maxwell Content-Type: multipart/alternative; boundary="000000000000fb5fe3056d9f18ba" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE 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: Sat, 02 Jun 2018 02:04:45 +0000 Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] BIP 158 Flexibility and Filter Size X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2018 02:02:52 -0000 --000000000000fb5fe3056d9f18ba Content-Type: text/plain; charset="UTF-8" To address the at-least-one-honest peer security assumption for light clients, I think this is a rather good security model for light clients. First it significantly reduces the chances that an attacker can eclipse a client just by chance, and clients can implement measures like ensuring connectivity to peers from different subnets. But even if, as you suggest, a network attacker controls the target's local network, peers still can have good security guarantees by requiring authenticated connections to semi-trusted peers. A client can select a set of N servers that it believes will not collude to attack it, and only sync filters if connected to a threshold of them. So even if the network is malicious, the attacker cannot forge the authenticated responses. The level of trust in these designated parties again is quite low because only one has to be honest. This would require something like BIP 150. Even if clients are uncomfortable with whitelisting required peers, it could have a policy of requiring a certain number of connections to peers that have honestly served it filters in the past. This is sort of like trust-on-first-use. This type of scheme, however, would require nodes to advertise a pubkey per address, which BIP 150/151 does not support at present. All in all, I think this is an acceptable security model for light clients. Without the ability to verify filter validity, a client would have to stop syncing altogether in the presence of just one malicious peer, which is unacceptable. The other concern you raise, Greg, is using a filter for P2P communications that we expect may be replaced in the future. You also raise the point that full node wallets can use the smaller filters for rescans because the filter validity is not in question. I'd perfectly fine with the idea of defining two filter types in the BIP, one that is output script + outpoint and the other output script + prev script. But I imagine some people would object to the idea of full nodes storing two different filters that overlap in contents. If we had to pick just one though, I'm strongly in support of output script + outpoint so that BIP 157 can be deployed ASAP without a consensus change. It's entirely possible we will learn even more about optimal filter design through deployment and adoption. On Fri, Jun 1, 2018 at 5:22 PM Gregory Maxwell wrote: > On Sat, Jun 2, 2018 at 12:01 AM, Olaoluwa Osuntokun > wrote: > >> A typical network attacker (e.g. someone on your lan or wifi segmet, or > >> someone who has compromised or operates an upstream router) can be all > of > >> your peers. > > > > This is true, but it cannot make us accept any invalid filters unless the > > attacker is also creating invalid blocks w/ valid PoW. > > I wish that were the true, but absent commitments that wouldn't be the > case unless you were always downloading all the blocks-- since you > wouldn't have any sign that there was something wrong with the > filter-- and downloading all the blocks would moot using the filters > in the first place. :) > > Or have I misunderstood you massively here? > > For segwit originally I had proposed adding additional commitments > that would make it possible to efficiently prove invalidity of a > block; but that got stripped because many people were of the view that > the "assume you have at least one honest peer who saw that block and > rejected it to tell you that the block was invalid" security > assumption was of dubious value. Maybe it's more justifiable to make > use of a dubious assumption for a P2P feature than for a consensus > feature? Perhaps, I'd rather have both filter types from day one so > that things not implementing the comparison techniques don't get the > efficiency loss or the extra work to change filter types for a > consensus one. > > [I think now that we're much closer to a design that would be worth > making a consensus committed version of than we were a few months ago > now, since we are effectively already on a second generation of the > design with the various improvements lately] > --000000000000fb5fe3056d9f18ba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
To address the at-least-one-honest peer security assumptio= n for light clients, I think this is a rather good security model for light= clients. First it significantly reduces the chances that an attacker can e= clipse a client just by chance, and clients can implement measures like ens= uring connectivity to peers from different subnets. But even if, as you sug= gest, a network attacker controls the target's local network, peers sti= ll can have good security guarantees by requiring authenticated connections= to semi-trusted peers. A client can select a set of N servers that it beli= eves will not collude to attack it, and only sync filters if connected to a= threshold of them. So even if the network is malicious, the attacker canno= t forge the authenticated responses. The level of trust in these designated= parties again is quite low because only one has to be honest. This would r= equire something like BIP 150.

Even if clients are uncom= fortable with whitelisting required peers, it could have a policy of requir= ing a certain number of connections to peers that have honestly served it f= ilters in the past. This is sort of like trust-on-first-use. This type of s= cheme, however, would require nodes to advertise a pubkey per address, whic= h BIP 150/151 does not support at present.

All in = all, I think this is an acceptable security model for light clients. Withou= t the ability to verify filter validity, a client would have to stop syncin= g altogether in the presence of just one malicious peer, which is unaccepta= ble.

The other concern you raise, Greg, is using a= filter for P2P communications that we expect may be replaced in the future= . You also raise the point that full node wallets can use the smaller filte= rs for rescans because the filter validity is not in question. I'd perf= ectly fine with the idea of defining two filter types in the BIP, one that = is output script=C2=A0+ outpoint and the other output script=C2=A0+ prev sc= ript. But I imagine some people would object to the idea of full nodes stor= ing two different filters that overlap in contents. If we had to pick just = one though, I'm strongly in support of output script=C2=A0+ outpoint so= that BIP 157 can be deployed ASAP without a consensus change. It's ent= irely possible we will learn even more about optimal filter design through = deployment and adoption.

On Fri, Jun 1, 2018 at 5:22 PM Gregory Maxwell <greg@xiph.org> wrote:
On Sat, Jun 2, 2018 at 12:01 AM, Olaoluwa Osuntokun <laolu32@gmail.com>= wrote:
>> A typical network attacker (e.g.=C2=A0 someone on your lan or wifi= segmet, or
>> someone who has compromised or operates an upstream router) can be= all of
>> your peers.
>
> This is true, but it cannot make us accept any invalid filters unless = the
> attacker is also creating invalid blocks w/ valid PoW.

I wish that were the true, but absent commitments that wouldn't be the<= br> case unless you were always downloading all the blocks-- since you
wouldn't have any sign that there was something wrong with the
filter-- and downloading all the blocks would moot using the filters
in the first place. :)

Or have I misunderstood you massively here?

For segwit originally I had proposed adding additional commitments
that would make it possible to efficiently prove invalidity of a
block; but that got stripped because many people were of the view that
the "assume you have at least one honest peer who saw that block and rejected it to tell you that the block was invalid" security
assumption was of dubious value. Maybe it's more justifiable to make use of a dubious assumption for a P2P feature than for a consensus
feature?=C2=A0 Perhaps,=C2=A0 I'd rather have both filter types from da= y one so
that things not implementing the comparison techniques don't get the efficiency loss or the extra work to change filter types for a
consensus one.

[I think now that we're much closer to a design that would be worth
making a consensus committed version of than we were a few months ago
now, since we are effectively already on a second generation of the
design with the various improvements lately]
--000000000000fb5fe3056d9f18ba--