upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/wallet_persist.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-16 15:32:55 +0530
committerYour Name <you@example.com>2026-05-16 15:32:55 +0530
commit133e40c82afb4d7659758b1fa57925ac57af4621 (patch)
tree130f43e668f42f8fcc8ef55808ba89b6db40f615 /main/wallet_persist.h
parent8f0aeb7d7b8216f1fc906cf855e5be9e90ecc0a8 (diff)
Phase 3: on-device Cashu wallet with mbedTLS secp256k1 + SPIFFS persistence + PSRAM
- wallet.c/h: secp256k1 ECP primitives (hash_to_curve, scalar_mul, point_add) - wallet_persist.c/h: SPIFFS persistence with threshold-based write protection - Fee accounting for swap (input_fee_ppk from /v1/keysets) - Keyset fetch via /v1/keysets (586 bytes vs 21KB for /v1/keys) - Wallet API: GET /wallet, POST /wallet/swap, POST /wallet/send - Payment proofs auto-stored to wallet + persisted on SPIFFS - PSRAM enabled for large allocations (ESP32-S3 has 8MB) - Wallet init deferred to dedicated task (avoids sys_evt stack overflow) - Cashu proof ID buffer size fixed (66 hex chars, not 16) - HTTP client: added fetch_headers() call for proper response handling - persist_threshold_sats config parameter (default: 1 sat)
Diffstat (limited to 'main/wallet_persist.h')
-rw-r--r--main/wallet_persist.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/wallet_persist.h b/main/wallet_persist.h
new file mode 100644
index 0000000..4dfcbfc
--- /dev/null
+++ b/main/wallet_persist.h
@@ -0,0 +1,9 @@
1#ifndef WALLET_PERSIST_H
2#define WALLET_PERSIST_H
3
4#include "esp_err.h"
5
6esp_err_t wallet_persist_save(void);
7esp_err_t wallet_persist_load(void);
8
9#endif