I am experiment with constructing SegWit transactions manually, and I’ve written a non-standard easy script only for testing. No signing or something, simply your typical “add two numbers, examine equality” script. Nonetheless, when making an attempt to broadcast it, I get an error.
I already despatched the cash to the script, now I am simply attempting to spend from it.
Right here is my enter:
{
"txid": "174692a9b447d62043b90059c83237b0526bc09551aa39839a1d4fafc29252b7",
"hash": "27afb30315f82dd64815ef259b7f4075359d42390f549b9a05132d11cf0d5670",
"model": 2,
"dimension": 205,
"vsize": 154,
"weight": 616,
"locktime": 206,
"vin": [
{
"txid": "1e025a8b1af84f4b7f0724b89ed0fc3b0ee6f2e8d1c0b635827edf6f60a0ff9e",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"2b8aac44cbfe12c56ddfd1ff2a0021c6f9b4e76b0325b44a647365ae9e695044029f6f7eb409baee56803e80e47a643711703795c955a8bdc5a0abc5761902fe"
],
"sequence": 4294967293
}
],
"vout": [
{
"value": 1.00000000,
"n": 0,
"scriptPubKey": {
"asm": "0 8b88aeecc8810057147ae75bb5fef0b88e74cdd69877a0b0d9119cbc0a13bd18",
"desc": "addr(bcrt1q3wy2amxgsyq9w9r6uadmtlhshz88fnwknpm6pvxezxwtczsnh5vq8ynwca)#88xz032h",
"hex": "00208b88aeecc8810057147ae75bb5fef0b88e74cdd69877a0b0d9119cbc0a13bd18",
"address": "bcrt1q3wy2amxgsyq9w9r6uadmtlhshz88fnwknpm6pvxezxwtczsnh5vq8ynwca",
"type": "witness_v0_scripthash"
}
},
{
"value": 46.99952700,
"n": 1,
"scriptPubKey": {
"asm": "1 ab0af65a053979dfd08b9673405900f185b6d45edea4dddd5dec9b7ec2eba5fc",
"desc": "rawtr(ab0af65a053979dfd08b9673405900f185b6d45edea4dddd5dec9b7ec2eba5fc)#utsgce08",
"hex": "5120ab0af65a053979dfd08b9673405900f185b6d45edea4dddd5dec9b7ec2eba5fc",
"address": "bcrt1p4v90vks989ual5ytjee5qkgq7xzmd4z7m6jdmh2aajdhasht5h7qx008qn",
"type": "witness_v1_taproot"
}
}
]
}
Vout 0 is the output of curiosity right here.
Right here is my decoded transaction after I try and spend it:
{
"txid": "0110d9fd63ec46c2b47bc589d2f032d10f288912e4d82c88c8aaa1dfed251909",
"hash": "08881deca20dc914f14a03d5caf97bd4b7c717ef9047b1a6f70f5deb44eb8545",
"model": 1,
"dimension": 96,
"vsize": 86,
"weight": 342,
"locktime": 0,
"vin": [
{
"txid": "174692a9b447d62043b90059c83237b0526bc09551aa39839a1d4fafc29252b7",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"63000000",
"5193016487"
],
"sequence": 0
}
],
"vout": [
{
"value": 0.50000000,
"n": 0,
"scriptPubKey": {
"asm": "0 43620bf89a7acd30cc09914e023cdce377e70828",
"desc": "addr(bcrt1qgd3qh7y60txnpnqfj98qy0xuudm7wzpgz5c02y)#thrxqf0c",
"hex": "001443620bf89a7acd30cc09914e023cdce377e70828",
"address": "bcrt1qgd3qh7y60txnpnqfj98qy0xuudm7wzpgz5c02y",
"type": "witness_v0_keyhash"
}
}
]
}
The witness script (5193016487
) is 1 OP_ADD 100 OP_EQUAL
. The witness stack additionally has 99 (63000000
).
Why do I get this confirm error after I try and broadcast it?
error code: -26
error message:
non-mandatory-script-verify-flag (unknown error)