Gossip builds an incomplete map
BOLT 7 defines signed node, channel and directional update messages. Updates advertise status, base and proportional fees, HTLC bounds and CLTV delta, from which a sender builds a local network graph.
Funding capacity is visible on chain, but its current division is not public. Private channels are absent from the global graph. The map therefore shows possible edges rather than a guarantee for a particular amount.
The route is calculated backwards
Starting from the requested amount and final expiry, the sender adds each next node's fee and CLTV delta while moving backwards. The first HTLC therefore carries a larger amount and later expiry than the last.
The cheapest route need not be best. Wallet algorithms can weigh success probability, hop count, time exposure, channel bounds and previous attempts. Route choice is wallet policy, not one Lightning consensus algorithm.
Onion routing reveals one step
BOLT 4 uses a layered Sphinx packet. Each hop removes its layer, learns the outgoing channel, amount and expiry, and forwards a transformed packet. It does not automatically see the entire route or other hops' instructions.
This is not perfect anonymity. The first hop sees its sending peer, the last hop points toward the recipient, and timing, amounts, topology or controlled nodes can create clues. Repeated failed attempts also disclose information.
Failure is part of route finding
A payment can fail because of directional liquidity, stale updates, an offline node, HTLC limits, fees or timing. An encrypted failure lets the sender update its local view and try another route without settling only part of the payment.
A wallet may split a payment across paths, but each part still needs a viable route and compatible recipient. Better liquidity and retries improve probability, not certainty, so a truthful interface never promises an exact result or time.