public static boolean isP2WSH(Script script) {
        if (!isP2WH(script))
            return false;
        List<ScriptChunk> chunks = script.chunks;
        if (!chunks.get(0).equalsOpCode(OP_0))
            return false;
        byte[] chunk1data = chunks.get(1).data;
        return chunk1data != null && chunk1data.length == SegwitAddress.WITNESS_PROGRAM_LENGTH_SH;
    }
public static boolean isP2WSH ( Script script ) { if ( ! isP2WH ( script ) ) return false ; List < ScriptChunk > chunks = script . chunks ; if ( ! chunks . get ( 0 ) . equalsOpCode ( OP_0 ) ) return false ; byte [ ] chunk1data = chunks . get ( 1 ) . data ; return chunk1data != null && chunk1data . length == SegwitAddress . WITNESS_PROGRAM_LENGTH_SH ; }
Returns true if this script is of the form {@code OP_0 <hash>} and hash is 32 bytes long. This can only be a P2WSH
scriptPubKey. This script type was introduced with segwit.