Repository Public
1# QYVORA — project instructions23QYVORA is a non-custodial, fully local iOS wallet (Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, seven EVM4networks, Solana and TRON; see `docs/CHAINS.md`) with a post-quantum cryptographic engine written from5scratch in Swift. Repository: https://git.spboucher.ai/qyvora. Source of truth: this6laptop checkout (Apple-app exception to the remote-first rule). Register of what works: `docs/STATUS.md`.78## Standing decisions of the owner910- **Mainnet (2026-12-04).** The original brief forbade real funds before an audit. The owner then asked for11 mainnet on the internal TestFlight build, to test with small real amounts. Implemented as: Info.plist key12 `QYInternalMainnet` + a user switch in the settings (both required) and per-transaction limits13 (`MainnetPolicy.limits` in `Sources/QyvoraCore/Networks.swift`). Do not raise the limits, remove the14 switch or ship `QYInternalMainnet` in a public build without an explicit request.15- **TestFlight before the audit (2026-12-04).** The owner asked for the first internal TestFlight build to be16 uploaded as soon as the wallet screens are merged, without waiting for the audit. This covers internal17 TestFlight only; the audit stays mandatory and still runs automatically afterwards, and it remains a18 precondition for external testing, App Store submission or any wider distribution.19- **Multi-chain upgrade (2026-12-05).** The owner asked for a major upgrade beyond the original two-chain brief:20 more blockchains "like SP Wallet" and a better front end. Scope chosen: EVM networks (Base, Arbitrum, Optimism,21 Polygon, BNB Chain, Avalanche), UTXO coins (Litecoin, Dogecoin, Bitcoin Cash), Solana (Ed25519 written from22 scratch) and TRON, each with its test network. The mainnet opt-in, the per-transaction limits and the mandatory23 audit apply to every new chain; the audit is re-run on the upgraded code before any build that contains it.24- **Export compliance (2026-12-05).** The owner answered "no non-exempt encryption" for build 1 in App Store25 Connect and asked for build 4 to be made available the same way; `ITSAppUsesNonExemptEncryption = false` is26 therefore set in Info.plist. It is his declaration: revisit it with him before any App Store submission.27- **No fabricated data.** No placeholder balances, prices, history, test results or benchmark numbers.28- **Honest positioning.** Post-quantum cryptography protects the local vault, backups, transfers and the29 separate identity. It does not make Bitcoin or Ethereum quantum-resistant; never claim end-to-end30 post-quantum protection.3132## MANDATORY — full wallet security audit (owner instruction of 2026-12-04)3334Once the functional implementation of the wallet is complete, run the audit below **without waiting for a35new instruction**, on the final code, before any publication, TestFlight distribution or production release.36The project is not finished just because the application builds and works. The audit is really executed,37never merely documented or simulated.3839### 1. Automated tools (installed, configured and run on our own infrastructure)4041Semgrep (static analysis), MobSF (compiled iOS application), mobsfscan (Swift source), Gitleaks (secrets in42code and Git history), Dontrust (crypto-wallet analysis, according to its real compatibility), the Coinspect43Wallet Security Framework (wallet security reference), OWASP MASVS and MASTG (mobile security validation).44Check the real compatibility and coverage of each tool; complete insufficient analyses with specialised tests.4546### 2. In-depth cryptographic audit (absolute priority: the algorithms are written from scratch)4748For every classical and post-quantum implementation: conformance to the applicable NIST standards; official49test vectors; private and public key generation; signature generation and verification; entropy and random50numbers; cryptographic arithmetic; hash functions; key derivation; resistance to timing attacks and to side51channels; handling and erasure of sensitive data in memory; malformed-input validation; arithmetic overflow52detection; differential tests against independent reference implementations (allowed in the test53environment only, never as production dependencies); cryptographic fuzzing; property and mathematical54invariant tests.5556### 3. Wallet security audit5758Local storage of private keys; Secure Enclave and Keychain; Face ID authentication; protection of recovery59phrases; backup and restore; encryption of local data; auto-lock; protection against compromised60applications; leaks in logs; clipboard and screenshots; network communications; protection against61fraudulent transactions; address validation; construction and signing of Bitcoin and Ethereum transactions;62fees, nonces and UTXOs; replay protection; integrity of the transactions presented to the user. Keep the63post-quantum security of local storage explicitly separate from that of Bitcoin and Ethereum transactions64and protocols.6566### 4. Permanent audit infrastructure6768An audit engine inside this repository, at least: `security/audit/`, `security/tests/`, `security/vectors/`,69`security/fuzzing/`, `security/reports/`, `security/policies/`, `scripts/security-audit.sh`. The whole audit70re-runs with one command: `./scripts/security-audit.sh`. It is wired into CI/CD so that every significant71change to the wallet triggers the appropriate checks. Use MacLustr to parallelise where relevant.7273### 5. Automatic correction7475For each problem found: root cause; severity and impact; an appropriate fix; a regression test; re-run of76the analyses concerned; check that the fix introduces nothing new. Any unresolved critical or high77vulnerability blocks publication.7879### 6. Final professional report8081`SECURITY_AUDIT_REPORT.pdf`, `SECURITY_AUDIT_REPORT.html`, `SECURITY_AUDIT_REPORT.md`,82`SECURITY_AUDIT_RESULTS.json`, `CRYPTOGRAPHIC_VALIDATION_REPORT.pdf`, `THREAT_MODEL.md`, `SECURITY.md`.83They include: audited wallet version; exact Git commit hash; date; tool versions; methodology; scope and84real coverage; number of tests executed; detailed results; vulnerabilities by severity; CVSS where85applicable; fixes made; residual risks; cryptographic vector results; limits of the audit; recommendations86before production. Professional enough to be published on the wallet's site after removal of sensitive87information.8889### 7. Non-negotiable conditions9091No fictitious result. No simulated test presented as passed. No transmission of private keys or recovery92phrases. No upload of the source code to an external service without authorisation. No real funds used93during the tests; test networks and isolated environments only. No invented security certification. No94vulnerability hidden to ease publication. No claim of absolute security. The automated audit is presented95as an internal technical audit, not as an independent certification.9697### 8. Final validation requires9899A working application; conclusive cryptographic tests; a complete automated audit; critical and high100vulnerabilities fixed; reproducible and verifiable reports; and an independent cryptographic review before101any recommendation to use the wallet with real funds.102103## Working notes104105- Engine and services: Swift package at the repository root (`swift test -c release --filter <Module>Tests`).106 Application: `cd App && xcodegen generate`, simulator "Qyvora iPhone", release pipeline107 `App/Scripts/release.sh archive|export|upload`.108- Heavy builds belong on cluster nodes (rsync the worktree to `<node>:qyvora-build/<name>/`), not on the laptop.109 Nodes run Swift 6.3; the laptop runs 6.4, which is stricter about isolation: re-run tests locally after a merge.110- Parallel contributors follow `docs/CONTRIBUTING-AGENTS.md`.111- Landing site: `Scripts/package-site.sh`, then `mld stage build/site-deploy qyvora-site && mld deploy qyvora-site`.112