Nostr Wallet Connect Docs
  • Introduction
    • Welcome to NWC
    • Introduction to NWC
  • What to Build
  • FAQ
  • Bitcoin apps and websites
    • Benefits and Features
    • Getting Started
    • Code Examples
    • Connecting To The Wallet
      • Traditional Connection Flow
      • 1-Click Wallet Connections
    • SDKs and Tools
    • Best Practices
  • Bitcoin Lightning wallets
    • Benefits and Features
    • Getting Started
    • Code Examples
    • NWC Relay
    • References & SDKs
    • Best Practices
  • Reference API
    • Overview
      • get_info
      • get_balance
      • make_invoice
      • pay_invoice
      • multi_pay_invoice
      • pay_keysend
      • lookup_invoice
      • list_transactions
    • Error Codes
  • Contribute
    • Specification
    • Design Assets
Powered by GitBook
On this page
  • Introduction
  • Demo 1: Connecting a web wallet to a web app
  • Demo 2: Connecting a self-custodial wallet hosted on a private device to a web app
  • Connection Secret
  • Implementation
  • As a (Progressive) Web App
  • As a Mobile App
  1. Bitcoin apps and websites
  2. Connecting To The Wallet

1-Click Wallet Connections

PreviousTraditional Connection FlowNextSDKs and Tools

Last updated 1 month ago

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

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.

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 and all Javascript libraries or frameworks, such as , Angular, Vue, Solid.js, etc.

Instructions on how to use it are mentioned .

Bitcoin Connect
HTML
React
Code example
Code examples
here
Connecting Alby Hub hosted on Alby Cloud in one click to a web app
Connecting Alby Hub hosted on a private device in one click via Alby Go to a web app