0

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

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

  • Why do you think there is a human readable form of a bitcoin script tape? – Anonymous Nov 7 '18 at 10:35
  • 1
    Try using hex encoding, then you can see what each byte value represents: en.bitcoin.it/wiki/Script – JBaczuk Nov 7 '18 at 14:04
  • @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 Nov 9 '18 at 3:55
0

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.