• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

How to create an inscription (memo) on the Dash network, aka OP_RETURN aka null data using the core wallet

xkcd

Well-known member
Masternode Owner/Operator
An OP_RETURN is a special type of transaction that allows you to store a small amount of arbitrary data on the blockchain, this data is commonly referred to as a memo or an inscription. For more information, refer to the link below, in short the main thing to know is that you can store at most 80 bytes, which is about 80 characters.




To start, load the core wallet and ideally create a new wallet to play in, goto File and create wallet and give it a name, note you can switch back and forth between wallets from the drop down list on the top right of the Dash Core wallet. In the new wallet, goto the Receive tab and click the button to create the address, copy this address and now switch back to your other wallet, in there find a mixed input of the smallest size and using coin control (you can enable it from the Options menu) send that one input to the new address you just created.

For this guide I am using this address https://chainz.cryptoid.info/dash/address.dws?Xnx6vqfDvGpXgnMMcdZJKQgvsviJZaEt4p.htm

Capture.PNG


Now that the wallet is funded, you can create the transaction, open the console CTRL+SHIFT+C and in the top left, be sure to select the new wallet you just created. Open notepad and keep track of some things, firstly create your message, eg

This is my first inscription !

Head on over this site to encode it into hexadecimal. https://www.rapidtables.com/convert/number/ascii-to-hex.html


Capture.PNG


On the above screen paste in the message and be sure to choose None for the delimiter and then click Convert. Copy the result to notepad.


54686973206973206D7920666972737420696E736372697074696F6E2021

Go to the transactions tab on the core wallet and right click on the funding TX you did earlier and copy the transaction ID, eg mine is

2ab9f25acc286e0c1574f808cd8d419287ede776426a5ea5b4c31abe50baeb8e

Refer to the explorer, but notice in the below screen grab, the output of the TX is zero, note this down also.




Capture.PNG


Now in the wallet, either create a new address or use the same address you just used when you funded the wallet, I will use the same address, note it down also.


Now you have everything you need to create the transaction.

The transaction itself must look something like this

createrawtransaction "[{\"txid\":\"2ab9f25acc286e0c1574f808cd8d419287ede776426a5ea5b4c31abe50baeb8e\",\"vout\":0}]" "[{\" Xnx6vqfDvGpXgnMMcdZJKQgvsviJZaEt4p\":0.000996},{\"data\":\"54686973206973206D7920666972737420696E736372697074696F6E2021\"}]"

In the above, replace, the blue transaction ID, with your TXID, after the vout, replace 0 with the TX index you want to spend, eg 0,1,2,... For the green address replace with YOUR address, for the red amount, this is how much the transaction should send to that address, basically make it about 300 duffs less than what the input contains, eg my input has 0.0009981 Dash, so I want to spend 0.0009981 - 0.0000300 = 0.0009681. We will calculate the lowest fee optionally in the next step, however, this is bare minimum to create a valid transaction. Special Notice! If you make this value too low, then the result will be you pay a very high fee! Any Dash that is not spent, ie sent to the address you specify will be used as the fee!

Once you have populated all the parts of the TX, paste it into the console to create the raw transaction.

Copy the transaction and put it into notepad. eg mine is,

02000000018eebba50be1ac3b4a55e6a4276e7ed8792418dcd08f874150c6e28cc5af2b92a0000000000ffffffff0210850100000000001976a914868459c10a29b395d18811f96ba332f1d3a64d3088ac0000000000000000206a1e54686973206973206d7920666972737420696e736372697074696f6e202100000000


Now sign the TX in the console with signrawtransactionwithwallet <YOUR TX HEX>, this will give you result similar to below.



{

"hex": "02000000018eebba50be1ac3b4a55e6a4276e7ed8792418dcd08f874150c6e28cc5af2b92a000000006a47304402202c438a164031f0f16f021f866fac68c9bd03830a9950519390897bea03050cea0220769f388ef4c0ca48eea6751ee7a50b169e3e6e68a338a215e98ca7991dfd553a0121021d9b2ebb964944fb336764c353139ccb71a77f17367defa4d42ebdff1af1986dffffffff0264850100000000001976a914868459c10a29b395d18811f96ba332f1d3a64d3088ac0000000000000000206a1e54686973206973206d7920666972737420696e736372697074696f6e202100000000",

"complete": true

}



Optional. To compute the exact fee, tally up the number of bytes using the below command, change the hex values with your raw transaction, eg

Code:
wc -c <<< "02000000018eebba50be1ac3b4a55e6a4276e7ed8792418dcd08f874150c6e28cc5af2b92a000000006a47304402202c438a164031f0f16f021f866fac68c9bd03830a9950519390897bea03050cea0220769f388ef4c0ca48eea6751ee7a50b169e3e6e68a338a215e98ca7991dfd553a0121021d9b2ebb964944fb336764c353139ccb71a77f17367defa4d42ebdff1af1986dffffffff0264850100000000001976a914868459c10a29b395d18811f96ba332f1d3a64d3088ac0000000000000000206a1e54686973206973206d7920666972737420696e736372697074696f6e202100000000"

It will spit out a number, eg mine gave me 465, subtract one from that number eg 464 and divide my 2 to get the number of bytes in the transaction, ie 232, Now you know the exact fee you need to pay, eg 232 Duffs, so you can recalculate the amount to send in the TX and update that value, eg 0.0009981 - 0.00000232 = 0.00099578 So, I can change the above TX to send 0.00099578 to my address, change it now and place the command back into the console once more and sign it again.

Here is my updated TX.

Updated and signed TX.
02000000018eebba50be1ac3b4a55e6a4276e7ed8792418dcd08f874150c6e28cc5af2b92a000000006a47304402200535369754d6eed482033a967661abab53b1a32eb292132aad43ed7da96ae3fe022010ff521c1d49b1c963f8d969231aa0d76e2901075be31e3da15bfbb7c96fdede0121021d9b2ebb964944fb336764c353139ccb71a77f17367defa4d42ebdff1af1986dffffffff02fa840100000000001976a914868459c10a29b395d18811f96ba332f1d3a64d3088ac0000000000000000206a1e54686973206973206d7920666972737420696e736372697074696f6e202100000000



Now, send the TX (note this is the part where the TX is sent and the fee is charged.

sendrawtransaction <YOUR SIGNED TX HEX>

and this give you the transaction ID of the TX if successful!


5fe19963641d3b1ab0d6b1ef8285eb906356a6404a825897bebcd4f28334adca

Wait for one confirmation and check the result on the block explorer !

While you are waiting you can check out the site https://mnowatch.org/history/ which finds all of these transactions and lets you search on all of them and read their secret messages! The site updates hourly, so your TX will appear on the explorer before you can see it on the MNOwatch page.

and here it is finally! The completed product! Well done! Now you know how to inscribe any random message you like into the Dash Blockchain !

Capture.PNG
 
Back
Top