Debate: 64 bytes in OP_RETURN VS taproot OP_FALSE OP_IF OP_PUSH



Summary:

In a recent post on the Bitcoin Development mailing list, Russell O'Connor raised an interesting point about the cost of using bytes in the witness versus bytes in the script pubkey. According to O'Connor, there is a crossover point in data size where it becomes cheaper to use witness data as compared to bytes in the script pubkey. However, this is only true given today's standardness constraints. O'Connor suggests that allowing a data carrier entry in the annex would enable publishing data with a single transaction, with malleability prevented because the annex content is committed to by the signature. The cost for publishing data via the witness today is roughly 115 vb for the commitment tx and 115 vb + datalen/4 for the publication tx. On the other hand, a tx with an OP_RETURN output costs around 125 vb + datalen, making it more expensive than the witness for datalengths greater than 140 bytes.Furthermore, using the witness for random data has another advantage over OP_RETURN. The txid commits to the OP_RETURN output, so all OP_RETURN data must be downloaded to validate a block's merkle tree. In contrast, you can partially validate a block without downloading witness data. Overall, these findings suggest that a datacarrier in the annex with similar or higher limits than OP_RETURN would make OP_RETURN obsolete.


Updated on: 2023-05-22T23:26:12.968073+00:00