def hex2pub(pub_hex: str) -> PublicKey:
    """
    Convert ethereum hex to EllipticCurvePublicKey
    The hex should be 65 bytes, but ethereum public key only has 64 bytes
    So have to add \x04

    Parameters
    ----------
    pub_hex: str
        Ethereum public key hex string

    Returns
    -------
    coincurve.PublicKey
        A secp256k1 public key calculated from ethereum public key hex string

    >>> data = b'0'*32
    >>> data_hash = sha256(data)
    >>> eth_prv = generate_eth_key()
    >>> cc_prv = hex2prv(eth_prv.to_hex())
    >>> eth_prv.sign_msg_hash(data_hash).to_bytes() == cc_prv.sign_recoverable(data)
    True
    >>> pubhex = eth_prv.public_key.to_hex()
    >>> computed_pub = hex2pub(pubhex)
    >>> computed_pub == cc_prv.public_key
    True
    """
    uncompressed = decode_hex(pub_hex)
    if len(uncompressed) == 64:
        uncompressed = b"\x04" + uncompressed

    return PublicKey(uncompressed)