SPB Git

Repository Public

CLAUDE.md 7.3 KB

# QYVORA — project instructions

QYVORA is a non-custodial, fully local iOS wallet (Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, seven EVM networks, Solana and TRON; see docs/CHAINS.md) with a post-quantum cryptographic engine written from scratch in Swift. Repository: https://git.spboucher.ai/qyvora. Source of truth: this laptop checkout (Apple-app exception to the remote-first rule). Register of what works: docs/STATUS.md.

# Standing decisions of the owner

  • Mainnet (2026-12-04). The original brief forbade real funds before an audit. The owner then asked for mainnet on the internal TestFlight build, to test with small real amounts. Implemented as: Info.plist key QYInternalMainnet + a user switch in the settings (both required) and per-transaction limits (MainnetPolicy.limits in Sources/QyvoraCore/Networks.swift). Do not raise the limits, remove the switch or ship QYInternalMainnet in a public build without an explicit request.
  • TestFlight before the audit (2026-12-04). The owner asked for the first internal TestFlight build to be uploaded as soon as the wallet screens are merged, without waiting for the audit. This covers internal TestFlight only; the audit stays mandatory and still runs automatically afterwards, and it remains a precondition for external testing, App Store submission or any wider distribution.
  • Multi-chain upgrade (2026-12-05). The owner asked for a major upgrade beyond the original two-chain brief: more blockchains "like SP Wallet" and a better front end. Scope chosen: EVM networks (Base, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche), UTXO coins (Litecoin, Dogecoin, Bitcoin Cash), Solana (Ed25519 written from scratch) and TRON, each with its test network. The mainnet opt-in, the per-transaction limits and the mandatory audit apply to every new chain; the audit is re-run on the upgraded code before any build that contains it.
  • No fabricated data. No placeholder balances, prices, history, test results or benchmark numbers.
  • Honest positioning. Post-quantum cryptography protects the local vault, backups, transfers and the separate identity. It does not make Bitcoin or Ethereum quantum-resistant; never claim end-to-end post-quantum protection.

# MANDATORY — full wallet security audit (owner instruction of 2026-12-04)

Once the functional implementation of the wallet is complete, run the audit below without waiting for a new instruction, on the final code, before any publication, TestFlight distribution or production release. The project is not finished just because the application builds and works. The audit is really executed, never merely documented or simulated.

# 1. Automated tools (installed, configured and run on our own infrastructure)

Semgrep (static analysis), MobSF (compiled iOS application), mobsfscan (Swift source), Gitleaks (secrets in code and Git history), Dontrust (crypto-wallet analysis, according to its real compatibility), the Coinspect Wallet Security Framework (wallet security reference), OWASP MASVS and MASTG (mobile security validation). Check the real compatibility and coverage of each tool; complete insufficient analyses with specialised tests.

# 2. In-depth cryptographic audit (absolute priority: the algorithms are written from scratch)

For every classical and post-quantum implementation: conformance to the applicable NIST standards; official test vectors; private and public key generation; signature generation and verification; entropy and random numbers; cryptographic arithmetic; hash functions; key derivation; resistance to timing attacks and to side channels; handling and erasure of sensitive data in memory; malformed-input validation; arithmetic overflow detection; differential tests against independent reference implementations (allowed in the test environment only, never as production dependencies); cryptographic fuzzing; property and mathematical invariant tests.

# 3. Wallet security audit

Local storage of private keys; Secure Enclave and Keychain; Face ID authentication; protection of recovery phrases; backup and restore; encryption of local data; auto-lock; protection against compromised applications; leaks in logs; clipboard and screenshots; network communications; protection against fraudulent transactions; address validation; construction and signing of Bitcoin and Ethereum transactions; fees, nonces and UTXOs; replay protection; integrity of the transactions presented to the user. Keep the post-quantum security of local storage explicitly separate from that of Bitcoin and Ethereum transactions and protocols.

# 4. Permanent audit infrastructure

An audit engine inside this repository, at least: security/audit/, security/tests/, security/vectors/, security/fuzzing/, security/reports/, security/policies/, scripts/security-audit.sh. The whole audit re-runs with one command: ./scripts/security-audit.sh. It is wired into CI/CD so that every significant change to the wallet triggers the appropriate checks. Use MacLustr to parallelise where relevant.

# 5. Automatic correction

For each problem found: root cause; severity and impact; an appropriate fix; a regression test; re-run of the analyses concerned; check that the fix introduces nothing new. Any unresolved critical or high vulnerability blocks publication.

# 6. Final professional report

SECURITY_AUDIT_REPORT.pdf, SECURITY_AUDIT_REPORT.html, SECURITY_AUDIT_REPORT.md, SECURITY_AUDIT_RESULTS.json, CRYPTOGRAPHIC_VALIDATION_REPORT.pdf, THREAT_MODEL.md, SECURITY.md. They include: audited wallet version; exact Git commit hash; date; tool versions; methodology; scope and real coverage; number of tests executed; detailed results; vulnerabilities by severity; CVSS where applicable; fixes made; residual risks; cryptographic vector results; limits of the audit; recommendations before production. Professional enough to be published on the wallet's site after removal of sensitive information.

# 7. Non-negotiable conditions

No fictitious result. No simulated test presented as passed. No transmission of private keys or recovery phrases. No upload of the source code to an external service without authorisation. No real funds used during the tests; test networks and isolated environments only. No invented security certification. No vulnerability hidden to ease publication. No claim of absolute security. The automated audit is presented as an internal technical audit, not as an independent certification.

# 8. Final validation requires

A working application; conclusive cryptographic tests; a complete automated audit; critical and high vulnerabilities fixed; reproducible and verifiable reports; and an independent cryptographic review before any recommendation to use the wallet with real funds.

# Working notes

  • Engine and services: Swift package at the repository root (swift test -c release --filter <Module>Tests). Application: cd App && xcodegen generate, simulator "Qyvora iPhone", release pipeline App/Scripts/release.sh archive|export|upload.
  • Heavy builds belong on cluster nodes (rsync the worktree to <node>:qyvora-build/<name>/), not on the laptop. Nodes run Swift 6.3; the laptop runs 6.4, which is stricter about isolation: re-run tests locally after a merge.
  • Parallel contributors follow docs/CONTRIBUTING-AGENTS.md.
  • Landing site: Scripts/package-site.sh, then mld stage build/site-deploy qyvora-site && mld deploy qyvora-site.
Files main
Menu

Theme