Documentation Index
Fetch the complete documentation index at: https://mintlify.com/satsigner/satsigner/llms.txt
Use this file to discover all available pages before exploring further.
Overview
SatSigner uses a 4-digit PIN as the primary authentication mechanism to protect your Bitcoin wallet. The PIN serves dual purposes:- Authentication - Controls access to the application
- Encryption key - Derives cryptographic keys to encrypt sensitive data
PIN Security Architecture
Encryption Algorithm
SatSigner implements industry-standard AES-256-CBC encryption for all sensitive data:- Algorithm: AES (Advanced Encryption Standard)
- Key Size: 256-bit
- Mode: CBC (Cipher Block Chaining)
- Key Derivation: PBKDF2 with SHA-256
Key Derivation Process
The PIN is never stored directly. Instead, it undergoes a secure key derivation process:- Iterations: 10,000 (computational cost to resist brute-force attacks)
- Output Length: 256 bits
- Hash Function: SHA-256
- Salt: 16-byte random value (unique per installation)
Storage Security
PIN-related data is stored in platform-specific secure enclaves:- iOS: Keychain (hardware-backed when available)
- Android: SharedPreferences with encryption
PIN Configuration
Default Settings
Configurable Options
Maximum Attempts:- Minimum: 3 attempts
- Maximum: 10 attempts
- Default: 5 attempts
- Default: 30 seconds of inactivity
- Customizable per user preference
PIN Setup Process
Initial Setup
When setting up a PIN for the first time (apps/mobile/store/auth.ts:71-76):- User enters desired 4-digit PIN
- System generates a random 16-byte salt
- PIN is hashed using PBKDF2 (10,000 iterations)
- Salt and hashed PIN are stored in secure storage
- Encryption keys are derived for wallet data protection
PIN Validation
Every unlock attempt validates the PIN by:- Retrieving the stored salt from secure storage
- Applying PBKDF2 to the entered PIN with the same salt
- Comparing the result with the stored hash
- Granting access only on exact match
Security Lockout
Failed Attempt Handling
The system tracks failed PIN attempts (apps/mobile/app/unlock.tsx:99-108):Auto-Lock Behavior
The application automatically locks when:- App is sent to background
- Configured idle timeout is reached (default: 30 seconds)
- Device is locked
- App is force-closed
Best Practices
Choosing a Secure PIN
Recommendations:- Use a random 4-digit combination
- Avoid personal information
- Do not reuse PINs from other services
- Consider enabling a duress PIN for additional security
PIN Change Procedure
When changing your PIN:- Enter current PIN - Authentication required
- Enter new PIN - Choose a strong combination
- Confirm new PIN - Verify correct entry
- Re-encryption process - All encrypted data is re-encrypted with the new PIN-derived key
Changing your PIN requires re-encrypting all sensitive wallet data. This process happens automatically and securely in the background.
Data Protected by PIN
The PIN-derived encryption key protects:- Seed phrases (mnemonics) - BIP39 recovery words
- Private keys - Extended private keys (xprv)
- Passphrases - Optional BIP39 passphrase
- Descriptors - Output descriptors containing key information
- Account secrets - All sensitive account data
- Public keys and addresses
- Transaction history (without signing capability)
- Account metadata (names, labels)
- Application settings
Technical Implementation
Encryption Flow
- Plaintext: Sensitive data (e.g., mnemonic)
- Key: PIN-derived via PBKDF2
- IV (Initialization Vector): Random 32-character hex string
- Algorithm: AES-256-CBC
Decryption Flow
- Correct PIN (for key derivation)
- Original initialization vector (stored with encrypted data)
- Encrypted ciphertext
Threat Model
Protected Against
✓ Physical device theft - PIN required to access ✓ Unauthorized access - Auto-lock on inactivity ✓ Brute-force attacks - PBKDF2 iterations slow down attempts ✓ Data extraction - AES-256 encryption protects data at rest ✓ Memory dumps - Secure storage prevents plaintext exposureNot Protected Against
✗ Shoulder surfing - Physical observation of PIN entry ✗ Keyloggers - Malware on compromised device ✗ Physical device compromise - Advanced forensic techniques ✗ Weak PIN selection - User choosing guessable PINRecovery Considerations
PIN Recovery
There is no PIN recovery mechanism. If you forget your PIN:- You have a limited number of attempts (default: 5)
- Exceeding attempts triggers data deletion
- You must restore from seed phrase backup
Account Recovery Without PIN
If PIN access is lost:- Allow lockout to occur (data will be deleted)
- Reinstall or reset the application
- Use “Import Mnemonic” to restore accounts
- Re-enter seed phrases from secure backup
- Set a new PIN
Related Topics
- Duress PIN Functionality - Emergency protection mechanism
- Backup & Recovery - Protecting against PIN loss
- Encryption - Technical encryption details
- Seed Management - Protecting your seed phrases