# SQRL Pay

SQRL Pay is a non-custodial Lightning wallet for Bitcoin and SCL assets. It runs in your browser and holds your keys there: the hub coordinates Lightning connectivity, and your device signs.

> Part of the SQRL documentation, section "Protocol".
> Rendered page: https://docs.sqrl.tech/protocol/lightning/sqrl-pay

## Security model

**One seed, all keys.** Your wallet derives everything from a single BIP39 mnemonic:

* An on-chain Bitcoin wallet (BIP84, native SegWit) for sends, receives, and SCL contract anchoring.
* Lightning channel keys, derived per channel from the same master seed.
* A node identity key used to authenticate your session with the hub.

**Keys never leave the browser.** The signer is compiled to WebAssembly and keeps key material in local browser storage. When the hub needs a signature (funding a channel, updating a commitment, closing), it sends a signing *request* over an authenticated WebSocket, and your signer answers with just the signature. You can also sign with a hardware wallet through the same signing interface, so key material stays off the browser entirely.

**Authenticated sessions.** On connect, the hub issues a random challenge; your signer proves ownership of your node key by signing it. Sessions survive mobile backgrounding and tab switches: when your tab wakes up, the wallet transparently reconnects and resumes the same session.

## What you can do

* **Receive on-chain**: fresh native-SegWit addresses on demand.
* **Send on-chain**: the wallet builds the transaction, your signer signs it locally, the hub broadcasts.
* **Open a Lightning channel**: one click; the funding transaction is built cooperatively and signed by your browser.
* **Get paid over Lightning**: create BOLT11 invoices.
* **Pay over Lightning**: pay any BOLT11 invoice, routed across the network.
* **Send and receive assets over Lightning**: attach asset terms to an invoice and the tokens transfer instantly when the payment settles, moving through existing channels and routing infrastructure.
* **Close channels**: cooperative close (or force-close if your counterparty is unresponsive), with funds swept back to your on-chain wallet by your own signer. Channel-bound assets settle back to Bitcoin automatically.
* **Issue and move SCL assets**: deploy, mint, and transfer asset contracts. The wallet builds the anchoring Bitcoin transaction and the signed call envelope in the browser, then forwards them for settlement on the SCL node.

## How an SCL asset operation flows

1. The wallet prepares an unsigned Bitcoin transaction carrying the contract commitment.
2. Your browser signer signs it and the call envelope locally.
3. The signed transaction is broadcast to Bitcoin.
4. The call is forwarded to an SCL node, which validates it against the on-chain anchor and applies it deterministically.

The result: every asset you issue or move from the wallet is provable against Bitcoin, and no server ever held your keys.

  The wallet is non-custodial: your seed phrase is the only recovery path. Nobody, including SQRL, can restore funds for you without it.
