public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] NODE_BLOOM BIP
@ 2013-08-18  2:59 Peter Todd
  2013-08-18 22:00 ` Mike Hearn
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Todd @ 2013-08-18  2:59 UTC (permalink / raw)
  To: Bitcoin Dev

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

My draft is as follows.

Gregory Maxwell: Can you assign a BIP # for this? The next number, 38,
is on the wiki as "Passphrase-protected private key" by Mike Caldwell,
although it isn't in the list so I don't know if that is official or
not.



BIP: ?
Title: NODE_BLOOM service bit
Author: Peter Todd <pete@petertodd•org>
Type: Standards Track (draft)
Created: 17-08-2013

Abstract
========

This BIP extends BIP 37, Connection Bloom filtering, by defining a service bit
to allow peers to advertise that they support bloom filters explicitly.


Motivation
==========

BIP 37 did not specify a service bit for the bloom filter service, thus
implicitly assuming that all nodes that serve peers data support it. There are
however cases where a node may want to provide data, such as mempool
transactions and blocks, but do not want to or have not implemented bloom
filtering. Additionally it is good practice for nodes to be given options as to
the granularity of the services they are providing the public - a full-node
operator may be able to donate only a small amount of bandwidth and may want
those efforts to be used by other full-node operators.


Specification
=============

The following protocol bit is added:

    NODE_BLOOM = (1 << 1)

In addition the protocol version is increased from 70001 to 70002 in the
reference implementation. Nodes that support bloom filters should set that
protocol bit. Otherwise it should remain unset.

NODE_BLOOM is distinct from NODE_NETWORK, and it is legal to advertise
NODE_BLOOM but not NODE_NETWORK.

If a node does not support bloom filters but receives a "filterload",
"filteradd", or "filterclear" message from a peer the node should disconnect
that peer immediately.

While outside the scope of this BIP it is suggested that DNS seeds and other
peer discovery mechanisms support the ability to specify the services required;
current implementations simply check only that NODE_NETWORK is set.


Design rational
===============

A service bit was chosen as applying a bloom filter is a service.

The increase in protocol version is for backwards compatibility. Nodes that
require the bloom filter service can set NODE_BLOOM for peers advertising a
protocol version < 70002, allowing the rest of the implementation to be
unchanged. Nodes with implementations that do not know of the NODE_BLOOM bit
will be disconnected immediately as though the connection failed for some
reason, and thus will not have incoming bandwidth wasted by that peer and can
easily connect to another peer.

Supporting NODE_BLOOM but not NODE_NETWORK allows for situations where a node
may have data that its peers may be interested in, but is not a full node and
thus does not have block data in general. For instance an SPV node that
receives a full, unfiltered, block from a peer may want to let its SPV peers
know about the existence of that block and provide them that data if requested.
Those peers in turn may only be interested in knowing about the block if it
matches a specific bloom filter. Note how in this example DoS attacks are made
prohibitively expensive by the work required to create a valid block header.


Reference Implementation
========================

https://github.com/bitcoin/bitcoin/pull/2900


Copyright
=========

This document is placed in the public domain.

-- 
'peter'[:-1]@petertodd.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bitcoin-development] NODE_BLOOM BIP
  2013-08-18  2:59 [Bitcoin-development] NODE_BLOOM BIP Peter Todd
@ 2013-08-18 22:00 ` Mike Hearn
  2013-08-18 22:22   ` Gavin Andresen
  2013-08-18 22:59   ` Peter Todd
  0 siblings, 2 replies; 5+ messages in thread
From: Mike Hearn @ 2013-08-18 22:00 UTC (permalink / raw)
  To: Peter Todd; +Cc: Bitcoin Dev

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

The original Bloom filtering spec did not make this feature optional for
the same reason gzip isn't an optional part of the PNG specification. I see
no reason to revisit that. It's definitely not the case that making every
possible feature optional is smart design, often it's the opposite.

If in future there are nodes that for some reason can't technically support
this feature, then there'd be a stronger rationale for something like this.
However no such nodes exist, nor are they likely to in future given that
it's a simple feature to implement.

For these reason I oppose this BIP.


On Sun, Aug 18, 2013 at 4:59 AM, Peter Todd <pete@petertodd•org> wrote:

> My draft is as follows.
>
> Gregory Maxwell: Can you assign a BIP # for this? The next number, 38,
> is on the wiki as "Passphrase-protected private key" by Mike Caldwell,
> although it isn't in the list so I don't know if that is official or
> not.
>
>
>
> BIP: ?
> Title: NODE_BLOOM service bit
> Author: Peter Todd <pete@petertodd•org>
> Type: Standards Track (draft)
> Created: 17-08-2013
>
> Abstract
> ========
>
> This BIP extends BIP 37, Connection Bloom filtering, by defining a service
> bit
> to allow peers to advertise that they support bloom filters explicitly.
>
>
> Motivation
> ==========
>
> BIP 37 did not specify a service bit for the bloom filter service, thus
> implicitly assuming that all nodes that serve peers data support it. There
> are
> however cases where a node may want to provide data, such as mempool
> transactions and blocks, but do not want to or have not implemented bloom
> filtering. Additionally it is good practice for nodes to be given options
> as to
> the granularity of the services they are providing the public - a full-node
> operator may be able to donate only a small amount of bandwidth and may
> want
> those efforts to be used by other full-node operators.
>
>
> Specification
> =============
>
> The following protocol bit is added:
>
>     NODE_BLOOM = (1 << 1)
>
> In addition the protocol version is increased from 70001 to 70002 in the
> reference implementation. Nodes that support bloom filters should set that
> protocol bit. Otherwise it should remain unset.
>
> NODE_BLOOM is distinct from NODE_NETWORK, and it is legal to advertise
> NODE_BLOOM but not NODE_NETWORK.
>
> If a node does not support bloom filters but receives a "filterload",
> "filteradd", or "filterclear" message from a peer the node should
> disconnect
> that peer immediately.
>
> While outside the scope of this BIP it is suggested that DNS seeds and
> other
> peer discovery mechanisms support the ability to specify the services
> required;
> current implementations simply check only that NODE_NETWORK is set.
>
>
> Design rational
> ===============
>
> A service bit was chosen as applying a bloom filter is a service.
>
> The increase in protocol version is for backwards compatibility. Nodes that
> require the bloom filter service can set NODE_BLOOM for peers advertising a
> protocol version < 70002, allowing the rest of the implementation to be
> unchanged. Nodes with implementations that do not know of the NODE_BLOOM
> bit
> will be disconnected immediately as though the connection failed for some
> reason, and thus will not have incoming bandwidth wasted by that peer and
> can
> easily connect to another peer.
>
> Supporting NODE_BLOOM but not NODE_NETWORK allows for situations where a
> node
> may have data that its peers may be interested in, but is not a full node
> and
> thus does not have block data in general. For instance an SPV node that
> receives a full, unfiltered, block from a peer may want to let its SPV
> peers
> know about the existence of that block and provide them that data if
> requested.
> Those peers in turn may only be interested in knowing about the block if it
> matches a specific bloom filter. Note how in this example DoS attacks are
> made
> prohibitively expensive by the work required to create a valid block
> header.
>
>
> Reference Implementation
> ========================
>
> https://github.com/bitcoin/bitcoin/pull/2900
>
>
> Copyright
> =========
>
> This document is placed in the public domain.
>
> --
> 'peter'[:-1]@petertodd.org
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bitcoin-development] NODE_BLOOM BIP
  2013-08-18 22:00 ` Mike Hearn
@ 2013-08-18 22:22   ` Gavin Andresen
  2013-08-18 23:11     ` Peter Todd
  2013-08-18 22:59   ` Peter Todd
  1 sibling, 1 reply; 5+ messages in thread
From: Gavin Andresen @ 2013-08-18 22:22 UTC (permalink / raw)
  To: Mike Hearn; +Cc: Bitcoin Dev

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

Mike pointed out exactly the reason I oppose a NODE_BLOOM service bit: I
also think it is a bad idea to start making various bits and pieces of the
protocol optional.

It is bad for privacy (easier to fingerprint nodes) and bad for
decentralization (fewer nodes support your required feature set). And every
bit you add can give you an exponential number of combinations your QA team
should test.

I'd say the same thing about NODE_TRANSACTION ("I don't know about blocks,
have and NODE_BLOCK bits.

-- 
--
Gavin Andresen

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bitcoin-development] NODE_BLOOM BIP
  2013-08-18 22:00 ` Mike Hearn
  2013-08-18 22:22   ` Gavin Andresen
@ 2013-08-18 22:59   ` Peter Todd
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Todd @ 2013-08-18 22:59 UTC (permalink / raw)
  To: Mike Hearn; +Cc: Bitcoin Dev

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

On Mon, Aug 19, 2013 at 12:00:23AM +0200, Mike Hearn wrote:
> The original Bloom filtering spec did not make this feature optional for
> the same reason gzip isn't an optional part of the PNG specification. I see
> no reason to revisit that. It's definitely not the case that making every
> possible feature optional is smart design, often it's the opposite.

Bloom filtering isn't lossless so to speak.

A better analogy would be making re-sharing an optinal part of the
BitTorrent specification, and then expecting that the majority of users
would never upload data to peers that needed it.

-- 
'peter'[:-1]@petertodd.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bitcoin-development] NODE_BLOOM BIP
  2013-08-18 22:22   ` Gavin Andresen
@ 2013-08-18 23:11     ` Peter Todd
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Todd @ 2013-08-18 23:11 UTC (permalink / raw)
  To: Gavin Andresen; +Cc: Bitcoin Dev

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

On Mon, Aug 19, 2013 at 08:22:10AM +1000, Gavin Andresen wrote:
> Mike pointed out exactly the reason I oppose a NODE_BLOOM service bit: I
> also think it is a bad idea to start making various bits and pieces of the
> protocol optional.

> It is bad for privacy (easier to fingerprint nodes) and bad for
> decentralization (fewer nodes support your required feature set). And every
> bit you add can give you an exponential number of combinations your QA team
> should test.

Mike's and others have been talking about persistent node-specific
identifiers, and after all at this level there are IP addresses;
fingerprinting nodes is trivial.

> I'd say the same thing about NODE_TRANSACTION ("I don't know about blocks,
> have and NODE_BLOCK bits.

We need options so peopl can contribute to relaying and the health of
the network - these edge cases are going to be tested anyway by people
like me deciding to disable bloom filtering.

-- 
'peter'[:-1]@petertodd.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-18 23:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-18  2:59 [Bitcoin-development] NODE_BLOOM BIP Peter Todd
2013-08-18 22:00 ` Mike Hearn
2013-08-18 22:22   ` Gavin Andresen
2013-08-18 23:11     ` Peter Todd
2013-08-18 22:59   ` Peter Todd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox