4

To look up information of a channel on 1ML.com, I wonder how the channel_id is built.

Reading this question and the corresponding BOLT02, 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, 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?
Theova
  • 43
  • 3

1 Answers1

2

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

Rene Pickhardt
  • 11,670
  • 8
  • 35
  • 1
    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 Jan 25 '22 at 13:28
  • Thank you both for the answer. Indeed, 1ML.com uses the "LND sid format". – Theova Jan 25 '22 at 14:53