Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 2.72 KB

File metadata and controls

49 lines (36 loc) · 2.72 KB

Changelog

0.3.0 (2026-08-01)

Security

  • FIXED: Rewrote BOLT11 decoder (decodeBolt11) to use proper bech32 HRP/separator parsing — extractPaymentHashFromBolt11 and extractTimestampFromBolt11 previously returned null/0 on valid invoices (verified against the official BOLT11 test vector)
  • Added network validation — invoices are checked against the configured network (mainnet default, also testnet/regtest) in both webhook and relay payment paths
  • Added invoice expiry validation — expired invoices are rejected (default 3600s if no x tag)
  • Added SSRF protection for relay URLs — isAllowedRelayUrl rejects non-wss/ws schemes, localhost, private/loopback/link-local IPs; applied to subscribe, publish, key generation, and payment handler
  • Relay settlement now requires preimage + bolt11 proof and verifies the payment hash — res:"ok" without proof is refused
  • Atomic status transitions — offer settlement/expiry updates are conditional on status: 'pending' and re-checked
  • Added Nostr event kind (21001) and p-tag correlation checks before processing relay events

Changed

  • New network config option: 'mainnet' | 'testnet' | 'regtest' (default mainnet)
  • NostrKeyService and ClinkService throw when all configured relay URLs are blocked

0.2.0 (2026-07-23)

Security

  • CRITICAL: Added HMAC-SHA256 signature verification for all webhook endpoints (x-clink-signature header)
  • CRITICAL: Added preimage verification — sha256(preimage) === payment_hash is now enforced before settling
  • Added BOLT11 invoice decoding to extract payment hash and amount for verification
  • Added amount validation — bolt11 invoice amount must match offer amount
  • Added Nostr event signature verification (verifyEvent) for relay payments
  • Added webhookSecret config option — required when httpFallback is enabled

Changed

  • Webhook endpoints now reject all requests without valid HMAC signature
  • Webhook endpoints now reject requests without preimage verification

0.1.0 (2026-07-23)

Features

  • Initial release of the Bitcoin Lightning CLINK plugin for Vendure
  • ClinkPaymentHandler — asynchronous payment handler with BTC price oracle
  • ClinkPaymentProcess — custom payment state machine (Created → Pending → Settled/Error/Cancelled)
  • OracleService — BTC/USD price oracle with CoinGecko, Kraken, and custom providers
  • Per-channel Nostr keypair generation and relay configuration
  • Shop API: create payment offers, poll payment status
  • Admin API: configure CLINK settings, manage offers, test oracle providers
  • HTTP webhook fallback for wallets without Nostr support
  • Storefront React component (ClinkPayment)
  • Comprehensive unit tests (43 tests)