Skip to main content

दो modes

ModeProviderFeeTestnet / SandboxSetup
ManagedManagedProvider0.3% प्रति sat❌ (tests में mock उपयोग करें)केवल Lightning address
SoberanoBlink0%❌ केवल mainnetFree custodial account
SoberanoLNbits0%✅ RegTest / signetSelf-host या public instance
SoberanoOpenNode0%testMode: trueFree sandbox account
SoberanoAlby Hub0%✅ Hub testnet wallet के माध्यम सेSelf-custodial cloud node
SoberanoBTCPay0%✅ RegTest supportSelf-hosted node
SoberanoCustom0%✅ जो भी आप wire up करेंकोई भी Lightning backend
Managed mode — l402kit.com Lightning node host करता है। आप अपना Lightning address जोड़ें। हम हर sat का 99.7% आपको automatically forward करते हैं। Soberano mode — आप अपना खुद का Lightning wallet/node connect करें। 0% fee, full custody, किसी भी provider के साथ काम करता है।

ManagedProvider (अनुशंसित)

कोई Lightning node की जरूरत नहीं। अपना Lightning address जोड़ें और earning शुरू करें — l402kit.com सभी invoice creation और payment routing संभालता है। Fee: प्रति sat received पर 0.3%। 99.7% सीधे आपके Lightning wallet में जाता है। कोई monthly fee नहीं।
import { l402, ManagedProvider } from 'l402-kit';
import express from 'express';

const app = express();
const lightning = ManagedProvider.fromAddress('you@yourdomain.com');

app.get('/premium', l402({ priceSats: 10, lightning }), (req, res) => {
  res.json({ data: 'Payment confirmed ⚡' });
});

app.listen(3000);
// 0.3% fee · no node setup · works immediately
यह कैसे काम करता है:
  1. आपका API ManagedProvider.fromAddress("you@domain.com") call करता है
  2. जब कोई caller आपके endpoint को hit करता है, l402kit.com एक Lightning invoice बनाता है
  3. Caller payment करता है → Lightning settle होता है → 99.7% आपके Lightning address पर instantly forward होता है
  4. आपका API cryptographic proof verify करता है और 200 OK return करता है
0.3% routing fee ही एकमात्र cost है। कोई monthly fee नहीं। कोई account registration नहीं। कोई भी Lightning address काम करता है (Blink, Phoenix, Alby, Strike, Wallet of Satoshi, आदि)।

Trust और availability

l402kit.com कौन चलाता है? ShinyDapps (open source, MIT)। Managed infrastructure Cloudflare Workers पर चलता है — globally distributed, कोई single server down नहीं होता। Uptime: stats.uptimerobot.com/57uOzF17jK पर 24/7 monitor किया जाता है। SLA target: 99.9%। अगर l402kit.com बंद हो जाए? आपका verification logic local है — SHA256(preimage) == paymentHash आपके process में चलता है, zero network calls। केवल invoice creation l402kit.com को touch करता है। अगर managed service down हो जाए, तो एक line में किसी भी soberano provider पर switch करें:
// पहले (managed)
const lightning = ManagedProvider.fromAddress("you@yourdomain.com");

// बाद में (soberano — 0% fee, full custody)
const lightning = new BlinkProvider(process.env.BLINK_API_KEY!, process.env.BLINK_WALLET_ID!);
कोई अन्य code changes नहीं। पहले से paid tokens काम करते रहेंगे — verification purely cryptographic है। क्या मैं managed layer को self-host कर सकता हूं? हाँ। Full source MIT license के तहत GitHub पर है। cloudflare/ में managed API worker है — इसे 5 मिनट में अपने Cloudflare account पर deploy करें।
Blink एक free custodial Bitcoin Lightning wallet है जिसमें GraphQL API है। कोई KYC नहीं, कोई monthly fee नहीं, instant setup। इसे soberano mode में 0% fee के साथ उपयोग करें।
Contingency plan: Blink एक free service है — उनकी pricing बदल सकती है। अगर Blink fees add करे या API limit करे, तो एक line of code में दूसरे soberano provider पर switch करें (कोई अन्य changes नहीं, पहले से paid tokens काम करते रहेंगे)। Zero lock-in। अच्छे alternatives: LNbits (self-hosted, 0% हमेशा), OpenNode (commercial SLA), Alby Hub (self-custodial), या BTCPay (fully sovereign)।
शुरू करें:
  1. dashboard.blink.sv पर account बनाएं
  2. API Keys पर जाएं → एक नई key बनाएं
  3. Wallet page से अपना BTC Wallet ID copy करें
import { BlinkProvider } from 'l402-kit';

const blink = new BlinkProvider(
  process.env.BLINK_API_KEY!,    // blink_xxx...
  process.env.BLINK_WALLET_ID!,  // UUID
);
Environment variables:
BLINK_API_KEY=blink_xxxxxxxxxxxxxxxxxxxxxxxx
BLINK_WALLET_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

LNbits (Soberano — 0% fee)

LNbits एक open-source Lightning wallet server है। इसे self-host करें या public instance उपयोग करें। शुरू करें:
  1. LNbits setup करें (self-host या legend.lnbits.com उपयोग करें)
  2. एक wallet बनाएं → Invoice/read key copy करें
import { LNbitsProvider } from 'l402-kit';

const lnbits = new LNbitsProvider(
  process.env.LNBITS_KEY!,
  process.env.LNBITS_URL ?? 'https://legend.lnbits.com',
);
Environment variables:
LNBITS_KEY=your-invoice-read-key
LNBITS_URL=https://your-lnbits-instance.com

OpenNode (Soberano — 0% fee)

OpenNode एक Lightning provider है जिसमें testing के लिए free sandbox है। शुरू करें:
  1. app.opennode.com पर account बनाएं
  2. IntegrationsAPI Keys पर जाएं → एक key बनाएं
import { OpenNodeProvider } from 'l402-kit';

const opennode = new OpenNodeProvider(
  process.env.OPENNODE_KEY!,
  process.env.NODE_ENV !== 'production', // testMode
);

Alby Hub (Soberano — 0% fee)

Alby Hub cloud में एक self-custodial Lightning node है। आपकी keys, आपके sats — कोई custodian नहीं। शुरू करें:
  1. hub.getalby.com पर एक Hub बनाएं (या self-host करें)
  2. Settings → Access Tokens पर जाएं → invoices:create + invoices:read scopes के साथ token बनाएं
  3. अपना Hub URL और access token copy करें
import { AlbyProvider } from 'l402-kit';

const alby = new AlbyProvider(
  process.env.ALBY_ACCESS_TOKEN!,  // Hub → Settings → Access Tokens
  process.env.ALBY_HUB_URL!,       // e.g. "https://your-name.getalby.com"
);
Environment variables:
ALBY_ACCESS_TOKEN=your-alby-access-token
ALBY_HUB_URL=https://your-name.getalby.com

BTCPay Server (Soberano — 0% fee)

BTCPay Server fully self-sovereign Bitcoin + Lightning है। आपका node, आपकी keys, zero custody। इनके साथ compatible: self-hosted (Umbrel, Start9, VPS) या managed (Voltage, LunaNode)। शुरू करें:
  1. BTCPay store → Lightning → Settings
  2. Account → API Keysbtcpay.store.cancreatelightninginvoice scope के साथ key generate करें
  3. Store URL से अपना Store ID copy करें
import { BTCPayProvider } from 'l402-kit';

const btcpay = new BTCPayProvider(
  process.env.BTCPAY_URL!,       // e.g. "https://btcpay.yourdomain.com"
  process.env.BTCPAY_API_KEY!,   // Account → API Keys
  process.env.BTCPAY_STORE_ID!,  // store URL से
);
Environment variables:
BTCPAY_URL=https://btcpay.yourdomain.com
BTCPAY_API_KEY=your-api-key
BTCPAY_STORE_ID=your-store-id

Custom provider (Soberano — 0% fee)

किसी भी Lightning backend का उपयोग करने के लिए LightningProvider interface implement करें:
import type { LightningProvider, Invoice } from 'l402-kit';

class MyProvider implements LightningProvider {
  async createInvoice(amountSats: number): Promise<Invoice> {
    // Call your Lightning node API
    const result = await myNode.createInvoice(amountSats);
    const macaroon = Buffer.from(
      JSON.stringify({ hash: result.hash, exp: Date.now() + 3_600_000 })
    ).toString('base64');
    return {
      paymentRequest: result.bolt11,
      paymentHash: result.hash,
      macaroon,
      amountSats,
      expiresAt: Date.now() + 3_600_000,
    };
  }

  async checkPayment(paymentHash: string): Promise<boolean> {
    return myNode.isPaid(paymentHash);
  }
}