<p>The witness only contains data pushes, unlike the scriptSig. Here the Script interpreter compares <code>0x58</code> and <code>8</code> and pushes <code>0</code> on the stack. Hence the error:</p>
<blockquote>
<p>Script evaluated without error but finished with a false/empty top stack element</p>
</blockquote>

CC BY-SA 4.0
2024-09-20T12:10:20.860Z
Perfect, thank you so much. I changed the witness from `58 5887 <control block>` to `08 5887 <control block>` and it worked. Much appreciated -- been banging my head against a wall for an hour over that one.
inersha
CC BY-SA 4.0
2024-09-20T12:06:54.630Z
2024-09-20T12:06:54.630Z
Antoine Poinsot
<p>I'm testing a P2TR script path spend.</p>
<p>The script tree contains a single script leaf with the following script:</p>
<pre><code>hex: 5887
asm: OP_8 OP_EQUAL
</code></pre>
<p>The witness spending this output then consists of the following:</p>
<pre><code>58 5887 &lt;control block&gt;
</code></pre>
<p>So the complete script should execute like this:</p>
<pre><code>hex: 585887
asm: OP_8 OP_8 OP_EQUAL
</code></pre>
<p>However, when I try to send the transaction in to the network I get the following error:</p>
<pre><code>error code: -26
error message:
mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)
</code></pre>
<p>Is this to be expected? Or might there be something else wrong with my witness structure (or the original script)?</p>

<script><p2tr>
Simple OP_EQUAL script (Script evaluated without error but finished with a false/empty top stack element)
inersha
# Simple OP_EQUAL script (Script evaluated without error but finished with a false/empty top stack element)

(Asked by: username_0 on 2024-09-20)

I'm testing a P2TR script path spend.
The script tree contains a single script leaf with the following script:
hex: 5887
asm: OP_8 OP_EQUAL

The witness spending this output then consists of the following:
58 5887 

So the complete script should execute like this:
hex: 585887
asm: OP_8 OP_8 OP_EQUAL

However, when I try to send the transaction in to the network I get the following error:
error code: -26
error message:
mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)

Is this to be expected? Or might there be something else wrong with my witness structure (or the original script)?

**Tags:** script, p2tr


---

## 1 answers

### Answer by username_1 on 2024-09-20. Score: 2 | Accepted answer

The witness only contains data pushes, unlike the scriptSig. Here the Script interpreter compares `0x58` and `8` and pushes `0` on the stack. Hence the error:

> Script evaluated without error but finished with a false/empty top stack element

> **Comments:**
> **username_0**: Perfect, thank you so much. I changed the witness from `58 5887 <control block>` to `08 5887 <control block>` and it worked. Much appreciated -- been banging my head against a wall for an hour over that one.  

---

