Any documentation available that would help developing a Bitcoin Client?

3

1

I want to start developing a Bitcoin Client in a new language. For this I'm looking for references and resources that could be used to as a guide. Some kind of comprehensive guideline of what a client should include. But haven't been really successful so far. Does anybody knows about something like this?

EDIT: I'm aiming for a full node with wallet capabilities

ntonnelier

Posted 2016-09-27T17:57:19.157

Reputation: 243

You may want to be specific about what type of client you want to make. There are full nodes with and without wallet capabilities, there are SPV wallets, there are mining nodes, etc. The features and protocols that need to be implemented will be determined by what type of node you want.Jestin 2016-09-27T18:46:50.620

just edited the question and added it, @Jestinntonnelier 2016-09-27T18:56:42.127

6If I would redesign Bitcoin Core today, I would start with a design where the wallet and the node functionality were separate (and work towards that is slowly underway in practice). By combining the two you are limiting your options. Write an SPV wallet first, and connect it to an existing full node. That way you don't risk introducing consensus bugs (which are extremely hard to find, experience has shown).Pieter Wuille 2016-09-27T19:15:17.843

1The ultimate, and authoritative, documentation is the source code of Bitcoin Core.Nate Eldredge 2016-09-27T20:12:46.633

It would be nice if most android spv wallets gave you the option of connecting to a specific set of full nodes.Erik Aronesty 2016-09-28T20:25:59.913

For some inspiration, do checkout go-btc. They do seperate full node logic and wallet implementation.

renlord 2016-09-28T23:47:04.927

Answers

2

The bitcoin.it wiki contains a Protocol documentation section with information about network messages mostly. You can also use other pages of this wiki, but be sure to check it's up to date.

Ultimately, the documentation you are looking for, as mentionned by the commenters, is Bitcoin Core's source code (unfortunately) ; if you want to create a full node implementation, you'll have to be bug for bug compatible.

Finally, to test your progress, you can use https://github.com/TheBlueMatt/test-scripts to see how your implementation handles some edge cases, as well as run it on testnet.

alcio

Posted 2016-09-27T17:57:19.157

Reputation: 81

1

I'd suggest you to start from making an offline blockchain-parser. Use the block stored on disk and start parsing them in order to build (and update) the UTXO database. This is the most crucial and performance critical part - if you have it working, the network part will not need much more of the resources.

Later, when you start playing with the network part, you will likely encounter problems that are much harder to analyse and fix, because to the asynchronous matter of the events. Still having a stable (and well performing) blockchain parser will benefit you hugely at this stage.

Also I'd advise you to not implement memory pool and transaction relaying from the start - make sure that processing of new blocks is stable before adding the memory pool feature.

Gigi

Posted 2016-09-27T17:57:19.157

Reputation: 600