<p>The <code>channel_id</code> in 1ml seems to be the lnd encoding of the <code>short_channel_id</code>. Note that the short Channel ID is just 3 bytes of blockheight, 3 bytes of transaction index within the and 2 bytes for the output index within the transaction. While BOLTs recommend to serialize this as HEIGHTxINDEXxOUTPUT lnd just concatenated those 8 bytes and displays them as a single large integer. I guess since lightning explorer tend to take over the APIs of implementations we have this confusion</p>

CC BY-SA 4.0
2022-01-25T13:28:00.113Z
More details on how to convert between lnd and say c-lightning short channel ID: https://bitcoin.stackexchange.com/questions/78029/how-to-convert-channel-id-from-c-lightning-to-lnd
Michael Folkson
CC BY-SA 4.0
2022-01-25T14:53:22.197Z
Thank you both for the answer. Indeed, 1ML.com uses the "LND sid format".
Theova
CC BY-SA 4.0
2022-01-25T13:21:10.710Z
2022-01-25T13:37:06.297Z
2022-01-25T13:37:06.297Z
Rene Pickhardt
<p>To look up information of a channel on <a href="https://1ML.com" rel="nofollow noreferrer">1ML.com</a>, I wonder how the <code>channel_id</code> is built.</p>
<p>Reading <a href="https://bitcoin.stackexchange.com/questions/84795/how-to-obtain-the-channel-id-from-the-short-channel-id">this question</a> and the <a href="https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message" rel="nofollow noreferrer">corresponding BOLT02</a>, I see that</p>
<pre><code>channel_id = funding_txid XOR funding_output_index
</code></pre>
<p>As the <code>funding_txid</code> is a 32 byte string (e.g. <code>399986f8d47b36d4f21c07de0ce7d422de244ed58a72e6b44d26985fe1e7465c</code>), the <code>channel_id</code> has also 32 bytes.</p>
<p>However, when looking at a <a href="https://1ml.com/channel/617430754733195265" rel="nofollow noreferrer">specific channel at 1ML.com</a>, the <code>channel_id</code> is much shorter (e.g., <code>735416048958177281</code>).</p>
<p>Hence my question is:</p>
<ul>
<li>Is the above definition of the <code>channel_id</code> correct? If so, what is the difference to the one of 1ML.com?</li>
<li>Otherwise: How is the <code>channel_id</code> computed correctly?</li>
</ul>

<lightning-network><channels>
What is the Channel ID in 1ML.com?
Theova
# What is the Channel ID in 1ML.com?

(Asked by: username_0 on 2022-01-25)

To look up information of a channel on [1ML.com](https://1ML.com), I wonder how the `channel_id` is built.

Reading [this question](https://bitcoin.stackexchange.com/questions/84795/how-to-obtain-the-channel-id-from-the-short-channel-id) and the [corresponding BOLT02](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message), I see that

```
channel_id = funding_txid XOR funding_output_index

```

As the `funding_txid` is a 32 byte string (e.g. `399986f8d47b36d4f21c07de0ce7d422de244ed58a72e6b44d26985fe1e7465c`), the `channel_id` has also 32 bytes.

However, when looking at a [specific channel at 1ML.com](https://1ml.com/channel/617430754733195265), the `channel_id` is much shorter (e.g., `735416048958177281`).

Hence my question is:

* Is the above definition of the `channel_id` correct? If so, what is the difference to the one of 1ML.com?
* Otherwise: How is the `channel_id` computed correctly?

**Tags:** lightning-network, channels


---

## 1 answers

### Answer by username_1 on 2022-01-25. Score: 2 | Accepted answer

The `channel_id` in 1ml seems to be the lnd encoding of the `short_channel_id`. Note that the short Channel ID is just 3 bytes of blockheight, 3 bytes of transaction index within the and 2 bytes for the output index within the transaction. While BOLTs recommend to serialize this as HEIGHTxINDEXxOUTPUT lnd just concatenated those 8 bytes and displays them as a single large integer. I guess since lightning explorer tend to take over the APIs of implementations we have this confusion

> **Comments:**
> **username_2**: More details on how to convert between lnd and say c-lightning short channel ID: https://bitcoin.stackexchange.com/questions/78029/how-to-convert-channel-id-from-c-lightning-to-lnd  
> **username_0**: Thank you both for the answer. Indeed, 1ML.com uses the "LND sid format".  

---

