On May 15th, 2021, Bitcoin Cash experienced a upgrade adding 2 new prominent features to the network; namely Removal of the unconfirmed transaction chain limit and Allowance of transactions with multiple OP_RETURN outputs.
The feature we are interested in using here is the multiple OP_RETURN feature. By sending more than 1 OP_RETURN, its possible to manipulate it in such a way that it creates a blockchain-saved group chat that can be accessed and added to by using the same first OP_RETURN value followed by the information you wish to add.
Utilizing this method saves your messages on the blockchain in a similar way as Memo.cash or Member.cash does, however, all of the messages are kept on 1 address in the Bitcoin Cash Explorer.
Unlike Memo, Members, or other BCH social media services, posting to the blockchain using this method does not submit through open internet protocols that could be intercepted and processed in countries prone to internet surveillance and censorship.
What Does This Look Like?
What Do I Need To Do This?
A wallet that supports adding custom OP_RETURNs, such as Electron Cash 4.2.4 (Github)
ASCII Text to Hex Code Converter; I used this one: Text to Hex Converter
String length & byte counter: Link
BCH Blockchain Explorer that can read OP_RETURN data: BlockChair
How Do I Do It?
Open up your wallet that supports adding custom OP_RETURNs, the one I'll be using in this tutorial is Electron Cash 4.2.4 (Github)
Once you have your wallet opened, go to the Send tab and type
OP_RETURN , 0
OP_RETURN , 0
This will be the basis of our transaction format, the first line is where the group name will go and the second line is where the message will go.
Go to https://www.rapidtables.com/convert/number/ascii-to-hex.html
The first step here is to click the drop-down box that says "Spaces" and change it to "None"
Now type the name of your "Group" in the top box and click convert; in my case it's BCHGroup1:
Copy the output from the bottom box and put it in after the first "OP_RETURN" like this:
Now go back to the Text to Hex editor and write your message in the top box and convert it, then put it back in after the "OP_RETURN" the same way you did the group name.
Make sure the name of your group and your message together are equal to or less than 218 bytes. You can check this here: https://mothereff.in/byte-counter
Your message is ready to send! Either click Preview or Send and your transaction will be sent off.
Copy your transaction ID and view it on the blockchain explorer.
Go to the transaction page and click on the Top Most OP_RETURN that says the group name to get to the page that will show all the messages
Here was mine: BCHGroup1 - BlockChair Explorer
To read the OP_RETURN text of any message, click on "Bin" in between OP and HEX next to the box that says "Script"
Now you can view everyone's messages there!
Who Can Benefit From Using This? - Conclusion
There seems to be potential in using this feature as a public messaging system for groups, specific usernames, and other cases. In the past, some non-blockchain "secure" messaging services have cut off communication between people and groups in times of uprisings. Currently, some governments monitor all traffic and data with certain phrases, words, and web-links being red flags to be watched, arrested, or worse.
By using this multiple OP_RETURN feature, people can submit messages in a semi-encrypted manner (by use of Hex Encoding vs plain-text) without the fear of triggering certain words or phrases in oppressive governments, without possibility of removal or censorship.
I'm sure people will find more uses for Bitcoin Cash's new multiple OP_RETURN feature in the future and I look forward to seeing what's possible!
Thanks for your time reading!
The End.
nice