<blockquote>
  <p>Input script is very simple which returns 1.</p>
</blockquote>

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

<p><a href="https://testnet.smartbit.com.au/address/2Muf8gJV81wa93smDeiy7X777BJcppBR5uP" rel="nofollow noreferrer">https://testnet.smartbit.com.au/address/2Muf8gJV81wa93smDeiy7X777BJcppBR5uP</a></p>

CC BY-SA 4.0
2018-08-26T09:44:54.283Z
As I understood firstly I should create transaction with output script of hash160(51) as in [this](https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d) transaction.
Then should be possible to create a transaction with input script 51 as done [here](https://www.blocktrail.com/tBTC/tx/839b903b9f79c3372792ceb95917047c46d1b919ed1f6471f5a19d7c865ab32c). 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
CC BY-SA 4.0
2018-08-26T09:45:23.527Z
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
CC BY-SA 4.0
2018-08-26T11:16:36.137Z
the `vin` in your transaction can be found in testnet network. it was easy to find some details you've omitted
amaclin
CC BY-SA 4.0
2018-08-26T12:01:19.633Z
What details are you talking about?
Andr1i
CC BY-SA 4.0
2018-08-26T12:10:56.977Z
address and redeemscript. note: you can not spend from 2Muf8gJV81wa93smDeiy7X777BJcppBR5uP with a script of 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN
amaclin
CC BY-SA 4.0
2018-08-26T13:15:13.607Z
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
CC BY-SA 4.0
2018-08-26T13:58:56.223Z
you put a link to a transaction spending from 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN in your first comment
amaclin
CC BY-SA 4.0
2018-08-26T14:38:29.870Z
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
CC BY-SA 4.0
2018-08-25T19:06:01.147Z
2018-08-25T19:06:01.147Z
amaclin
<p>I have transaction</p>

<pre><code>020000000001019e1ab6b4683d58a37f969991304798bbbf7687599f057de0ae61f92945fd1216000000000151ffffffff02BB51D9000000000017a914182fd008c33ac992bda3bac7e09297ebe8639aca87800bb2030000000017a914182fd008c33ac992bda3bac7e09297ebe8639aca87024730440220110ff8ea143c0e1b14da35103ee285be9c0729a79a1e70c543627da58c07947c02204afd8d5a29d50d3519735b33ada00a09fbf379e424b137f547d3f5cd9db24f62012102ada9884dbd1e8bd90968ba66256f017cd77d83595027f7929ae3537f98c92d4a00000000
</code></pre>

<p>which is</p>

<pre><code>{
    "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
}
</code></pre>

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

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

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

CC BY-SA 4.0
2018-08-25T18:20:58.433Z
What is the redeemscript?
Pieter Wuille
<transactions><p2sh>
Error while sending transaction with script OP_TRUE (Script evaluated without error but finished with a false/empty top stack element)
Andr1i
# Error while sending transaction with script OP_TRUE (Script evaluated without error but finished with a false/empty top stack element)

(Asked by: username_0 on 2018-08-25)

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?

**Tags:** transactions, p2sh

> **Comments:**
> **username_1**: What is the redeemscript?  

---

## 1 answers

### Answer by username_2 on 2018-08-25. Score: 0 | Accepted answer

> 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>

> **Comments:**
> **username_0**: As I understood firstly I should create transaction with output script of hash160(51) as in [this](https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d) transaction. Then should be possible to create a transaction with input script 51 as done [here](https://www.blocktrail.com/tBTC/tx/839b903b9f79c3372792ceb95917047c46d1b919ed1f6471f5a19d7c865ab32c). 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).  
> **username_0**: Why did you write that I can not send a transaction with this input from this address? Is it somehow related with that address?  
> **username_2**: the `vin` in your transaction can be found in testnet network. it was easy to find some details you've omitted  
> **username_0**: What details are you talking about?  
> **username_2**: address and redeemscript. note: you can not spend from 2Muf8gJV81wa93smDeiy7X777BJcppBR5uP with a script of 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN  
> **username_0**: 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.  
> **username_2**: you put a link to a transaction spending from 2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN in your first comment  
> **username_0**: 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.  

---

