{"id":17278283,"url":"https://github.com/kulpreet/lightning-network-graph-analysis","last_synced_at":"2025-10-30T01:19:05.795Z","repository":{"id":146435033,"uuid":"144632449","full_name":"kulpreet/lightning-network-graph-analysis","owner":"kulpreet","description":"Analyse the lightning network graph ","archived":false,"fork":false,"pushed_at":"2019-11-14T17:31:07.000Z","size":4185,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T22:42:40.455Z","etag":null,"topics":["analysis","boost-graph-library","lightning-network"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kulpreet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-13T20:50:02.000Z","updated_at":"2022-05-23T22:50:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"a73d59cc-2fdb-40a1-83e1-b86a14f4044c","html_url":"https://github.com/kulpreet/lightning-network-graph-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Flightning-network-graph-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Flightning-network-graph-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Flightning-network-graph-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Flightning-network-graph-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kulpreet","download_url":"https://codeload.github.com/kulpreet/lightning-network-graph-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852186,"owners_count":21171843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","boost-graph-library","lightning-network"],"created_at":"2024-10-15T09:11:17.251Z","updated_at":"2025-10-30T01:19:05.732Z","avatar_url":"https://github.com/kulpreet.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightning Network Graph Analysis\n\nAnalyse the lightning network graph to find articulation points.\n\nThis repo builds a binary that can take a GraphML representation of\nlightning network graph to generate data points about node centrality,\nnumber of articulation points and LN nodes sorted by centrality. These\ndata points are then accessed by a front end to plot various\ncharts. The front end is source code is at\nhttps://github.com/kulpreet/ln-metrics\n\n\nThe binary generated here accepts LN graph represented as\nGraphML. https://github.com/lightningnetwork/lnd has a cli called\nlncli, that can dump the current LN graph as a json file using `lncli\ndescribegraph`.\n\nThe json from `describegraph` is piped through\n[lightning-network-graphxml](https://github.com/kulpreet/lightning-network-graphxml)\nbefore being processed by the binary generated by this\nrepo. `lightning-network-graphxml` converts the json from\n`describegraph` into GraphML syntax that can be then imported into\nBoost Graph Library.\n\n## Metrics\n\nFor now, we compute centrality, number of biconnected components and\nthe number of articulation points. We also output a list of all LN\nnodes ordered by node centrality.\n\nResults are meant to be published on a daily metrics page. This page\nused to be up on lnmetric.opdup.com.\n\n## Requirements\n\nBoost Graph Library, version 1.62.0 or higher\n\n## Running\n\n`make`\n\n`./readgraph --help`\n\n`./readgraph --input [inputfile.xml] --outdir [dirname]`\n\nThe repo includes some dumps from lncli describe graph in the `data`\ndirectory. So you can try it out by:\n\n`./readgraph --input data/20180824_120001.xml --outdir /tmp/`\n\nThis will generate a bunch of csv files:\n\n| File                                | CSV Header                          | Notes                                                                                                                          |\n|:------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|\n| /tmp/20180824_120001.all_ap.csv     | alias,degree,pub_key                | List all nodes by degree                                                                                                       |\n| /tmp/20180824_120001.centrality.csv | alias,centrality,pub_key            | Lists all nodes in decreasing order of node centrality                                                                         |\n| /tmp/20180824_120001.key_ap.csv     | alias,num components,degree,pub_key | Lists top nodes that are the articulation points in the graph. Also shows how many components each articulation point connects |\n| /tmp/all_ap_stats.csv               | --                                  | Lists number of components and the number of articulation points in the graph by timestamp                                     |\n| /tmp/cpd.csv                        | --                                  | Lists the LN graph's Central Point Dominance by timestamp                                                                      |\n| /tmp/key_ap_stats.csv               | --                                  | Filters all_ap_stats by including only those nodes that connect two or more components with at least 1 node in each            |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulpreet%2Flightning-network-graph-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkulpreet%2Flightning-network-graph-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulpreet%2Flightning-network-graph-analysis/lists"}