Key Derivation (KDF)
Key Derivation Model
This guide explains how IBEx links a Passkey Signer to a Safe Smart Contract Wallet, and how additional wallets (EVM EOA, Solana, Bitcoin) are deterministically derived.
Architecture Overview
Passkey → Safe Wallet
The X/Y coordinates of the P-256 public key (stored in Signer.data.safe.signer.coordinates) are used to deterministically compute the Safe address:
- Passkey → WebAuthn signer identity —
rawId+(x, y)public key coordinates - Signer identity → Safe owner — The
SafeWebAuthnSignerFactorydeterministically deploys a signer contract from(rawId, x, y) - Safe owner → Safe address — Computed from the factory/proxy setup + owner, even before on-chain deployment (counterfactual)
No private key on the server. The Safe is a smart contract wallet. Authorization is done via WebAuthn signatures generated inside the authenticator's secure enclave.
Deriving EOA / Solana / Bitcoin
Derived wallets use a master derivation value associated with the same Signer, not from the Safe address itself.
Master Key Acquisition
Option 1 — PRF (preferred): The WebAuthn PRF extension returns deterministic bytes from the authenticator, using a tenant-scoped salt:
Option 2 — Sealed fallback: If PRF is unavailable, the backend generates 32 random bytes and stores them encrypted (AES-256-GCM) in Signer.data.derivation.sealedMaster.
HKDF Derivations
All derived wallets use HKDF-SHA256 with salt "ibexfi:derivation:v1":
| Wallet | Info String | Output | Address Format |
|---|---|---|---|
| EVM EOA | global:single_eoa | 32 bytes → secp256k1 scalar | Ethereum checksum address |
| Solana | solana:global | 32 bytes → Ed25519 seed | Base58 address |
| Bitcoin P2WPKH | bitcoin:global | 32 bytes → secp256k1 | bech32 (bc1q...) |
| Bitcoin Taproot | bitcoin:taproot | 32 bytes → secp256k1 | bech32m (bc1p...) |
Security Model
Protected by Design (Passkeys)
- Passkey private keys are non-exportable from the authenticator
- The server cannot reconstruct passkey private keys from stored data
Server-Side Secrets (Sealed Master)
When PRF is unavailable, security depends on:
DERIVATION_SECRET/DERIVATION_SALTenvironment variables- These should be stored in a KMS, not in plaintext env files
Recommendations
- Enforce required env vars — fail startup if derivation secrets are missing
- Prefer PRF-only mode where feasible
- Never log PRF outputs, unsealed master, or derived private keys
- Sign client-side for Bitcoin/Solana (server only prepares/relays)