9
2
When a transaction is broadcasted to the network, what is being sent? Is it a hash? if yes, is it going to be the hash of: previous transaction + public key of the receiver?
9
2
When a transaction is broadcasted to the network, what is being sent? Is it a hash? if yes, is it going to be the hash of: previous transaction + public key of the receiver?
10
inv frame, which indicates that it has something in its memory pool, by giving the hash of the transaction to one or more connected peersinv frame, checks its own memory pool, it's not in there, so it sends a getdata frame backgetdata frame for the transaction it just created, so it sends a tx with the entire transactiontx, hashes it and puts it in the memory poolinv to all connected peersinv frame, notices that it's already in the memory pool, and ignores itinv frame as well, getdata's it, stores the tx, sends inv, and repeat that until the entire network has the transaction.References :
Correct me if I'm wrong, but doesn't bitcoin only send the transaction to one peer if it originated the transaction? – Nick ODell – 2013-04-16T21:01:36.660
1@NickODell Perhaps, but that's implementation related, and not a network rule. – Tom van der Woerdt – 2013-04-16T21:02:29.510
Thank you Tom, very clear explanation. However, I still have a question. Based on Satoshi paper http://bitcoin.org/bitcoin.pdf, the hash consists of the public key of the receiver too. I suppose that the public key is added in order to have different hashes?
– anapaso – 2013-04-16T21:27:33.650(Disclaimer: I've never read the paper, I've only built a client.) The hash of a transaction is simply the entire transaction (
tx) hashed (unlike blocks, which only have their headers hashed). This includes all the inputs and outputs. – Tom van der Woerdt – 2013-04-16T22:15:44.583how fast or how long does it take to broadcast the information to all peers? i mean when i'm mining, and somebody has already found a new block, how long would it take till i receive the information and start mining again on new block? – ulkas – 2013-04-17T07:11:55.813
Reaching all peers can take a long time (maybe even up to an hour), as there are always a few edges on the network where it takes a lot longer. However, for most nodes it's a matter of seconds to maybe two minutes. – Tom van der Woerdt – 2013-04-17T09:04:52.033