Skip to content

Security

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:

  • $1+ trillion in value secured by secp256k1
  • 15+ years of continuous operation since 2009
  • Zero cryptographic failures in Bitcoin’s history
  • Millions of nodes validating cryptographic proofs daily
ComponentStandardDescription
Elliptic Curvesecp256k1256-bit curve used by Bitcoin
Signature AlgorithmECDSAElliptic Curve Digital Signature Algorithm
Hash FunctionSHA-256Secure Hash Algorithm, 256-bit
Key DerivationBIP-32/39Hierarchical Deterministic Wallets

ByteAuth uses the same elliptic curve as Bitcoin:

y² = x³ + 7 (mod p)

Where:

  • p = 2²⁵⁶ - 2³² - 977 (a 256-bit prime)
  • Generator point G is standardized
  • Order n ≈ 2²⁵⁶

Why secp256k1?

  • Faster signature verification than NIST curves
  • No suspicious “magic numbers” (unlike P-256)
  • Extensively audited by the cryptocurrency community
  • Standardized parameters prevent backdoors

The Elliptic Curve Digital Signature Algorithm provides:

  1. Authentication — Proves the signer knows the private key
  2. Non-repudiation — Signer cannot deny creating the signature
  3. Integrity — Any message modification invalidates the signature

Signature Process:

1. Hash the message: h = SHA256(message)
2. Generate random k (nonce)
3. Calculate r = (k × G).x mod n
4. Calculate s = k⁻¹(h + r × privateKey) mod n
5. Signature = (r, s)

All messages are hashed with SHA-256 before signing:

  • 256-bit output — Collision-resistant up to 2¹²⁸ operations
  • Preimage resistant — Cannot reverse hash to find input
  • Second preimage resistant — Cannot find different input with same hash
  • NIST standardized — Published, audited, trusted

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:

  • Single backup (seed phrase) recovers all keys
  • Unique key pair per domain (privacy)
  • Compromising one domain doesn’t affect others
  • Deterministic — same seed always produces same keys

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.

  • Device compromise — If an attacker has full control of the user’s phone
  • Coerced authentication — If a user is physically forced to authenticate
  • Lost seed phrase — If the user loses their backup and device
  • Social engineering — Tricking users into authenticating to malicious sites
Attack VectorPasswordsByteAuth
Credential stuffingVulnerableImmune
PhishingHighly vulnerableResistant
Database breachCatastrophicNo impact
Brute forcePossibleImpossible
Rainbow tablesPossibleN/A
KeyloggersVulnerableResistant
AspectWebAuthnByteAuth
Key custodyPlatform (Apple/Google/Microsoft)User
Cross-deviceRequires same ecosystemAny device via QR
RecoveryPlatform-dependentSeed phrase
Bitcoin integrationNoneNative
Biometric bindingPlatform-enforcedApp-enforced

WebAuthn’s limitations:

  • Keys tied to platform accounts (not self-sovereign)
  • Cross-device auth requires ecosystem buy-in
  • No standard recovery mechanism
  • Can’t integrate with Bitcoin/Lightning
AspectLNURL-authByteAuth
Wallet requirementLightning walletByteVault
Network dependencyLightning NetworkNone
Biometric requirementWallet-dependentAlways required
Liveness detectionNoneBuilt-in
Corporate adoptionLimitedGrowing

LNURL-auth’s limitations:

  • Requires functional Lightning wallet
  • Network connectivity for signing
  • No biometric enforcement standard
  • Limited enterprise tooling

ByteVault requires biometric authentication before signing:

  • Uses Secure Enclave for key protection
  • Biometric data never leaves device
  • Hardware-backed attestation
  • Keys protected by TEE (Trusted Execution Environment)
  • BiometricPrompt API enforces strong auth
  • Hardware security module on supported devices

ByteVault includes passive liveness detection to prevent:

  • Photo attacks
  • Video replay attacks
  • 3D mask attacks
  • Screen capture attacks
// ALWAYS verify signatures cryptographically
const isValid = verifySignature(publicKey, signature, challenge);
if (!isValid) {
throw new Error('Invalid signature');
}
// ALWAYS check timestamp freshness
const age = Date.now() / 1000 - payload.timestamp;
if (age > 30) {
throw new Error('Challenge expired');
}
// ALWAYS validate challenge format
if (!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 seconds
setInterval(refreshQR, 30000);
// DO poll for status at reasonable intervals
setInterval(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 codes
  1. Use TLS 1.3 for all communications
  2. Implement rate limiting on all auth endpoints
  3. Log all authentication events for audit trails
  4. Monitor for anomalies (impossible travel, unusual patterns)
  5. Rotate webhook secrets periodically

Before going to production:

  • TLS configured on all endpoints
  • Webhook signature verification enabled
  • Rate limiting implemented
  • Logging and monitoring configured
  • Error handling doesn’t leak information
  • Session management secure (httpOnly, secure cookies)
  • CORS configured correctly
  • CSP headers prevent XSS
  • No secrets in client-side code
  • Webhook endpoints not publicly browsable

If you suspect a security incident:

  1. Don’t panic — ByteAuth’s design limits blast radius
  2. Rotate webhook secrets immediately
  3. Review authentication logs for anomalies
  4. Contact security@bytefederal.com for support
  5. Notify affected users if appropriate

Report security vulnerabilities responsibly: