WP Manifestindependent plugin directory
manifest / email / nostr-outbox-for-wordpress

NOW - Nostr Outbox for WordPress

Send WordPress and WooCommerce notifications via Nostr instead of email. Includes Lightning payments, Nostr login, NIP-05 verification, and encrypted direct messaging.

by mnpezz · github.com/mnpezz/nostr-outbox-for-wordpress · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/mnpezz/nostr-outbox-for-wordpress/archive/refs/heads/main.zip

Readme

⚡ NOW - Nostr Outbox for WordPress

Send WordPress and WooCommerce notifications via Nostr instead of email, plus reward users with Bitcoin!

A comprehensive WordPress plugin that enables encrypted Nostr Direct Messages, Nostr authentication, Lightning Network payments, NIP-05 verification, and Bitcoin Lightning rewards for WooCommerce stores.


🎯 What Makes This Plugin Special?

First WordPress plugin with full Nostr DM integration
Instant Lightning payments with auto-verification
💰 Zap Rewards - Reward users with Bitcoin for engagement
🔐 Passwordless login via Nostr browser extensions
💬 Replace emails with encrypted Nostr DMs
👥 Multiple Group Chats - Route different notifications to different teams
🆔 NIP-05 verification built-in (username@yourdomain.com)
🔄 Profile sync from Nostr relays
🤖 Fully automatic DM sending via WP-Cron
🌐 No external services required (besides Nostr relays)

Perfect for:

  • Privacy-focused WooCommerce stores
  • Bitcoin/Lightning-only shops
  • Nostr-native businesses
  • Community-driven sites
  • Censorship-resistant communications

✨ Features

🔐 Nostr Authentication

  • One-Click Login: Users log in using their Nostr browser extension (Alby, nos2x)
  • Auto Account Creation: Automatically creates WordPress accounts for new Nostr users
  • NIP-05 Verification: Built-in identity verification (username@yourdomain.com)
  • Profile Sync: Automatically sync user profiles (name, avatar, bio) from Nostr relays
  • Secure: Server-side signature verification with time-limited auth events
  • No Passwords: Eliminate password fatigue and security risks

💬 Nostr Direct Messages

  • Replace Email Notifications: Send DMs instead of emails for orders, updates, etc.
  • Automatic Sending: PHP-based crypto for fully automatic DM delivery via WP-Cron
  • NIP-04 Encryption: All messages encrypted end-to-end
  • Multiple Group Chats: Create separate groups for admins, workers, special teams
  • Smart Message Routing: Different email types go to appropriate groups
  • Persistent Queue: Bulletproof queue system with corruption detection & auto-recovery
  • DM Management Interface: View queue, outbox, inbox, and compose messages
  • 0xchat Integration: Users receive messages in their Nostr DM apps
  • Site Nostr Identity: Your site has its own nsec/npub for sending DMs
  • Auto Opt-In: Nostr users automatically receive DMs; traditional users get emails

👥 Multiple Group Chats

  • Create Unlimited Groups: Workers, Admins, VIPs, etc.
  • Granular Control: Each group has its own message type settings
  • Smart Filtering: Individual confirmations stay private, admin notifications go to groups
  • User-Friendly Management: Select from existing users or add custom npubs
  • Per-Group Toggle: Enable/disable different notification types per group
  • Message Type Routing:
    • 🛒 WooCommerce Orders (New orders)
    • 👤 New User Registrations
    • 🔑 Password Resets
    • ⚙️ Admin Notifications
    • 💬 Comments & Reviews
    • 📋 Gig Notifications (if using gig plugins)

💬 Customer Service Chat Widget

  • Frontend Widget: Floating chat button for customer support
  • Real-Time: Instant message delivery via WebSockets (desktop & mobile)
  • Mobile Ready:
    • Android Support: Seamless integration with Amber via nostr-login
    • iOS Support: Works with Nostash (Safari extension)
    • QR Code Handoff: "Continue on Mobile" tab lets users scan to chat in their favorite app
  • No Extension Required: Smart fallback with helpful onboarding links
  • Integrated: Chat history syncs with Admin DM interface

💰 Zap Rewards

  • Reward Engagement: Automatically send Bitcoin Lightning payments to users
  • Comment Rewards: Pay users for approved comments (configurable amount)
  • Review Rewards: Incentivize product reviews on WooCommerce
  • Purchase Rewards: Cashback percentage on purchases
  • Daily Limits: Prevent abuse with per-user daily reward caps
  • User Dashboard: Users see their rewards history at /my-account/zap-rewards/
  • Lightning Address Field: Users can set their Lightning address for rewards
  • Admin Management: View pending, completed, and failed rewards
  • Payment Methods:
    • Coinos API (recommended - simple and reliable)
    • NWC Protocol (experimental - for future when BIP-340 Schnorr libraries mature)
  • Flexible Addresses: Supports Lightning addresses, Coinos usernames, and invoices

Lightning Network Payments

  • Instant Payments: Accept Bitcoin via Lightning Network (settles in seconds)
  • Multiple Payment Methods:
    • Browser wallet (WebLN/nos2x) - One-click instant payment
    • QR code - Scan with any Lightning wallet
  • Auto-Verification: Payments auto-complete in 3-6 seconds via NWC
  • Accurate Pricing: Real-time BTC exchange rates from multiple reliable APIs

🎯 Smart Payment Flow

  • Browser Wallet Priority: If customer has Alby/nos2x, show instant pay button
  • QR Code Fallback: Universal payment method for any Lightning wallet
  • Automatic Detection: Plugin adapts based on merchant's NWC configuration

🚀 Quick Start (5 Minutes!)

Prerequisites

Server Requirements:

  1. WordPress 5.8+ with WooCommerce installed
  2. PHP 7.4+ with extensions: openssl, gmp, json, curl
  3. Composer (for automatic DM sending)
  4. A Coinos account (free, instant setup)

For Testing (Your Users Will Need):

  • Nostr Extension: Alby or nos2x for login
  • Lightning Wallet: Any Lightning wallet for payments (Zeus, Phoenix, Alby, etc.)
  • Nostr DM App: 0xchat, Amethyst, or Damus for receiving DMs

Step 1: Install Plugin

  1. Upload plugin folder to /wp-content/plugins/nostr-outbox-wordpress/
  2. Activate in WordPress admin → Plugins

Step 2: Install Crypto Dependencies (For Automatic DMs)

For automatic Nostr DM sending via WP-Cron:

# Install PHP GMP extension (if not already installed)
sudo apt-get install php-gmp

# Navigate to plugin directory
cd /path/to/wp-content/plugins/nostr-outbox-wordpress

# Run installation script
bash INSTALL-CRYPTO.sh

# Or install manually via Composer
composer require simplito/elliptic-php textalk/websocket

Manual DMs work without this, but automatic sending requires crypto libraries.

Step 3: Configure Lightning Address

  1. Sign up at coinos.io (takes 30 seconds)
  2. Your Lightning address is: username@coinos.io
  3. Go to Settings → NOW - Nostr Outbox → NWC Settings
  4. Paste your Lightning address → Save Settings

You're now accepting Lightning payments!

Step 4: Enable Auto-Verification (Recommended)

For QR code payments to auto-complete:

  1. Go to coinos.ioSettings → Plugins → NWC
  2. Create new connection with permission: lookup_invoice
  3. Copy the connection string (starts with nostr+walletconnect://)
  4. Paste in NWC Connection (For Auto-Verification) field → Save

🎉 Done! QR payments now auto-complete in 3-6 seconds!

Step 5: Configure Zap Rewards (Optional)

Reward your users with Bitcoin for engagement!

  1. Go to Settings → NOW - Nostr Outbox → 💰 Zap Rewards → Settings
  2. Add your Coinos API Token (get it from coinos.io/docs)
  3. Enable reward types (comments, reviews, purchases)
  4. Set reward amounts and daily limits
  5. Save Settings

Users will receive Lightning payments automatically when they engage!

Step 6: Configure Group Chats (Optional)

Route notifications to different teams:

  1. Go to Settings → NOW - Nostr Outbox → 💬 DM Management → Group Chats
  2. Create groups (e.g., "Admins", "Workers", "VIPs")
  3. Add members (select existing users or paste custom npubs)
  4. Enable message types for each group
  5. Save

Now different notifications automatically go to the right teams!

Step 7: Configure Nostr Relays & DMs

  1. Go to Settings → NOW - Nostr Outbox → Relays
  2. Add your preferred Nostr relays (or use defaults)
  3. Choose redirect page after login
  4. Go to 💬 DM Management tab to view your site's Nostr identity

User DM Preferences:

  • Users who log in with Nostr automatically get DMs enabled
  • Traditional email users continue receiving emails
  • Users can toggle DM preference in their account settings
  • Admin can manually compose DMs to any user from DM Management

🎉 All done! Your site now has full Nostr integration + Bitcoin rewards!


💡 How It Works

Nostr Direct Messages

Email → Nostr DM Replacement:

WooCommerce Order
    ↓
Instead of Email → Nostr DM (encrypted)
    ↓
User receives in 0xchat/Damus/Amethyst
    ↓
Private, encrypted, censorship-resistant! 💬

Automatic Sending:

  1. User places order or triggers notification
  2. Plugin intercepts email
  3. Checks if user has Nostr pubkey → converts to encrypted DM
  4. Checks if message should go to group chats → queues for groups
  5. Adds to queue
  6. WP-Cron processes queue every 5 minutes
  7. PHP crypto signs and encrypts
  8. Published to relays via WebSocket
  9. Users receive in Nostr DM app ✅

Group Chat Routing:

  • Individual confirmations ("Your order...", "Reminder: You have...") → Stay private
  • Admin notifications ("New order #123", "Gig claimed") → Sent to configured groups
  • Smart filtering prevents private messages from going to groups

Zap Rewards Flow

User Action (comment/review/purchase)
    ↓
Plugin checks: Is reward enabled?
    ↓
✅ Yes → Check daily limit
    ↓
Not exceeded → Create reward record
    ↓
Resolve Lightning address to invoice
    ↓
Send payment via Coinos API
    ↓
Payment successful → Mark as completed
    ↓
User receives sats! ⚡

For Customers

Browser Wallet Payment (Recommended)

  1. Click "⚡ Pay with Browser Wallet" at checkout
  2. Alby/nos2x prompts for approval
  3. Confirm payment
  4. Order completes automatically ✅

QR Code Payment (Universal)

  1. Scan QR code with any Lightning wallet (Zeus, Phoenix, Wallet of Satoshi, etc.)
  2. Confirm payment in your wallet
  3. Plugin detects payment via NWC
  4. Order completes automatically ✅ (if NWC configured)

Earning Zap Rewards

  1. Set Lightning address in My Account → Zap Rewards
  2. Leave comments, reviews, or make purchases
  3. Receive automatic Bitcoin payments! ⚡
  4. View reward history on rewards page

For Store Owners

Order Created → Invoice Generated (via Lightning Address)
                        ↓
        ┌───────────────┴───────────────┐
        │                               │
 Browser Wallet                    QR Code
 (WebLN instant)               (Universal payment)
        │                               │
        ├─ Preimage returned            ├─ NWC checks wallet
        ├─ Auto-complete ✅             │   every 3 seconds
        │                               ├─ Payment detected
        │                               ├─ Auto-complete ✅
        └───────────────┬───────────────┘
                        │
                Order Complete! 🎉
                        │
        Check if rewards enabled for user
                        │
        ✅ Yes → Send Zap Reward ⚡

⚙️ Configuration

General Settings (Settings → NOW - Nostr Outbox → General)

Setting Description Default
Enable Nostr Login Allow users to log in with Nostr ✅ Enabled
Auto-create Accounts Create WordPress accounts for new Nostr users ✅ Enabled
Default User Role Role for new Nostr accounts Customer

NWC Payment Settings (Settings → NOW - Nostr Outbox → NWC Settings)

Setting Description Required
Enable Payment Gateway Enable Lightning as payment method ✅ Yes
Lightning Address Your receiving address (username@coinos.io) ✅ Yes
NWC Connection For QR auto-verification (Coinos NWC string) ⚠️ Optional*

* Without NWC: QR payments require manual "Mark as Paid" button.
With NWC: QR payments auto-complete in seconds! 🚀

Zap Rewards Settings (Settings → NOW - Nostr Outbox → 💰 Zap Rewards)

Setting Description Default
Coinos API Token API token from coinos.io/settings None
Enable Comments Reward approved comments ❌ Disabled
Comment Amount Sats per comment 100
Enable Reviews Reward product reviews ❌ Disabled
Review Amount Sats per review 500
Enable Purchases Cashback on purchases ❌ Disabled
Purchase Percentage Cashback % of order total 1%
Daily Limit Max rewards per user per day 5

💡 Tip: 100 sats ≈ $0.10 USD (varies with Bitcoin price)

Group Chat Settings (Settings → NOW - Nostr Outbox → 💬 DM Management → Group Chats)

Per-Group Configuration:

  • Group Name: Descriptive name (e.g., "Admins", "Workers")
  • Enabled: Toggle group on/off
  • Members: Select existing users or add custom npubs
  • Message Types: Choose which notifications this group receives
    • 🛒 WooCommerce Orders
    • 👤 New User Registrations
    • 🔑 Password Resets
    • ⚙️ Admin Notifications
    • 💬 Comments & Reviews
    • 📋 Gig Notifications

Smart Filtering:

  • Individual messages (confirmations, reminders) automatically stay private
  • Only admin-level notifications go to groups
  • Prevents sensitive customer info from going to wrong people

Read the full README on GitHub →