Can there be a half segwit, half normal Bitcoin transaction?

3

1

I was wondering if it's feasible to compile a bitcoin transaction that is somewhere in between (segwit and non-segwit), maybe one of these scenarios. I'll call the non-segwit inputs, normal inputs just for the sake of simplicity.

  • Use one normal UTXO input and one segwit input
  • Use Segwit inputs but have normal outputs
  • Have a transaction with two outputs, one Segwit and one normal

If the answer to any of these is yes (maybe doesnt apply to the last scenario), what would be the case for transaction malleability? would the final transaction be still vulnerable to transaction malleability as the signature is still in the main transaction object?

Shayan

Posted 2017-07-20T16:21:07.010

Reputation: 281

Answers

4

Yes, absolutely.

Every output can independently be a normal or SegWit output (when using P2SH-embedded SegWit, you can't even tell until it is being spent).

Every input can independently spend a normal output or SegWit output.

When a transaction has at least 1 SegWit input it's called a SegWit transaction.

When not all inputs are SegWit inputs, the transaction is still malleable.

Pieter Wuille

Posted 2017-07-20T16:21:07.010

Reputation: 54 032

1

Thanks Pieter. your answer and some readings here resolved most of my questions: https://bitcoincore.org/en/segwit_wallet_dev/

Shayan 2017-07-20T16:58:40.687

3

Yes, that is certainly possible. BIP 143 has examples of such transactions. Transactions that spend from both segwit outputs and non-segwit outputs are still vulnerable to transaction malleability.

Andrew Chow

Posted 2017-07-20T16:21:07.010

Reputation: 40 910