import binascii


def decode_pubkey(serialized_pubkey, encoding_format='hex'):
    """Decodes a provided public key into the requested format

    Args:
        serialized_pubkey (str): The encoded public key
        encoding_format (str): The format of the provided encoded
            public key. Must be 'hex'.

    Returns:
        bytes: The native bytes representation of the public key
    """
    if encoding_format == 'hex':
        serialized_pubkey = binascii.unhexlify(serialized_pubkey)
    else:
        raise ValueError("Unrecognized pubkey encoding format")

    return serialized_pubkey