public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Erik Aronesty <erik@q32.com>
To: Leo Wandersleb <leo@leowandersleb.de>,
	 Bitcoin Protocol Discussion
	<bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Committed bloom filters for improved wallet performance and SPV security
Date: Fri, 6 Jan 2017 17:07:36 -0500	[thread overview]
Message-ID: <CAJowKgLvZQxGqB6U5RiEizjkNXd1OYuTaRqXONTWTQ0VvX7FGA@mail.gmail.com> (raw)
In-Reply-To: <307a1ca0-5554-a14e-fd3b-aace7d7c2233@LeoWandersleb.de>

[-- Attachment #1: Type: text/plain, Size: 4559 bytes --]

 - N \log_2 \epsilon * 1.44

N = 41000 blocks
epsilon = 1/41000 (fp rate)

= 904689.8bits

~ 1 MB


On Thu, Jul 28, 2016 at 5:07 PM, Leo Wandersleb via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> gmaxwell just made me aware of this mail thread [0]. Some days ago I had
> independently and naively started implementing "something similar" [1].
>
> My version totally ignored the commitment and signing part but I'm pretty
> sure
> that 12GB is overkill. My code is currently broken and I have no time to
> work on
> it much but I thought it might be helpful to chime in.
>
> At this point in time the difference between 80GB and 3GB (as my current
> 1.5GB
> of only outputs would suggest if I had covered the inputs) or even 12GB
> makes
> the difference of being able to store it on a phone, vs. not being able
> to. 80GB
> "compressed" to 3GB is not that bad at all. Unfortunately, with segWit
> this will
> be worse, with the higher transaction count per MB.
>
> Regards,
>
> Leo
>
> [0]
> https://www.reddit.com/r/Bitcoin/comments/4v28jl/how_
> have_fungiblity_problems_affected_you_in/d5ux6aq
> [1] https://github.com/Giszmo/TransactionFinder
>
> On 05/11/2016 10:29 PM, Bob McElrath via bitcoin-dev wrote:
> > Eerrrr....let me revise that last paragraph.  That's 12 *GB* of filters
> at
> > today's block height (at fixed false-positive rate 1e-6.  Compared to
> block
> > headers only which are about 33 MB today.  So this proposal is not really
> > compatible with such a wallet being "light"...
> >
> > Damn units...
> >
> > Bob McElrath via bitcoin-dev [bitcoin-dev@lists.linuxfoundation.org]
> wrote:
> >> I like this idea, but let's run some numbers...
> >>
> >> bfd--- via bitcoin-dev [bitcoin-dev@lists.linuxfoundation.org] wrote:
> >>> A Bloom Filter Digest is deterministically created of every block
> >> Bloom filters completely obfuscate the required size of the filter for
> a desired
> >> false-positive rate.  But, an optimal filter is linear in the number of
> elements
> >> it contains for fixed false-positive rate, and logarithmic in the
> false-positive
> >> rate.  (This comment applies to a RLL encoded Bloom filter Greg
> mentioned, but
> >> that's not the only way)  That is for N elements and false positive rate
> >> \epsilon:
> >>
> >>     filter size = - N \log_2 \epsilon
> >>
> >> Given that the data that would be put into this particular filter is
> *already*
> >> hashed, it makes more sense and is faster to use a Cuckoo[1] filter,
> choosing a
> >> fixed false-positive rate, given expected wallet sizes.  For Bloom
> filters,
> >> multiply the above formula by 1.44.
> >>
> >> To prevent light clients from downloading more blocks than necessary,
> the
> >> false-positive rate should be roughly less than 1/(block height).  If
> we take
> >> the false positive rate to be 1e-6 for today's block height ~ 410000,
> this is
> >> about 20 bits per element.  So for todays block's, this is a 30kb
> filter, for a
> >> 3% increase in block size, if blocks commit to the filter.  Thus the
> required
> >> size of the filter commitment is roughly:
> >>
> >>     filter size = N \log_2 H
> >>
> >> where H is the block height.  If bitcoin had these filters from the
> beginning, a
> >> light client today would have to download about 12MB of data in
> filters.  My
> >> personal SPV wallet is using 31MB currently.  It's not clear this is a
> bandwidth
> >> win, though it's definitely a win for computing load on full nodes.
> >>
> >>
> >> [1] https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf
> >>
> >> --
> >> Cheers, Bob McElrath
> >>
> >> "For every complex problem, there is a solution that is simple, neat,
> and wrong."
> >>     -- H. L. Mencken
> >>
> >>
> >>
> >> !DSPAM:5733934b206851108912031!
> >
> >
> >> _______________________________________________
> >> bitcoin-dev mailing list
> >> bitcoin-dev@lists.linuxfoundation.org
> >> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> >>
> >>
> >> !DSPAM:5733934b206851108912031!
> > --
> > Cheers, Bob McElrath
> >
> > "For every complex problem, there is a solution that is simple, neat,
> and wrong."
> >     -- H. L. Mencken
> >
> >
> >
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>

[-- Attachment #2: Type: text/html, Size: 6811 bytes --]

  reply	other threads:[~2017-01-06 22:07 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09  8:26 [bitcoin-dev] Committed bloom filters for improved wallet performance and SPV security bfd
2016-05-09  8:57 ` Gregory Maxwell
2016-05-11 20:06 ` Bob McElrath
2016-05-11 20:29   ` Bob McElrath
2016-07-28 21:07     ` Leo Wandersleb
2017-01-06 22:07       ` Erik Aronesty [this message]
2017-01-03 20:24     ` bfd
     [not found] ` <77b6dd25-0603-a0bd-6a9e-38098e5cb19d@jonasschnelli.ch>
2017-01-03 20:18   ` bfd
2017-01-03 22:18     ` Aaron Voisine
2017-01-03 22:28       ` bfd
2017-01-03 23:06       ` adiabat
2017-01-03 23:46         ` Aaron Voisine
2017-01-04  0:10           ` bfd
2017-01-04  0:36             ` Aaron Voisine
2017-01-04  6:06               ` Eric Voskuil
2017-01-04 16:13         ` Leo Wandersleb
2017-01-04  7:47       ` Jonas Schnelli
2017-01-04  8:56         ` Aaron Voisine
2017-01-04 10:13           ` Jorge Timón
2017-01-04 11:00             ` Adam Back
2017-01-06  2:15           ` bfd
2017-01-06  7:07             ` Aaron Voisine
2017-01-05  7:06         ` Chris Priest
2017-01-05  7:45           ` Eric Voskuil
2017-01-05 14:48             ` Christian Decker
2017-01-06 20:15             ` Chris Priest
2017-01-06 21:35               ` James MacWhyte
2017-01-06 21:50                 ` Eric Voskuil
2017-01-06  2:04           ` bfd
2017-03-15 22:36             ` Tom Harding
2017-03-16  0:25               ` bfd
2017-03-16 15:05                 ` Tom Harding
2017-02-17  0:28 ` Chris Belcher
2017-04-01 23:49   ` bfd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJowKgLvZQxGqB6U5RiEizjkNXd1OYuTaRqXONTWTQ0VvX7FGA@mail.gmail.com \
    --to=erik@q32.com \
    --cc=bitcoin-dev@lists.linuxfoundation.org \
    --cc=leo@leowandersleb.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox