{"id":13499288,"url":"https://gitlab.com/inbitcoin/lighter","last_synced_at":"2025-03-29T04:31:01.589Z","repository":{"id":56752145,"uuid":"9764894","full_name":"inbitcoin/lighter","owner":"inbitcoin","description":"Lighter: enabling the 3rd layer with consensus on the 2nd","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":31,"open_issues_count":1,"forks_count":4,"subscribers_count":null,"default_branch":"develop","last_synced_at":"2024-10-31T17:39:23.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":null,"metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-04T19:15:34.870Z","updated_at":"2020-08-20T09:46:52.572Z","dependencies_parsed_at":"2022-09-07T19:51:22.122Z","dependency_job_id":null,"html_url":"https://gitlab.com/inbitcoin/lighter","commit_stats":null,"previous_names":[],"tags_count":8,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/inbitcoin%2Flighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/inbitcoin%2Flighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/inbitcoin%2Flighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/inbitcoin%2Flighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/inbitcoin","download_url":"https://gitlab.com/inbitcoin/lighter/-/archive/develop/lighter-develop.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4518364,"owners_count":6900,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":[],"created_at":"2024-07-31T22:00:31.890Z","updated_at":"2025-03-29T04:31:00.917Z","avatar_url":null,"language":null,"readme":"# Lighter - enabling the 3rd layer with consensus on the 2nd\n\nLighter is a Lightning Network node wrapper.\n\nIt provides a uniform interface to the main LN implementations,\nallowing client code to be agnostic on which node is running under the hood\nand therefore focus on functionality.\n\nThis means that the underlying LN node implementation can be\nchanged anytime, affecting client code as little as possible.\nEach underlying implementation can, and indeed does, implement some features\nwith \"little\" differences. Lighter strives to keep a uniform interface\nat all times, drawing a common line where implementations differ\nand always choosing to stay BOLT-compliant as much as possible.\n\nLighter was initially born to handle this complexity.\n\nThe purpose of the project is to allow developers of LN-based front-end\napplications to code in peace without having to loyalize to a single\nimplementation.\nAs a bonus, this helps to keep the competitiveness among LN implementers high.\n\nLighter - Where all the weight of the world is just a little bit lighter,\non our shoulders.\n\nThis is an open project under the GNU AGPLv3 license.\n\n\n### Implementations :zap:\n\nCurrently, it supports the main LN implementations \u003csup\u003e1\u003c/sup\u003e:\n\n- [c-lightning](https://github.com/ElementsProject/lightning)\n  (v0.8.2.1 \u003csup\u003e2\u003c/sup\u003e) by Blockstream\n- [eclair](https://github.com/ACINQ/eclair) (v0.4) by Acinq\n- [electrum](https://github.com/spesmilo/electrum) (unreleased \u003csup\u003e3\u003c/sup\u003e)\n  by Thomas Voegtlin\n- [lnd](https://github.com/lightningnetwork/lnd) (v0.10.1-beta) by Lightning\n  Labs\n\n### How it works\n\nLighter exposes a gRPC client interface, which uses protocol buffers,\nGoogle’s open source mechanismn for serializing structured data.\nThis enables generation of efficient data access classes in 11 languages from\nthe proto definition using `protoc`, making it possible for polyglot services\nto connect easily.\n\nFrom the Lighter user's point of view, implementation-specific configuration\nvariables and software dependencies are the only differences between the\nvarious supported implementations.\n\nTo secure Lighter we use macaroons as authorization mechanism.\nSee [Security](/doc/security.md) to get more information on how Lighter is\nsecured.\n\n\n#### Notes\n1. _at the moment Lighter supports only the specified versions of the LN nodes\n  (not provided within this software)_\n2. _`c-lightning`'s `fundchannel` and `pay` plugins are required_\n3. _`electrum` might be unstable, you should not use it on mainnet_\n\n\n## Requirements\n\nFirst of all, Lighter will need to connect to an already existing and\nsupported LN node, which determines the main configuration parameter,\n`implementation`.\n\nBefore it's run, Lighter needs to be configured according to the chosen\nimplementation.\n\nIn order to run Lighter some software dependencies have to be met.\nSome requirements are determined by the configured implementation.\n\nLighter will check at runtime for the availability of the required\ndependencies, based on its configuration.\n\n\n### System dependencies\n\n- Linux \u003csup\u003e1\u003c/sup\u003e or macOS \u003csup\u003e2\u003c/sup\u003e\n(_Windows may work, but is not supported_)\n- Python 3.5+ \u003csup\u003e3\u003c/sup\u003e\n- [optional] libscrypt 1.8+ (_faster start_)\n\n### Resources\n\nResource demand should be pretty low.\nMore precise recommendations will be available in the future\nas gathered real-world usage data grows.\n\n- CPU: 1 core is enough\n- RAM: ~64MB when idling\n- disk: docker image weights ~170MB\n\n#### Notes\n\n1. _tested on Debian 10 Buster_\n2. _tested on macOS 10.13 High Sierra_\n3. _tested with python3.7_\n\n\n## Building\n\n#### Building locally\n\nIn order to install Lighter, run\n```bash\n$ pip install .\n```\nUsage of `virtualenv` is recommended.\n\n#### Building docker image\n\nTo build a docker image, run:\n```bash\n$ ./unix_helper.sh docker_build\n```\n\n#### Notes\n\n1. _supported architectures: amd64, arm32v7 (may require additional\n    dependencies)_\n\n\n## Configuring\n\nLighter needs to be configured before the execution of any other operation\n(`build` excluded).\nSee [Configuring](/doc/configuring.md) for instructions on how to configure\nLighter.\n\n\n## Securing\n\nIn order to run Lighter, you need to configure the necessary secrets and set a\npassword to manage and protect them.\nTo do so, run:\n```bash\n$ lighter-secure\n```\n\nThis can be run interactively or not.\nIt will create or update Lighter's database and macaroon files in their\nconfigured path.\nAll secrets will be stored in encrypted form (in the database) and\nmade available to Lighter only at runtime, after it has been unlocked.\n\nRead [Security](/doc/security.md) for more details.\n\n\n## Running\n\nTo start Lighter's gRPC server, run:\n\n```bash\n$ lighter\n```\n\n\n## Using\n\nLighter can be operated through its gRPC client interface.\nA CLI with bash and zsh completion support is also available for maintenance\nand testing.\n\nThe `lighter.proto` defines the structure for the data to be serialized\nand can be found [here](/lighter/lighter.proto).\ngRPC client libraries for supported languages can be generated from this file.\n[Generation instructions](/doc/client_libraries.md) are available.\n\nProtocol buffer data is structured as messages (and enums), where each message\ncan contain a series of name-value pairs called fields.\nSeveral services can be defined in the proto file, each one\nincluding different methods.\nOur proto file contains two services: _Unlocker_ and _Lightning_.\nThe former unlocks Lighter.\nThe latter only starts after it is unlocked and provides all the supported LN\nnode operations \u003csup\u003e1\u003c/sup\u003e.\n\nA set of **documentation for the gRPC APIs**, along with example code in\nPython, Go, Node.js and Bash can be found at our\n[lighter-doc API page](https://lighter-doc.inbitcoin.it).\n\nTo unlock Lighter and have a full list of available commands of\nLighter's **CLI**, run:\n```bash\n$ cliter unlocklighter\n$ cliter --help\n```\nTo activate completion support, first locate completion scripts,\nwhich are in `share/doc/lighter_bitcoin/examples/`, relative to python\ninstallation path.\nPossible installation paths: `/venv/path/`, `~/.local/`, `/usr/local/`.\n\nThen, you can add completion support by adding the appropriate line to your\nshell's RC file:\n- `~/.bashrc`: `. /path/to/complete-cliter-bash.sh`\n- `~/.zshrc`: `. /path/to/complete-cliter-zsh.sh`\n\nTo **pair** Lighter with a client, run:\n```bash\n$ lighter-pairing\n```\nThis will create two URIs to allow easy retrieval of\nconnection data (`lighterconnect://\u003chost\u003e:\u003cport\u003e[?cert=\u003cPEM certificate\u003e]`)\nand macaroon (`macaroon:\u003cchosen macaroon\u003e`).\nAs output format, it will let you choose between QR codes and text.\n\n### Clients with pairing support\n\n- [Globular](https://gitlab.com/inbitcoin/globular), Android wallet\n\n#### Notes\n\n1. _some operations may not be supported for some implementations, see\n    [Supported APIs](/doc/supported_apis.md) for details_\n2. _please note there are\n   [options](https://developers.google.com/protocol-buffers/docs/proto3#options)\n   that can be added to the proto file_\n3. _for more information, check the\n   [proto3](https://developers.google.com/protocol-buffers/docs/proto3)\n   language guide and the developer documentation for\n   [gRPC](https://grpc.io/docs/)_\n\n\n## Contributing\n\nAll contributions to Lighter are welcome.\u003cbr\u003e\nWe will strive to keep Lighter updated but help is appreciated,\nespecially with keeping support for underlying implementations updated,\nsince they are still in the early stages and therefore significant changes\nmay occur.\n\nTo learn more on how and where to contribute, continue reading\n[here](/CONTRIBUTING.md).\n","funding_links":[],"categories":["Developer Resources"],"sub_categories":["Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Finbitcoin%2Flighter","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2Finbitcoin%2Flighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Finbitcoin%2Flighter/lists"}