<p>I figured it out. </p>

<p>setps: </p>

<ol>
<li>Get the <code>transactionID</code></li>
<li>RPCCall <code>getRawTransaction transactionID</code> - copy the rawTransaction</li>
<li>RPCCall <code>decoderawtransaction rawTransaction</code> - copy the scriptPubKey</li>
<li>RPCCall <code>decodescript scriptPubKey</code></li>
</ol>

CC BY-SA 4.0
2018-11-09T03:58:41.457Z
2018-11-09T03:58:41.457Z
Vishwas Bhushan
<p>I am debugging Bitcoin cpp code. I wanted to see what exactly come for <code>scriptPubKey</code> property of output. Theoretically, I know this but I want to see in the code how does it looks like. </p>

<p>Now while debugging I see  <code>scriptPubKey</code> object which is of type <code>CScript</code> and hence the format is different which is unreadable (see the screen shot below, it looks like char[]). How to read this value?<a href="https://i.sstatic.net/Az1dR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Az1dR.png" alt="enter image description here"></a></p>

<p>It looks like this : 
<code>
\200\002\0\0à\210¼XUU\0\0\220»ÿÿÿ\177\0\0à¡·XUU\0
</code></p>

CC BY-SA 4.0
2018-11-07T10:35:14.587Z
Why do you think there is a human readable form of a bitcoin script tape?
Claris
CC BY-SA 4.0
2018-11-07T14:04:06.890Z
Try using hex encoding, then you can see what each byte value represents: https://en.bitcoin.it/wiki/Script
JBaczuk
CC BY-SA 4.0
2018-11-09T03:55:49.103Z
@JBaczuk thanks man, you are right I had to get the HEX of it and then call rpc decodescript to get in human readable format. :)
Vishwas Bhushan
<bitcoin-core><bitcoin-core-development><debugging>
Converting raw scriptPubKey to readable format
Vishwas Bhushan
# Converting raw scriptPubKey to readable format

(Asked by: username_0 on 2018-11-07)

I am debugging Bitcoin cpp code. I wanted to see what exactly come for `scriptPubKey` property of output. Theoretically, I know this but I want to see in the code how does it looks like.

Now while debugging I see `scriptPubKey` object which is of type `CScript` and hence the format is different which is unreadable (see the screen shot below, it looks like char[]). How to read this value?[![enter image description here](https://i.sstatic.net/Az1dR.png)](https://i.sstatic.net/Az1dR.png)

It looks like this :
`\200\002\0\0à\210¼XUU\0\0\220»ÿÿÿ\177\0\0à¡·XUU\0`

**Tags:** bitcoin-core, bitcoin-core-development, debugging

> **Comments:**
> **username_1**: Why do you think there is a human readable form of a bitcoin script tape?  
> **username_2**: Try using hex encoding, then you can see what each byte value represents: https://en.bitcoin.it/wiki/Script  
> **username_0**: @username_2 thanks man, you are right I had to get the HEX of it and then call rpc decodescript to get in human readable format. :)  

---

## 1 answers

### Answer by username_0 on 2018-11-09. Score: 1

I figured it out.

setps:

1. Get the `transactionID`
2. RPCCall `getRawTransaction transactionID` - copy the rawTransaction
3. RPCCall `decoderawtransaction rawTransaction` - copy the scriptPubKey
4. RPCCall `decodescript scriptPubKey`


---

