Message in a Blockchain

Tara Annison
3 min readSep 18, 2019

In February 2019, a feud broke out between BCH SV creator Craight Wright and a journalist from Hard Fork who ran a story about illegal material being added to the BCH SV blockchain. Whilst the article was generally correct, Craig’s rebuttal was that this feature is not specific to BCH SV, and as such the article’s focus on BCH SV was unjust.

Whilst the nature of the discussion was unsavoury in many regards, it served to highlight an often-forgotten feature of many blockchains — the ability to encode plaintext and encrypted data.

This has been an ability within both the ETH and BTC blockchains since inception and as such there are block explorers which allow for text and image searches within blocks as well as companies who provide message finding services. Using these you may find the infamous ‘Tank Man’ image from the Tiananmen Square protests in 1989, any of the 16 marriage proposals within the BTC blockchain or even the tribute to Nelson Mandela.

So how have these been added onto a blockchain…

Adding Messages to the Blockchain

There are a number of ways to add a message to the bitcoin blockchain:

- Within the coinbase transaction

The coinbase transaction is the first transaction in a block and used by the miner to claim the block reward and transaction fees (Full overview of coinbase transactions: https://www.linkedin.com/pulse/what-coinbase-transaction-tara-annison/). It can contain up to 100 bytes of arbitrary data which is where the message can be placed by miners.

The most notable message of this type was Satoshi’s within the genesis block which read:

“The Times 03/Jan/2009 Chancellor on brink of second bailout for banks”

This was not placed as plaintext within the transaction but written in hex as the following hash value:

000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26

- Using an OP_RETURN transaction

The OP_RETURN transaction type was added within Bitcoin Core 0.9.0 and allows for arbitrary data to be added to a provably unspendable pubkey script, therefore ensuring full nodes do not need to store the UTXO data. Let’s unpack this a little …

Within a standard bitcoin transaction, a number of inputs are taken to create outputs, referred to as unspent transaction outputs (UTXOs). The movement of these funds is recorded on the blockchain and any full node can scan the history of all transactions to see who has the ability to move UTXOs. The UTXOs are our bitcoins moving around the system. However, an OP_RETURN transaction creates unspendable UTXOs which are therefore just data, rather than bitcoins. They are limited to 40 bytes and one per transaction, but provide a suitable message carrier.

An example of this is in April 2018 when the online stock trading platform TD Ameritrade used 68 bitcoin transactions and the OP_RETURN functionality to create an ASCII flag image to advertise their brand.

- Using a Pay-to-Script-Hash

P2SH transactions allow for the sender to create conditions upon which the UTXOs can be spent, such as multi-sig or timelock scripts ( read more in my bitcoin transaction explainer: https://www.linkedin.com/pulse/understanding-bitcoin-transactions-tara-annison/). As such the spender could create a pubkey script containing a hash of a second script (called the redeem script) which contains some arbitrary data — the message. This would result in an unspendable UTXO and messaged placed within the blockchain.

It is also possible to send messages within the Ethereum blockchain. Either by sending the message as part of the data field in a transaction or by using a contract to post an event to the blockchain. However, there is a size limit of 80kb per transaction so messages sent within the data field are best placed as HEX values which are converted from plaintext or ASCII.

If this has inspired you to add your own message to the blockchain but you don’t want the hassle of creating an OP_RETURN transaction or creating a contract, then fret not, as you can use these blockchain messaging services instead:

- https://eternitywall.it/

- https://blockchainsareforever.com

UPDATE 31/07/2019

Since creating this article, the above blockchain messaging services have gone out of business. As such Eternity wall is not eternal and blockchains apparently aren’t forever.

For more blockchain and cryptocurrency articles, follow me on LinkedIn @TaraAnnison

--

--