<p>The <code>short_channel_id</code> points to the funding transaction of the payment channel by the format <code>blockheight</code> x <code>transaction_index</code> x <code>output</code> where the x is used to separate the three values, and the three values are depicted in decimal. This is at least the BOLT 1.1 agreed format for the short channel id. Previously the shortchannel id might have been encoded and depicted differently depending on the implementation. For example, c-lightning used a colon instead of an <code>x</code> to separate these fields.</p>
<p><a href="https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#the-funding_signed-message" rel="nofollow noreferrer">According to BOLT02</a> the <code>channel_id</code> is created as follows:</p>
<blockquote>
<p>This message introduces the <code>channel_id to identify the channel. It's derived from the funding transaction by combining the </code>funding_txid<code>and the</code>funding_output_index<code>, using big-endian exclusive-OR (i.e. </code>funding_output_index` alters the last 2 bytes).</p>
</blockquote>
<p>As the <code>funding_txid</code> is a hash of its fields, this has no relation with the short channel id. So without looking at the blockchain data, I believe it is impossible transfer the <code>short_channel_id</code> to the <code>channel_id</code> or back.</p>

CC BY-SA 4.0
2019-09-19T11:34:41.493Z
Thanks Rene for your answer and pointing to the Bolt. It's still unclear to me. A channel id looks something like: "channel_id":"565048921200525312" (a random node token from a recent snapshot). If you XOR a transaction hash and a 2 byte number how could you get a channel id like that one? It's too long to be a 2 byte number and too short to be a number derived from a 32-byte hash.
István András Seres
CC BY-SA 4.0
2019-02-21T18:06:41.767Z
2022-09-01T18:46:48.647Z
2022-09-01T18:46:48.647Z
Rene Pickhardt
<p>Is there a way to retrieve the Channel_ID knowing the Short_Channel_ID <strong>without using any lightning network explorer</strong>? </p>

<p>How is the Short_Channel_ID calculated? Is this operation reversible? </p>

<lightning-network><lightning-network-daemon><micropaymentchannels><lncli>
How to obtain the Channel_ID from the Short_Channel_ID?
Stefano Angieri
# How to obtain the Channel_ID from the Short_Channel_ID?

(Asked by: username_0 on 2019-02-21)

Is there a way to retrieve the Channel\_ID knowing the Short\_Channel\_ID **without using any lightning network explorer**?

How is the Short\_Channel\_ID calculated? Is this operation reversible?

**Tags:** lightning-network, lightning-network-daemon, micropaymentchannels, lncli


---

## 1 answers

### Answer by username_1 on 2019-02-21. Score: 6 | Accepted answer

The `short_channel_id` points to the funding transaction of the payment channel by the format `blockheight` x `transaction_index` x `output` where the x is used to separate the three values, and the three values are depicted in decimal. This is at least the BOLT 1.1 agreed format for the short channel id. Previously the shortchannel id might have been encoded and depicted differently depending on the implementation. For example, c-lightning used a colon instead of an `x` to separate these fields.

[According to BOLT02](https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#the-funding_signed-message) the `channel_id` is created as follows:

> This message introduces the `channel_id to identify the channel. It's derived from the funding transaction by combining the` funding\_txid`and the`funding\_output\_index`, using big-endian exclusive-OR (i.e.` funding\_output\_index` alters the last 2 bytes).

As the `funding_txid` is a hash of its fields, this has no relation with the short channel id. So without looking at the blockchain data, I believe it is impossible transfer the `short_channel_id` to the `channel_id` or back.

> **Comments:**
> **username_2**: Thanks username_1 for your answer and pointing to the Bolt. It's still unclear to me. A channel id looks something like: "channel_id":"565048921200525312" (a random node token from a recent snapshot). If you XOR a transaction hash and a 2 byte number how could you get a channel id like that one? It's too long to be a 2 byte number and too short to be a number derived from a 32-byte hash.  

---

