<blockquote>
  <p>Thank you for answer! :) Could you tell one more thing? How can I get
  proper output script? I thought that I have all information needed to
  count in this transaction. If I have for example this transaction link
  , what should I do? What scriptPubKey shoud I use?</p>
</blockquote>

<p>Dont get scared by the wall of Text following, I just want to make it as understandable as I can:</p>

<p>Give this TX-Data:</p>

<pre><code>{
  "txid": "1ea183203c2a2b8db9a84b0d90bfc0b072f0484ec6536b95f69733ae251a3288",
  "version": 2,
  "locktime": 0,
  "tx-comment": "",
  "vin": [
    {
      "txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50",
      "vout": 0,
      "scriptSig": {
        "asm": "304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a501 03e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022",
        "hex": "47304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a5012103e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 1.3491183,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9aa813b6983a609ebb5992408457dbb814824124 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149aa813b6983a609ebb5992408457dbb81482412488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FKvrsYB5dR2xSW1ujUXq7RLdiUxoZHEH58"
        ]
      }
    },
    {
      "value": 1.59661273,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3ea405431679a7d51fb5da6106cb91f4a1d066ec OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9143ea405431679a7d51fb5da6106cb91f4a1d066ec88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FBYKr3SGVWMrbHngSGVua1LiCN2GYQV8Lp"
        ]
      }
    }
  ]
}
</code></pre>

<p>This Transaction got one input:</p>

<pre><code> "vin": [
        {
          "txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50",
          "vout": 0,
          "scriptSig": {
            "asm": "304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a501 03e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022",
            "hex": "47304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a5012103e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022"
          },
          "sequence": 4294967295
        }
      ]
</code></pre>

<p>This input is refering to an output from a previous transaction:</p>

<pre><code>"txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50"
"vout": 0
</code></pre>

<p>This is the point where you get your scriptPubKey from. <a href="http://florinexchange.com/explorer/tx/?txid=8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50" rel="nofollow">Input</a>:</p>

<pre><code>"vout": [
    {
      "value": 3.04573103,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 a0207d9ea622db7f63b70223ba4dea67c260a91b OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914a0207d9ea622db7f63b70223ba4dea67c260a91b88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FLRnVzFCvGbKEpbjsFBSRejBHEcpbKScAe"
        ]
      }
    },
    {
      "value": 29.93357942,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 5eecec983a2105c049b4d1c1a43287ee07bd075f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9145eecec983a2105c049b4d1c1a43287ee07bd075f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FEV2oce6qUAq9zYfJeBMVZTk6qeJfvkQ7n"
        ]
      }
    }
  ]
</code></pre>

<p>There are two outputs. The right one is:</p>

<pre><code>"n": 0
</code></pre>

<p>because the reference was:</p>

<pre><code>"vout": 0
</code></pre>

<p>And here is the Script you need:</p>

<pre><code>"asm": "OP_DUP OP_HASH160 a0207d9ea622db7f63b70223ba4dea67c260a91b OP_EQUALVERIFY OP_CHECKSIG"
"hex": "76a914a0207d9ea622db7f63b70223ba4dea67c260a91b88ac"
</code></pre>

<p>Back to your original Transaction and its outputs:</p>

<pre><code>"vout": [
    {
      "value": 1.3491183,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9aa813b6983a609ebb5992408457dbb814824124 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149aa813b6983a609ebb5992408457dbb81482412488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FKvrsYB5dR2xSW1ujUXq7RLdiUxoZHEH58"
        ]
      }
    },
    {
      "value": 1.59661273,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3ea405431679a7d51fb5da6106cb91f4a1d066ec OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9143ea405431679a7d51fb5da6106cb91f4a1d066ec88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FBYKr3SGVWMrbHngSGVua1LiCN2GYQV8Lp"
        ]
      }
    }
  ]
</code></pre>

<p>Those are not needed for checking the inputs of your transaction. They will be needed for the next Transaction spending your coins from this transaction.</p>

<p>I hope I dont confuse you, and if i did we can propably use <a href="http://chat.stackexchange.com/">chat</a> or so.</p>

CC BY-SA 3.0
2014-06-16T18:22:00.010Z
@me.ex Nice to hear that i could help you, maybe you can mark the answer as correct;)
Dennis Kriechel
CC BY-SA 3.0
2014-06-08T11:44:46.793Z
2014-06-08T11:44:46.793Z
Dennis Kriechel
<p>Use www.webbtc.com</p>

<p>It has a feature to execute scripts step-by-step</p>

<p>for example </p>

<p><a href="http://webbtc.com/script/b8eccf259d051b75f1e5c0f524b125dea0575cce2cca2db16790506d39001961:0" rel="nofollow">http://webbtc.com/script/b8eccf259d051b75f1e5c0f524b125dea0575cce2cca2db16790506d39001961:0</a></p>

CC BY-SA 3.0
2014-06-08T16:36:58.577Z
This site seems pretty awesome, thx for clue.
Dennis Kriechel
CC BY-SA 3.0
2014-06-08T16:16:57.020Z
2014-06-08T16:16:57.020Z
amaclin
<p>You are using the wrong output-script. The output-script you are using is the one you would need for spending the bitcoins send in this transaction. </p>

<p>You need to use the outputscript which the input is refering to:</p>

<pre><code>"txid": "e1142c945b73826b552407916c13402fb873fb1d3f7c16fa561367aaddd076a7",
"vout": 0
</code></pre>

<p>which is: <code>76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac</code></p>

<p>So I checked your json and noticed that:</p>

<pre><code>"asm": "OP_DUP OP_HASH160 f5d214041d44860c8c08202a9e4263fc47a2fe88 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac",
</code></pre>

<p>looking at the hex value and print it out as human readable:</p>

<pre><code>76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac = OP_DUP OP_HASH160 5e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d OP_EQUALVERIFY OP_CHECKSIG 
</code></pre>

<p>you see its different to the asm value:</p>

<pre><code>f5d214041d44860c8c08202a9e4263fc47a2fe88           = 1PQnDVEi2u4e8rFmE3d9J51eQz8cQXpybC
76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac = 19bgJQVTweVk5umYme3Xe5VYTnySRp1Yi9
</code></pre>

<p>As you can see those are two different bitcoin-addresses in there. If you use the hex value as script you should be fine.</p>

CC BY-SA 3.0
2014-06-08T11:18:06.610Z
Thank you for answer! :) Could you tell one more thing? How can I get proper output script? I thought that I have all information needed to count in this transaction. If I have for example this transaction [link](http://florinexchange.com/explorer/tx/?txid=1ea183203c2a2b8db9a84b0d90bfc0b072f0484ec6536b95f69733ae251a3288) , what should I do? What scriptPubKey shoud I use?
me.ex
CC BY-SA 3.0
2014-06-08T11:49:29.930Z
Just wrote a another answer because i cant get it all in a comment ;)
Dennis Kriechel
CC BY-SA 3.0
2014-06-08T10:39:58.693Z
2014-06-08T10:56:00.883Z
2014-06-08T10:56:00.883Z
Dennis Kriechel
<p>I would like to count script step by step, but I have problem with it.</p>

<p>For example, I have such transaction:</p>

<pre><code>{
    "locktime": 0,
    "txid": "c0fdb774710943d8dbb5f823c00394452fb1a1d63a3a7a9fb8de41299b37f090",
    "version": 1,
    "vin": [
        {
        "scriptSig": {
            "asm": "3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801 02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f",
            "hex": "483045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a58012102c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f"
        },
        "sequence": 4294967295,
        "txid": "e1142c945b73826b552407916c13402fb873fb1d3f7c16fa561367aaddd076a7",
        "vout": 0
        }
    ],
    "vout": [
        {
        "n": 0,
        "scriptPubKey": {
            "addresses": [
            "1PQnDVEi2u4e8rFmE3d9J51eQz8cQXpybC"
            ],
            "asm": "OP_DUP OP_HASH160 f5d214041d44860c8c08202a9e4263fc47a2fe88 OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac",
            "reqSigs": 1,
            "type": "pubkeyhash"
        },
        "value": 0.58407
        }
    ]
}
</code></pre>

<p>First of all I put on the stack</p>

<pre><code>3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
</code></pre>

<p>and</p>

<pre><code>02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
</code></pre>

<p>and I start execute script, so</p>

<ul>
<li><p>after OP_DUP the stack looks like:</p>

<pre><code>3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
</code></pre></li>
<li><p>to execute OP_HASH160, I get the first element on the top of stack, change hex to bytes, count Hash160 using formula: Hash160(x) = RIPEMD160(SHA256(x)) and put new value on stack. In Javascript it looks like </p>

<pre><code>CryptoJS.RIPEMD160(hexToBytes(CryptoJS.SHA256(hexToBytes("02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f")).toString())).toString()
</code></pre></li>
</ul>

<p>and it returns value "38ef3b4b7f01ea41e2013d4b77f63c998967efc9", so the new value of stack is:</p>

<pre><code>    3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
    02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
    38ef3b4b7f01ea41e2013d4b77f63c998967efc9
</code></pre>

<ul>
<li><p>the next step of counting script is putting f5d214041d44860c8c08202a9e4263fc47a2fe88 on the stack</p>

<pre><code>3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
38ef3b4b7f01ea41e2013d4b77f63c998967efc9
f5d214041d44860c8c08202a9e4263fc47a2fe88
</code></pre></li>
</ul>

<p>And now, I should check if 38ef3b4b7f01ea41e2013d4b77f63c998967efc9 is equal f5d214041d44860c8c08202a9e4263fc47a2fe88 and I get of course false.</p>

<p>What am I doing wrong? I got the same problem with all transactions, which I checked, so probably I don't understand how scripts work or how OP_HASH160 is counted.</p>

<transactions><script>
How to get value of script?
me.ex
# How to get value of script?

(Asked by: username_0 on 2014-06-08)

I would like to count script step by step, but I have problem with it.

For example, I have such transaction:

```
{
    "locktime": 0,
    "txid": "c0fdb774710943d8dbb5f823c00394452fb1a1d63a3a7a9fb8de41299b37f090",
    "version": 1,
    "vin": [
        {
        "scriptSig": {
            "asm": "3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801 02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f",
            "hex": "483045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a58012102c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f"
        },
        "sequence": 4294967295,
        "txid": "e1142c945b73826b552407916c13402fb873fb1d3f7c16fa561367aaddd076a7",
        "vout": 0
        }
    ],
    "vout": [
        {
        "n": 0,
        "scriptPubKey": {
            "addresses": [
            "1PQnDVEi2u4e8rFmE3d9J51eQz8cQXpybC"
            ],
            "asm": "OP_DUP OP_HASH160 f5d214041d44860c8c08202a9e4263fc47a2fe88 OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac",
            "reqSigs": 1,
            "type": "pubkeyhash"
        },
        "value": 0.58407
        }
    ]
}

```

First of all I put on the stack

```
3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801

```

and

```
02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f

```

and I start execute script, so

* after OP\_DUP the stack looks like:

  ```
  3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
  02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
  02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f

  ```
* to execute OP\_HASH160, I get the first element on the top of stack, change hex to bytes, count Hash160 using formula: Hash160(x) = RIPEMD160(SHA256(x)) and put new value on stack. In Javascript it looks like

  ```
  CryptoJS.RIPEMD160(hexToBytes(CryptoJS.SHA256(hexToBytes("02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f")).toString())).toString()

  ```

and it returns value "38ef3b4b7f01ea41e2013d4b77f63c998967efc9", so the new value of stack is:

```
    3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
    02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
    38ef3b4b7f01ea41e2013d4b77f63c998967efc9

```

* the next step of counting script is putting f5d214041d44860c8c08202a9e4263fc47a2fe88 on the stack

  ```
  3045022074f35af390c41ef1f5395d11f6041cf55a6d7dab0acdac8ee746c1f2de7a43b3022100b3dc3d916b557d378268a856b8f9a98b9afaf45442f5c9d726fce343de835a5801
  02c34538fc933799d972f55752d318c0328ca2bacccd5c7482119ea9da2df70a2f
  38ef3b4b7f01ea41e2013d4b77f63c998967efc9
  f5d214041d44860c8c08202a9e4263fc47a2fe88

  ```

And now, I should check if 38ef3b4b7f01ea41e2013d4b77f63c998967efc9 is equal f5d214041d44860c8c08202a9e4263fc47a2fe88 and I get of course false.

What am I doing wrong? I got the same problem with all transactions, which I checked, so probably I don't understand how scripts work or how OP\_HASH160 is counted.

**Tags:** transactions, script


---

## 3 answers

### Answer by username_1 on 2014-06-08. Score: 2 | Accepted answer

> Thank you for answer! :) Could you tell one more thing? How can I get
> proper output script? I thought that I have all information needed to
> count in this transaction. If I have for example this transaction link
> , what should I do? What scriptPubKey shoud I use?

Dont get scared by the wall of Text following, I just want to make it as understandable as I can:

Give this TX-Data:

```
{
  "txid": "1ea183203c2a2b8db9a84b0d90bfc0b072f0484ec6536b95f69733ae251a3288",
  "version": 2,
  "locktime": 0,
  "tx-comment": "",
  "vin": [
    {
      "txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50",
      "vout": 0,
      "scriptSig": {
        "asm": "304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a501 03e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022",
        "hex": "47304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a5012103e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 1.3491183,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9aa813b6983a609ebb5992408457dbb814824124 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149aa813b6983a609ebb5992408457dbb81482412488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FKvrsYB5dR2xSW1ujUXq7RLdiUxoZHEH58"
        ]
      }
    },
    {
      "value": 1.59661273,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3ea405431679a7d51fb5da6106cb91f4a1d066ec OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9143ea405431679a7d51fb5da6106cb91f4a1d066ec88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FBYKr3SGVWMrbHngSGVua1LiCN2GYQV8Lp"
        ]
      }
    }
  ]
}

```

This Transaction got one input:

```
 "vin": [
        {
          "txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50",
          "vout": 0,
          "scriptSig": {
            "asm": "304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a501 03e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022",
            "hex": "47304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a5012103e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022"
          },
          "sequence": 4294967295
        }
      ]

```

This input is refering to an output from a previous transaction:

```
"txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50"
"vout": 0

```

This is the point where you get your scriptPubKey from. [Input](http://florinexchange.com/explorer/tx/?txid=8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50):

```
"vout": [
    {
      "value": 3.04573103,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 a0207d9ea622db7f63b70223ba4dea67c260a91b OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914a0207d9ea622db7f63b70223ba4dea67c260a91b88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FLRnVzFCvGbKEpbjsFBSRejBHEcpbKScAe"
        ]
      }
    },
    {
      "value": 29.93357942,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 5eecec983a2105c049b4d1c1a43287ee07bd075f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9145eecec983a2105c049b4d1c1a43287ee07bd075f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FEV2oce6qUAq9zYfJeBMVZTk6qeJfvkQ7n"
        ]
      }
    }
  ]

```

There are two outputs. The right one is:

```
"n": 0

```

because the reference was:

```
"vout": 0

```

And here is the Script you need:

```
"asm": "OP_DUP OP_HASH160 a0207d9ea622db7f63b70223ba4dea67c260a91b OP_EQUALVERIFY OP_CHECKSIG"
"hex": "76a914a0207d9ea622db7f63b70223ba4dea67c260a91b88ac"

```

Back to your original Transaction and its outputs:

```
"vout": [
    {
      "value": 1.3491183,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9aa813b6983a609ebb5992408457dbb814824124 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149aa813b6983a609ebb5992408457dbb81482412488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FKvrsYB5dR2xSW1ujUXq7RLdiUxoZHEH58"
        ]
      }
    },
    {
      "value": 1.59661273,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3ea405431679a7d51fb5da6106cb91f4a1d066ec OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9143ea405431679a7d51fb5da6106cb91f4a1d066ec88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FBYKr3SGVWMrbHngSGVua1LiCN2GYQV8Lp"
        ]
      }
    }
  ]

```

Those are not needed for checking the inputs of your transaction. They will be needed for the next Transaction spending your coins from this transaction.

I hope I dont confuse you, and if i did we can propably use [chat](http://chat.stackexchange.com/) or so.

> **Comments:**
> **username_1**: @username_0 Nice to hear that i could help you, maybe you can mark the answer as correct;)  

---

### Answer by username_2 on 2014-06-08. Score: 2

Use www.webbtc.com

It has a feature to execute scripts step-by-step

for example

<http://webbtc.com/script/b8eccf259d051b75f1e5c0f524b125dea0575cce2cca2db16790506d39001961:0>

> **Comments:**
> **username_1**: This site seems pretty awesome, thx for clue.  

---

### Answer by username_1 on 2014-06-08. Score: 1

You are using the wrong output-script. The output-script you are using is the one you would need for spending the bitcoins send in this transaction.

You need to use the outputscript which the input is refering to:

```
"txid": "e1142c945b73826b552407916c13402fb873fb1d3f7c16fa561367aaddd076a7",
"vout": 0

```

which is: `76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac`

So I checked your json and noticed that:

```
"asm": "OP_DUP OP_HASH160 f5d214041d44860c8c08202a9e4263fc47a2fe88 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac",

```

looking at the hex value and print it out as human readable:

```
76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac = OP_DUP OP_HASH160 5e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d OP_EQUALVERIFY OP_CHECKSIG 

```

you see its different to the asm value:

```
f5d214041d44860c8c08202a9e4263fc47a2fe88           = 1PQnDVEi2u4e8rFmE3d9J51eQz8cQXpybC
76a9145e4ff47ceb3a51cdf7ddd80afc4acc5a692dac2d88ac = 19bgJQVTweVk5umYme3Xe5VYTnySRp1Yi9

```

As you can see those are two different bitcoin-addresses in there. If you use the hex value as script you should be fine.

> **Comments:**
> **username_0**: Thank you for answer! :) Could you tell one more thing? How can I get proper output script? I thought that I have all information needed to count in this transaction. If I have for example this transaction [link](http://florinexchange.com/explorer/tx/?txid=1ea183203c2a2b8db9a84b0d90bfc0b072f0484ec6536b95f69733ae251a3288) , what should I do? What scriptPubKey shoud I use?  
> **username_1**: Just wrote a another answer because i cant get it all in a comment ;)  

---

