Credential Theft
Private keys never leave the device. There’s nothing to steal from servers.
ByteAuth is built on Bitcoin’s battle-tested cryptographic primitives. This page details our security architecture, cryptographic choices, and best practices for implementation.
We deliberately chose Bitcoin’s cryptographic stack because it’s the most adversarially tested system in the world:
| Component | Standard | Description |
|---|---|---|
| Elliptic Curve | secp256k1 | 256-bit curve used by Bitcoin |
| Signature Algorithm | ECDSA | Elliptic Curve Digital Signature Algorithm |
| Hash Function | SHA-256 | Secure Hash Algorithm, 256-bit |
| Key Derivation | BIP-32/39 | Hierarchical Deterministic Wallets |
ByteAuth uses the same elliptic curve as Bitcoin:
y² = x³ + 7 (mod p)Where:
p = 2²⁵⁶ - 2³² - 977 (a 256-bit prime)G is standardizedn ≈ 2²⁵⁶Why secp256k1?
The Elliptic Curve Digital Signature Algorithm provides:
Signature Process:
1. Hash the message: h = SHA256(message)2. Generate random k (nonce)3. Calculate r = (k × G).x mod n4. Calculate s = k⁻¹(h + r × privateKey) mod n5. Signature = (r, s)All messages are hashed with SHA-256 before signing:
ByteVault derives domain-specific keys using Bitcoin standards:
Master Seed (256 bits) ↓Master Key (BIP-32) ↓Purpose Key (m/44') ↓Coin Type Key (m/44'/0') ↓Account Key (m/44'/0'/0') ↓Domain Key (m/44'/0'/0'/domain_hash)Benefits:
Credential Theft
Private keys never leave the device. There’s nothing to steal from servers.
Phishing Attacks
Users verify the domain in ByteVault before signing. Signatures are domain-bound.
Database Breaches
Only public keys are stored. They’re called “public” for a reason.
Replay Attacks
Challenges expire in 30 seconds and include unique nonces.
Man-in-the-Middle
Signatures include the target domain. Intercepted signatures can’t be reused.
Brute Force
256-bit keys have 2²⁵⁶ possibilities. The sun will burn out first.
| Attack Vector | Passwords | ByteAuth |
|---|---|---|
| Credential stuffing | Vulnerable | Immune |
| Phishing | Highly vulnerable | Resistant |
| Database breach | Catastrophic | No impact |
| Brute force | Possible | Impossible |
| Rainbow tables | Possible | N/A |
| Keyloggers | Vulnerable | Resistant |
| Aspect | WebAuthn | ByteAuth |
|---|---|---|
| Key custody | Platform (Apple/Google/Microsoft) | User |
| Cross-device | Requires same ecosystem | Any device via QR |
| Recovery | Platform-dependent | Seed phrase |
| Bitcoin integration | None | Native |
| Biometric binding | Platform-enforced | App-enforced |
WebAuthn’s limitations:
| Aspect | LNURL-auth | ByteAuth |
|---|---|---|
| Wallet requirement | Lightning wallet | ByteVault |
| Network dependency | Lightning Network | None |
| Biometric requirement | Wallet-dependent | Always required |
| Liveness detection | None | Built-in |
| Corporate adoption | Limited | Growing |
LNURL-auth’s limitations:
ByteVault requires biometric authentication before signing:
ByteVault includes passive liveness detection to prevent:
// ALWAYS verify signatures cryptographicallyconst isValid = verifySignature(publicKey, signature, challenge);if (!isValid) { throw new Error('Invalid signature');}
// ALWAYS check timestamp freshnessconst age = Date.now() / 1000 - payload.timestamp;if (age > 30) { throw new Error('Challenge expired');}
// ALWAYS validate challenge formatif (!challenge.startsWith('byteauth:')) { throw new Error('Invalid challenge format');}
// ALWAYS use HTTPS for webhooks// ALWAYS verify webhook signatures// ALWAYS rate limit authentication attempts// DO refresh QR codes every 30 secondssetInterval(refreshQR, 30000);
// DO poll for status at reasonable intervalssetInterval(checkStatus, 5000);
// DON'T store session IDs in localStorage (use httpOnly cookies)// DON'T implement signature verification client-side// DON'T display sensitive data in QR codesBefore going to production:
If you suspect a security incident:
Report security vulnerabilities responsibly: