<p>You didn't copy the full script from blockchain.info, you copied half of the already decoded script. The part you copied is the signature, but the public key (the other part) is also part of the script. Even if you had both, though, it's still not the right data to pass to decode script, because the script has already been decoded. The hex that should be passed to the getrawtransaction call can be gotten by looking at the result of:</p>

<pre><code>getrawtransaction 2c7b5cede0ab477800c407526ea98de9c89e80e53435dc786479be15970cc0d7 1
</code></pre>

<p>But you will just get the same thing as what blockchain.info already has up on their site.</p>

<p>And the "p2sh" value is the address that would be made by using the script passed to the RPC call as the <code>redeemScript</code>. I don't think this is what you're looking for at all, so you can pretty safely ignore it. </p>

CC BY-SA 3.0
2014-12-03T12:29:55.737Z
@Willipm, you're welcome. If this answered your question, mark it so others know. If you still have more questions related to this, let me know!
morsecoder
CC BY-SA 3.0
2014-12-03T05:04:30.530Z
2014-12-03T05:04:30.530Z
morsecoder
<p>I used "decodescript" on a transaction inputscript </p>

<pre><code>304402206c4eba989dd5f87b7814f25ec8b9e08f955d30b299d963df8955639aa0a0f9bc02203c4d41b047d4dc616da101911c512e89255e2c3261733f030f9d1329ca2822dd01
</code></pre>

<p>I got this script from <a href="https://blockchain.info/tx/2c7b5cede0ab477800c407526ea98de9c89e80e53435dc786479be15970cc0d7" rel="nofollow">this website.</a></p>

<p>and got </p>

<pre><code>"p2sh" : "3BfdeDc4HpcLJCs6PZ5jzdfaVDzFDBXrVu"
</code></pre>

<p>which makes no sense to me.</p>

<json-rpc>
How do I use the RPC command "decodescript"?
Willipm
# How do I use the RPC command "decodescript"?

(Asked by: username_0 on 2014-12-03)

I used "decodescript" on a transaction inputscript

```
304402206c4eba989dd5f87b7814f25ec8b9e08f955d30b299d963df8955639aa0a0f9bc02203c4d41b047d4dc616da101911c512e89255e2c3261733f030f9d1329ca2822dd01

```

I got this script from [this website.](https://blockchain.info/tx/2c7b5cede0ab477800c407526ea98de9c89e80e53435dc786479be15970cc0d7)

and got

```
"p2sh" : "3BfdeDc4HpcLJCs6PZ5jzdfaVDzFDBXrVu"

```

which makes no sense to me.

**Tags:** json-rpc


---

## 1 answers

### Answer by username_1 on 2014-12-03. Score: 2 | Accepted answer

You didn't copy the full script from blockchain.info, you copied half of the already decoded script. The part you copied is the signature, but the public key (the other part) is also part of the script. Even if you had both, though, it's still not the right data to pass to decode script, because the script has already been decoded. The hex that should be passed to the getrawtransaction call can be gotten by looking at the result of:

```
getrawtransaction 2c7b5cede0ab477800c407526ea98de9c89e80e53435dc786479be15970cc0d7 1

```

But you will just get the same thing as what blockchain.info already has up on their site.

And the "p2sh" value is the address that would be made by using the script passed to the RPC call as the `redeemScript`. I don't think this is what you're looking for at all, so you can pretty safely ignore it.

> **Comments:**
> **username_1**: @username_0, you're welcome. If this answered your question, mark it so others know. If you still have more questions related to this, let me know!  

---

