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?

3
+100

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.

2
  • So should I signal NODE_WITNESS, so segwit nodes ask with MSG_WITNESS_TX Nov 20 '21 at 21:34
  • 1
    Yes, the correct thing to do would be to signal NODE_WITNESS.
    – Andrew Chow
    Nov 20 '21 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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