I’m making an attempt to spend a P2SH UTXO based mostly on a redeem script that requires no signatures and easily wants the right enter to equal the OP_HASH160 digest within the corresponding P2SH locking script.
My unlocking script pushes 17 bytes onto the stack (0x11) that are the next 17 bytes that represent the “secret” quantity to get the right hash.
The decoded uncooked tx is the next (with the 17 byte secret quantity eliminated):
"txid": "0ba564fc00cbeada33ccded7f4e45f17bfff69c8f8a38132dc715de0d905b857",
"hash": "0ba564fc00cbeada33ccded7f4e45f17bfff69c8f8a38132dc715de0d905b857",
"model": 1,
"dimension": 113,
"vsize": 113,
"weight": 452,
"locktime": 0,
"vin": [
{
"txid": "f8e5dfe32a57872d58cee6f3eb32ec0277f3563306ae623109ea651fd9dc8087",
"vout": 1,
"scriptSig": {
"asm": "<17 byte redeem script>",
"hex": "11<17 byte redeem script>"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.00002000,
"n": 0,
"scriptPubKey": {
"asm": "02de153317307164e7c9918791c7787d9833a3a8201bdff880e631e490cf9a087c OP_CHECKSIG",
"desc": "pk(02de153317307164e7c9918791c7787d9833a3a8201bdff880e631e490cf9a087c)#epafp6sh",
"hex": "2102de153317307164e7c9918791c7787d9833a3a8201bdff880e631e490cf9a087cac",
"type": "pubkey"
}
}
]
}
I can not see any errors nevertheless “sendrawtransaction” offers me the error: error code: -26 error message: mandatory-script-verify-flag-failed (Opcode lacking or not understood)
I had thought possibly this was a non-standard tx and subsequently would not be legitimate until submitted on to miner*, nevertheless it was my understanding that P2SH allowed the liberty to submit arbitrary redeem scripts, supplied the unlocking script is legitimate and the redeem script equals the redeem script hash within the locking script.
*bitcoin-cli decodescript for my unlocking script hex does give me Kind:nonstandard
