Vibe Code An Application To Send And Receive Lightning Payments With Rizful
Want to build Lightning-powered applications without getting lost in the weeds? With Rizful test vaults and Nostr Wallet Connect (NWC), you can point your favorite AI coding assistant at a working example and let it help you build something awesome.
This guide shows you how to set up everything you need to vibe code Lightning payment functionality into your applications.
Vibe coding is a development approach where you use AI coding assistants (like Claude Code, GitHub Copilot, or Cursor) to rapidly build applications. You describe what you want, point the AI at relevant examples, and iterate quickly. With the right setup, you can build Lightning-enabled apps in minutes.
Prerequisitesโ
Before you start vibe coding, you'll need:
- Two test Rizful vaults with NWC codes (one for sending, one for receiving)
- Docker and Docker Compose installed on your machine
- An AI coding assistant (Claude Code, Cursor, GitHub Copilot, etc.)
Step 1: Set Up Test Rizful Vaultsโ
First, create dedicated test vaults to experiment with. This keeps your main funds safe while you learn and build.
๐ Safely Set Up Test Rizful Vaults with NWC โ Create isolated vaults with small balances for testing
Create two vaults:
- One for sending payments (fund this one with ~100 sats)
- One for receiving payments
Step 2: Get NWC Codes for Both Vaultsโ
Next, generate send-and-receive NWC codes for each of your test vaults.
๐ Get A Send & Receive NWC Code from Rizful โ Learn how to create NWC codes that allow apps to send and receive payments
You'll need two NWC codes:
NWC_CODE_SENDERโ from your sending vaultNWC_CODE_RECEIVERโ from your receiving vault
Step 3: Test Your NWC Codes (Optional)โ
Before diving into code, you can verify your NWC codes work using the Alby Sandbox. This is a great way to understand how NWC works without writing any code.
Using Alby Sandboxโ
- Visit sandbox.albylabs.com
- Click on Payment Notifications in the sidebar
- Paste your sender NWC code into the "Alice" connection field
- Paste your receiver NWC code into the "Bob" connection field
- Click Connect on both

Now you can experiment with:
- โก Payment Notifications โ See real-time notifications when payments are sent/received
- ๐ธ Simple Invoice Payment โ Create and pay invoices
- ๐ Lookup Invoice Status โ Check payment statuses
- ๐ Balance Chart โ Monitor wallet balances
Step 4: Point Your AI at the Example Repositoryโ
Ready to build? Point your AI coding assistant at this repository:
๐ github.com/MegalithicBTC/rizful-lightning-vibe-code-example
This repository contains a minimal, working example that:
- Connects to two Lightning wallets via NWC
- Subscribes to payment notifications on both wallets
- Creates a 1 sat invoice from the receiver
- Pays the invoice from the sender
- Displays the notifications received by both wallets
Quick Start with the Exampleโ
# Clone the repository
git clone https://github.com/MegalithicBTC/rizful-lightning-vibe-code-example.git
cd rizful-lightning-vibe-code-example
# Create your secrets file
cp secrets.env.example secrets.env
Add Your NWC Codesโ
Edit secrets.env and add your two NWC connection strings:
NWC_CODE_SENDER=nostr+walletconnect://...
NWC_CODE_RECEIVER=nostr+walletconnect://...
Run the Demoโ
docker compose up --build
You should see output showing:
- โ Both wallets connecting
- ๐ Invoice creation
- ๐ธ Payment being sent
- ๐ Notifications from both sender and receiver
- ๐ฐ Updated balances
Step 5: Start Vibe Coding!โ
Now that you have a working example, you can ask your AI assistant to help you build features. Here are some prompts to try:
Simple Promptsโ
- "Modify this app to send 10 sats instead of 1 sat"
- "Add a loop that sends 1 sat every 30 seconds"
Intermediate Promptsโ
- "Create a web server that displays the current balance"
- "Add logging to a file for all payment notifications"
Advanced Promptsโ
- "Build a web interface that shows a QR code for the receiver's Lightning address and displays confetti when a payment arrives"
- "Create a payment forwarding feature that automatically sends received payments to another address"
- "Build a Lightning-powered tip jar with a leaderboard"
What You Can Buildโ
With Rizful NWC codes and vibe coding, you can build:
| Application Type | Description |
|---|---|
| โก Tip Jars | Accept Lightning payments with real-time notifications |
| ๐ค Payment Bots | Automate payments based on triggers or schedules |
| ๐ Dashboards | Monitor wallet balances and transaction history |
| ๐ฎ Games | Micropayment-enabled gaming experiences |
| ๐ E-commerce | Accept Bitcoin payments in your apps |
| ๐ Notification Systems | React to incoming/outgoing payments |
Resourcesโ
- ๐ Alby SDK Documentation โ The SDK used in the example
- ๐งช Alby Sandbox โ Test Lightning scenarios
- ๐ NWC Protocol Specification โ Understand the protocol
The only dangerous part of this setup is your NWC codes. These codes give applications the ability to send payments from your vault.
- ๐ Never commit NWC codes to version control โ Use
.gitignoreto exclude yoursecrets.envfile - ๐ซ Never share NWC codes publicly โ Treat them like passwords
- ๐งช Use test vaults with small balances โ Limit your exposure while experimenting
- ๐๏ธ Delete NWC codes when done โ Remove unused connections from your Rizful vault
If you can avoid leaking your NWC codes, you're good! The example repository is already set up with a .gitignore that excludes secrets.env, so your codes won't accidentally get committed.