The final DigiFact — Storing messages in the DigiByte blockchain
If you’ve been following along with @digibytecoin on Twitter, you’ll have seen the 40 DigiFacts Christmas Countdown as we celebrate 40 facts about DigiByte while counting down to Christmas.
The final DigiFact needed more than the 200-odd characters that Twitter would give us to explain how to see the DigiFact, so I’ve put it together here on Medium for you to follow along.
This is going to need you to have the DigiByte Core Wallet installed on your computer, and fully sync’d up-to-date as well. If you don’t have it, or don’t want to get it, then you can keep reading down to learn some cool stuff anyway if you’d like.
By the end of this, you’ll have decoded the final DigiFact
Think of it like a digital easter-egg hunt, except you’re going to be guided through how to find the secret message.
Now, let’s start with understanding this final DigiFact.
Begin by firing up the DigiByte Core Wallet if you don’t already have it open, and let it fully sync.
Then, go to Help -> Debug Window
Click on Console, and be sure to take note of the warning message:
This warning is totally OK, I’ll explain everything along the way, before I get you to run any commands, so you don’t have to worry about your DigiByte funds going anywhere. Always be careful though!
Now, you’ve been given a TxID in the tweet. This is a “Transaction ID”, and is included as part of a Block (7886953). With DigiByte, you can have multiple transactions in one block.
Every transaction on the DigiByte Blockchain has a unique identifier, and this particular TxID is what contains the special DigiFact message.
You can even take this TxID and paste it in to DigiExplorer.info to view it on the blockchain:
What you’re going to see is:
This is DigiExplorers way of telling you “This isn’t actually an address, but rather, it’s a message included with the transaction”. Somebody has included some information in the “OP_RETURN field” of the DigiByte transaction, that we talked about back with DigiFact #25
Cool, so you know there’s a message in there!
Now, how do you get that message?
Well, this is where you’re going to want the DigiByte Core Wallet, so go back to the DigiByte debug console window and we’re going to use a command called “getrawtransaction”. What this requests is all of the information about a specific transaction, even the extra details that DigiExplorer doesn’t show you, and including the message containing the final DigiFact.
You need to type in “getrawtransaction txid 1”, replacing txid with the Transaction ID that you got from the final DigiFact tweet, and then add a space followed by a 1 on the end:
getrawtransaction 0e345b1e94806150be838a7f0ce14e26702cedfc17871831391b8a89ed601f29 1
The “1” on the end tells the wallet to show it to you in a human readable manner (Though you’re welcome to leave the “1” off and see what it looks like if you’re the curious type).
Now you’re going to look for the part that says “OP_RETURN”:
You’ll see there’s a long string of letters and numbers, starting with “446” and ending with “465” all on the same line. You may need to scroll up a tiny bit to find it if you can’t see it right away.
Found it? Good!
That’s the message. Pretty great huh?
Well, I guess we should translate (“decode”) the message in to something meaningful.
You see, that’s the message in “Hexadecimal” form. When saving messages in to the DigiByte Blockchain through the DigiByte Core Wallet, it automatically converts the messages in to hexadecimal format. We need to change it back to being a readable text that you and I can understand.
How are we going to do that? It’s nice and easy actually.
Copy the long string of letters and numbers on the OP_RETURN line, starting with “446” and ending with “465”, and we’re going to go to a website to help us make sense of it: http://www.convertstring.com/EncodeDecode/HexDecode
This website will take the Hexadecimal message and convert it for you.
Simply pop the string in to the top box, and it will convert it for you and show you it in the bottom:
Click on “Hex Decode!” and you’ll see the message from the DigiByte team.
Congratulations, you’ve got the message straight from the DigiByte Blockchain!
This message will be permanently stored in the blockchain, forever, unable to be deleted, amended or changed.
You’ve also learned about getting information out of the DigiByte blockchain that has been previously stored in it.