1-Click Wallet Connections
Introduction
NWC is built with user experience and interoperability at its core. It defines a simple, one-click flow for connecting wallets to apps—just like “Log in with Google,” but for bitcoin lightning wallets “Connect your wallet.”
What sets NWC apart is its cross-platform compatibility. Whether it’s linking a mobile wallet to a web app, a browser-based wallet to a native mobile app, or even a self-hosted Lightning node—NWC makes it seamless. Delivering a smooth, intuitive experience for users across all setups is a fundamental design goal.
Demo 1: Connecting a web wallet to a web app
For publicly accessible lightning wallets, NWC specifies a flow based on HTTP to create an OAuth-like experience
Demo 2: Connecting a self-custodial wallet hosted on a private device to a web app
For mobile-based or self-hosted Lightning wallets, NWC defines a flow that leverages the Nostr protocol. The key benefit is seamless cross-device connectivity—mobile to web and vice versa.
Connection Secret
Unlike the traditional connection flow, the secret is generated by the client application and never leaves the device. Only the public keys of the client and wallet are exchanged to initiate the connection, creating a safer and user-friendly connection flow. Rather than receiving the entire NWC connection string from the server, The client constructs its connection from individual parts (the wallet's public key and relay URL, and its own generated secret).
Implementation
As a (Progressive) Web App
Bitcoin Connect is a front end library that does the heavily lifting for you. The library includes web components letting users connect from both desktop and mobile devices, using their favorite browser. PWAs just work. Bitcoin Connect's components work with pure HTML and all Javascript libraries or frameworks, such as React, Angular, Vue, Solid.js, etc.
As a Mobile App
HTTP Flow
This flow covers wallets that are publicly accessible and can provide a static link for users to connect their wallet and be redirected back into the application.
Nostr Flow
This flow covers wallets that are not publicly accessible, which is often the case for mobile-based or self-hosted lightning wallets. The app creates a QR code for the user to scan and link the wallet.
Instructions on how to use it are mentioned here.
Read the NIP-47 PR for one-click connections here.
Last updated