Script Abuse Potential?



Summary:

In a discussion on the bitcoin-dev mailing list, a potential attack vector was brought up involving a pk_script that includes multiple "op_2dup" commands. Steve Davis asked if this could be a problem and Johnson Lau replied that there could only be a maximum of 201 opcodes in a script, which means there could be a maximum of 198 "op_2dup" commands in this case. The MAX_SCRIPT_ELEMENT_SIZE is 520 Bytes, so the worst that could happen would be around 10 MB. However, Jeremy Rubin noted that a more concerning issue would be the "op_dup/op_cat style bug," which can cause out of memory errors. Rubin also mentioned that the elements alpha proposal to reenable a limited op_cat to 520 bytes is somewhat controversial. Another participant in the discussion mentioned that the original OP_CAT was disabled because it was not specified properly.


Updated on: 2023-06-11T21:02:04.880434+00:00