OP_RETURN inside TapScript



Summary:

Since the activation of Taproot, it is no longer necessary to create separate OP_RETURN outputs to attach data to a transaction. Instead, it is possible to create "OP_RETURN" as a branch in the TapScript to store data off-chain and prove that it is connected with a taproot address pushed on-chain. This can be done without revealing the full script and without costing extra bytes on-chain. However, creating non-deterministic scripts can make backup recovery more difficult. Additionally, the scheme is not equivalent to OP_RETURN because it requires out-of-band communication to reveal the commitment. The cost of storing additional data on-chain is also considered expensive. Ruben Somsen notes that committing to an ECC point has always been possible and is not specific to Tapscript. It is possible to tweak an ECC point to commit data inside it and store 1.5GB of data using OP_RETURN or even an entire merkle tree of hashes.


Updated on: 2023-06-15T17:14:14.026268+00:00