1

Quoting Bitcoin wiki:

A transaction is valid if nothing in the combined script triggers failure and the top stack item is true (non-zero).

However, P2WPKH and P2WSH scriptPubkeys are two data pushes of witness versions and witness programs with empty scriptsigs spending them. From a pre-segwit client perspective, stack is ending with data pushes which are non-true? If so how do legacy clients evaluate segwit spends true?

1 Answer 1

1

In the Bitcoin scripting system, anything that is not explicitly OP_FALSE (0) is implicitly true. Because the top stack elements is not 0, it will be evaluated as true.

2
  • "The top stack item true" is just a relay policy then?
    – brq
    Mar 20 at 19:37
  • 1
    No, it is a consensus rule.
    – Andrew Chow
    Mar 20 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.