Mapping the Bitcoin Lightning Network: Why not use the Blockchain? Researching about the available routing algorithms for the Bitcoin Lightning Network, I have been reading the Flare whitepaper, and this idea/question came to mind:

Since all payment channels are created with a blockchain transaction, and Flare itself checks the Blockchain to see if a channel is live or has been closed, wouldn't it be possible to parse the blockchain for all live payment channels to create a complete, up-to-date map of the Network so that you do not have to use flooding or beacons on the Network itself?

Do/can on-chain transactions that create the payment channel store nodes' ids? If yes, then this seems a trivial and maybe effective tactic.
wouldn't it be possible to parse the blockchain for all live payment channels to create a complete, up-to-date map of the Network so that you do not have to use flooding or beacons on the Network itself?


No because it is not possible to know which transactions are related to a payment channel opening, and channel closing transactions can be ambiguous. The funding transaction sends money to a 2-of-2 multisig, but these are in outputs as a P2WSH or P2SH-P2WSH script which means that the redeemScript that specifies the 2-of-2 are not known. You cannot assume that any P2WSH or P2SH (because a P2SH-P2WSH looks just like a P2SH) is for funding a payment channel.

For closing transactions, if there is a cooperative close, then the spend of the funding transaction's outputs will look just like a normal 2-of-2 multisig, which is not indicative of a payment channel. In a unliateral close, you would be able to identify the unilateral close only after the person closing the channel spends their output.