docs: @Override
      public ScriptType getOutputScriptType() {
          int version = getWitnessVersion();
          checkState(version == 0);
          int programLength = getWitnessProgram().length;
          if (programLength == WITNESS_PROGRAM_LENGTH_PKH)
              return ScriptType.P2WPKH;
          if (programLength == WITNESS_PROGRAM_LENGTH_SH)
              return ScriptType.P2WSH;
          throw new IllegalStateException("Cannot happen.");
      }