Bitcoin Forum
May 03, 2024, 12:32:44 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: opcodeexplained.com - A website which explain Bitcoin Opcodes  (Read 143 times)
ABCbits (OP)
Legendary
*
Offline Offline

Activity: 2870
Merit: 7452


Crypto Swap Exchange


View Profile
November 23, 2023, 10:07:40 AM
Merited by NotATether (5), pooya87 (4), BlackHatCoiner (4), NeuroticFish (3), vapourminer (1), Coin-1 (1), DdmrDdmr (1), vv181 (1), Charles-Tim (1), garlonicon (1), satscraper (1), vjudeu (1)
 #1

Does anyone know existence of https://opcodeexplained.com/? I discovered this website from Bitcoin Ops mailing and i found this website is rather helpful. It has more info compared with other website such as  https://en.bitcoin.it/wiki/Script and https://developer.bitcoin.org/reference/transactions.html. It also mention Opcodes which disabled on Bitcoin network such as OP_CAT.

P.S. I am NOT owner of this website.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
1714696364
Hero Member
*
Offline Offline

Posts: 1714696364

View Profile Personal Message (Offline)

Ignore
1714696364
Reply with quote  #2

1714696364
Report to moderator
1714696364
Hero Member
*
Offline Offline

Posts: 1714696364

View Profile Personal Message (Offline)

Ignore
1714696364
Reply with quote  #2

1714696364
Report to moderator
1714696364
Hero Member
*
Offline Offline

Posts: 1714696364

View Profile Personal Message (Offline)

Ignore
1714696364
Reply with quote  #2

1714696364
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714696364
Hero Member
*
Offline Offline

Posts: 1714696364

View Profile Personal Message (Offline)

Ignore
1714696364
Reply with quote  #2

1714696364
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10530



View Profile
November 24, 2023, 04:10:55 AM
Merited by ABCbits (1), vjudeu (1)
 #2

It is an interesting site but there are some weirdness in it too.

For example they are categorizing/naming 0xbb to 0xfe as OP_RETURN_XXX which is a bit misleading. These are undefined OP codes meaning the interpreter fails if it reaches any of these bytes when reading/interpreting/executing the script stream. Even though in action this is performing the same task as OP_RETURN but it is not the same. Being "undefined" means they can be defined at some point. For example in witness version 1 when the interpreter reaches these OP codes it returns as a successful interpretation (since it reached OP_SUCCESS) not the way it treats OP_RETURN (0x6a) which is failing right away even in witness version 1.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6724


bitcoincleanup.com / bitmixlist.org


View Profile WWW
November 24, 2023, 05:20:03 AM
Merited by vjudeu (1)
 #3

I also want to point out that it appears that the dictionary of opcodes is unfinished, although it is a pretty comprehensive list regardless. For example if you go to the pages for OP_EQUAL, OP_EQUALVERIFY, and even common stuff like OP_HASH160, they list those pages as under construction.

We should probably help out and fill in the remaining ones.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits (OP)
Legendary
*
Offline Offline

Activity: 2870
Merit: 7452


Crypto Swap Exchange


View Profile
November 24, 2023, 10:32:51 AM
Merited by vjudeu (1)
 #4

It is an interesting site but there are some weirdness in it too.

For example they are categorizing/naming 0xbb to 0xfe as OP_RETURN_XXX which is a bit misleading. These are undefined OP codes meaning the interpreter fails if it reaches any of these bytes when reading/interpreting/executing the script stream. Even though in action this is performing the same task as OP_RETURN but it is not the same. Being "undefined" means they can be defined at some point. For example in witness version 1 when the interpreter reaches these OP codes it returns as a successful interpretation (since it reached OP_SUCCESS) not the way it treats OP_RETURN (0x6a) which is failing right away even in witness version 1.

That's good point. Looking at explanation of OP_RETURN_XXX pages, it seems the author use name from library called rust-bitcoin[1] which IMO is weird decision.

We should probably help out and fill in the remaining ones.

And the author welcome such help[2].

[1] https://opcodeexplained.com/opcodes/OP_RETURN_228.html
[2] https://twitter.com/thunderB__/status/1722301073585475712

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
vjudeu
Hero Member
*****
Offline Offline

Activity: 677
Merit: 1555



View Profile
November 24, 2023, 10:59:20 AM
Last edit: November 24, 2023, 03:36:32 PM by vjudeu
 #5

Quote
It is a synonym for OP_RETURN.
This part is wrong. A better approximation is OP_RESERVED. If you have OP_RETURN, then the Script is invalid immediately. But in case of OP_RESERVED, it can be wrapped in some unexecuted OP_IF, and it will still remain valid.

But in general, it would be even better to compare it into "OP_FALSE OP_VERIFY", because this is what was intended, when creating OP_RETURN.

Edit: By the way, there were more pages like that in the past: https://en.bitcoin.it/Script

So, I wonder, if we need a new one. If so, then some information from the link above can be useful. But maybe it is easier to update the wiki instead?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 25, 2023, 12:16:23 PM
Merited by ABCbits (2), vjudeu (1)
 #6

Quote
It is a synonym for OP_RETURN.
This part is wrong. A better approximation is OP_RESERVED. If you have OP_RETURN, then the Script is invalid immediately. But in case of OP_RESERVED, it can be wrapped in some unexecuted OP_IF, and it will still remain valid.
This is one of those little details in Bitcoin that not that many people know.
The only OP codes that would invalidate a script by just existing are these (like OP_CAT). However, OP codes like OP_RETURN need to be executed to invalidate a script, otherwise they can exist in an unexecuted branch for example and the script would still be valid.

Example:
https://blockstream.info/testnet/tx/95b3bccdd66d139f7f87a6c85bb704cb7278bfb8f8ff1859e3c9f99223c3bcc4?expand
The redeem script here is:
Code:
OP_IF
  <push public key> OP_CheckSig
OP_ELSE
  OP_RETURN
OP_ENDIF
The output was spent using the IF branch
Code:
<push signature>
OP_TRUE
Since the OP_RETURN is never reached or executed, it does no invalidate the script or the transaction. As you can see the transaction I created was included in testnet block #2540377

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
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!