# Unpack data\_hex not work

**URL:** <https://forums.counterparty.io/t/unpack-data-hex-not-work/4479>\
**Category:** Counterparty\
**Created:** [January 31, 2018, 4:52am UTC](https://forums.counterparty.io/t/unpack-data-hex-not-work/4479 "2018-01-31T04:52:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobi](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/tobi/32/1043_2.png) [@tobi](https://forums.counterparty.io/u/tobi)\
**Post date:** [January 31, 2018, 4:52am UTC](https://forums.counterparty.io/t/unpack-data-hex-not-work/4479/1 "2018-01-31T04:52:10Z")

</div>

I wanna get balances from tx\_hash so i followed this tutorial

> [@How to encode and decode a Counterparty transaction](https://forums.counterparty.io/t/how-to-encode-and-decode-a-counterparty-transaction/2426):
>
> This post explains the process of encoding and decoding Counterparty transactions #Encode You can use one of these methods: Use Counterparty API (e.g. create\_send) to create a raw Bitcoin transaction with embedded Counterparty payload. This approach is easier, but requires access to a Counterparty server or API endpoint. Use any programming language to compose such a transaction manually. This is harder, but does not require a Counterparty server or Counterparty API access. The API (create\_…

> {  
> “method”: “get\_tx\_info”,  
> “params”: {“tx\_hex”: “0100000001a89b03fc094f99b70d1006977280ee272f4c22b2ae2a738ed60d93fb49497e30010000006b483045022100867045c12241b097dc5e7ac873a21b2117248126aa8e7cee5982ecbe4a111a0202206ee1531937964b9c1a968a149e87b9d63a5f07fcc3eb8821a20973c2b9b6f91b0121028c661bb03d755f834a47e5d267432ae2bb002a5a63af69fd0749892fb7966c03ffffffff020000000000000000306a2e9bcaccbf7a31c1213f0b3d0c5f8b997fcdd0841d2ff3fb38a1b7dd8c2dc806222a1e74c23b9902ed7022d538ab7938f95705000000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac00000000”},  
> “jsonrpc”: “2.0”,  
> “id”: 1  
> }

Response:

> {  
> “jsonrpc”: “2.0”,  
> “id”: 1,  
> “result”: [  
> “mypcUU2fYyJav7XUpPLtMVhuPupArLJtiM”,  
> “”,  
> 0,  
> 6175,  
> “0200000000082f6b7100000000000138806f23c3c1c7d135274d267528ff3bebf311958a4776”  
> ]  
> }

Then

> {  
> “method”: “unpack”,  
> “params”: {“data\_hex”: “0200000000082f6b7100000000000138806f23c3c1c7d135274d267528ff3bebf311958a4776”},  
> “jsonrpc”: “2.0”,  
> “id”: 1  
> }

but

> {  
> “jsonrpc”: “2.0”,  
> “error”: {  
> “data”: {  
> “type”: “APIError”,  
> “message”: “unsupported message type”,  
> “args”: [  
> “unsupported message type”  
> ]  
> },  
> “code”: -32000,  
> “message”: “Server error”  
> },  
> “id”: 1  
> }

Does anyone have any idea ?! , thanks

---

<div class="post-metadata">

**Author:** ![pkeane4osu](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/pkeane4osu/32/427_2.png) [@pkeane4osu](https://forums.counterparty.io/u/pkeane4osu)\
**Post date:** [February 4, 2018, 8:27am UTC](https://forums.counterparty.io/t/unpack-data-hex-not-work/4479/2 "2018-02-04T08:27:35Z")

</div>

> [@tobi](#):
>
> 0100000001a89b03fc094f99b70d1006977280ee272f4c22b2ae2a738ed60d93fb49497e30010000006b483045022100867045c12241b097dc5e7ac873a21b2117248126aa8e7cee5982ecbe4a111a0202206ee1531937964b9c1a968a149e87b9d63a5f07fcc3eb8821a20973c2b9b6f91b0121028c661bb03d755f834a47e5d267432ae2bb002a5a63af69fd0749892fb7966c03ffffffff020000000000000000306a2e9bcaccbf7a31c1213f0b3d0c5f8b997fcdd0841d2ff3fb38a1b7dd8c2dc806222a1e74c23b9902ed7022d538ab7938f95705000000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac00000000

hers the tx decoded →

“lock\_time”:0,  
“size”:249,  
“inputs”:[  
{  
“prev\_out”:{  
“index”:1,  
“hash”:“307e4949fb930dd68e732aaeb2224c2f27ee80729706100db7994f09fc039ba8”  
},  
“script”:“483045022100867045c12241b097dc5e7ac873a21b2117248126aa8e7cee5982ecbe4a111a0202206ee1531937964b9c1a968a149e87b9d63a5f07fcc3eb8821a20973c2b9b6f91b0121028c661bb03d755f834a47e5d267432ae2bb002a5a63af69fd0749892fb7966c03”  
}  
],  
“version”:1,  
“vin\_sz”:1,  
“hash”:“0b4f1c29024bc1aa3598f375302ed2a35e03290cebde3ca4d3d4dfb50d6174b6”,  
“vout\_sz”:2,  
“out”:[  
{  
“script\_string”:“OP\_RETURN 9bcaccbf7a31c1213f0b3d0c5f8b997fcdd0841d2ff3fb38a1b7dd8c2dc806222a1e74c23b9902ed7022d538ab79”,  
“value”:0,  
“script”:“6a2e9bcaccbf7a31c1213f0b3d0c5f8b997fcdd0841d2ff3fb38a1b7dd8c2dc806222a1e74c23b9902ed7022d538ab79”  
},  
{  
“script\_string”:“OP\_DUP OP\_HASH160 c8c934c4ad0fa394fd01747c375957f30752e26f OP\_EQUALVERIFY OP\_CHECKSIG”,  
“address”:“1KJfBQwgjwsL913s6pNWXaVaXvDTs5kVAW”,  
“value”:89651512,  
“script”:“76a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac”  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![pkeane4osu](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/pkeane4osu/32/427_2.png) [@pkeane4osu](https://forums.counterparty.io/u/pkeane4osu)\
**Post date:** [February 4, 2018, 8:58am UTC](https://forums.counterparty.io/t/unpack-data-hex-not-work/4479/3 "2018-02-04T08:58:13Z")

</div>

now were you doing this on testnet or main? it appears you were doing it on testnet but i just wanted to confirm with you the network you were on? secondly, what exactly are you trying to “get”? because the way i read your post, it seemed as if you are attempting to “change” the output destination of that tx. which is no longer possible as it was in the past through a very lengthy process PRIOR to the 1st confirmation being obtained. that was only done by canceling a tx then respending the available “value” and of course you needed to be the holder of the private keys to resign the new tx.

remember, createrawtransaction does not automatically create change outputs, so you can easily accidentally pay a large transaction fee. In this example, our input had 50.0000 bitcoins and our output ($NEW\_ADDRESS) is being paid 49.9999 bitcoins, so the transaction will include a fee of 0.0001 bitcoins. If we had paid $NEW\_ADDRESS only 10 bitcoins with no other changes to this transaction, the transaction fee would be a whopping 40 bitcoins. See the Complex Raw Transaction subsection below for how to create a transaction with multiple outputs so you can send the change back to yourself.

for referance see --\> [https://bitcoin.org/en/developer-examples#simple-raw-transaction](https://bitcoin.org/en/developer-examples#simple-raw-transaction)

---

<div class="post-metadata">

**Author:** ![tobi](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/tobi/32/1043_2.png) [@tobi](https://forums.counterparty.io/u/tobi)\
**Post date:** [February 6, 2018, 3:47am UTC](https://forums.counterparty.io/t/unpack-data-hex-not-work/4479/4 "2018-02-06T03:47:17Z")

</div>

> [@tobi](#):
>
> 0200000000082f6b7100000000000138806f23c3c1c7d135274d267528ff3bebf311958a4776

@pkeane4osu i wanna decode `data_hex` not decode transaction info(this one i can do myself). And im using testnet.

btw. They comfirmed that is a bug

[https://github.com/CounterpartyXCP/counterparty-lib/issues/1026](https://github.com/CounterpartyXCP/counterparty-lib/issues/1026)

---

<div class="post-metadata">

**Author:** ![tobi](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/tobi/32/1043_2.png) [@tobi](https://forums.counterparty.io/u/tobi)\
**Post date:** [February 9, 2018, 2:02am UTC](https://forums.counterparty.io/t/unpack-data-hex-not-work/4479/5 "2018-02-09T02:02:27Z")

</div>

@something excuse me, do you know how it decode this one, many thanks
