summaryrefslogtreecommitdiff
path: root/8c/da951cb5a6908b624ddb3f42bc9e66d3c07edd
blob: 38200b67d221e22bbe258f69ac849193ce22008c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Return-Path: <gmaxwell@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id E0350C97
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed,  7 Jun 2017 21:41:38 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-ua0-f179.google.com (mail-ua0-f179.google.com
	[209.85.217.179])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6022515F
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed,  7 Jun 2017 21:41:37 +0000 (UTC)
Received: by mail-ua0-f179.google.com with SMTP id q15so12009039uaa.2
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 07 Jun 2017 14:41:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc;
	bh=Yc3mnI5+knr+li55/aYhCb9J9Tl1fcA9HaTQaQQAKmQ=;
	b=qwBUs3MKiHE4hRg55+aKNudroR3KnN8Ogxp9C8nrrnFlxD/3LV4Qndw/1bJgThmTWv
	niOjgeyHAvsBI3q8OnmY2URW1KMUavlzhCKte+aoT76QDa+taC8GQzGhbdZycHhLPJa5
	gzaQbTTK5f4H816PqZpqPG9zVFc8KdLhzUeaYXZZcS/Fe/pSVaszcHb9OZUAVARNUPH0
	lJug0Q3QXr88sab0gywVB0y1p3Rg8v8rlN1FMn1mZwNchr0USTpPntv33VPB4KNlvJeI
	zfWKclljt6JEI+5p8CJ7/hv8katYjiND7/CJJf8Uh8GApdSfuGvRxwwKYyIx5VgvGBVU
	5G6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc;
	bh=Yc3mnI5+knr+li55/aYhCb9J9Tl1fcA9HaTQaQQAKmQ=;
	b=caCsyx1XeJAYtLkg2Nw6nSxYmWwehuPcIrnsHxeUym7rL8kDO5aB2cgoBXNRIg4xjK
	3khV03qb2i8to2ltmCAZu70dkhCdYSdAOVuAZbXS3YjAayBbGaTBIHJDLTxeW1wyJcRJ
	N0WN8bd1KWjQPziTAFIf2r5qInLhJ6XkN9XuBKyEs0rrrU7ss5YZiwhxUQH3m0S9S+h3
	aG8IoQ1puAbwGoTOLqvAEhmxaezKtYucJw8loSlBoQMqSCXIW4WtuTGFZbDEy6qF9/eL
	zYVAeuhq644c3abk6JIUK67LDNgtUDLP2FrgVqnZu7IlYBQDiqtzKur0Rxp+jb2k7fex
	LLcg==
X-Gm-Message-State: AODbwcDSnpARS8MI/Ejaw16fAFAEMoA0jhAX+e16/DBOV7TzTjh62qm6
	8MUEBY6dNlETiwecSZiWLrQYWwCxDQ==
X-Received: by 10.176.82.18 with SMTP id i18mr2095033uaa.57.1496871696556;
	Wed, 07 Jun 2017 14:41:36 -0700 (PDT)
MIME-Version: 1.0
Sender: gmaxwell@gmail.com
Received: by 10.103.20.66 with HTTP; Wed, 7 Jun 2017 14:41:36 -0700 (PDT)
In-Reply-To: <CAO3Pvs8ccTkgrecJG6KFbBW+9moHF-FTU+4qNfayeE3hM9uRrg@mail.gmail.com>
References: <CAO3Pvs8ccTkgrecJG6KFbBW+9moHF-FTU+4qNfayeE3hM9uRrg@mail.gmail.com>
From: Gregory Maxwell <greg@xiph.org>
Date: Wed, 7 Jun 2017 21:41:36 +0000
X-Google-Sender-Auth: 6Uiln7zDva5NvTBUJXX5vSnssOg
Message-ID: <CAAS2fgRVTfsfXAyHBoBaCqAXpK+=QCFy-Lx3zH=d3tPteu7GcA@mail.gmail.com>
To: Olaoluwa Osuntokun <laolu32@gmail.com>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, FREEMAIL_FROM,
	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
Cc: Arnoud Kouwenhoven - Pukaki Corp via bitcoin-dev
	<bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] BIP Proposal: Compact Client Side Filtering for
 Light Clients
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Jun 2017 21:41:39 -0000

On Thu, Jun 1, 2017 at 7:01 PM, Olaoluwa Osuntokun via bitcoin-dev
<bitcoin-dev@lists.linuxfoundation.org> wrote:
> Hi y'all,
>
> Alex Akselrod and I would like to propose a new light client BIP for
> consideration:
>    * https://github.com/Roasbeef/bips/blob/master/gcs_light_client.mediawiki

I see the inner loop of construction and lookup are free of
non-constant divmod. This will result in implementations being
needlessly slow (especially on arm, but even on modern x86_64 a
division is a 90 cycle-ish affair.)

I believe this can be fixed by using this approach
http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
   which has the same non-uniformity as mod but needs only a multiply
and shift.

Otherwise fast implementations will have to implement the code to
compute bit twiddling hack exact division code, which is kind of
complicated. (e.g. via the technique in "{N}-bit Unsigned Division via
{N}-bit Multiply-Add" by Arch D. Robison).

Shouldn't all cases in your spec where you have N=transactions be
n=indexed-outputs? Otherwise, I think your golomb parameter and false
positive rate are wrong.