9

When a bitcoin node has the blockchain in sync, most transactions in incoming block messages may have been already received as standalone tx messages before.

With a block message with only transaction hashes, the receiving node could try to reassemble the full block with its unconfirmed transactions and just request the missing transactions to complete the block.

Since this way to save bandwidth looks too obvious, I'm guessing there must a reason to always include the transactions in block messages, even after downloading the blockchain.

1 Answer 1

9

There are probably several reasons, but it's mostly historic. There is no inherent problem with just sending transaction id's. There is a disadvantage too, though, namely increased latency, which is not necessarily a problem when doing an initial sync, but it is not wanted when a fresh new block is propagating.

In fact, this idea is part of BIP 37, which specifies a protocol extension for requesting filtered blocks. To avoid the increased latency, matching transactions that are not known to the server to be already known to the receiver, are sent immediately after the filtered block itself.

Edit: BIP152 compact blocks also use this idea, though they use shortened 48-bit transaction ids instead to save space.

3
  • Regarding latency, couldn't a block message with transactions id's be relayed as soon as it arrives before verifying its transactions? Creating blocks with invalid transactions would be too costly to consider them a problem, right? Jan 24, 2013 at 12:54
  • Didn't know bloom filters included filtered blocks. That solves the issue. Is the full implementation of BIP 37 coming with 0.8 release? Jan 24, 2013 at 13:06
  • A server-side implementation of BIP 37 will be in 0.8, yes. Jan 24, 2013 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.