def parse_b128(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
    """

    data = utxo[offset : offset + 2]
    offset += 2
    more_bytes = (
        int(data, 16) & 0x80
    )  # MSB b128 Varints have set the bit 128 for every byte but the last one,
    # indicating that there is an additional byte following the one being analyzed. If bit 128 of the byte being read is
    # not set, we are analyzing the last byte, otherwise, we should continue reading.
    while more_bytes:
        data += utxo[offset : offset + 2]
        more_bytes = int(utxo[offset : offset + 2], 16) & 0x80
        offset += 2

    return data, offset