Why Nostr? What is Njump?
2023-06-07 15:14:00
in reply to

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/3737

Just 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
Author Public Key
npub10etkvm8l0jr0jsgdx02dxnhnu5g989dnca90guj5rklwkaplnh3sgjc727