Lightning payments don't go on the blockchain, which is why people assume Lightning is private. It's more private than on-chain Bitcoin in some specific ways and leakier in others, and which one you get depends heavily on how you use it.
A quick refresher on the mechanics. Two parties lock bitcoin into a shared channel with an on-chain transaction. After that, they can update the balance between them as often as they like without touching the chain. A payment to someone you don't have a channel with is routed through other nodes' channels, with each hop forwarding it on. When the channel eventually closes, the final balance settles on-chain.
What's actually hidden
Payments are routed with onion encryption borrowed from the same ideas as Tor's onion routing. The sender picks the whole route and wraps the instructions in layers (the format is called Sphinx). Each routing node peels one layer and learns only the previous hop and the next hop. It doesn't learn, from the packet alone, whether the previous hop was the sender or just another router, or whether the next one is the final recipient.
Individual payments never touch the public ledger. Nobody downloading the blockchain sees that you paid for a coffee, a VPN subscription or a donation. For small everyday payments that's a real improvement over on-chain spending, where every payment reveals your change output and often your balance.
Where it leaks
Several places, and some of them are surprising.
Channel opens and closes are on-chain. Your node's public channels are announced to the whole network through gossip, including the funding transaction they're tied to. So a public routing node links its node ID to specific on-chain coins. If those coins came from a KYC exchange, the node is linked to you. The closing transaction later shows where the balance went.
Invoices are a bigger leak than most people realise. A standard BOLT11 invoice contains the recipient node's public key. If you receive through unannounced (private) channels, the invoice includes route hints that reveal the channel's short ID, which points straight at the funding transaction. Anyone you hand an invoice to can look that up.
The payment hash is the same at every hop. If one entity runs two nodes on the same route, it can see the same hash pass through both and correlate the payment, which partly defeats the onion. A replacement (PTLCs, which use different values per hop) has been discussed for years but isn't deployed on the network as I write this.
Balances can be probed. By sending payments that are designed to fail, an observer can narrow down how much sits on each side of a public channel. Repeated over time, that reveals payment flows between nodes.
Timing and amounts help too. Routing nodes see the amount being forwarded and when. Small networks with few routes make correlation easier.
The wallet you pick matters most
A lot of Lightning use happens in custodial wallets, where a company holds the funds and makes payments for you. The operator sees every payment in plain view, along with your account and probably your IP. Privacy-wise it's a bank account, usually without the legal protections a bank account comes with.
Non-custodial mobile wallets usually rely on a Lightning Service Provider that opens a channel to you. The LSP is your only peer, so it sees every payment you route through it, though the amount of detail it learns about the final destination depends on the wallet's design. Read the privacy section of the wallet's documentation. The honest ones explain exactly what their server learns.
Running your own node with several channels to unrelated peers gives the best privacy, at the cost of real effort: liquidity management, backups, uptime.
BOLT12 and blinded paths
The newer BOLT12 "offers" standard helps with the invoice problem. An offer is a reusable payment code, and it can use blinded paths, where the recipient builds the last part of the route and encrypts it so the payer doesn't learn the recipient's node ID or channels. Core Lightning has supported offers for a while, and support across other implementations and wallets has been spreading. If your wallet supports receiving with blinded paths, use it.
Running a node over Tor
Your node's IP address is part of its gossip announcement unless you hide it. Both main implementations make Tor straightforward. In LND, in lnd.conf:
[Tor]
tor.active=true
tor.v3=true
tor.streamisolation=true
In Core Lightning, in its config file:
proxy=127.0.0.1:9050
always-use-proxy=true
Both can create an onion service for incoming connections through Tor's control port, much like the Bitcoin Core setup in running your own Bitcoin node over Tor. Tor-only nodes do have downsides: payments are a bit slower and some peers prefer clearnet connections for reliability. Plenty of nodes run hybrid mode, with a clearnet address for routing and Tor for everything else, but that obviously publishes an IP.
For on-chain coins that fund your channels, the usual UTXO care applies. Opening a channel with coins straight from an identity-verified exchange ties your node to your name before you've made a single payment.