Key Derivation
GRIPLOCK uses a deterministic key derivation scheme to generate Solana wallet addresses from two input factors: the NFC card UID and the user’s PIN.Overview
The derivation process transforms two secrets into a valid Ed25519 keypair, which is then encoded as a Solana address. This process is:- Deterministic — Same inputs always produce the same address
- Irreversible — Cannot recover inputs from the address
- Domain-separated — Isolated from other derivation contexts
Derivation Pipeline
Implementation Details
Step 1: Input Preparation
- NFC UIDs have fixed, known formats (typically 4, 7, or 10 bytes hex)
- The HKDF process provides collision resistance regardless of input structure
Step 2: Salt Generation
- Derivations are isolated to the GRIPLOCK context
- Different versions can use different salts for migration
- Prevents rainbow table attacks across applications
Step 3: HKDF Key Derivation
| Parameter | Value | Purpose |
|---|---|---|
| Hash | SHA-256 | Cryptographic hash function |
| IKM | nfcId + pin | Input keying material |
| Salt | griplock/solana/v1 | Domain separation |
| Info | griplock/ed25519-seed | Context binding |
| Length | 32 bytes | Ed25519 seed size |
Step 4: Ed25519 Key Generation
Note: The seed IS the private key. It’s used once for derivation and immediately zeroized. The private key is never stored or transmitted.
Step 5: Base58 Encoding
Complete Implementation
Security Analysis
Cryptographic Strength
| Property | Bits | Notes |
|---|---|---|
| HKDF output | 256 | Full SHA-256 security |
| Ed25519 security | ~128 | Equivalent symmetric security |
| Address space | 256 | 2^256 possible addresses |
Attack Resistance
Brute Force
Brute Force
Assuming a 6-digit PIN (10^6 possibilities) and known NFC UID, an attacker would need to perform 10^6 HKDF + Ed25519 operations. With rate limiting and proper hardware, this is impractical in real-time but highlights the importance of longer PINs for high-value wallets.Mitigation: Support longer PINs (8-12 digits) for enhanced security.
Rainbow Tables
Rainbow Tables
Pre-computed tables are defeated by:
- Domain-specific salt (
griplock/solana/v1) - Unique NFC UID per card
- Combination of two factors
Side-Channel
Side-Channel
The Noble cryptography libraries use constant-time implementations to resist timing attacks. Memory is zeroized immediately after use.
NFC Cloning
NFC Cloning
While NFC UIDs can theoretically be read, the PIN requirement means cloning alone doesn’t compromise the wallet. Physical possession + PIN knowledge are both required.
Derivation Properties
Determinism
- No seed storage required
- Recovery by re-tapping the same card with the same PIN
- Consistent access across multiple sessions
Irreversibility
Given only the Solana address, it is computationally infeasible to:- Recover the NFC UID
- Recover the PIN
- Recover the private key
Domain Separation
Thegriplock/solana/v1 salt and griplock/ed25519-seed info strings ensure:
- GRIPLOCK derivations don’t collide with other systems
- Future versions can use different parameters
- Multiple derivation contexts (e.g., different networks) can coexist
PIN Strength Recommendations
| PIN Length | Combinations | Security Level |
|---|---|---|
| 4 digits | 10,000 | Low — avoid for high-value |
| 6 digits | 1,000,000 | Medium — acceptable |
| 8 digits | 100,000,000 | High — recommended |
| 12 digits | 10^12 | Very High — maximum security |
Version Migration
If a new derivation scheme is needed in the future:- Update the salt to
griplock/solana/v2 - Users generate new addresses with their existing cards
- Transfer funds from v1 to v2 addresses
- Old addresses remain accessible with v1 code path
