def script_type_default(witness_type=None, multisig=False, locking_script=False
    ):
    """
    Determine default script type for provided witness type and key type combination used in this library.

    :param witness_type: Type of wallet: standard or segwit
    :type witness_type: str
    :param multisig: Multisig key or not, default is False
    :type multisig: bool
    :param locking_script: Limit search to locking_script. Specify False for locking scripts and True
    for unlocking scripts
    :type locking_script: bool
    :return str: Default script type
    """
    if not witness_type:
        return None
    if witness_type == 'legacy' and not multisig:
        return 'p2pkh' if locking_script else 'sig_pubkey'
    elif witness_type == 'legacy' and multisig:
        return 'p2sh' if locking_script else 'p2sh_multisig'
    elif witness_type == 'segwit' and not multisig:
        return 'p2wpkh' if locking_script else 'sig_pubkey'
    elif witness_type == 'segwit' and multisig:
        return 'p2wsh' if locking_script else 'p2sh_multisig'
    elif witness_type == 'p2sh-segwit' and not multisig:
        return 'p2sh' if locking_script else 'p2sh_p2wpkh'
    elif witness_type == 'p2sh-segwit' and multisig:
        return 'p2sh' if locking_script else 'p2sh_p2wsh'
    else:
        raise ValueError(
            'Wallet and key type combination not supported: %s / %s' % (
            witness_type, multisig))
