decode data hash

+1 vote

Hello guys ,
I am using getwallettransaction txid to fetch particular transaction details so i want to convert value of data in string so it is giving me unreadable string format......please let me know how can i decode and read data?

 getwallettransaction 0e5b03efb67984966095dd929d23723f77074414786a594ac65c7404deca01f4
{"method":"getwallettransaction","params":["0e5b03efb67984966095dd929d23723f77074414786a594ac65c7404deca01f4"],"id":1,"chain_name":"Rapidchain1"}

{
    "balance" : {
        "amount" : 0.00000000,
        "assets" : [
        ]
    },
    "myaddresses" : [
        "1aeRDR8jgKinQditYrujNRCaSzWb4napwHS29V"
    ],
    "addresses" : [
    ],
    "permissions" : [
    ],
    "items" : [
    ],
    "data" : [
        "53504b62473045022100e7b19d958d3ce901b3ff52f5049f10d62f4cf49ad3f032a7c78dc2f465c5b2af02202b64b7f366ddd6a087546fed204b9c35ee86912e6e6a2492e66988be995948e002210258b366ca791ff59a1f3ef6ada216faa85b2d4973167996d05b593bf934e3b8c2"
    ],
    "confirmations" : 172,
    "generated" : true,
    "blockhash" : "00a2879445a885bc9f46b1a2faa49f693c0212eef47790f165e82e69b84b88e9",
    "blockindex" : 0,
    "blocktime" : 1545033454,
    "txid" : "0e5b03efb67984966095dd929d23723f77074414786a594ac65c7404deca01f4",
    "valid" : true,
    "time" : 1545033454,
    "timereceived" : 1545033454
}

asked Jan 8 by kheteshrotangan

2 Answers

+1 vote

Data value is in hex format so you can use some function to unhexlify this hex data to the readable format data. I have used unhexlify function in python.

answered Jan 8 by gimmick
after decoding data hash:

decoded output :SPKbG0E!籝•<é³ÿRõŸÖ/LôšÓð2§ÇÂôeŲ¯ +d·ófÝÖ ‡Toí Kœ5.nj$’æiˆ¾™YHà!X³fÊyõš>ö­¢ú¨[-Isy–Ð[Y;ù4ã¸Â

what is that ? i think this data is no a transaction data ..........
Yes it is the data for the coinbase transaction block so its irrelevant for you. If you want to access the data which you have published into some stream or send with some transaction then you can use getwallettransaction or getstreamitem API commands. And remember this data will be in hex format so you have to convert it into ascii format.
yes sir , i have converted data in to ascii format still it shows same
SPKbG0E!籝•<é³ÿRõŸÖ/LôšÓð2§ÇÂôeŲ¯ +d·ófÝÖ ‡Toí Kœ5.nj$’æiˆ¾™YHà!X³fÊyõš>ö­¢ú¨[-Isy–Ð[Y;ù4ã¸Â

that means i can not see coinbase transaction data, right?
This is the miner signature in the coinbase. You should have no need to access this information directly – the miner identity for the block can be retrieved from APIs like getblock/listblocks.
0 votes
FYI this particular piece of data is a miner block signature and so probably not relevant for your application. Presumably you're looking at the first transaction in a block, which is always the "coinbase" transaction that includes this miner signature.
answered Jan 9 by MultiChain
As per my reading and understanding coinbase transaction in block represent total reward for miner but in multichain miner is mining block without any rewards then why coinbase transaction ?

this data which i have mentioned that will not give me transaction data , is it?

Hope you understand my question .
Thanks  for your response
Every block has a coinbase transaction, even if it has no reward. Miners embed their signature in the coinbase in order to prove who created the block – this is required with permissioned mining: https://www.multichain.com/developers/mining-block-signatures/
...