upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/components/nucula_lib/nucula_wallet.cpp
AgeCommit message (Collapse)Author
2026-05-21Wallet receive via health task queue (no separate TLS worker)Your Name
- Removed standalone TLS worker task (couldn't allocate 16KB internal stack) - Added wallet receive queue to mint_health task (already has 16KB stack + working TLS) - health_task processes wallet tokens between probe intervals (1s poll) - tls_worker_set_queue() registers queue from mint_health_start() - Fallback to synchronous receive if queue not available - Added freertos/queue.h and tollgate_api.h stubs for unit tests - Added BaseType_t/UBaseType_t/TickType_t/pdFALSE to FreeRTOS stub - Full payment round-trip confirmed: 2 payments → 41 sat balance
2026-05-21feat(wallet): lazy keyset loading with exponential backoff + jitterYour Name
- Remove eager load_keysets() from init_wallet(), load on first use - Add ensure_keysets() with binary exponential backoff + random jitter - Guard all wallet operations (receive, send, melt, swap_all) with ensure_keysets() - Skip checkstate on TLS failure, let wallet swap verify proofs instead - Pin HTTP server to core 0 (fixes TLS cert verification in checkstate) - Rewrite nucula http.c to use manual open/write/read (same as working health probe) - Disable hardware MPI (CONFIG_MBEDTLS_HARDWARE_MPI=n) - Add http.h stub for unit tests Known issue: progressive TLS failure after 2-3 connections (PK verify 0x4290), wallet receive swap fails. Needs deeper mbedTLS/PSRAM investigation.
2026-05-19feat: multi-mint wallet with health tracking, WPA auto-detect, display gatingYour Name
Squash merge of feature/multi-mint-support (21 commits): Multi-mint wallet: - Accept payments from 4 mints: minibits, coinos, 21mint, lnvoltz - Periodic health probing (300s interval, 3 recovery threshold) - Multi-wallet init with nucula_wallet_init_multi() - /mints and /wallet API endpoints WPA auto-detect: - wifi_auth_mode config field (default WPA2, supports WPA3) - Runtime mapping to wifi_auth_mode_t in STA config Display gating: - display_enabled config field (default true) - Guards display_init/display_update per-board Bug fixes: - 3s delay before service start prevents lwip mem_free assertion - Real npub in discovery (identity_get()->npub_hex) - Health probe interval 300s (production value) - Duplicate services_start_task call removed - UTF-8 arrow replaced with ASCII in log message Tests: 61+14 unit tests passing, firmware builds clean
2026-05-17Phase 5: Lightning auto-payout with LNURL-pay and NUT-05 meltYour Name
- New lnurl_pay.c/h: LNURL-pay protocol (GET .well-known/lnurlp + callback) - New lightning_payout.c/h: threshold-based auto-payout with multi-recipient split - Extended nucula_wallet bridge with nucula_wallet_melt() (NUT-05) - Config: payout section with multi-mint, multi-recipient, fee_tolerance - Default: enabled, TollGate@coinos.io, min_payout=128, min_balance=64 - 18 new unit tests (all passing), 134 total
2026-05-16Phase 3: Nostr identity derivation + wifistr service discoveryYour Name
- Add identity.c/h: HMAC-SHA512 derivation from nsec → npub, STA/AP MAC, SSID, AP IP - Add nostr_event.c/h: NIP-01 event serialization + Schnorr signing (BIP-340) - Add geohash.c/h: lat/lon to geohash encoding - Add wifistr.c/h: kind 38787 event builder + WebSocket publish to Nostr relays - Update config.c/h: nsec-based identity, Nostr relay/geo config, remove static SSID/IP - Replace custom mbedTLS wallet with nucula library (libsecp256k1) - Remove wallet.c/h, wallet_persist.c/h (replaced by nucula_lib component) - Verified on Board A: derived SSID, captive portal, payment, wallet, wifistr publish