LearnBitcoin

Bitcoin Dev Archive 2014

Proposal: allocate 8 service bits for experimental use

9 messages, 17 to 18 Jun 2014. Started by Peter Todd.

Wladimir J. van der Laan (5), Jeff Garzik (2), Peter Todd, Matt Whitlock

Permalink Original thread on gnusha.org

Peter Todd permalink original

For my replace-by-fee implementation(1) I used service bit 26 to let preferential peering work so that replace-by-fee nodes could easily find each other. Of course, that's a temporary/experimental usage that can be dropped after wider adoption, so I included the following comment:

    // Reserve 24-31 for temporary experiments
    NODE_REPLACE_BY_FEE = (1 << 26)

Service bits are never a guaranteed thing anyway, so occasional collisions can and should be tolerated by applications using these experimental service bits.

Alternately Wladimir J. van der Laan brought up elsewhere(2) the possibility for a wider notion of an extension namespace. I'm personally not convinced of the short-term need - we've got 64 service bits yet NODE_BLOOM is the first fully fleshed out proposal to use one - but it's worth thinking about for the long term.

1) https://github.com/petertodd/bitcoin/tree/replace-by-fee-v0.9.1
2) https://github.com/bitcoin/bitcoin/pull/4351#issuecomment-46272958
Wladimir J. van der Laan in reply to Peter Todd permalink original

On Tue, Jun 17, 2014 at 9:23 AM, Peter Todd <pete@petertodd•org> wrote:

Quoted text (5 lines)
> Alternately Wladimir J. van der Laan brought up elsewhere(2) the
> possibility for a wider notion of an extension namespace. I'm personally
> not convinced of the short-term need - we've got 64 service bits yet
> NODE_BLOOM is the first fully fleshed out proposal to use one - but it's
> worth thinking about for the long term

Yes, as I said in the github topic (https://github.com/bitcoin/bitcoin/pull/4351) I suggest we adapt a string-based name space for extensions.

A new network version could add a command 'getextensions' to query the supported extensions, returning a list of extension strings or (extension,version) pairs. For BIPs some something like 'BIP0064' could be defined, but for an experiment for example 'experimental-getutxo'. This would be easy to implement and specify.

Unlike with the 64 service bits it does not require (as much) central coordination to assign as there is no real danger of collisions. It takes the political aspect out of P2P network extensions, and gives more freedom to alternative implementations to experiment with their own extensions. And no more need for bitcoin core to drive what must be supported with increasing network versions.

Wladimir

Matt Whitlock in reply to Wladimir J. van der Laan permalink original

On Tuesday, 17 June 2014, at 9:57 am, Wladimir wrote:

Quoted text (3 lines)
> Yes, as I said in the github topic
> (https://github.com/bitcoin/bitcoin/pull/4351) I suggest we adapt a
> string-based name space for extensions.

Why use textual strings? These fields are not for human consumption. Why not use UUIDs, which are fixed length and will not waste as much bandwidth in the protocol? Or if you'd prefer a hierarchical namespace, you could use OIDs, a la ASN.1.

Wladimir J. van der Laan in reply to Matt Whitlock permalink original

On Tue, Jun 17, 2014 at 10:02 AM, Matt Whitlock <bip@mattwhitlock•name> wrote:

Quoted text (6 lines)
> On Tuesday, 17 June 2014, at 9:57 am, Wladimir wrote:
>> Yes, as I said in the github topic
>> (https://github.com/bitcoin/bitcoin/pull/4351) I suggest we adapt a
>> string-based name space for extensions.
>
> Why use textual strings? These fields are not for human consumption. Why not use UUIDs, which are fixed length and will not waste as much bandwidth in the protocol? Or if you'd prefer a hierarchical namespace, you could use OIDs, a la ASN.1.

Come on, this is only sent over the line at connection time at most once. No need to overdesign a scheme here.

Anyhow, if we like to bike-shed so much: - UUIDs are 16 bytes -- most human-recognizable strings are shorter. And they're ugly to use as well. - OIDs need central and hierarchical coordination, just what we're trying to avoid.

Wladimir

Wladimir J. van der Laan in reply to Wladimir J. van der Laan permalink original

On Tue, Jun 17, 2014 at 10:08 AM, Wladimir <laanwj@gmail•com> wrote:

Quoted text (7 lines)
> On Tue, Jun 17, 2014 at 10:02 AM, Matt Whitlock <bip@mattwhitlock•name> wrote:
>> On Tuesday, 17 June 2014, at 9:57 am, Wladimir wrote:
>>> Yes, as I said in the github topic
>>> (https://github.com/bitcoin/bitcoin/pull/4351) I suggest we adapt a
>>> string-based name space for extensions.
>>
>> Why use textual strings? These fields are not for human consumption. Why not use UUIDs, which are fixed length and will not waste as much bandwidth in the protocol? Or if you'd prefer a hierarchical namespace, you could use OIDs, a la ASN.1.

Also it IS useful for these fields to be human readable for statistics, peer list views and such. When encountering a new, unknown extension when connecting to a node it's much more useful to get a google-able string to find out what it is about, than some long hexadecimal or dotted-number identifier.

Wladimir

Jeff Garzik in reply to Wladimir J. van der Laan permalink original

I wrote a patch for string-based name extensions, circa 2011-2012. I agree that is preferable to unreadable bits, for reasons you cite.

However, it was noted that extensions (or UUIDs etc.) would not be propagated around the network in "addr" messages, as service bits are.

On Tue, Jun 17, 2014 at 3:57 AM, Wladimir <laanwj@gmail•com> wrote:

Quoted text (37 lines)
> On Tue, Jun 17, 2014 at 9:23 AM, Peter Todd <pete@petertodd•org> wrote:
>
>> Alternately Wladimir J. van der Laan brought up elsewhere(2) the
>> possibility for a wider notion of an extension namespace. I'm personally
>> not convinced of the short-term need - we've got 64 service bits yet
>> NODE_BLOOM is the first fully fleshed out proposal to use one - but it's
>> worth thinking about for the long term
>
> Yes, as I said in the github topic
> (https://github.com/bitcoin/bitcoin/pull/4351) I suggest we adapt a
> string-based name space for extensions.
>
> A new network version could add a command 'getextensions' to query the
> supported extensions, returning a list of extension strings or
> (extension,version) pairs. For BIPs some something like 'BIP0064'
> could be defined, but for an experiment for example
> 'experimental-getutxo'. This would be easy to implement and specify.
>
> Unlike with the 64 service bits it does not require (as much) central
> coordination to assign as there is no real danger of collisions. It
> takes the political aspect out of P2P network extensions, and gives
> more freedom to alternative implementations to experiment with their
> own extensions. And no more need for bitcoin core to drive what must
> be supported with increasing network versions.
>
> Wladimir
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge•net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
Wladimir J. van der Laan in reply to Jeff Garzik permalink original

On Tue, Jun 17, 2014 at 11:29 PM, Jeff Garzik <jgarzik@bitpay•com> wrote:

Quoted text (5 lines)
> I wrote a patch for string-based name extensions, circa 2011-2012.  I
> agree that is preferable to unreadable bits, for reasons you cite.
>
> However, it was noted that extensions (or UUIDs etc.) would not be
> propagated around the network in "addr" messages, as service bits are.

Thanks for letting me know, I didn't remember your patch.

Ugh, yes, propagating all extensions in `addr` messages is not how I imagined this to work.

But then there would need to be an alternative way to discover nodes that offer a certain extension. Alas, this moves it from a straightforward and common sense change to a significant change to the protocol.

Wladimir

Wladimir J. van der Laan in reply to Peter Todd permalink original

On Tue, Jun 17, 2014 at 9:23 AM, Peter Todd <pete@petertodd•org> wrote:

Quoted text (11 lines)
> For my replace-by-fee implementation(1) I used service bit 26 to let
> preferential peering work so that replace-by-fee nodes could easily find
> each other. Of course, that's a temporary/experimental usage that can be
> dropped after wider adoption, so I included the following comment:
>
>     // Reserve 24-31 for temporary experiments
>     NODE_REPLACE_BY_FEE = (1 << 26)
>
> Service bits are never a guaranteed thing anyway, so occasional
> collisions can and should be tolerated by applications using these
> experimental service bits.

Anyhow -- back to the original proposal. I'm fine with setting aside part of the service bit space for experiments.

Wladimir

Jeff Garzik in reply to Wladimir J. van der Laan permalink original

On Wed, Jun 18, 2014 at 5:23 AM, Wladimir <laanwj@gmail•com> wrote:

Quoted text (2 lines)
> Anyhow -- back to the original proposal. I'm fine with setting aside
> part of the service bit space for experiments.

ACK