Bitcoin Forum
June 23, 2025, 12:56:49 AM *
News: Pizza day contest voting
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [EDU] Hands on OP_RETURN  (Read 181 times)
promise444c5 (OP)
Sr. Member
****
Offline Offline

Activity: 686
Merit: 438


All things are numbers


View Profile
June 10, 2025, 07:52:16 AM
Last edit: June 14, 2025, 12:11:23 AM by promise444c5
Merited by Mia Chloe (5), Igebotz (4), Charles-Tim (2), EarnOnVictor (2), Amphenomenon (1), Felicity_Tide (1)
 #1

What's OP_RETURN ??
OP_RETURN( an Opcode)  refers  to  a locking script  used for locking data to atrasanction, this data can't exceed 80 Bytes ...

Why do we use OP_RETURN ??
OP_RETURN was meant to be used to store only  important trx related data..you see in the past, there was no usage  of OP_RETURN and some People(with cryptographic Knowledge) were able to embed data in  a way  which will make it remain in the UTXO sets,
This data could be large like(images, tweets...) which could eventually lead to bloated UTXO set , but with OP_RETURN  this  datas were proved to be non-spendable thus, can be pruned by nodes.
Also, to prevent the blockchain from being spammed with large data set, OP_RETURN Limit was introduced..    

Here's a quick Tut on using OP_RETURN on Electrum Testnet
  • Open your Electrum and goto send Tab
  • On the "Pay to" section, input your Address then followed by  the amount but seperated by delimer " , " comma ( the amount set will be automatically updated on the "Amount section"
  • Next, move to the next line in same "Pay to" section and input "OP_RETURN <your data in hex format>" followed by amount to be burned which will be zero(0), also seperated by delimeter " , "  


      

     
  • Now you can add description (if you want for ease identificattoion locally) and then pay , you will be having a transaction like this:

       
          you should notice the output with the OP_RETURN script has a balance of zero

    Input:             => Sender address
                    
          
    Outputs:           => Receiver address
                           => Change address

        
On mempool.space the transaction first-output [zero] will readily have your text attached to it.. and  the hex is still available too, if you use explorer like Blockchair i think it will only show you the hex  and you have to decode it yourself..

the TXID 66f4bd03c03280156d5efeb6965f2b0102c17bd41302c16ab0a089e326b48059

So now you can go through thread like this and understand what's been discussed  

Note: OP_RETURN wasn't created to store all kinds of data.. if you need to store one you can do that on a cloud storage or your local drives but incase you need to store an important messages,data to your transaction, OP_RETURN got you covered.  
Warning:   For the purpose of trying out the Tutorial, use testnet to prevent losing of funds  

Source and useful links:
https://learnmeabitcoin.com/technical/script/return/
https://bitcoin.stackexchange.com/questions/29554/explanation-of-what-an-op-return-transaction-looks-like
https://en.bitcoin.it/wiki/Script
https://learnmeabitcoin.com/technical/general/bytes/
https://learnmeabitcoin.com/technical/general/hexadecimal/

Corrections and suggestions are welcome ..



██
██
██████
R


▀▀██████▄▄
████████████████
▀█████▀▀▀█████
████████▌███▐████
▄█████▄▄▄█████
████████████████
▄▄██████▀▀
LLBIT
██████
██
██
██████
██
██
██
██
██
██
██
██
██
██
██
██████
██████████████
 
 TH#1 SOLANA CASINO 
██████████████
██████
██
██
██
██
██
██
██
██
██
██
██
██████
████████████▄
▀▀██████▀▀███
██▄▄▀▀▄▄████
████████████
██████████
███▀████████
▄▄█████████
████████████
████████████
████████████
████████████
█████████████
████████████▀
████████████▄
▀▀▀▀▀▀▀██████
████████████
███████████
██▄█████████
████▄███████
████████████
█░▀▀████████
▀▀██████████
█████▄█████
████▀▄▀████
▄▄▄▄▄▄▄██████
████████████▀
[
[
5,000+
GAMES
INSTANT
WITHDRAWALS
][
][
HUGE
   REWARDS   
VIP
PROGRAM
]
]
████
██
██
██
██
██
██
██
██
██
██
██
████
████████████████████████████████████████████████
 
PLAY NOW
 

████████████████████████████████████████████████
████
██
██
██
██
██
██
██
██
██
██
██
████
Mia Chloe
Hero Member
*****
Offline Offline

Activity: 742
Merit: 1237


Contact me for your designs...


View Profile
June 10, 2025, 08:37:22 AM
Merited by promise444c5 (1)
 #2

Finally a decent technical post. Anyways OP,  a little correction. Actually OP_RETURN isn't technically a locking script. Rather It is an opcode that creates a provably unspendable output (not technically a locking mechanism).  Also, The standard limit is 80 bytes of data but the total output script can actually be up to 83 bytes i.e (including the OP_RETURN opcode + push opcode). I think some implementations allow non-standard larger sizes too. 
Also take note that OP_RETURN outputs are actually prunable and I think nodes discard them from the UTXO set. For this kind of experiment it would be nice to use a testnet so you don't end up burning some coins.

promise444c5 (OP)
Sr. Member
****
Offline Offline

Activity: 686
Merit: 438


All things are numbers


View Profile
June 10, 2025, 09:49:43 AM
 #3

Actually OP_RETURN isn't technically a locking script

Yes you're right it's just referred to as OP_RETURN ,it's an opcode used in the locking script (added that) but   just to avoid confusion.. i will edit that
Thanks Mia Chloe

Also take note that OP_RETURN outputs are actually prunable and I think nodes discard them from the UTXO set.
Yeah added that earlier here :
Quote
... with OP_RETURN  this  datas were proved to be non-spendable thus, can be pruned by nodes


For this kind of experiment it would be nice to use a testnet so you don't end up burning some coins.
I used Testnet, i should have specified that  but i thought it's more easier to recognise through the adrress ..



██
██
██████
R


▀▀██████▄▄
████████████████
▀█████▀▀▀█████
████████▌███▐████
▄█████▄▄▄█████
████████████████
▄▄██████▀▀
LLBIT
██████
██
██
██████
██
██
██
██
██
██
██
██
██
██
██
██████
██████████████
 
 TH#1 SOLANA CASINO 
██████████████
██████
██
██
██
██
██
██
██
██
██
██
██
██████
████████████▄
▀▀██████▀▀███
██▄▄▀▀▄▄████
████████████
██████████
███▀████████
▄▄█████████
████████████
████████████
████████████
████████████
█████████████
████████████▀
████████████▄
▀▀▀▀▀▀▀██████
████████████
███████████
██▄█████████
████▄███████
████████████
█░▀▀████████
▀▀██████████
█████▄█████
████▀▄▀████
▄▄▄▄▄▄▄██████
████████████▀
[
[
5,000+
GAMES
INSTANT
WITHDRAWALS
][
][
HUGE
   REWARDS   
VIP
PROGRAM
]
]
████
██
██
██
██
██
██
██
██
██
██
██
████
████████████████████████████████████████████████
 
PLAY NOW
 

████████████████████████████████████████████████
████
██
██
██
██
██
██
██
██
██
██
██
████
Hatchy
Hero Member
*****
Offline Offline

Activity: 812
Merit: 858


The Alliance Of Bitcointalk Translators - ENG>PID


View Profile WWW
June 10, 2025, 11:50:08 AM
 #4

I used Testnet, i should have specified that  but i thought it's more easier to recognise through the adrress ..
Not everyone would recognise those test net addresses as most people on the local board are just familiar with the normal bitcoin address. But then nice thread but the way op. It nice that we have some technical post here some times to help inform our local board members of many possibilities that can happen in the bitcoin world.

Well op_return was introduced as cleaner way to embed data, allowing nodes to immediately identify and discard these output that would have caused the UTXO set to bloat..

R


▀▀▀▀▀▀▀██████▄▄
████████████████
▀▀▀▀█████▀▀▀█████
████████▌███▐████
▄▄▄▄█████▄▄▄█████
████████████████
▄▄▄▄▄▄▄██████▀▀
LLBIT|
4,000+ GAMES
███████████████████
██████████▀▄▀▀▀████
████████▀▄▀██░░░███
██████▀▄███▄▀█▄▄▄██
███▀▀▀▀▀▀█▀▀▀▀▀▀███
██░░░░░░░░█░░░░░░██
██▄░░░░░░░█░░░░░▄██
███▄░░░░▄█▄▄▄▄▄████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█████████
▀████████
░░▀██████
░░░░▀████
░░░░░░███
▄░░░░░███
▀█▄▄▄████
░░▀▀█████
▀▀▀▀▀▀▀▀▀
█████████
░░░▀▀████
██▄▄▀░███
█░░█▄░░██
░████▀▀██
█░░█▀░░██
██▀▀▄░███
░░░▄▄████
▀▀▀▀▀▀▀▀▀
||.
|
▄▄████▄▄
▀█▀
▄▀▀▄▀█▀
▄░░▄█░██░█▄░░▄
█░▄█░▀█▄▄█▀░█▄░█
▀▄░███▄▄▄▄███░▄▀
▀▀█░░░▄▄▄▄░░░█▀▀
░░██████░░█
█░░░░▀▀░░░░█
▀▄▀▄▀▄▀▄▀▄
▄░█████▀▀█████░▄
▄███████░██░███████▄
▀▀██████▄▄██████▀▀
▀▀████████▀▀
.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
░▀▄░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░▄▀
███▀▄▀█████████████████▀▄▀
█████▀▄░▄▄▄▄▄███░▄▄▄▄▄▄▀
███████▀▄▀██████░█▄▄▄▄▄▄▄▄
█████████▀▄▄░███▄▄▄▄▄▄░▄▀
███████████░███████▀▄▀
███████████░██▀▄▄▄▄▀
███████████░▀▄▀
████████████▄▀
███████████
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
▄███▀▄▄███████▄▄▀███▄
▄██▀▄█▀▀▀█████▀▀▀█▄▀██▄
▄██▀▄███░░░▀████░███▄▀██▄
███░████░░░░░▀██░████░███
███░████░█▄░░░░▀░████░███
███░████░███▄░░░░████░███
▀██▄▀███░█████▄░░███▀▄██▀
▀██▄▀█▄▄▄██████▄██▀▄██▀
▀███▄▀▀███████▀▀▄███▀
▀████▄▄▄▄▄▄▄████▀
▀▀███████▀▀
OFFICIAL PARTNERSHIP
SOUTHAMPTON FC
FAZE CLAN
SSC NAPOLI
DubemIfedigbo001
Hero Member
*****
Offline Offline

Activity: 700
Merit: 525


Let love lead


View Profile WWW
June 10, 2025, 05:38:30 PM
 #5

Nice one promise444c5, it's good that there's a way to exclude these excesses of irrelevant data that the devs have found a way to include and bloat the size of UTXO, leading to higher transaction fees.

Personally, I don't see the need for such extra data being included in the UTXOs, it feels to me that they're deviating from the main focus of Bitcoin, which is sending funds across from one person to another. It might even open door for security threats in the future.

 
█▄
R


▀▀██████▄▄
████████████████
▀█████▀▀▀█████
████████▌███▐████
▄█████▄▄▄█████
████████████████
▄▄██████▀▀
LLBIT▀█ 
  TH#1 SOLANA CASINO  
████████████▄
▀▀██████▀▀███
██▄▄▀▀▄▄████
████████████
██████████
███▀████████
▄▄█████████
████████████
████████████
████████████
████████████
█████████████
████████████▀
████████████▄
▀▀▀▀▀▀▀██████
████████████
███████████
██▄█████████
████▄███████
████████████
█░▀▀████████
▀▀██████████
█████▄█████
████▀▄▀████
▄▄▄▄▄▄▄██████
████████████▀
........5,000+........
GAMES
 
......INSTANT......
WITHDRAWALS
..........HUGE..........
REWARDS
 
............VIP............
PROGRAM
 .
   PLAY NOW    
promise444c5 (OP)
Sr. Member
****
Offline Offline

Activity: 686
Merit: 438


All things are numbers


View Profile
June 14, 2025, 12:07:41 AM
 #6

Not everyone would recognise those test net addresses as most people on the local board are just familiar with the normal bitcoin address.
Don't mind me, i literally included it "Electrum testnet" right from when i was constructing the post, i think Mia Chloe is just directing the statement to those who might be willing  to give the tutorial  a try , so that  they won't risk their real sats ... i didn’t include that before but i will include it as warning now.



██
██
██████
R


▀▀██████▄▄
████████████████
▀█████▀▀▀█████
████████▌███▐████
▄█████▄▄▄█████
████████████████
▄▄██████▀▀
LLBIT
██████
██
██
██████
██
██
██
██
██
██
██
██
██
██
██
██████
██████████████
 
 TH#1 SOLANA CASINO 
██████████████
██████
██
██
██
██
██
██
██
██
██
██
██
██████
████████████▄
▀▀██████▀▀███
██▄▄▀▀▄▄████
████████████
██████████
███▀████████
▄▄█████████
████████████
████████████
████████████
████████████
█████████████
████████████▀
████████████▄
▀▀▀▀▀▀▀██████
████████████
███████████
██▄█████████
████▄███████
████████████
█░▀▀████████
▀▀██████████
█████▄█████
████▀▄▀████
▄▄▄▄▄▄▄██████
████████████▀
[
[
5,000+
GAMES
INSTANT
WITHDRAWALS
][
][
HUGE
   REWARDS   
VIP
PROGRAM
]
]
████
██
██
██
██
██
██
██
██
██
██
██
████
████████████████████████████████████████████████
 
PLAY NOW
 

████████████████████████████████████████████████
████
██
██
██
██
██
██
██
██
██
██
██
████
EarnOnVictor
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 739



View Profile
June 14, 2025, 05:37:03 AM
Merited by promise444c5 (1)
 #7

Oh, this is lovely! I'm just seeing this post here for the first time, and as a matter of fact, I'm just seeing this kind of technical post on the Naija board, all-time. That's interesting, and nice to see that Bill Gates is now among us. Smiley This OP_RETURN of a thing is useful, to be honest, and I will take my time to go through it over again.

.
 betpanda.io 
 
ANONYMOUS & INSTANT
.......ONLINE CASINO.......
▄███████████████████████▄
█████████████████████████
█████████████████████████
████████▀▀▀▀▀▀███████████
████▀▀▀█░▀▀░░░░░░▄███████
████░▄▄█▄▄▀█▄░░░█▄░▄█████
████▀██▀░▄█▀░░░█▀░░██████
██████░░▄▀░░░░▐░░░▐█▄████
██████▄▄█░▀▀░░░█▄▄▄██████
█████████████████████████
█████████████████████████
█████████████████████████
▀███████████████████████▀
▄███████████████████████▄
█████████████████████████
██████████▀░░░▀██████████
█████████░░░░░░░█████████
███████░░░░░░░░░███████
████████░░░░░░░░░████████
█████████▄░░░░░▄█████████
███████▀▀▀█▄▄▄█▀▀▀███████
██████░░░░▄░▄░▄░░░░██████
██████░░░░█▀█▀█░░░░██████
██████░░░░░░░░░░░░░██████
█████████████████████████
▀███████████████████████▀
▄███████████████████████▄
█████████████████████████
██████████▀▀▀▀▀▀█████████
███████▀▀░░░░░░░░░███████
██████░░░░░░░░░░░░▀█████
██████░░░░░░░░░░░░░░▀████
██████▄░░░░░░▄▄░░░░░░████
████▀▀▀▀▀░░░█░░█░░░░░████
████░▀░▀░░░░░▀▀░░░░░█████
████░▀░▀▄░░░░░░▄▄▄▄██████
█████░▀░█████████████████
█████████████████████████
▀███████████████████████▀
.
SLOT GAMES
....SPORTS....
LIVE CASINO
▄░░▄█▄░░▄
▀█▀░▄▀▄░▀█▀
▄▄▄▄▄▄▄▄▄▄▄   
█████████████
█░░░░░░░░░░░█
█████████████

▄▀▄██▀▄▄▄▄▄███▄▀▄
▄▀▄█████▄██▄▀▄
▄▀▄▐▐▌▐▐▌▄▀▄
▄▀▄█▀██▀█▄▀▄
▄▀▄█████▀▄████▄▀▄
▀▄▀▄▀█████▀▄▀▄▀
▀▀▀▄█▀█▄▀▄▀▀

Regional Sponsor of the
Argentina National Team
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!