<p>The nodes are listed in lexicographical order after compressed DER encoding. It is not possible to tell from the public information about a channel who requested to open it.</p>

<p>The ordering is required so that signature verification of a <code>channel_announcement</code> message always passes. If intermediate nodes were able to rearrange the order of information within the message, it would fail verification even though the information is correct.</p>

<p>Additionally, the numerical ordering is used for <code>channel_update</code> messages, as a single bit is used to denote whether the update applies to node1 or node2.</p>

CC BY-SA 4.0
2019-11-28T20:27:07.643Z
One could look at the funding TX and see if Bitcoins where spent from a channel that was previously owned by one of the nodes. This would be a rather strong hint. But not directly what the question asked
Rene Pickhardt
CC BY-SA 4.0
2019-11-28T21:13:24.267Z
That's true, but this would also require you to collect and archive historical channel data too. Regular node software should garbage collect such information as soon as they're confirmed spent. I'm sure the spies are already collecting everything.
Mark H
CC BY-SA 4.0
2019-11-28T16:43:24.747Z
2019-11-28T16:49:20.707Z
2019-11-28T16:49:20.707Z
Mark H
<p>LN clients can export their view of the network as a JSON file. For instance, in a file obtained from LND, a channel (edge) is described by this structure:</p>

<pre><code>{
    "channel_id": "555479871492063233",
    "chan_point": "dbd46c11d740d7554454d2aad0520e18eedbc9c5e282d21dd065f275cbbe8380:1",
    "last_update": 1540396105,
    "node1_pub": "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e",
    "node2_pub": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
    "capacity": "300000",
    "node1_policy": {
        "time_lock_delta": 14,
        "min_htlc": "0",
        "fee_base_msat": "546000",
        "fee_rate_milli_msat": "10",
        "disabled": false
    },
    "node2_policy": {
        "time_lock_delta": 14,
        "min_htlc": "0",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "10",
        "disabled": true
    }
}
</code></pre>

<p>Does node order have a meaning here? In other words, is <code>node1_pub</code> the one who initially opened the channel?</p>

<lightning-network>
Does node order have meaning in a JSON describing the Lightning network graph?
Sergei Tikhomirov
# Does node order have meaning in a JSON describing the Lightning network graph?

(Asked by: username_0 on 2019-11-28)

LN clients can export their view of the network as a JSON file. For instance, in a file obtained from LND, a channel (edge) is described by this structure:
{
    "channel_id": "555479871492063233",
    "chan_point": "dbd46c11d740d7554454d2aad0520e18eedbc9c5e282d21dd065f275cbbe8380:1",
    "last_update": 1540396105,
    "node1_pub": "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e",
    "node2_pub": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
    "capacity": "300000",
    "node1_policy": {
        "time_lock_delta": 14,
        "min_htlc": "0",
        "fee_base_msat": "546000",
        "fee_rate_milli_msat": "10",
        "disabled": false
    },
    "node2_policy": {
        "time_lock_delta": 14,
        "min_htlc": "0",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "10",
        "disabled": true
    }
}

Does node order have a meaning here? In other words, is node1_pub the one who initially opened the channel?

**Tags:** lightning-network


---

## 1 answers

### Answer by username_1 on 2019-11-28. Score: 2 | Accepted answer

The nodes are listed in lexicographical order after compressed DER encoding. It is not possible to tell from the public information about a channel who requested to open it.

The ordering is required so that signature verification of a `channel_announcement` message always passes. If intermediate nodes were able to rearrange the order of information within the message, it would fail verification even though the information is correct.

Additionally, the numerical ordering is used for `channel_update` messages, as a single bit is used to denote whether the update applies to node1 or node2.

> **Comments:**
> **username_2**: One could look at the funding TX and see if Bitcoins where spent from a channel that was previously owned by one of the nodes. This would be a rather strong hint. But not directly what the question asked  
> **username_1**: That's true, but this would also require you to collect and archive historical channel data too. Regular node software should garbage collect such information as soon as they're confirmed spent. I'm sure the spies are already collecting everything.  

---

