Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ideas500k.com on September 29, 2019, 08:15:47 AM



Title: How to read information put into a Bitcoin transaction?
Post by: ideas500k.com on September 29, 2019, 08:15:47 AM
I have been wondering what is the best approach to reading the information that can be supposedly put into a transaction.

Where do you look at it from and how do you read it?


Title: Re: How to read information put into a Bitcoin transaction?
Post by: pooya87 on September 29, 2019, 08:42:32 AM
are you talking about the OP_RETURN output scripts' content?

if so then you just have to parse the bytes into whatever format you want. since there is no rules for it, you have to know what that data is. it could be a text using ASCII or UTF8 encoding in which case you just have to decode it using those encoding schemes, or it could be some script or even a hash (ie. random data in your POV).
if you just want a site that shows these things then visit a block explorer like smartbit that has that option. https://www.smartbit.com.au/op-returns


Title: Re: How to read information put into a Bitcoin transaction?
Post by: Heisenberg_Hunter on September 30, 2019, 06:27:52 AM
OP_Return opcode is pretty much bad for network as a whole as they would be seemingly polluting the blockchain. Also they have been frowned upon by the developers since they reduce/burn the number of bitcoins in existense and make the outputs (txout) unspendable within the transaction. OP_Return can be viewed upon in various block explorers like Blockchain.info (https://www.blockchain.com/), Blockchain.com (https://blockchair.com)

Here is an example of how an arbitary data in bitcoin blockchain will look like :

https://www.blockchain.com/btc/tx/d276abe15791941649c3ca8425d79167cc1cf801f83aa99753fe7f42740c0f23

Check for the arbitary data in Output Scripts [RETURN PUSHDATA] part.


Title: Re: How to read information put into a Bitcoin transaction?
Post by: Heisenberg_Hunter on October 01, 2019, 11:00:01 AM
AFAIK OP_RETURN don't burn bitcoin and create non-spendable UTXO. It's only true when people attempted to store information on Bitcoin's blockchain before OP_RETURN is introduced,

Yes, that's precisely the statement. But OP_Return are long used by people to make the coins unspendable by removing the UTXO set which will thus reduce the number of spendable coins in existance. Probably I should have been more clear in my above post.  :P


Title: Re: How to read information put into a Bitcoin transaction?
Post by: pooya87 on October 01, 2019, 01:50:03 PM
AFAIK OP_RETURN don't burn bitcoin and create non-spendable UTXO. It's only true when people attempted to store information on Bitcoin's blockchain before OP_RETURN is introduced,

Yes, that's precisely the statement. But OP_Return are long used by people to make the coins unspendable by removing the UTXO set which will thus reduce the number of spendable coins in existance. Probably I should have been more clear in my above post.  :P

what you are referring to is sometimes referred to as proof of burn and it is the least common way of using OP_Return output script types. the fact is the primary usage of this type of PublicScript is still to insert arbitrary data in the immutable bitcoin blockchain mostly used by altcoin miners who are doing some sort of merge mining (the data being their block hash) or altcoins such as those of Omni layer sending transactions that way.