Bitcoin Forum
May 03, 2024, 08:47:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to write messages into the blockchain?  (Read 3179 times)
Gimonela (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 20, 2015, 09:46:29 PM
 #1

I heard recently that its possible to write plain text messages in the blockchain.

How can one do that? Can someone explain me how can I do that using bitcoin-qt?

And how can I read my message and others? using bitcoin-qt or blockchain.info?

Thanks
1714769265
Hero Member
*
Offline Offline

Posts: 1714769265

View Profile Personal Message (Offline)

Ignore
1714769265
Reply with quote  #2

1714769265
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714769265
Hero Member
*
Offline Offline

Posts: 1714769265

View Profile Personal Message (Offline)

Ignore
1714769265
Reply with quote  #2

1714769265
Report to moderator
1714769265
Hero Member
*
Offline Offline

Posts: 1714769265

View Profile Personal Message (Offline)

Ignore
1714769265
Reply with quote  #2

1714769265
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4615



View Profile
February 20, 2015, 10:20:25 PM
 #2

I heard recently that its possible to write plain text messages in the blockchain.

How can one do that? Can someone explain me how can I do that using bitcoin-qt?

User level functionality to do this does not yet exist in Bitcoin-Qt (and perhaps never will).

You would need to create your own raw transactions with the message already encoded.  Then you can use Bitcoin-Qt to broadcast the raw transaction if you like.

And how can I read my message and others? using bitcoin-qt

User level functionality to do this does not yet exist in Bitcoin-Qt (and perhaps never will).

From the console in the debug window you could issue the command getrawtransaction if you know the transaction ID.

or blockchain.info?

View the transaction with the block explorer.  Make sure you click the "show scripts & coinbase" link.
unamis76
Legendary
*
Offline Offline

Activity: 1512
Merit: 1005


View Profile
February 20, 2015, 10:31:08 PM
 #3

You're going to need a service like this: http://www.cryptograffiti.info/ for your purpose.
Gimonela (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 20, 2015, 10:33:44 PM
 #4


You would need to create your own raw transactions with the message already encoded.


How to do that?


Quote from: Glimanora
or blockchain.info?

View the transaction with the block explorer.  Make sure you click the "show scripts & coinbase" link.


This transaction here:

https://blockchain.info/tx/8a754f417dfda84d8fa8a27d67560fd4a0d13c54d3f617ccabae3a473d308208?show_adv=true

I know it has the text:

"The Congress shall have Power... To promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries;"

But I don't see it when I click "show scripts & coinbase"
Gimonela (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 20, 2015, 10:41:47 PM
 #5

You're going to need a service like this: http://www.cryptograffiti.info/ for your purpose.

Thanks, but I would like to know how to do it myself
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4615



View Profile
February 20, 2015, 10:44:33 PM
 #6

This transaction here:

https://blockchain.info/tx/8a754f417dfda84d8fa8a27d67560fd4a0d13c54d3f617ccabae3a473d308208?show_adv=true

I know it has the text:

"The Congress shall have Power... To promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries;"

But I don't see it when I click "show scripts & coinbase"

You are mistaken.

Currently the protocol doesn't support OP_RETURN messages that are longer than 40 bytes.  If you want to encode that message in plain text, it would require more than 200 bytes.

Perhaps that transaction encodes a hash of the text?  Or perhaps it has the text encoded in some form such that it is not plain text?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4615



View Profile
February 20, 2015, 10:47:41 PM
 #7

You're going to need a service like this: http://www.cryptograffiti.info/ for your purpose.

Thanks, but I would like to know how to do it myself

About 10 seconds with the Google search engine turned up the following:

In python you could specify the OP_RETURN value as follows:

Code:
from binascii import unhexlify

msg = 'your message of max 40 chars'
# convert msg to OP_RETURN script in hexadecimal
hexed = "6a%x%s" % (len(msg), msg.encode('hex'))
# convert to binary encoding
script = unhexlify(hexed)
Set the value of the output to 0.0, replace the transaction script with the binary part above.

Do not forget to add enough fee and send the remainder to your change address.

If you can't figure out how to use an internet search engine, it is very unlikely that you'll be able to figure out how to write a program that will allow you to build raw bitcoin transactions.
najzenmajsen
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500



View Profile
February 22, 2015, 01:35:46 PM
 #8

i've actually wondered this , but not much enough to google it , thanks for the help guis Smiley
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!