Steve Shadders, Lead Developer at nChain, has put out a call to action. If you’re a Bitcoin SV (BSV) app developer, his new article, “The return of OP_RETURN – roadmap to Genesis part 4” gets into the history of OP_RETURN, and a specific but simple thing you’ll need to do before the Genesis upgrade hits in February 2020.
OP_RETURN was part of the original Bitcoin code, but as Shadders explained, due to a critical problem with the way transactions were handled at the time, Satoshi Nakamoto had to implement a change to it to avoid potential disaster. If OP_RETURN was used in a specific way, “The signature check is never performed and the script is considered valid because the top stack item is a Boolean ‘true’,” he writes. “In fact it doesn’t matter what the locking script is. This behavior could be exploited to spend any bitcoin at all.”
Satoshi’s fix was “to make OP_RETURN always exit and FAIL the script.” Shadders guesses that Satoshi used this as his method of fixing the code because it was simple and it would work, and he was pressed by the potential that someone would exploit the code before he could fix it. Improving OP_RETURN would have been much more complicated and time consuming, so he went for the simplest solution at the time.
Shadders notes though that as BSV adopts the Genesis upgrade, this is all going to change. The way we are all using OP_RETURN right now is going to get broken if we fix OP_RETURN,” he says. “But don’t worry too much, it’s an easy fix and we can start right now.”
So, as an app developer, what do you need to do? “There is something very simple you can do right now that will ensure your app will maintain consistent behavior both now and after the Genesis upgrade. Instead of starting your script with OP_RETURN, start it with OP_FALSE OP_RETURN,” Shadders writes. It would effectively make your code look like this:
OP_TRUE | OP_FALSE OP_RETURN
He notes that as of version 0.2.1, this code will work, so it can be implemented right away. He also clarifies that old OP_RETURN outputs will not suffer as a result of the change. But the change needs to be made. He concludes by explaining the call to action:
The above section was titled ‘call to action’ and that’s exactly what this article is. You can change your code right now because OP_FALSE OP_RETURN behaves functionally identical to a simple OP_RETURN on its own right now. The sooner your app supports this the sooner you can forget about it. The behavior of this script type won’t change after the upgrade. So please update your software ASAP. We are now 7 month out from the return to Genesis. There is a lot of work to do both in the Bitcoin SV as well as in the wallet and app ecosystem. We can knock this one off now so we can focus on the other stuff later.
Note: Tokens on the Bitcoin Core (SegWit) chain are referenced as SegWitCoin BTC coins. Altcoins, which value privacy, anonymity, and distance from government intervention, are referenced as dark coins.
Bitcoin Satoshi Vision (BSV) is today the only Bitcoin project that follows the original Satoshi Nakamoto whitepaper, and that follows the original Satoshi protocol and design. BSV is the only public blockchain that maintains the original vision for Bitcoin and will massively scale to become the world’s new money and enterprise blockchain.