def get_pubkey(point, compressed=True):
    """
    Get the Serialized pubkey from an ecdsa Point object.
    point = ecdsa Point object
    compressed = Boolean whether or not you want the pubkey compressed.
    """
    if compressed:
        return ("0" + str(2 + (1 & point.y())) + ("%064x" % point.x())).decode('hex')
    else:
        return ("04" + ("%064x" % point.x()) + ("%064x" % point.y())).decode('hex')