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?

1 Answer 1

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

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.