Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: galeru on December 05, 2010, 10:53:55 PM



Title: Protocol Buffer example file for Bitcoins
Post by: galeru on December 05, 2010, 10:53:55 PM
The current network serialization and implementation is really quite specialized, which is at cross-purposes to the goal of having several different clients that can all interact with the network.  I think that having our serialization and network data in a common format which already has several implementations in different languages would be very helpful to the long-term distribution of the bitcoin network.

In this view, I've created a quick and dirty Protocol Buffers version of the network protocol.  I doubt that it's particularly interoperable with the current code, but it does allow for all the information that goes over the network, according to the draft spec on the wiki.  I've uploaded the file at http://pastebin.com/SAgvHwa0


Title: Re: Protocol Buffer example file for Bitcoins
Post by: jgarzik on December 06, 2010, 03:35:55 AM
The draft spec on the wiki is incomplete crap.

Your example is missing obvious data central to bitcoin -- transaction and block data.

It also seems that your hashes shrank to 32 bits.


Title: Re: Protocol Buffer example file for Bitcoins
Post by: galeru on December 06, 2010, 04:51:25 AM
I did shrink the hashes, they're now fixed so they can be the 32 bytes they are. http://pastebin.com/zQEyKV0A

Could you please point me to where the transaction and block data is in the source code?  I thought I already had them encapsulated in the Tx and Block messages, but if there's more, having it all in one place can only help.