Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E0350C97 for ; 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 ; Wed, 7 Jun 2017 21:41:37 +0000 (UTC) Received: by mail-ua0-f179.google.com with SMTP id q15so12009039uaa.2 for ; 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: References: From: Gregory Maxwell Date: Wed, 7 Jun 2017 21:41:36 +0000 X-Google-Sender-Auth: 6Uiln7zDva5NvTBUJXX5vSnssOg Message-ID: To: Olaoluwa Osuntokun 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 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.