Jeremy Spilman [ARCHIVE] on Nostr: š
Original date posted:2014-02-24 š Original message:On Mon, 24 Feb 2014 ...
š
Original date posted:2014-02-24
š Original message:On Mon, 24 Feb 2014 09:10:26 -0800, Jeff Garzik <jgarzik at bitpay.com> wrote:
> This PR reduces the size to 40 bytes:
>
https://github.com/bitcoin/bitcoin/pull/3737Just quickly GLANCED at it, but if I understand correctly how the template
matching code works, that will change max size of the <data> to 40 bytes
but does not do anything to enforce most-efficient encoding.
else if (opcode2 == OP_SMALLDATA)
{
// small pushdata, <= MAX_OP_RETURN_RELAY bytes
if (vch1.size() > MAX_OP_RETURN_RELAY)
break;
}
This code was a bit hard for me to parse since it's not actually requiring
any data, just disallowing more than a certain number of bytes of data. So
a bare OP_RETURN would be allowed as well, for whatever good that will do.
If you want to strictly require no PUSHDATA, perhaps you could do:
else if (opcode2 == OP_SMALLDATA)
{
// small pushdata, <= MAX_OP_RETURN_RELAY bytes
if (opcode1 >= OP_PUSHDATA1 || vch1.size() > MAX_OP_RETURN_RELAY)
break;
}
Thanks,
Jeremy
Published at
2023-06-07 15:14:00Event JSON
{
"id": "59b90f40fd6e42fb6150163b067a346ec20e8cccad60226700221b77bb44c65b",
"pubkey": "7e57666cff7c86f9410d33d4d34ef3e5105395b3c74af472541dbeeb743f9de3",
"created_at": 1686150840,
"kind": 1,
"tags": [
[
"e",
"1ef870aa2080d76066b16301e94316a8cf8557aa7768e48cc4c5664289bfd14e",
"",
"root"
],
[
"e",
"9b33c09ee309986cb48e431299bdffcce8021063a9e5f123cf084f8a7cad053b",
"",
"reply"
],
[
"p",
"b25e10e25d470d9b215521b50da0dfe7a209bec7fedeb53860c3e180ffdc8c11"
]
],
"content": "š
Original date posted:2014-02-24\nš Original message:On Mon, 24 Feb 2014 09:10:26 -0800, Jeff Garzik \u003cjgarzik at bitpay.com\u003e wrote:\n\u003e This PR reduces the size to 40 bytes:\n\u003e https://github.com/bitcoin/bitcoin/pull/3737\n\nJust quickly GLANCED at it, but if I understand correctly how the template \nmatching code works, that will change max size of the \u003cdata\u003e to 40 bytes \nbut does not do anything to enforce most-efficient encoding.\n\n else if (opcode2 == OP_SMALLDATA)\n {\n // small pushdata, \u003c= MAX_OP_RETURN_RELAY bytes\n if (vch1.size() \u003e MAX_OP_RETURN_RELAY)\n break;\n }\n\nThis code was a bit hard for me to parse since it's not actually requiring \nany data, just disallowing more than a certain number of bytes of data. So \na bare OP_RETURN would be allowed as well, for whatever good that will do.\n\nIf you want to strictly require no PUSHDATA, perhaps you could do:\n\n else if (opcode2 == OP_SMALLDATA)\n {\n // small pushdata, \u003c= MAX_OP_RETURN_RELAY bytes\n if (opcode1 \u003e= OP_PUSHDATA1 || vch1.size() \u003e MAX_OP_RETURN_RELAY)\n break;\n }\n\nThanks,\nJeremy",
"sig": "82c4f536f3772b95533c2a22f3f7d20286dd043ef49167c45327a16f884c05bfa600225a3c20fe03a00219bd2c6e6ce266f052af936c9792770a9a0a788e7514"
}