Skip to content

Vib-UX/dca-bitcoin

Repository files navigation

DCA Bitcoin

QuietGain DCA is a privacyโ€‘first Bitcoin DCA app: stack sats via Nostr with BIPโ€‘352 Silent Payments, use Lightning stable channels to keep your fiat exposure steady when BTC pumps, and settle long-term wealth on P2QRH addresses generated with ML-DSA (CRYSTALS-Dilithium) to remain secure against quantum attacks.

๐ŸŒŸ Features

๐Ÿ’ฐ DCA Purchase Flow

  • Multi-Currency Support: Buy Bitcoin in USD, IDR (Indonesian Rupiah), or INR (Indian Rupee)
  • Direct Lightning Payments: Pay directly to Lightning addresses via YakiHonne wallet
  • Silent Payments: Receive Bitcoin privately using BIP-352 Silent Payments
  • Smart Widget Handler: Native payment integration with YakiHonne using smart-widget-handler SDK

โšก Stable Channels - Stabilize Your Bitcoin Gains

Lock in your Bitcoin value using Lightning Network stable channels. When BTC price increases, protect your gains by depositing into stable channels that maintain USD-equivalent value.

๐Ÿ“Š Portfolio Rebalance Example:

Scenario: You've accumulated 0.5 BTC through DCA purchases

Event BTC Price Your BTC USD Value Action
Initial DCA $60,000 0.5 BTC $30,000 Accumulating Bitcoin
BTC Pumps 40% $84,000 0.5 BTC $42,000 ๐ŸŽฏ Rebalance Trigger
Deposit to Stable $84,000 0.3 BTC
+ 0.2 BTC (stable)
$25,200 (BTC)
+ $16,800 (stable)
Lock in $12,000 gains
BTC Drops 20% $67,200 0.3 BTC
+ 0.2 BTC (stable)
$20,160 (BTC)
+ $16,800 (stable)
Protected value!

Without Stable Channel: 0.5 BTC @ $67,200 = $33,600 (-$8,400 from peak)
With Stable Channel: $20,160 + $16,800 = $36,960 (+$3,360 saved! โœ…)

How Stable Channels Work:

  1. Deposit: When BTC price rises, deposit a portion into Lightning stable channels
  2. Lock Value: Your deposited BTC maintains its USD value regardless of price changes
  3. Withdraw: Exit the channel anytime to convert back to regular Bitcoin
  4. Rebalance: Optimize channel capacity for better Lightning routing

๐Ÿ“ฑ Mobile-First Design

  • Optimized for YakiHonne playground
  • Progressive Web App (PWA) support
  • Touch-friendly interface
  • Responsive layout for all screen sizes

๐Ÿ” Privacy & Security

  • Silent Payments (BIP-352): Receive Bitcoin without address reuse
    • Generate addresses with Silentium Wallet
    • No on-chain linkability between transactions
    • Enhanced privacy for all DCA purchases
  • Nostr Integration: Your identity and history on decentralized relays
  • Lightning Payments: Fast, low-fee Bitcoin transactions

๐Ÿ”ฎ Future: Post-Quantum Security

As Bitcoin evolves, we're preparing for quantum-resistant cryptography:

ML-DSA (Module-Lattice-Based Digital Signature Algorithm) - FIPS-204 standard for post-quantum signatures. See implementation example: btc-vision/noble-post-quantum

This ensures your Bitcoin transactions remain secure even against quantum computers. The noble-post-quantum library provides:

  • ML-DSA: Lattice-based signatures (FIPS-204)
  • ML-KEM: Key encapsulation mechanism (FIPS-203)
  • SLH-DSA: Hash-based signatures (FIPS-205)

Integration planned for future Nostr event signing and Bitcoin transaction security.

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • Nostr browser extension (nos2x, Alby)
  • Lightning wallet with LNURL support

Installation

# Clone the repository
git clone https://github.com/Vib-UX/dca-bitcoin.git
cd dca-bitcoin

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:5173 in your browser.

For YakiHonne Users

  1. Open YakiHonne app
  2. Navigate to Widget Playground
  3. Load the widget using widget.json configuration
  4. Start DCA-ing Bitcoin with native payments!

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 18 - UI framework
  • Redux Toolkit - State management
  • React Router - Navigation
  • Vite - Build tool & dev server

Nostr Integration

  • NDK (@nostr-dev-kit/ndk) - Nostr Development Kit
  • nostr-tools - Core Nostr utilities
  • Dexie - IndexedDB cache for Nostr events

Lightning Network

  • smart-widget-handler - Native payment integration for YakiHonne
  • LNURL - Lightning address support
  • BIP-352 Silent Payments - Privacy-preserving Bitcoin reception

Relays

  • wss://nostr-01.yakihonne.com
  • wss://nostr-02.yakihonne.com
  • wss://relay.damus.io
  • wss://relay.nostr.band
  • wss://nos.lol

๐Ÿ“– How It Works

1. DCA Purchase Flow

User Input โ†’ Calculate Sats โ†’ Request Payment โ†’ YakiHonne Approval โ†’ Success

Example: Buy $100 USD of Bitcoin

  • BTC Price: $84,000
  • Amount in BTC: 0.00119048 BTC (119,048 sats)
  • Payment to: [email protected]
  • Silent Payment Address: Receive Bitcoin privately

2. Stable Channel Flow

Accumulate BTC โ†’ Price Rises โ†’ Deposit to Stable โ†’ Lock USD Value โ†’ Rebalance

Strategy:

  1. DCA into Bitcoin regularly
  2. When BTC pumps 30-50%, move 40% to stable channels
  3. Lock in gains at higher prices
  4. Buy back BTC when price dips

3. Nostr Publishing

All DCA purchases are published as Nostr events (kind 31111):

{
  "kind": 31111,
  "content": {
    "fiatAmount": 100,
    "currency": "USD",
    "btcAmount": 0.00119048,
    "btcPrice": 84000,
    "silentPaymentAddress": "sp1...",
    "timestamp": 1735868876
  }
}

๐ŸŽฏ Use Cases

For HODLers

  • Automate Bitcoin accumulation with DCA
  • Track all purchases on Nostr
  • Protect gains with stable channels during bull runs

For Privacy Advocates

  • Use Silent Payments for anonymous Bitcoin reception
  • No address reuse, no on-chain tracking
  • Recommended: Silentium Wallet for Silent Payment addresses

For Lightning Users

  • Instant payments via Lightning Network
  • Low fees (<1%)
  • Native YakiHonne integration

For Nostr Natives

  • Identity and history on Nostr
  • Decentralized, censorship-resistant
  • Portable across clients

๐Ÿ”ง Configuration

Environment Variables

Create a .env file:

VITE_DEFAULT_LIGHTNING_ADDRESS=[email protected]
VITE_ENABLE_MARKETPLACE=false

Widget Configuration

Edit widget.json for YakiHonne integration:

{
  "name": "DCA Bitcoin",
  "version": "1.0.0",
  "permissions": ["payment", "nostr"]
}

๐Ÿ“ฑ Mobile & PWA

The app is optimized for mobile devices:

  • Viewport: Configured for mobile screens
  • Touch: Large, touch-friendly buttons
  • Responsive: Adapts to all screen sizes
  • PWA: Install as standalone app
  • Manifest: public/manifest.json

๐Ÿงช Testing

# Run tests
npm test

# Run linter
npm run lint

# Build for production
npm run build

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

๐Ÿ“„ License

MIT License - see LICENSE file

๐Ÿ”— Links

๐Ÿ™ Acknowledgments


โšก Start DCA-ing Bitcoin today with privacy, Lightning speed, and gain protection!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors