public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: "Jeremy Spilman" <jeremy@taplink.co>
To: "Bitcoin Development" <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Revisiting the BIPS process, a proposal
Date: Thu, 24 Oct 2013 12:43:15 -0700	[thread overview]
Message-ID: <op.w5g42djqyldrnw@laptop-air> (raw)
In-Reply-To: <CALxbBHVEdTmo1VWL5zj2ZBV6c-Td4TfpbQSQOWuLGbpxHSDRdA@mail.gmail.com>

Thanks Christian, this is a really interesting bit of history. My own  
personal experience from when I wrote my own client and BCCAPI-ish server  
was that the protocol specification on the Wiki was hugely valuable, and  
rarely sent me astray. Supplement that with the occasional questions on  
#bitcoin-dev, and then just coding, coding, coding and getting unit tests  
to pass.

Nothing compares (IMO) to stepping through your own code watching the unit  
tests run, scripts evaluate, calculating transaction hashes for the  
different SIGHASH modes, and finally getting your first transaction into  
the block chain. I really appreciated the .json files holding the unit  
test data, which were easy to load into my own test harness, the tables on  
the Wiki showing what the stack should look like at each point in a script  
execution, and the diagrams showing transaction signing.

Bitcoin takes some time to "grok" when you first approach; more than a  
day, less than a month, and really no amount of reading documentation or  
specs will get you to that "ah ha" moment. When the fog lifts and the  
blockchain, scripting, signing, and wallet handling really click, suddenly  
the bitcoind code (and many other great public sources in just about any  
language you could want) actually does starts to feel fairly simple and  
obvious. But it certainly doesn't start out that way on day one.

I think the majority of client code development is actually people writing  
'agents' not end-user P2P wallets, and they tend to be written to connect  
to a single bitcoind acting as a proxy to the network. Even some end-user  
wallets work this way! As such, I spent very little time in my own client  
writing P2P protocol code, no peer discovery code, no anti-DoS, etc.  
Clients like this also don't pose much systemic risk, because they don't  
mine, they don't connect directly to external nodes, etc. They can  
certainly be used to "cause trouble" though, but so can  
'sendrawtransaction'.

I chose to speak the P2P protocol to bitcoind versus using some of the  
other options like ZeroMQ, but it still didn't take long to get headers,  
blocks, and transactions downloading. I remember getting stuck on the very  
first version message, because of missing the checksum and user-agent or  
something caused the latest bitcoind to just ignore me. A little wireshark  
capture of the exchange between two working bitcoind instances cleared it  
right up. I didn't mind the leg work, I don't think everything needs to be  
spoon fed, and it's certainly not purposefully obfuscated. Maybe one  
exception is the mix-matched endianness will throw you off, especially if  
you are developing on LE! Anyway, I have huge respect for how much effort  
it takes to keep even small bits of documentation up-to-date. For as  
"slow" as bitcoin moves, it's actually moving incredibly fast.

Finally, the bitcoind console and debug logs, as well sites like  
blockchain.info and blockexplorer.com are hugely helpful for debugging raw  
and live transactions for when you get stuck. There's a surprisingly large  
tooling and support ecosystem out there.

Moral of the story, I think, is everything you need is there. No, it's not  
all in one place. Yes, it takes time to find it and assimilate all that  
knowledge. It also really helps that the community is extremely willing to  
help and answer technical questions, and point you in the right direction,  
even when you're working on your own private client code. The IRC channel  
can certainly be intimidating because it seems like every time I hit enter  
to send a question, gmaxwell's respond 300ms later would invoke an  
immediate forehead slap and a groan of "shit, I knew/should have known  
that, now I feel dumb" ;-) but if you're working on bitcoin, you better  
get used to not being the smartest person in the room! The responses I got  
were never arrogant or disparaging, but they were straight to-the-point  
and surprisingly high quality. Ain't no slouches in that channel, yes you  
will have to bring your A-game and you are expected to have "tried first"  
before just asking. I have fairly limited experience working on open  
source projects, but I'm extremely happy with my experience with the  
Bitcoin community and found writing Bitcoin code hugely enjoyable.

The flip side to helping people implement their own clients, agents, or  
even miners, is helping people to contribute pulls requests, or at the  
very highest echelon, a BIP. If you haven't written any significant  
Bitcoin code, you might want to consider investing in that first before  
submitting a BIP. :-)

For a BIP to be valuable, often it requires widespread or even consensus  
adoption. BIPs are probably not the place to toss just any old 'good idea'  
because BIPs impose a cost on all active developers. I want to read and  
understand 'all the BIPs' because for the most part they are actually  
essential, like, how to handle duplicate transactions in BIP30 - if you  
don't read BIP30 you very likely totally miss that, until your code throws  
exceptions while processing block 91842.

And perhaps the hardest kind of BIP of all is the "lets get wallets to add  
this user-facing feature" where it has no bearing on the blockchain or  
transaction processing, it doesn't make the network more resilient or add  
crucial functionality for increasing scalability. Kind of like JPK's HD  
wallet encryption proposal, which I love, and I tried to contribute to in  
the forums, but I can totally understand the headwinds for making progress  
on BIPs like that one and BIP39. No one is against it per-say, it's just  
much harder to articulate and justify the NEED for everyone to implement,  
test, and support this new not-yet-standard, nice-to-have feature. For  
those kinds of BIPs you probably have to go out and get some wallets to  
implement it, or implement it yourself, to prove the value and kick start  
critical mass before you will even get enough support for getting a BIP  
number assigned. IMO, it's not a Bad Thing.

TL;DR; The current support systems worked very well for me. I was able to  
accomplish all my goals, and I would even say it was a pleasure. Keep a  
high bar for assigning BIP numbers. And I hope to be able to jump back in  
and do more with Bitcoin soon.

Thanks all, sorry if I'm rambling,
Jeremy Spilman

On Thu, 24 Oct 2013 04:11:05 -0700, Christian Decker  
<decker.christian@gmail.com> wrote:

> I'd like to add some historical background about how the "protocol
> specification" came to be in the first place.
>
> A bit over three years [1] ago I started an attempt to document the
> network protocol, by reverse engineering it from the satoshi
> client. My goal, back then, was to enable like-minded engineers to
> create alternative clients and move away from the client-monoculture
> that is still predominant today. It was clear from the beginning that
> it would merely be a reverse engineering effort, and that it would
> likely lag a bit behind the changes in the main client. It was meant
> as a help for engineers that are not well versed in C/C++ to enable
> them to contribute by creating new clients, but the satoshi client
> would always be the de-facto standard.
>
> With the move from Google Code to the Bitcoin.it wiki somehow this
> notion of it being a reverse engineering effort was lost and people
> started assuming that if the behavior of the satoshi client did not
> match the protocol description it was a bug on the client
> side. Instead it is because the reverse engineering of the protocol is
> incorrect or simply missing some details. Although the protocol
> description is far more complete than it was back when we started, I
> still don't feel comfortable giving it the name specification.
>
> I still believe that a client monoculture is bad for the system as a
> whole, because a single bug might bring down the whole network. Giving
> people the necessary tools to implement new clients brings
> stability. I do understand the criticism that writing a specification
> might hinder future development as it restricts the possible changes
> to the protocol, but isn't this already the case as long as we have
> legacy versions of the client participating in the network? I would
> also argue that having a specification allows an application
> independent review of the protocol to identify possible improvements
> and bugs.
>
> I think the protocol description has an important place in the
> development of Bitcoin, so much so that we pushed a long time ago to
> separate protocol version from the client version. I would love to see
> the protocol specification becoming official part of the bitcoin
> github repository, which would ideally be maintained alongside the
> satoshi client to keep it up to date.
>
> Regards,
> Christian Decker
>
> [1] https://bitcointalk.org/index.php?topic=231
> --
> Christian Decker
>
>




  reply	other threads:[~2013-10-24 19:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 14:30 [Bitcoin-development] Revisiting the BIPS process, a proposal Jeff Garzik
2013-10-21 14:34 ` Jeff Garzik
2013-10-21 15:46   ` Andreas Schildbach
2013-10-21 16:14     ` Jeff Garzik
2013-10-21 17:17 ` Jeff Garzik
2013-10-21 19:38   ` Jean-Paul Kogelman
2013-10-21 19:47     ` Luke-Jr
2013-10-21 20:57       ` Benjamin Cordes
2013-10-21 20:59       ` Benjamin Cordes
2013-10-22  6:39       ` Martin Sustrik
2013-10-22  6:59         ` Jean-Paul Kogelman
2013-10-22  7:03           ` Gregory Maxwell
2013-10-22  7:34             ` Martin Sustrik
2013-10-22  7:49               ` Peter Todd
2013-10-22  7:56               ` Gregory Maxwell
2013-10-22  8:20                 ` Martin Sustrik
2013-10-22 14:08               ` Jeff Garzik
2013-10-23  7:38                 ` Martin Sustrik
2013-10-23 19:40                   ` Peter Todd
2013-10-23 20:05                     ` Martin Sustrik
2013-10-23 20:27                       ` Peter Todd
2013-10-23 21:07                         ` Pieter Wuille
2013-10-23 21:42                           ` Allen Piscitello
2013-10-23 21:49                             ` Luke-Jr
2013-10-24  7:03                           ` Martin Sustrik
2013-10-24 10:39                             ` Jeff Garzik
2013-10-24 11:11                             ` Christian Decker
2013-10-24 19:43                               ` Jeremy Spilman [this message]
2013-11-19 16:32 ` Wladimir
2013-11-19 16:53   ` Drak
2013-11-19 17:01     ` Gregory Maxwell
2013-11-19 17:07       ` Drak
2013-11-19 17:45       ` Wladimir
2013-11-19 17:54         ` Gregory Maxwell
2013-11-19 17:06   ` Peter Todd
     [not found]     ` <CA+s+GJA=p+yvoJqUAMQQRcfYK1B8eMVSJDWaXW8o+X5dzCXkdA@mail.gmail.com>
2013-11-19 17:21       ` [Bitcoin-development] Fwd: " Wladimir

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=op.w5g42djqyldrnw@laptop-air \
    --to=jeremy@taplink.co \
    --cc=bitcoin-development@lists.sourceforge.net \
    /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