Adding Messages On The Bitcoin Blockchain - A How-To Guide

Adding Messages On The Bitcoin Blockchain - A How-To Guide

Can I write on a Bitcoin Blockchain? Can I drop down a message? Yes, Luca of course you can! You can leave a message on a Bitcoin blockchain using a particular op code, called OP_RETURN.


Today Luca asks:

Can I write on a Bitcoin Blockchain? Can I drop down a message?

Yes, Luca of course you can! You can leave a message on a Bitcoin blockchain using a particular op code, called **OP_RETURN**.

Through this operation code, your UTXO became unspendable! You can use at most 80 bytes for your message (160 hexadecimal characters)!

This operation is known as “timestamping of write information” because the message will become part of a block with a timestamp as well.

In Action

Can I write on Bitcoin Blockchain? — Italian Language 🇮🇹

First of all, I get a SegWit address from my testnet node.

$ bitcoin-cli getnewaddress "" "bech32"

I need bitcoins! I need to use a faucet service such as:

After that, I can check my mempool and find my TX ID.

$ bitcoin-cli getrawmempool | grep c5ce66d638f1b8ca702dfb8f7d1da7a6707d9c6497212dc66829c99f69b28b9a

the c5ce66d638f1b8ca702dfb8f7d1da7a6707d9c6497212dc66829c99f69b28b9a is the faucet’s transaction.

When can I use my UTXO?

I can use it after the mining process.

Please recover my UTXO with **listunspent** command.

$ bitcoin-cli listunspent 1 101 '["tb1qrggdlvezgd4uy9mntz50mpmwd6l4vk9rm4ft3d"]' | jq
"txid": "c5ce66d638f1b8ca702dfb8f7d1da7a6707d9c6497212dc66829c99f69b28b9a",
"vout": 1,
"address": "tb1qrggdlvezgd4uy9mntz50mpmwd6l4vk9rm4ft3d",
"label": "",
"scriptPubKey": "00141a10dfb322436bc2177358a8fd876e6ebf5658a3",
"amount": 0.00100000,
"confirmations": 6,
"spendable": true,
"solvable": true,
"desc": "wpkh([3a46ecca/0'/0'/4']020d12775323bbdaf0cb6e9a2b44ae7a591ef5872364e80e363a93d283c10b9e4f)#kxjva7dw",
"safe": true

Nice! I need to retrieve the private key, as we know it’s mandatory to sign my transaction.

$ bitcoin-cli dumpprivkey tb1qrggdlvezgd4uy9mntz50mpmwd6l4vk9rm4ft3d

Now, we are able to create an amazing message, for instance:

Yep, we need to use hexadecimal!

$ printf "" | xxd -ps

I have the necessary to create the transaction!

Using _help_ I can retrieve a lot of information about this method. I want to use it on **createrawtransaction**.

$ bitcoin-cli help createrawtransaction

The receiver is the faucet’s address, I give back bitcoins :).

The address is:


Finally, I can build my transaction, in the data field I can put my hexadecimal message. Remember that it will create an operation code OP_RETURN as we discussed above.

bitcoin blockchain what-is-bitcoin blockchain-development blockchain-use-cases blockchain-developer btc bitcoin-spotlight

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Dedicated Blockchain Developer for Hire

Do you need Blockchain developers for hire? Every organization needs a solution that will improve their sales processes, bring efficiency, transparency, and speed in business transactions conducted internally. That’s why companies around the...

5 Blockchain Applications That Have Transformed the World of Technology

The blockchain is the decentralized database of the blocks of information, which gets recorded in the chain format and linked in a secured crypto graphical manner. This technology ensures proper safety of the data due to its secure nature, and it totally changes how people carry out transactions. It also brings about a faster and secure process of validating information needed to establish reliability.

Top Blockchain Application Development Company

Codezeros is a top **[Blockchain solution and service provider]( "Blockchain solution and service provider")** company which reinvents business with Blockchain solutions. Our Blockchain development solutions fortify the...

Emerging use cases of blockchain in healthcare and the life sciences

Our Blockchain Online Training will provide you to learn about Blockchain technology aspects with realty. Our Blockchain Course also includes live sessions, live Projects

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.