def parse(utxo, offset=0):
    """ Parses a given serialized UTXO to extract a base-128 varint.
    :param utxo: Serialized UTXO from which the varint will be parsed.
    :type utxo: hex str
    :param offset: Offset where the beginning of the varint if located in the UTXO.
    :type offset: int
    :return: The extracted varint, and the offset of the byte located right after it.
    :rtype: hex str, int
    """

    i = 0
    ret = 0

    go = True
    while go:
        next_byte = ord(utxo[i])
        go = bool(next_byte & 0x80)
        ret = (ret << 7 | next_byte & 0x7f) + go

        i += 1

    return ret,i