<p>The transaction is valid. <a href="https://gist.github.com/RaghavSood/e9e39cb5c258da67273c67c05b5ffdc1" rel="nofollow noreferrer">This</a> golang code gives the correct result.</p>

<p>You need to HASH160 <code>51</code>, not <code>1</code>.</p>

<p>Additionally, make sure you run the hash on <code>0x51</code>, not <code>"51"</code> or <code>int(51)</code>.</p>

CC BY-SA 3.0
2018-04-27T08:49:02.287Z
Thank you for your answer, Raghav! I cannot access the golang code on github. Could  you please update the url link? Thanks again.
J Doe
CC BY-SA 3.0
2018-04-27T08:52:17.497Z
@JDoe That's odd. Seems to work for me. [Here's](https://pastebin.com/jfFWpBKg) the same code on pastebin
Raghav Sood
CC BY-SA 3.0
2018-04-27T08:10:23.653Z
2018-04-27T08:10:23.653Z
Raghav Sood
<p>The before transaction is @ <a href="https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d" rel="nofollow noreferrer">https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d</a></p>

<p>Its output script is "OP_HASH160 da1745e9b549bd0bfa1a569971c77eba30cd5a4b OP_EQUAL".</p>

<p>The current transaction is @
<a href="https://www.blocktrail.com/tBTC/tx/839b903b9f79c3372792ceb95917047c46d1b919ed1f6471f5a19d7c865ab32c?txinIdx=0" rel="nofollow noreferrer">https://www.blocktrail.com/tBTC/tx/839b903b9f79c3372792ceb95917047c46d1b919ed1f6471f5a19d7c865ab32c?txinIdx=0</a></p>

<p>Its input script is "51". </p>

<p>I verified the transaction manually but it failed.
Why the transaction was accepted and confirmed?</p>

<p>The evolved stack is as below. What's wrong?
628850cb844fe63c308c62afc8bc5351f1952a7f = RIPEMD160(SHA256(1))
<a href="https://i.sstatic.net/C2DY0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/C2DY0.png" alt="enter image description here"></a></p>

<transaction-verification><input-script>
Why this transaction is valid?
J Doe
# Why this transaction is valid?

(Asked by: username_0 on 2018-04-27)

The before transaction is @ <https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d>

Its output script is "OP\_HASH160 da1745e9b549bd0bfa1a569971c77eba30cd5a4b OP\_EQUAL".

The current transaction is @
<https://www.blocktrail.com/tBTC/tx/839b903b9f79c3372792ceb95917047c46d1b919ed1f6471f5a19d7c865ab32c?txinIdx=0>

Its input script is "51".

I verified the transaction manually but it failed.
Why the transaction was accepted and confirmed?

The evolved stack is as below. What's wrong?
628850cb844fe63c308c62afc8bc5351f1952a7f = RIPEMD160(SHA256(1))
[![enter image description here](https://i.sstatic.net/C2DY0.png)](https://i.sstatic.net/C2DY0.png)

**Tags:** transaction-verification, input-script


---

## 1 answers

### Answer by username_1 on 2018-04-27. Score: 1

The transaction is valid. [This](https://gist.github.com/RaghavSood/e9e39cb5c258da67273c67c05b5ffdc1) golang code gives the correct result.

You need to HASH160 `51`, not `1`.

Additionally, make sure you run the hash on `0x51`, not `"51"` or `int(51)`.

> **Comments:**
> **username_0**: Thank you for your answer, Raghav! I cannot access the golang code on github. Could  you please update the url link? Thanks again.  
> **username_1**: @JDoe That's odd. Seems to work for me. [Here's](https://pastebin.com/jfFWpBKg) the same code on pastebin  

---

