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?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityThe 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 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_txidand 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.