upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/config.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-16 23:55:05 +0530
committerYour Name <you@example.com>2026-05-16 23:55:05 +0530
commit4c47ae188b288e7d24bd9566ab3e6a6805d9484f (patch)
tree33b74b2090b4f3b7597841734a56a4006a86d73f /main/config.h
parent133e40c82afb4d7659758b1fa57925ac57af4621 (diff)
Phase 3: Nostr identity derivation + wifistr service discovery
- 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
Diffstat (limited to 'main/config.h')
-rw-r--r--main/config.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/main/config.h b/main/config.h
index 2bcd400..8254a62 100644
--- a/main/config.h
+++ b/main/config.h
@@ -10,6 +10,7 @@
10#define TOLLGATE_MAX_MINT_URLS 3 10#define TOLLGATE_MAX_MINT_URLS 3
11#define TOLLGATE_MAX_AP_SSID_LEN 32 11#define TOLLGATE_MAX_AP_SSID_LEN 32
12#define TOLLGATE_MAX_AP_PASS_LEN 64 12#define TOLLGATE_MAX_AP_PASS_LEN 64
13#define TOLLGATE_MAX_RELAYS 4
13 14
14typedef struct { 15typedef struct {
15 char ssid[32]; 16 char ssid[32];
@@ -22,11 +23,17 @@ typedef struct {
22 int current_network; 23 int current_network;
23 int max_retry; 24 int max_retry;
24 25
26 char nsec[65];
27 char npub[65];
28
25 char ap_ssid[TOLLGATE_MAX_AP_SSID_LEN]; 29 char ap_ssid[TOLLGATE_MAX_AP_SSID_LEN];
26 char ap_password[TOLLGATE_MAX_AP_PASS_LEN]; 30 char ap_password[TOLLGATE_MAX_AP_PASS_LEN];
27 uint8_t ap_channel; 31 uint8_t ap_channel;
28 uint8_t ap_max_conn; 32 uint8_t ap_max_conn;
29 33
34 uint8_t sta_mac[6];
35 uint8_t ap_mac[6];
36
30 esp_ip4_addr_t ap_ip; 37 esp_ip4_addr_t ap_ip;
31 char ap_ip_str[16]; 38 char ap_ip_str[16];
32 39
@@ -36,7 +43,12 @@ typedef struct {
36 int step_size_ms; 43 int step_size_ms;
37 uint64_t persist_threshold_sats; 44 uint64_t persist_threshold_sats;
38 45
39 bool unique_derived; 46 char nostr_geohash[16];
47 char nostr_relays[TOLLGATE_MAX_RELAYS][128];
48 int nostr_relay_count;
49 int nostr_publish_interval_s;
50
51 bool identity_initialized;
40} tollgate_config_t; 52} tollgate_config_t;
41 53
42void tollgate_config_derive_unique(tollgate_config_t *cfg); 54void tollgate_config_derive_unique(tollgate_config_t *cfg);