PHPackages                             php-lightning/lnaddress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-lightning/lnaddress

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-lightning/lnaddress
=======================

0.9.0(3w ago)23523[10 issues](https://github.com/php-lightning/lnaddress/issues)MITPHPPHP &gt;=8.2CI passing

Since Mar 31Pushed 2w ago3 watchersCompare

[ Source](https://github.com/php-lightning/lnaddress)[ Packagist](https://packagist.org/packages/php-lightning/lnaddress)[ Fund](https://chemaclass.com/sponsor)[ RSS](/packages/php-lightning-lnaddress/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (9)Dependencies (21)Versions (9)Used By (0)

PHP Lightning Address
=====================

[](#php-lightning-address)

 [ ![GitHub Build Status](https://github.com/php-lightning/lnaddress/workflows/CI/badge.svg) ](https://github.com/php-lightning/lnaddress/actions) [ ![Psalm Type-coverage Status](https://camo.githubusercontent.com/6d31f8412436ff0685e80e9c4f77f8ccd1ef65060ec6208dffa8e26391b635aa/68747470733a2f2f73686570686572642e6465762f6769746875622f7068702d6c696768746e696e672f6c6e616464726573732f636f7665726167652e737667) ](https://shepherd.dev/github/php-lightning/lnaddress) [ ![MIT Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667) ](https://github.com/php-lightning/lnaddress/blob/main/LICENSE)

Self-host your own [Lightning Address](https://lightningaddress.com) in PHP: a human-readable identifier like `you@yourdomain.com` that any Lightning wallet can pay. It implements [LNURL-pay (LUD-06)](https://github.com/lnurl/luds/blob/luds/06.md) and is backend-agnostic — [LNbits](https://lnbits.com) is the backend available today. Built on the [Gacela](https://gacela-project.com) framework.

Quick start
-----------

[](#quick-start)

Requires PHP &gt;= 8.3 and an LNbits wallet API key.

```
composer require php-lightning/lnaddress          # or clone this repo + composer install
cp lightning-config.dist.php lightning-config.php # settings
cp backends.dist.json backends.json               # per-user invoice backends
composer serve                                    # http://localhost:8080
```

```
curl 'http://localhost:8080/bob'              # → LNURL-pay params
curl 'http://localhost:8080/bob?amount=2000'  # → bolt11 invoice (2000 millisats)
```

```
// lightning-config.php
use PhpLightning\Config\LightningConfig;

return (new LightningConfig())
    ->setDomain('yourdomain.com')
    ->setReceiver('default-receiver')
    ->setDescriptionTemplate('Pay to %s')                 // %s = the lightning address
    ->setSuccessMessage('Thanks for the payment!')
    ->setSendableRange(min: 100_000, max: 10_000_000_000) // millisats
    ->setCallbackUrl('https://yourdomain.com')
    ->addBackendsFile(getcwd() . '/backends.json');
```

```
// backends.json
{
  "bob":   { "type": "lnbits", "api_key": "abc...123", "api_endpoint": "http://localhost:5000" },
  "alice": { "type": "lnbits", "api_key": "def...456", "api_endpoint": "http://localhost:5000" }
}
```

Wallets resolve `bob@yourdomain.com` through `https://yourdomain.com/.well-known/lnurlp/bob`, so route that path to this app's `/{username}` over HTTPS.

Documentation
-------------

[](#documentation)

GuideContents[Getting started](docs/getting-started.md)Install, configure, run, deploy[Configuration](docs/configuration.md)Every setter, defaults, backends file[HTTP API](docs/api.md)Routes, payloads, CORS, error objects[Architecture](docs/architecture.md)Modules, layers, adding a backend[Development](docs/development.md)Scripts, tests, static analysis, releasingAlso: [project page](https://php-lightning.github.io/lnaddress/) · [CHANGELOG](CHANGELOG.md) · [wiki](https://github.com/php-lightning/lnaddress/wiki) · [demo template](https://github.com/php-lightning/demo-lnaddress)

Development
-----------

[](#development)

```
composer test-all   # php-cs-fixer + psalm + phpstan + phpunit + rector (dry-run)
composer fix        # apply php-cs-fixer and rector changes
```

Contributing
------------

[](#contributing)

Issues and pull requests are welcome — read [CONTRIBUTING](.github/CONTRIBUTING.md) and the [Code of Conduct](.github/CODE_OF_CONDUCT.md), and run `composer test-all` first.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance88

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~173 days

Recently: every ~300 days

Total

8

Last Release

25d ago

PHP version history (3 changes)0.2.0PHP &gt;=8.0

0.5.0PHP &gt;=8.0.2

0.8.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d166420c6770c5941e10bd68b2d26501eabb432e280d8e6eba0a344bcc1e5ae?d=identicon)[Chemaclass](/maintainers/Chemaclass)

---

Top Contributors

[![Chemaclass](https://avatars.githubusercontent.com/u/5256287?v=4)](https://github.com/Chemaclass "Chemaclass (175 commits)")[![Bashy](https://avatars.githubusercontent.com/u/540518?v=4)](https://github.com/Bashy "Bashy (13 commits)")[![JesusValeraDev](https://avatars.githubusercontent.com/u/6381924?v=4)](https://github.com/JesusValeraDev "JesusValeraDev (5 commits)")

---

Tags

bitcoinlightning-addresslightning-networklnphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/php-lightning-lnaddress/health.svg)

```
[![Health](https://phpackages.com/badges/php-lightning-lnaddress/health.svg)](https://phpackages.com/packages/php-lightning-lnaddress)
```

###  Alternatives

[symfony/asset-mapper

Maps directories of assets &amp; makes them available in a public directory with versioned filenames.

1669.5M285](/packages/symfony-asset-mapper)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5196.5k22](/packages/phel-lang-phel-lang)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
