2

I have a neutrino client that currently signals NODE_NONE. When it announces transactions it sends inventory messages and gets getdata MSG_TX requests back. Currently it replies with the witness serialization of the transaction and it seems to work fine. Is this correct or should we be signaling NODE_WITNESS so we can receive MSG_WITNESS_TX and properly send the witness version of the transaction?

Murch
  • 71,155
  • 33
  • 180
  • 600

1 Answers1

3

Given that the vast majority of nodes are Bitcoin Core and segwit capable, this is probably okay, but technically does not follow the protocol.

Bitcoin Core itself does not check whether a transaction it receives is in response to a particular getdata, and so it does not check whether it asked using MSG_WITNESS_TX or MSG_TX. So responding to a getdata containing MSG_TX with a transaction with witnesses will be fine as long as the node is segwit capable.

However, if the node you are connected to is not segwit capable, you would probably end up being disconnected by that node (and possibly banned by it) as segwit transactions are not understandable by non-segwit nodes. It is for this reason that there is a distinction of segwit capability in network messages. Non-segwit nodes need the non-segwit version of the transaction.

Andrew Chow
  • 67,209
  • 5
  • 76
  • 149