Author

Topic: Data on Blockchain [Question] (Read 222 times)

legendary
Activity: 3472
Merit: 10611
June 08, 2019, 08:56:28 PM
#7
That is something I will consider. However, for every transaction say the transaction creator will be entering data. How hard it is to achieve this on a programming level and of course on ETH chain. Will the above scenario work for a smart contract as well?

it is very easy to code this since it is just a trivial and simple code to write as long as you have basic familiarity with transaction structure and scripts.
as for ethereum case, i am not that familiar with its blockchain but you should be able to find a way to construct a smart contract to do that too.
legendary
Activity: 1750
Merit: 1115
Providing AI/ChatGpt Services - PM!
June 08, 2019, 08:13:33 AM
#6
I don't know on Ethereum, but you can easily add short texts into Bitcoin transaction.
Yeah, I'm aware of that but that is not what I was looking for. Thanks for your inputs though.

actually you don't even need OP_Return if the option doesn't exist, you just have to view transactions differently. a transaction is jut a data structure with different parts that we interpret differently. for instance the first 4 bytes of a transaction is interpreted as a number which we call "version".

so in order to put "data" in a transaction you just have to find a field in your tx that allows you to enter data. in a transaction this can be the output. with OP_Return it becomes easier since it is designed for data but you can still do it with other OPs too. for instance the regular P2PKH outputs can be used (assuming OP_Return doesn't exist). you just have to change the pushed data to the value you like.

example: if you pay any amount to this address: 18L1ocUNq8EKJu1UHu92HKUk4jeXL9eXoL you are technically putting your bitcointalk username (Patatas) in the blockchain because if you look at the transaction's actual data you can see that this address is actually stored like this as an output:
76a914506174617461730000000000000000000000000088ac
or in more human readable format:
OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG

ps. obviously any amount sent to this address is lost because it is a burn address.
That is something I will consider. However, for every transaction say the transaction creator will be entering data. How hard it is to achieve this on a programming level and of course on ETH chain. Will the above scenario work for a smart contract as well?
legendary
Activity: 3472
Merit: 10611
June 02, 2019, 10:18:30 PM
#5
actually you don't even need OP_Return if the option doesn't exist, you just have to view transactions differently. a transaction is jut a data structure with different parts that we interpret differently. for instance the first 4 bytes of a transaction is interpreted as a number which we call "version".

so in order to put "data" in a transaction you just have to find a field in your tx that allows you to enter data. in a transaction this can be the output. with OP_Return it becomes easier since it is designed for data but you can still do it with other OPs too. for instance the regular P2PKH outputs can be used (assuming OP_Return doesn't exist). you just have to change the pushed data to the value you like.

example: if you pay any amount to this address: 18L1ocUNq8EKJu1UHu92HKUk4jeXL9eXoL you are technically putting your bitcointalk username (Patatas) in the blockchain because if you look at the transaction's actual data you can see that this address is actually stored like this as an output:
76a914506174617461730000000000000000000000000088ac
or in more human readable format:
OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG

ps. obviously any amount sent to this address is lost because it is a burn address.
newbie
Activity: 21
Merit: 0
June 01, 2019, 10:42:09 PM
#4
You might have to create your own blockchain
sr. member
Activity: 910
Merit: 351
June 01, 2019, 05:14:11 PM
#3
Theoretically, and in practice, you can already do that on various blockchains. It might not be pretty, and you might need to convert your data to other formats, just like what you need to do on Ethereum blockchain on tutorial linked above. AFAIK, some projects offer "anchoring" which basically stores/records a hash of a data, which is essentially the same as a text.

You might want to fork or create your own blockchain if you want a prettier look on how the data encoded/recorded.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
June 01, 2019, 03:08:30 PM
#2
Just wondering how feasible it is to show data on the blockchain along with a transaction? Like a transaction with an item name? For instance, imagine I'm creating a smart contract using Ethereum and with every transaction I want the item name to persist in the blockchain. Is that even possible? This is not like naming an address or something but actual text data with a transaction that is visible on the block explorer.

I don't know on Ethereum, but you can easily add short texts into Bitcoin transaction.
It may not be pretty, but it can be done and seen. One example is (see the last decoded part in OP_RETURN) https://chain.so/tx/BTC/27daac15b942454b32f913a41633151163d1921b0c7bf6ddbea6020462d805ee
Some explanations on the subject (for Bitcoin) are https://www.reddit.com/r/btc/comments/49pp3n/eli5_how_to_embed_text_into_a_bitcoin_transaction/

If you insist on doing this on Ethereum blockchain, maybe you should look here: https://cryptobulls.info/store-text-message-ethereum-blockchain-censorship-resistant
(it's one of the results from the search engine)
legendary
Activity: 1750
Merit: 1115
Providing AI/ChatGpt Services - PM!
June 01, 2019, 08:28:05 AM
#1
Just wondering how feasible it is to show data on the blockchain along with a transaction? Like a transaction with an item name? For instance, imagine I'm creating a smart contract using Ethereum and with every transaction I want the item name to persist in the blockchain. Is that even possible? This is not like naming an address or something but actual text data with a transaction that is visible on the block explorer.
Jump to: