lightning-dev

OP_CAT was Re: Continuing the discussion about noinput / anyprevout

OP_CAT was Re: Continuing the discussion about noinput / anyprevout

Original Postby Peter Todd

Posted on: October 5, 2019 15:49 UTC

In an email exchange on October 4, 2019, Jeremy questioned the weakness of midstate attacks on a script under user control.

He suggested that using a correctly constructed midstate such as hashing all elements on the stack and comparing to a known hash could prevent such attacks. However, Peter Todd raised the question of the actual advantage over using OP_CAT. Given the size limit for OP_CAT output is comparable to SHA256STREAM, it may be just as easy to use OP_CAT followed by a single OP_SHA256. The email exchange was part of a discussion on petertodd.org.