2

You can do this with 1 transaction, it will get more expensive, but it has nothing to do with whether you use separate addresses or not (or with whether or not you're using BIP32 in any way or form, for that matter). Bitcoin uses a UTXO model: every transaction has 1 or more inputs, and one or more outputs. Every output creates a UTXO (which you can think ...


1

In your script the previous ScriptPubKey is different. If you want create custom script you need to sign manually the transaction, you can't use signrawtransactionwithkey. Bitcoin core sign only the standard transaction


1

Does this mean that in order for me to test my segwit code, I will have to wait till I get a segwit input somehow? Yes. You have non-segwit inputs. You cannot create a segwit transaction when your transaction has only non-segwit inputs. To get a segwit input, just send some of your Bitcoin to a segwit address that you own.


1

Only segwit outputs can be spent using segwit inputs. A segwit transaction is a transaction with at least one segwit input. You'll first need to create a segwit output to test segwit spending.


Only top voted, non community-wiki answers of a minimum length are eligible