I play around with transactions and testnet and created (not broadcasted yet) transaction with the following scriptPubKey:
"256 OP_CHECKSEQUENCEVERIFY OP_DROP OP_DUP OP_HASH160 <pkh> OP_EQUALVERIFY OP_CHECKSIG".
Now I'd like to sign a spend. Is there any standard approach or has it not been implemented in bitcoin core? The tool bitcoin-tx seems to be able to sign transactions, although I'm not sure if this is what it was designed for, namely
bitcoin-tx -testnet -create
This command ends with no error, but produces not-signed transaction. The program seems not to validate syntax of the script, since if I set as prevtxs["scriptPubKey"] some invalid script, it doesn't throw any error (e.g. swap OP_CHECKSIG (0xac) with OP_CHECKMULTISIG (0xae). I don't know actually why do I need to supply this info.
So I have 2 questions:
- Is my initial output script even correct? If not, what is the right way of using CHECKSEQUENCEVERIFY?
- How should I spend similar this kind of non-standard outputs? (except hard-coding that spend using bitcoin libraries.)
This behaviour has been observed on Bitcoin Core version v0.16.0