Error while sending transaction with script OP_TRUE (Script evaluated without error but finished with a false/empty top stack element)

0

I have transaction

020000000001019e1ab6b4683d58a37f969991304798bbbf7687599f057de0ae61f92945fd1216000000000151ffffffff02BB51D9000000000017a914182fd008c33ac992bda3bac7e09297ebe8639aca87800bb2030000000017a914182fd008c33ac992bda3bac7e09297ebe8639aca87024730440220110ff8ea143c0e1b14da35103ee285be9c0729a79a1e70c543627da58c07947c02204afd8d5a29d50d3519735b33ada00a09fbf379e424b137f547d3f5cd9db24f62012102ada9884dbd1e8bd90968ba66256f017cd77d83595027f7929ae3537f98c92d4a00000000

which is

{
    "result": {
        "txid": "5e24dee37a75b2573538a33f99a924741dc4f55854830a08f69da107a6f2676c",
        "hash": "8446cf6994ab7f8716cd55fb0c1f9a6f065abedd9f2b6f663c0f0315d1d0718a",
        "version": 2,
        "size": 225,
        "vsize": 144,
        "locktime": 0,
        "vin": [
            {
                "txid": "1612fd4529f961aee07d059f598776bfbb9847309199967fa3583d68b4b61a9e",
                "vout": 0,
                "scriptSig": {
                    "asm": "1",
                    "hex": "51"
                },
                "txinwitness": [
                    "30440220110ff8ea143c0e1b14da35103ee285be9c0729a79a1e70c543627da58c07947c02204afd8d5a29d50d3519735b33ada00a09fbf379e424b137f547d3f5cd9db24f6201",
                    "02ada9884dbd1e8bd90968ba66256f017cd77d83595027f7929ae3537f98c92d4a"
                ],
                "sequence": 4294967295
            }
        ],
        "vout": [
            {
                "value": 0.14242235,
                "n": 0,
                "scriptPubKey": {
                    "asm": "OP_HASH160 182fd008c33ac992bda3bac7e09297ebe8639aca OP_EQUAL",
                    "hex": "a914182fd008c33ac992bda3bac7e09297ebe8639aca87",
                    "reqSigs": 1,
                    "type": "scripthash",
                    "addresses": [
                        "33tuREAHMXoNBS5vCYKtk4qCCofzTn37oy"
                    ]
                }
            },
            {
                "value": 0.62000000,
                "n": 1,
                "scriptPubKey": {
                    "asm": "OP_HASH160 182fd008c33ac992bda3bac7e09297ebe8639aca OP_EQUAL",
                    "hex": "a914182fd008c33ac992bda3bac7e09297ebe8639aca87",
                    "reqSigs": 1,
                    "type": "scripthash",
                    "addresses": [
                        "33tuREAHMXoNBS5vCYKtk4qCCofzTn37oy"
                    ]
                }
            }
        ]
    },
    "error": null,
    "id": null
}

Input script is very simple which returns 1. But when I'm trying to send this transaction I get error:

code=-26, message=16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)

Actually, I want to use a different script, but I get the same error. What's wrong with this transaction?

Andr1i

Posted 2018-08-25T18:15:55.027

Reputation: 21

What is the redeemscript?Pieter Wuille 2018-08-25T18:20:58.433

Answers

0

Input script is very simple which returns 1.

You can not spend from 2Muf8gJV81wa93smDeiy7X777BJcppBR5uP with this scriptSig. Do not pay attention on the error message. Your transaction IS invalid

https://testnet.smartbit.com.au/address/2Muf8gJV81wa93smDeiy7X777BJcppBR5uP

amaclin

Posted 2018-08-25T18:15:55.027

Reputation: 5 763

As I understood firstly I should create transaction with output script of hash160(51) as in this transaction. Then should be possible to create a transaction with input script 51 as done here. But anyway I can't create transaction with output of hash160(51). I get error: (Signature must be zero for failed CHECK(MULTI)SIG operation).

Andr1i 2018-08-26T09:44:54.283

Why did you write that I can not send a transaction with this input from this address? Is it somehow related with that address?Andr1i 2018-08-26T09:45:23.527

the vin in your transaction can be found in testnet network. it was easy to find some details you've omittedamaclin 2018-08-26T11:16:36.137

What details are you talking about?Andr1i 2018-08-26T12:01:19.633

address and redeemscript. note: you can not spend from 2Muf8gJV81wa93smDeiy7X777BJcppBR5uP with a script of 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DNamaclin 2018-08-26T12:10:56.977

Thank you for your answers. I do not want to bother you with many questions since I still do not understand a lot, but could you at last tell how you got the 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN value and is it possible somehow to send transaction with input OP_TRUE using p2sh? Because in the transaction where i saw op_true used P2PKH.Andr1i 2018-08-26T13:15:13.607

you put a link to a transaction spending from 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN in your first commentamaclin 2018-08-26T13:58:56.223

I meant that I can not create an analogous transaction with the same output: HASH160(51) OP_EQUALS. As in link in my first comment. I tried create this because I think for sending transaction like in my question, firtsly should be created UTXO with that output.Andr1i 2018-08-26T14:38:29.870