CScript() << OP_RETURN << data produces up to 82 bytes #6392

issue haraldh opened this issue on July 7, 2015
  1. haraldh commented at 7:41 PM on July 7, 2015: none

    https://github.com/bitcoin/bitcoin/blob/master/src/test/transaction_tests.cpp#L354

    produces: 6a4c5004678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38

    which is OP_RETURN + OP_PUSHDATA1 + LEN + DATA

    so effectively OP_RETURN + 82 bytes

    This passes IsStandardTx(), but a OP_RETURN + 80 random chars does not.

  2. haraldh commented at 7:42 PM on July 7, 2015: none

    Maybe I miss some documentation, but most resources are outdated.

  3. luke-jr commented at 8:12 PM on July 7, 2015: member

    Scripts aren't random data. Without a push-data opcode, your "random chars" will be interpreted as opcodes, and count against miners' sigop limits.

  4. haraldh commented at 9:24 PM on July 7, 2015: none

    Maybe someone should change some wiki pages explaining, that OP_RETURN is only allowed to be followed by standard PUSHDATA.

  5. luke-jr commented at 9:31 PM on July 7, 2015: member

    Sounds like a good idea. Go for it.

  6. haraldh closed this on Jul 7, 2015

  7. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me