<p>I'd argue it is possible to get some estimate, when doing a time series analyses of 2-to-2 multisig spendings. Number of occurrences (or gowth rate) likely changed, when lightning got live. 
Question is how accurate such an estimate can be.</p>

CC BY-SA 4.0
2019-10-02T20:04:53.073Z
2019-10-02T20:04:53.073Z
Simon
<p>They can only be detected when force closed and there are still pending htlcs otherwise they look like a spend from a 2-2 multisig wallet. I've been told some people try to do chain analysis and machine learning to predict private channels. I highly doubt that this is reasonably possible.</p>

<p>Although there is one thing to consider. If a node has public and private channels the funds get mixed. Implementations currently do not do separate bookkeeping of those outputs which is a privacy issue and an attack vector for what you want. However if a new ln node is set up and it only has private channels it will be hard to detect those on chain (unless the Chanel partners later reuses / mixes the outputs with some fire public channels. </p>

CC BY-SA 4.0
2019-09-28T04:36:40.047Z
can't companies do some analysis based on lightning invoices which contain a path to the private channel? Just to give you an example, let us say I own a node with provider A and you provide me an invoice which contains the private channel info I would need to include in the onion. My provider detects that and uses it to enhance the data of the known private channels.
Ugam Kamat
CC BY-SA 4.0
2019-09-28T06:11:22.220Z
A private channel does not need to exist on chain. It is not even possible to prove that a private channel's `short_channel_id` points to a correct channel because you don't have access to the funding public keys in order to recreate the redeem script, and there are no signatures to prove that the transaction referred to by the `short_channel_id` is indeed owned by the recipient and the forwarding node specified in the BOLT11 invoice. It is best to assume that the `short_channel_id` specified in an invoice is just some arbitrary identifier which tells the last hop how to forward the payment.
Mark H
CC BY-SA 4.0
2019-09-28T06:45:32.290Z
@MarkH that's a very valid point.
Ugam Kamat
CC BY-SA 4.0
2019-09-27T22:52:02.830Z
2019-09-27T22:52:02.830Z
Rene Pickhardt
<p>I know it's possible to get number of public Lightning channels from Lightning Network gossip and some implementations offer network graph and it can be queried. But it's not possible to see private non-routing channels there.
<br/>Can channel opening transactions be identified checking the blockchain? if not, what's the best way to estimate?
<br/>This is more of a theoretical query to understand the structure of messages used in lightning network channel opening bitcoin transactions.</p>

<lightning-network><ln-opening-channels>
Is it possible to watch the chain to count the number of Lightning channels?
pseudozach
# Is it possible to watch the chain to count the number of Lightning channels?

(Asked by: username_0 on 2019-09-27)

I know it's possible to get number of public Lightning channels from Lightning Network gossip and some implementations offer network graph and it can be queried. But it's not possible to see private non-routing channels there.
  
Can channel opening transactions be identified checking the blockchain? if not, what's the best way to estimate?
  
This is more of a theoretical query to understand the structure of messages used in lightning network channel opening bitcoin transactions.

**Tags:** lightning-network, ln-opening-channels


---

## 2 answers

### Answer by username_2 on 2019-09-27. Score: 3 | Accepted answer

They can only be detected when force closed and there are still pending htlcs otherwise they look like a spend from a 2-2 multisig wallet. I've been told some people try to do chain analysis and machine learning to predict private channels. I highly doubt that this is reasonably possible.

Although there is one thing to consider. If a node has public and private channels the funds get mixed. Implementations currently do not do separate bookkeeping of those outputs which is a privacy issue and an attack vector for what you want. However if a new ln node is set up and it only has private channels it will be hard to detect those on chain (unless the Chanel partners later reuses / mixes the outputs with some fire public channels.

> **Comments:**
> **username_3**: can't companies do some analysis based on lightning invoices which contain a path to the private channel? Just to give you an example, let us say I own a node with provider A and you provide me an invoice which contains the private channel info I would need to include in the onion. My provider detects that and uses it to enhance the data of the known private channels.  
> **username_4**: A private channel does not need to exist on chain. It is not even possible to prove that a private channel's `short_channel_id` points to a correct channel because you don't have access to the funding public keys in order to recreate the redeem script, and there are no signatures to prove that the transaction referred to by the `short_channel_id` is indeed owned by the recipient and the forwarding node specified in the BOLT11 invoice. It is best to assume that the `short_channel_id` specified in an invoice is just some arbitrary identifier which tells the last hop how to forward the payment.  
> **username_3**: @username_4 that's a very valid point.  

---

### Answer by username_1 on 2019-10-02. Score: 0

I'd argue it is possible to get some estimate, when doing a time series analyses of 2-to-2 multisig spendings. Number of occurrences (or gowth rate) likely changed, when lightning got live.
Question is how accurate such an estimate can be.


---

