Author

Topic: opcodeexplained.com - A website which explain Bitcoin Opcodes (Read 169 times)

legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
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
  OP_CheckSig
OP_ELSE
  OP_RETURN
OP_ENDIF
The output was spent using the IF branch
Code:

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
copper member
Activity: 906
Merit: 2258
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?
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
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
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
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.
legendary
Activity: 3472
Merit: 10611
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.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
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.
Jump to: