Bitcoin Forum
November 18, 2024, 01:13:57 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Data on Blockchain [Question]  (Read 222 times)
Patatas (OP)
Legendary
*
Offline Offline

Activity: 1750
Merit: 1115

Providing AI/ChatGpt Services - PM!


View Profile
June 01, 2019, 01:28:05 PM
 #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.
NeuroticFish
Legendary
*
Offline Offline

Activity: 3864
Merit: 6596


Looking for campaign manager? Contact icopress!


View Profile
June 01, 2019, 08: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)

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
elda34b
Sr. Member
****
Offline Offline

Activity: 910
Merit: 351


View Profile
June 01, 2019, 10: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.
therealifiok
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
June 02, 2019, 03:42:09 AM
 #4

You might have to create your own blockchain
pooya87
Legendary
*
Offline Offline

Activity: 3640
Merit: 11040


Crypto Swap Exchange


View Profile
June 03, 2019, 03:18:30 AM
Merited by Patatas (2)
 #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 <Patatas(nullpaded)> OP_EQUALVERIFY OP_CHECKSIG

ps. obviously any amount sent to this address is lost because it is a burn address.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Patatas (OP)
Legendary
*
Offline Offline

Activity: 1750
Merit: 1115

Providing AI/ChatGpt Services - PM!


View Profile
June 08, 2019, 01:13:33 PM
 #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 <Patatas(nullpaded)> 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?
pooya87
Legendary
*
Offline Offline

Activity: 3640
Merit: 11040


Crypto Swap Exchange


View Profile
June 09, 2019, 01:56:28 AM
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!