Good resource for understanding the peer to peer protocol sequence

3

I'm looking for a good explanation or reference on the peer to peer aspects of the two main bitcoin actors- the clients(wallets) and miners.

Satoshi's white paper, in section 5. Network, gives a very high level overview of the steps to run on the network, yet what I'm looking for is a description of the handshake sequences, how the peers broadcast, collects new transactions, and how they request missed blocks.

I've read and somewhat understand the protocol at https://en.bitcoin.it/wiki/Protocol_specification I also have a solid understanding of the crypto, ECDSA, SHA-256, RIPEMD-160, Merkle trees, and Hashcash (and a bit of RPOW) so no need to cover that in particular.

What would be really helpful is a sequence diagram, if anyone knows of one, and a paper or article that goes into more detail than the whitepaper.

Any help, beyond "read the **'ing source code' would be great ;-)

Gene M.

Posted 2013-04-27T14:03:55.983

Reputation: 371

added a bit more detail about what it is specifically that I'm looking for....Gene M. 2013-04-28T06:50:15.720

1You wouldn't be the first person to ask for formal documentation of the protocol.Stephen Gornick 2013-04-28T18:26:29.887

1Gene, I'm going to discuss the P2P protocol sequence in great detail for the Bitcoin Education Project's course; however, the lectures won't be up until July or August. Until then, I would contact one of the devs and ask for their documentation.Charles Hoskinson 2013-05-28T14:08:16.227

Hi Charles, I look forward to your lectures, but in fact I've moved past this point since I've asked the question. I've found some diagrams and created some of my own, in fact.Gene M. 2013-06-01T19:00:49.783

Answers

1

Your question is rather vague, what do you really want to know?

Bitcoins peer-to-peer nature comes from the fact that no single entity holds the database (the block chain), but every client in the network does.

You misstate that Bitcoin has two main actors. In fact, miners are just like other clients. Every client in the network has the possibility to broadcast a new block it has found. The difference with miners is that they are actually trying to find such a block to publish.

Since the block chain is peer-to-peer, all updates to it will have to be broadcast to all clients as well. These update consist of blocks and transactions.

Whenever someone built a valid block to append to the current block chain, it broadcasts it so that every other client can verify it. If these clients accept the block, it will be added to their block chain. New blocks always refer to their previous block so that clients that did not receive one, or mistakenly accepted a malicious block, can always get the right blocks from the network.

Transactions, as well, are broadcast to all clients where they are validated. Most clients do not have to do anything with these transaction, only those that mine do. Clients that mine bundle all the valid transactions they received into the next block they are trying to build. When they succeed in building the block, these transactions are stored in the block and broadcast to be included in other clients' block chain.

One essential property of Bitcoins peer-to-peer nature is that you can only stop it from existing if you can stop all the nodes. As long as one node exists, "Bitcoin" exists.

Steven Roose

Posted 2013-04-27T14:03:55.983

Reputation: 10 855

1Hi Steven, I will update my question with more detail. Your observation about miners and clients is interesting. While so far I still see them having different roles, thus are different Actors but not a distinct class of citizen, or species, I won't go too far down that route to avoid going off topic.Gene M. 2013-04-28T06:36:38.667