Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: AdolfinWolf on January 13, 2018, 08:15:58 PM



Title: Is it possible to get the hex format from a transaction ID alone ?
Post by: AdolfinWolf on January 13, 2018, 08:15:58 PM
Is it possible to get the hex data from a transaction id which i haven't personally signed, and which is currently not being broadcasted by any nodes/isn't in the mempool.

Meaning that i only have the standard transaction id to work with. ( Something like 9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0, but then unbroadcasted, and unconfirmed/not in the mempool, in which case the links you provided about btc.com and blockchain.info's resolver won't work.).


(Since i would need the hex encoded data to  push a transaction back into the mempool, right? Would that be possible with only  an old valid transaction id that i have?) I don't think so.

And if so, how would i then get the hex encoded bitcoin transaction?

EDIT: let me get a better example.


Title: Re: Is it possible to get the hex format from a transaction ID?
Post by: vh on January 13, 2018, 08:24:05 PM
You left out the rest of your message there so I'll take a stab at the question in the topic:
Is it possible to get the hex format from a transaction ID?


The two quick ways to get this that I have bookmarked:

https://blockchain.info/tx/<txid>?format=hex
you get back the tx's hex

https://chain.so/api/v2/tx/BTC/<txid>
look in the tx_hex field

edit:

https://blockchain.info/tx/9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0?format=hex
https://chain.so/api/v2/tx/BTC/9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0

edit(2):

no you can go from txid to tx_hex.   if it's gone from mempools that offers this kind of api(s).


Title: Re: Is it possible to get the hex format from a transaction ID ?
Post by: Thirdspace on January 13, 2018, 09:23:00 PM
Is it possible to get the hex data from a transaction id which i haven't personally signed, and which is currently not being broadcasted by any nodes/isn't in the mempool.

Meaning that i only have the standard transaction id to work with. ( Something like 9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0, but then unbroadcasted, and unconfirmed/not in the mempool, in which case the links you provided about btc.com and blockchain.info's resolver won't work.).


(Since i would need the hex encoded data to  push a transaction back into the mempool, right? Would that be possible with only  an old valid transaction id that i have?) I don't think so.


it's only possible if the tx has been broadcasted at least once and reached bitaps or btc.com
bitaps is the explorer I know which keeps track all transactions: unconfirmed, double spend, dropped txs
bitaps openly shows all related txs on the address page, but btc.com only list confirmed and valid mempool txs
on btc.com you have to know the exact txid to be able to see other transaction data
if it never reached these 2 explorers and dropped, most likely you cannot get the hex by means of knowing its txid only
there might be other explorers, but I only use these two to query txid if it doesn't exist on bc.info anymore

edit: I'm sorry I typed extra 'p' on the url, corrected the url to https://bitaps.com/
@AdolfinWolf please edit your post too if you can, so people won't be directed to wrong site


Title: Re: Is it possible to get the hex format from a transaction ID ?
Post by: AdolfinWolf on January 13, 2018, 10:12:08 PM
Is it possible to get the hex data from a transaction id which i haven't personally signed, and which is currently not being broadcasted by any nodes/isn't in the mempool.

Meaning that i only have the standard transaction id to work with. ( Something like 9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0, but then unbroadcasted, and unconfirmed/not in the mempool, in which case the links you provided about btc.com and blockchain.info's resolver won't work.).


(Since i would need the hex encoded data to  push a transaction back into the mempool, right? Would that be possible with only  an old valid transaction id that i have?) I don't think so.


it's only possible if the tx has been broadcasted at least once and reached bitapps or btc.com
bitapps is the explorer I know which keeps track all transactions: unconfirmed, double spend, dropped txs
bitapps openly shows all related txs on the address page, but btc.com only list confirmed and valid mempool txs
on btc.com you have to know the exact txid to be able to see other transaction data
if it never reached these 2 explorers and dropped, most likely you cannot get the hex by means of knowing its txid only
there might be other explorers, but I only use these two to query txid if it doesn't exist on bc.info anymore

Btc.com shows the transaction but no transaction information/ information about the HEX id when i try the usual resolving method. Just returns an error.

I can't seem to find/open bitapps? are you talking about http://bitapps.com/? That doesn't seem like a blockexplorer to me?


Title: Re: Is it possible to get the hex format from a transaction ID ?
Post by: Thirdspace on January 14, 2018, 09:59:34 AM
edit: I'm sorry I typed extra 'p' on the url, corrected the url to https://bitaps.com/
@AdolfinWolf please edit your post too if you can, so people won't be directed to wrong site
I can't seem to find/open bitapps? are you talking about http://bitapps.com/? That doesn't seem like a blockexplorer to me?
In case you're only watching this thread and not checking it manually, so you won't notice my edited post
I made mistake typing site url, it should be bitaps.com :D


Title: Re: Is it possible to get the hex format from a transaction ID alone ?
Post by: bob123 on January 14, 2018, 10:47:44 AM
Since i would need the hex encoded data to  push a transaction back into the mempool, right? Would that be possible with only an old valid transaction id that i have?

You can't get the raw hex data of a transaction just out of an ID.
The transaction id is 'created' by hashing the TX twice with sha256 ('one-way-function').

You need to have access to the transaction (either by the tx being broadcasted / you have access to the tx data).
Quite a few block explorer give you the ability to get the raw transaction data. (e.g. blockchain.info, .. ).


Title: Re: Is it possible to get the hex format from a transaction ID alone ?
Post by: bitmover on January 15, 2021, 05:02:51 PM
Is it possible to get the hex data from a transaction id which i haven't personally signed, and which is currently not being broadcasted by any nodes/isn't in the mempool.

https://blockchain.info/tx/9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0?format=hex
https://chain.so/api/v2/tx/BTC/9021b49d445c719106c95d561b9c3fac7bcb3650db67684a9226cd7fa1e1c1a0

I had this problem today.

I made a transaction which I noticed had some broadcast problems. I could see it (unconfirmed) in blockchain.com and sochain, but I could not see that transaction in blockstream, neither in blockchair and blockchypher explores.

Then I decided to broadcast the transaction in blockchair tool. But I needed the transaction HEX. It was hard to find a working link, as those mentioned here were broken. Then I was able to get the HEX using sochain api.

Then I decided to make a tool to do that :)
It was easy to do, and you can see it here.
https://bitcoindata.science/bitcoin-raw-transaction-hex.html

Just insert your transaction ID and it will return the raw transaciton in HEX format.
It will not work with transactions that were not broadcasted to sochain... but, it might help some people (like me).