cryptnox-sdk-arduino
1.0.0
Arduino library for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
config.template.h
Go to the documentation of this file.
1
/*
2
* SPDX-License-Identifier: LGPL-3.0-or-later
3
* Copyright (c) 2026 Cryptnox SA
4
*/
5
6
#ifndef CONFIG_H
7
#define CONFIG_H
8
9
#include <stdint.h>
10
11
/* =========================
12
* WiFi Configuration
13
* ========================= */
14
#define WIFI_SSID "<YOUR_SSID>"
15
#define WIFI_PASSWORD "<YOUR_PASSWORD>"
16
17
/* =========================
18
* Ethereum / RPC
19
* ========================= */
32
33
/* --- Option A: PublicNode ----------------------------------------- */
34
#define RPC_HOST "ethereum-sepolia-rpc.publicnode.com"
35
#define RPC_PORT 443
36
#define RPC_PATH "/"
37
/* No authentication needed — leave RPC_PROJECT_ID / RPC_API_SECRET
38
* undefined (or comment them out) when using PublicNode. */
39
40
/* --- Option B: Infura --------------------------------------------- */
41
/* #define RPC_HOST "sepolia.infura.io" */
42
/* #define RPC_PORT 443 */
43
/* #define RPC_PROJECT_ID "<YOUR_INFURA_PROJECT_ID>" */
44
/* #define RPC_PATH "/v3/" RPC_PROJECT_ID */
45
/* #define RPC_API_SECRET "<YOUR_INFURA_API_SECRET>" */
46
47
/* --- TLS server certificate pinning (M-04) -----------------------
48
* The sketch defaults to ISRG Root X1 (Let's Encrypt). If your provider
49
* uses a different root CA, override WIFI_CA_CERT below with the
50
* appropriate root in PEM form.
51
*
52
* To retrieve the real CA chain of your endpoint:
53
* openssl s_client -showcerts -servername HOST -connect HOST:443 </dev/null
54
*
55
* To DISABLE pinning temporarily for development (e.g. to confirm a TLS
56
* handshake failure is a cert issue, not WiFi), uncomment WIFI_DISABLE_-
57
* CA_PINNING. The sketch prints a loud warning at boot when set.
58
* ⚠️ Never ship firmware with WIFI_DISABLE_CA_PINNING defined — the
59
* connection becomes trivially MITM-able. */
60
#define WIFI_CA_CERT \
61
"-----BEGIN CERTIFICATE-----\n" \
62
"MIIDejCCAmKgAwIBAgIQ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kNeWIP0GCbaM4C6uVdF5dTUsMVs/ZbzNnIdCp5Gxmx5ejvEau8otR/Cs\n" \
78
"kGN+hr/W5GvT1tMBjgWKZ1i4//emhA1JG1BbPzoLJQvyEotc03lXjTaCzv8mEbep\n" \
79
"8RqZ7a2CPsgRbuvTPBwcOMBBmuFeU88+FSBX6+7iP0il8b4Z0QFqIwwMHfs/L6K1\n" \
80
"vepuoxtGzi4CZ68zJpiq1UvSqTbFJjtbD4seiMHl\n" \
81
"-----END CERTIFICATE-----\n"
82
/* #define WIFI_DISABLE_CA_PINNING */
/* DEV ONLY — MITM vulnerable */
83
84
/* =========================
85
* Wallet / Keys (SENSITIVE)
86
* ========================= */
87
/* ⚠️ NEVER COMMIT config.h — it contains credentials.
88
*
89
* L-04 — A hardcoded PIN sits in flash (.rodata) and is recoverable via
90
* SWD/JTAG. OK for a demo, NOT for production: in prod replace with a
91
* keypad / BLE prompt / companion chip, then secure_wipe() the buffer
92
* right after wallet.sign() / wallet.verifyPin(). */
93
94
#define CARD_PIN "<CARD_PIN>"
/* 4-9 digit PIN, e.g. "000000000" */
95
#define CARD_PIN_LEN (9U)
/* number of digits in CARD_PIN */
96
97
/* =========================
98
* Ethereum Addresses
99
* ========================= */
100
/* Sender address — lowercase hex, no 0x prefix */
101
#define ADDR_FROM "<SENDER_ADDRESS>"
102
103
/* Recipient address */
104
#define ADDR_TO "<RECIPIENT_ADDRESS>"
105
106
/* USDC contract address (Sepolia testnet) */
107
#define ADDR_USDC "<USDC_CONTRACT_ADDRESS>"
108
109
/* =========================
110
* Transaction Parameters
111
* ========================= */
112
#define CHAIN_ID_SEPOLIA 11155111
113
114
/* Amount in token smallest unit (USDC has 6 decimals) */
115
#define AMOUNT_USDC 1000000UL
/* 1.0 USDC */
116
117
/* Gas parameters (in wei) */
118
#define MAX_PRIORITY_FEE 2000000000ULL
/* 2 Gwei */
119
#define MAX_FEE 4000000000ULL
/* 4 Gwei */
120
#define GAS_LIMIT_ERC20 60000ULL
121
122
#endif
/* CONFIG_H */
examples
UsdcSigning
config.template.h
Generated by
1.15.0