# Wallet Security Key Management Review

> Use when reviewing how a wallet or custody product generates, stores, backs up, and recovers keys, including seed handling, multisig quorum, and signing UX. Use when advising a team on custody tiers, auditing a signing flow for blind signing or phishing risk, or writing a recovery plan that survives a lost device.

- Skill: `mizazhaider-ceh/wallet-security-key-management-review` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/wallet-security-key-management-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/wallet-security-key-management-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/wallet-security-key-management-review

---


Almost all crypto theft is wallet compromise, not chain compromise, and most wallet compromise is a signing or backup failure, not a broken cipher. This sub-skill belongs to wallet-security, which owns wallet threat models and custody advice, and it supplies the key management review: generation, storage, backup, recovery, multisig quorum, and the signing screen the user actually sees. It is defensive and educational, for products you are authorized to assess and for your own custody setup. Never handle real seed phrases during a review; use test wallets and test keys only.

## Quick Workflow

1. Classify the setup: hot or cold, custodial or self custody, single signature or multisig, and the value each tier is allowed to hold.
2. Review key generation: randomness source, entropy size, derivation path, and whether generation ever touches a networked process or a log.
3. Review storage: where each key lives, what encrypts it, what unlocks it, and what an attacker with the device, but not the PIN, can extract.
4. Review backup and recovery: seed display, written backup, passphrase handling, social recovery, and the exact steps after a lost device.
5. Review the signing flow end to end: what the user sees, what is hidden, whether blind signing is possible, and how a malicious dApp request is presented.
6. Test the common theft techniques against the setup: phishing approvals, malicious token approvals, clipboard replacement, and fake update prompts.
7. Check the multisig quorum: threshold, signer independence, key locations, and what happens when one signer is lost or compromised.
8. Recommend custody tiers matched to value at risk, and verify the recommendation with a small test transaction before any real funding.

## 1. Generation and storage code review

```bash
# Search the wallet source for randomness, seed, and key handling
grep -rn "mnemonic\|seed\|entropy\|privateKey\|keystore" wallet-src/ -i | head -40
# Red flags to confirm by reading the code, not by grep alone:
# a seed written to a log file, sent to a server, or stored unencrypted
# a weak randomness source, a hardcoded test key left in production code
grep -rn "Math.random\|random()" wallet-src/ --include="*.ts" --include="*.js" | head -20
```

```python
#!/usr/bin/env python3
"""Entropy sanity check for a test wallet implementation, lab only."""
import secrets
# A proper wallet uses operating system level randomness.
# Verify the source in code, not the output, because output looks random
# even from a broken generator.
print("secrets module source:", secrets.__file__)
seed = secrets.token_bytes(32)
print("generated 256 bits:", seed.hex()[:32], "...")
print("never generate real seeds in a script you might log or share")
```

## 2. Signing UX and approval review

```bash
# List the approval and signing entry points and their user facing text
grep -rn "eth_sign\|personal_sign\|signTypedData\|approve\|setApprovalForAll" \
  wallet-src/ -i | head -40
# For each one, check: does the screen show the contract, the token,
# the amount, and the spender in plain language before the user signs?
# Unlimited approvals and blind signing of opaque hashes are findings.
```

```bash
# Check existing token approvals for a test address, to show the risk
# of an old unlimited approval being abused by a compromised contract
cast call $TOKEN "allowance(address,address)" $WALLET $SPENDER --rpc-url $RPC_URL
# Revocation is part of the review: can the user find and revoke
# approvals from inside the wallet, or must they use an outside tool?
```

## 3. Multisig quorum and recovery drill

```python
#!/usr/bin/env python3
"""Multisig quorum model: what one loss or one compromise costs."""
signers = ["alice-hardware", "bob-hardware", "paper-backup", "company-vault"]
threshold = 2
print(f"signers: {len(signers)}, threshold: {threshold}")
print("one signer lost: still usable" if len(signers) - 1 >= threshold else "one signer lost: funds frozen")
print("one signer compromised: still safe" if threshold > 1 else "one signer compromised: funds stolen")
print("flag it if two signers share one device, one location, or one person")
```

```bash
# Recovery drill on test wallets only: wipe a test device, restore
# from the backup, and confirm the restored address matches exactly
# before recommending the backup method to anyone
# 1. Record the test address. 2. Wipe. 3. Restore. 4. Compare addresses.
# 5. Send a tiny test transaction. 6. Document any step that was unclear.
echo "recovery drill checklist recorded in the review notes"
```

## Edge cases

- A passphrase (sometimes called the 25th word) creates a hidden wallet; losing the passphrase loses the funds even with a perfect seed backup, so the review must name it explicitly.
- Social recovery that depends on guardians who are all in one company or one family is a single point of failure dressed as redundancy.
- A hardware wallet used with a compromised host still needs the user to verify the address and amount on the device screen; skipping that check defeats the hardware.
- Custodial wallets shift the risk to the custodian's controls, insurance, and withdrawal delays; review those instead of pretending the user holds keys.
- Inheritance is part of key management: a setup nobody else can recover after death or incapacity is a finding, not a feature.
- Test keys and real keys must never share a backup, a device, or a password; a review that mixes them has already created the leak it was meant to find.

## Key references

- BIP39 mnemonic and BIP32 derivation specifications: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
- Ethereum documentation, wallets and account concepts: https://ethereum.org/en/wallets/
- OpenZeppelin Contracts, multisig style access control: https://docs.openzeppelin.com/contracts/
- Hardware wallet vendor security guidance for the device under review, read from the vendor site, not from a summary
- EIP-712 typed data signing specification: https://eips.ethereum.org/EIPS/eip-712

