def is_public_key(hex_data):
    """Given a bytes string, returns whether its is probably a bitcoin
    public key or not. It doesn't actually ensures that the data is a valid
    public key, justs that it looks like one
    """
    if type(hex_data) != bytes:
        return False

    # Uncompressed public key
    if len(hex_data) == 65 and int(hex_data[0]) == 4:
        return True

    # Compressed public key
    if len(hex_data) == 33 and int(hex_data[0]) in [2, 3]:
        return True

    return False