Oversize preimage attack.



Summary:

The context describes the process of redeeming a preimage by dropping it to the blockchain and sending it directly to a miner. However, a node attempting to use that preimage would create a non-standard transaction that may not propagate. This is where Segwit's witness program validation logic comes into play, which ensures that each element of the passed witness stack is less-than-or-equal-to the maximum script element size of 520 bytes. This check is enforced before execution itself, effectively enforcing a ceiling on the pre-image size. The writer of the post notes that they have also recently made a similar observation resulting in a modification to their scripts.


Updated on: 2023-05-18T16:46:24.588084+00:00