<p>Given that the vast majority of nodes are Bitcoin Core and segwit capable, this is probably okay, but technically does not follow the protocol.</p>
<p>Bitcoin Core itself does not check whether a transaction it receives is in response to a particular <code>getdata</code>, and so it does not check whether it asked using <code>MSG_WITNESS_TX</code> or <code>MSG_TX</code>. So responding to a <code>getdata</code> containing <code>MSG_TX</code> with a transaction with witnesses will be fine as long as the node is segwit capable.</p>
<p>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.</p>

CC BY-SA 4.0
2021-11-20T21:34:20.553Z
So should I signal NODE_WITNESS, so segwit nodes ask with MSG_WITNESS_TX
benthecarman
CC BY-SA 4.0
2021-11-20T23:03:40.937Z
Yes, the correct thing to do would be to signal NODE_WITNESS.
Ava Chow
CC BY-SA 4.0
2021-11-19T23:06:17.617Z
2021-11-19T23:06:17.617Z
Ava Chow
<p>I have a neutrino client that currently signals <code>NODE_NONE</code>. When it announces transactions it sends inventory messages and gets <code>getdata</code> <code>MSG_TX</code> 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 <code>NODE_WITNESS</code> so we can receive <code>MSG_WITNESS_TX</code> and properly send the witness version of the transaction?</p>

<segregated-witness><network><node-services>
Is it okay to send witness transactions in response to `MSG_TX` get data messages?
benthecarman
# Is it okay to send witness transactions in response to `MSG_TX` get data messages?

(Asked by: username_0 on 2021-11-16)

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?

**Tags:** segregated-witness, network, node-services


---

## 1 answers

### Answer by username_1 on 2021-11-19. Score: 3 | Accepted answer

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.

> **Comments:**
> **username_0**: So should I signal NODE_WITNESS, so segwit nodes ask with MSG_WITNESS_TX  
> **username_1**: Yes, the correct thing to do would be to signal NODE_WITNESS.  

---

