SPB Git

Repository Public

wallet-audit.json 153.8 KB 2,961 lines json

1{2  "schema": "qyvora-audit/framework/1",3  "framework": "QYVORA wallet audit (owner's brief, section 3 of the mandatory audit)",4  "source": {5    "version": "1",6    "retrieved": "2026-12-04",7    "note": "Checklist derived from CLAUDE.md, \"MANDATORY — full wallet security audit\", section 3."8  },9  "coverage": "Source review of the service layer (QyvoraWallet, QyvoraVault, QyvoraStorage, QyvoraNetworking, QyvoraBitcoin, QyvoraEthereum, QyvoraRecovery, QyvoraIdentity), of the UI components (QyvoraUI) and of the application sources present at the audited commit, with automated checks re-evaluated at every run. The application screens for sending, reviewing, unlocking and displaying the phrase were not finished: items that depend on them say so. No dynamic test on a device, no real funds.",10  "verdicts": {11    "pass": "design and implementation agree, with verified evidence",12    "partial": "met in part",13    "fail": "not met",14    "not-applicable": "statement of fact rather than a control",15    "not-assessed": "cannot be judged at the audited commit"16  },17  "items": [18    {19      "id": "WA-KEY-01",20      "title": "Vault file format: every secret encrypted and the whole file authenticated",21      "group": "key-storage",22      "verdict": "pass",23      "scope": "service",24      "rationale": "One file holds all secrets as records sealed with AES-256-GCM (96-bit random nonce, associated data binding vault, record identifier, type, creation time and key epoch). The file ends with an HMAC-SHA256 under a key derived from the master key and a SHA-256 checksum; parsing is bounds-checked and returns typed errors. Tests corrupt every byte, swap and relabel records, tamper slot headers and truncate the file.",25      "evidence": [26        {27          "ref": "Sources/QyvoraVault/VaultFile.swift:98",28          "contains": "file     = magic ‖ version ‖ headerLength ‖ header ‖ bodyLength ‖ body ‖ mac ‖ checksum"29        },30        {31          "ref": "Sources/QyvoraVault/Vault.swift:715",32          "contains": "private func seal("33        },34        {35          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:484",36          "contains": "everySingleByteCorruptionIsDetected"37        },38        {39          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:646",40          "contains": "recordsCannotBeSwappedOrRelabelledEvenWithTheKey"41        },42        {43          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:565",44          "contains": "slotHeaderTamperingIsDetected"45        },46        {47          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:506",48          "contains": "truncationAndGarbageAreTypedErrors"49        }50      ]51    },52    {53      "id": "WA-KEY-02",54      "title": "Slot wrapping: the master key is wrapped independently per credential, with a slow, salted derivation",55      "group": "key-storage",56      "verdict": "pass",57      "scope": "service",58      "rationale": "Password and PIN slots wrap the random 256-bit master key under HKDF-SHA256(Argon2id ‖ PBKDF2-HMAC-SHA512) with per-slot salts and a slot-type label; the associated data binds the slot to the vault and the key epoch. A wrong credential and a damaged file are distinguished; changing the password scrubs the previous copy.",59      "gap": "The strength of the password itself is not enforced (QYV-APP-001).",60      "finding": "QYV-APP-001",61      "evidence": [62        {63          "ref": "Sources/QyvoraVault/Vault.swift:738",64          "contains": "private func makeWrapSlot"65        },66        {67          "ref": "Sources/QyvoraVault/VaultCrypto.swift:294",68          "contains": "public static let passwordSlot = \"qyvora/v1/slot/password\""69        },70        {71          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:160",72          "contains": "changePasswordInvalidatesTheOldOne"73        },74        {75          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:723",76          "contains": "keyStretchingIsTheDocumentedCombiner"77        }78      ]79    },80    {81      "id": "WA-KEY-03",82      "title": "Keychain attributes",83      "group": "key-storage",84      "verdict": "pass",85      "scope": "service",86      "rationale": "Generic-password items in the data-protection Keychain, class WhenPasscodeSetThisDeviceOnly, never synchronizable; the device-slot key adds `.biometryCurrentSet`. The PIN failure counter also lives there, so replacing the vault file does not reset it.",87      "evidence": [88        {89          "ref": "Sources/QyvoraStorage/KeychainStore.swift:82",90          "contains": "kSecAttrSynchronizable as String: false"91        },92        {93          "ref": "Sources/QyvoraStorage/KeychainStore.swift:83",94          "contains": "kSecUseDataProtectionKeychain as String: true"95        },96        {97          "ref": "Sources/QyvoraStorage/KeychainStore.swift:102",98          "contains": "kSecAttrAccessible as String] = kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly"99        },100        {101          "ref": "Sources/QyvoraVault/Vault.swift:783",102          "contains": "Living in the Keychain, the counter survives a replaced or restored vault file."103        }104      ],105      "checks": [106        {107          "id": "keychain-classes",108          "type": "grep",109          "description": "No Keychain accessibility class weaker than WhenPasscodeSetThisDeviceOnly / WhenUnlockedThisDeviceOnly",110          "globs": [111            "Sources/**/*.swift",112            "App/Sources/**/*.swift"113          ],114          "pattern": "kSecAttrAccessibleAfterFirstUnlock|kSecAttrAccessibleAlways|kSecAttrAccessibleWhenUnlocked\\b|kSecAttrSynchronizable as String: true",115          "expect": "absent",116          "severity": "high",117          "area": "wallet",118          "cwe": "CWE-522",119          "recommendation": "Use a ThisDeviceOnly class that requires the device to be unlocked."120        }121      ]122    },123    {124      "id": "WA-KEY-04",125      "title": "Secure Enclave wrapper",126      "group": "key-storage",127      "verdict": "pass",128      "scope": "service",129      "rationale": "Optional second layer of the device slot: an ECIES-like wrap (ephemeral P-256 ECDH, HKDF-SHA256, AES-256-GCM, CryptoKit only) under a Secure Enclave key-agreement key that never leaves the hardware. The service enables it by default for biometrics and refuses to enable it where no enclave exists.",130      "gap": "The enclave key is created with `.privateKeyUsage` only: it binds the wrapped blob to the device, it does not itself require user presence (the biometric gate is the Keychain item). The opaque key handle is stored in the Keychain without biometry.",131      "evidence": [132        {133          "ref": "Sources/QyvoraStorage/SecureEnclaveKey.swift:134",134          "contains": "SecureEnclave.P256.KeyAgreement.PrivateKey(accessControl: control)"135        },136        {137          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:386",138          "contains": "public func enableBiometrics(useSecureEnclave: Bool = true)"139        },140        {141          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:277",142          "contains": "secureEnclaveMustBeAvailableToEnable"143        }144      ],145      "residual_risk": "low"146    },147    {148      "id": "WA-KEY-05",149      "title": "Design versus implementation of key storage",150      "group": "key-storage",151      "verdict": "pass",152      "scope": "service",153      "rationale": "The implementation matches the documented format (a test compares the byte layout with the documentation) and the threat model: system AEAD by default with an engine backend proven interoperable, two independent KDF implementations combined, previous-generation file kept for crash safety and scrubbed whenever a secret is replaced.",154      "evidence": [155        {156          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:455",157          "contains": "layoutMatchesTheDocumentedFormat"158        },159        {160          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:678",161          "contains": "aeadInteropBothWays"162        },163        {164          "ref": "Sources/QyvoraVault/Vault.swift:392",165          "contains": "// the replaced content must not survive in the `.previous` copy"166        }167      ]168    },169    {170      "id": "WA-KEY-06",171      "title": "Secrets in memory",172      "group": "key-storage",173      "verdict": "partial",174      "scope": "service",175      "severity": "low",176      "rationale": "On the signing path the phrase, the passphrase, the seed, the master key, the derived extended keys and the child private key are held as bytes for the duration of one signature and erased where they are; no String of the phrase is built for a signature (QYV-CRY-003, reduced). The vault keeps its master key in `SecretBytes`.",177      "gap": "Not erasable in Swift: secp256k1 scalars and nonces on the stack, hash scratch, and the String forms of passwords, PINs and of the phrase where it is displayed or typed (QYV-CRY-003, open).",178      "evidence": [179        {180          "ref": "Sources/QyvoraWallet/WalletService.swift:353",181          "contains": "seed = BIP39.seed(normalizedMnemonic: phrase, normalizedPassphrase: passphrase)"182        },183        {184          "ref": "Sources/QyvoraCore/HD/BIP32.swift:173",185          "contains": "public mutating func wipe() {"186        },187        {188          "ref": "Tests/QyvoraCoreTests/AuditRegressionTests.swift:115",189          "contains": "func wipeErasesThePrivateKeyAndTheChainCodeWhereTheyAre()"190        }191      ],192      "residual_risk": "low to medium",193      "finding": "QYV-CRY-003",194      "reassessed": "2026-12-04, on the application and service code after the fixes of the open findings"195    },196    {197      "id": "WA-AUTH-01",198      "title": "Face ID path",199      "group": "authentication",200      "verdict": "pass",201      "scope": "service",202      "rationale": "Biometric unlock reads a Keychain item protected by `.biometryCurrentSet`: the system performs the match and releases the key; no boolean result is trusted, a changed enrolment invalidates the item, and a key from an older slot generation is rejected by the AEAD.",203      "gap": "The lock screen that calls it is a placeholder at the audited commit.",204      "evidence": [205        {206          "ref": "Sources/QyvoraVault/Vault.swift:261",207          "contains": "public func unlockWithDevice(prompt: String? = nil)"208        },209        {210          "ref": "Sources/QyvoraStorage/KeychainStore.swift:124",211          "contains": "kSecUseAuthenticationContext"212        },213        {214          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:286",215          "contains": "deviceKeyOfAnOlderSlotIsRejected"216        },217        {218          "ref": "App/Resources/Info.plist:27",219          "contains": "NSFaceIDUsageDescription"220        }221      ],222      "checks": [223        {224          "id": "no-boolean-biometrics",225          "type": "grep",226          "description": "Biometrics are never used as a bare yes/no check (LAContext.evaluatePolicy)",227          "globs": [228            "Sources/**/*.swift",229            "App/Sources/**/*.swift"230          ],231          "pattern": "evaluatePolicy\\(",232          "expect": "absent",233          "severity": "medium",234          "area": "app",235          "cwe": "CWE-287",236          "on_unmet": "partial",237          "recommendation": "Keep the secret behind a Keychain item with an access control; never unlock on the boolean result of evaluatePolicy."238        },239        {240          "id": "faceid-purpose",241          "type": "plist",242          "description": "Face ID purpose string present",243          "path": "App/Resources/Info.plist",244          "key": "NSFaceIDUsageDescription",245          "expect": "present",246          "severity": "low",247          "area": "app"248        }249      ]250    },251    {252      "id": "WA-AUTH-02",253      "title": "PIN: throttling, device binding, optional wipe",254      "group": "authentication",255      "verdict": "pass",256      "scope": "service",257      "severity": "medium",258      "rationale": "Six digits, trivial PINs refused by the service (QYV-APP-011, fixed); bound to a device secret in the Keychain; escalating delays measured on the monotonic clock of the boot session, restarted in full after a restart or a clock change (QYV-SVC-010, fixed); counter in the Keychain, optional wipe. On a compromised device the Keychain items can be read and the PIN searched offline: the password slot is the protection there.",259      "evidence": [260        {261          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:530",262          "contains": "static func trivialPINReason(_ pin: String) -> String?"263        },264        {265          "ref": "Sources/QyvoraVault/Vault.swift:358",266          "contains": "guard state.hasMonotonic, state.bootSession == instant.bootSession, instant.seconds >= state.lastFailureUptime else { throw try restart() }"267        },268        {269          "ref": "Tests/QyvoraVaultTests/PINClockTests.swift:64",270          "contains": "func settingTheDateForwardDoesNotShortenTheDelay()"271        },272        {273          "ref": "Tests/QyvoraWalletTests/FindingsCredentialTests.swift:148",274          "contains": "func theServiceRefusesToEnableATrivialPIN()"275        }276      ],277      "reassessed": "2026-12-04, on the application and service code after the fixes of the open findings"278    },279    {280      "id": "WA-AUTH-03",281      "title": "Auto-lock",282      "group": "authentication",283      "verdict": "pass",284      "scope": "app",285      "severity": "medium",286      "rationale": "Applied by the application on a timer, on leaving for the background and before content is shown on return; decisions in `AutoLockRule`, tested against the service; \"never\" and delays above fifteen minutes refused (QYV-APP-003 and QYV-APP-004, fixed).",287      "evidence": [288        {289          "ref": "Sources/QyvoraWallet/WalletTypes.swift:259",290          "contains": "public var autoLock: AutoLockPolicy = .after(seconds: 300)"291        },292        {293          "ref": "Sources/QyvoraWallet/WalletService.swift:83",294          "contains": "public static let maximumAutoLockDelay: TimeInterval = 900"295        },296        {297          "ref": "Sources/QyvoraWallet/WalletService.swift:579",298          "contains": "The auto-lock cannot be switched off"299        },300        {301          "ref": "Sources/QyvoraWallet/AutoLockRule.swift:79",302          "contains": "public static func action(for event: Event, policy: AutoLockPolicy, isUnlocked: Bool) -> Action"303        },304        {305          "ref": "App/Sources/RootView.swift:132",306          "contains": "switch AutoLockRule.action(for: event, policy: snapshot.profile.autoLock, isUnlocked: snapshot.vault.isUnlocked)"307        },308        {309          "ref": "App/Sources/RootView.swift:89",310          "contains": ".task(id: autoLockTimerKey) { await autoLockTimer() }"311        },312        {313          "ref": "Tests/QyvoraWalletTests/FindingsFreshAuthenticationTests.swift:233",314          "contains": "func theLifeCycleLocksTheVaultImmediatelyAfterTheDelayAndInTheBackground()"315        }316      ],317      "checks": [318        {319          "id": "auto-lock-wired",320          "type": "grep",321          "description": "The application applies the auto-lock policy (timer or scene phase)",322          "globs": [323            "App/Sources/**/*.swift"324          ],325          "pattern": "autoLockIfNeeded\\(\\)",326          "expect": "present",327          "exclude": [328            "App/Sources/WalletStore.swift"329          ],330          "on_unmet": "fail",331          "finding": "QYV-APP-003"332        }333      ],334      "reassessed": "2026-12-04, on the application and service code after the fixes of the open findings"335    },336    {337      "id": "WA-AUTH-04",338      "title": "Fresh authentication for sensitive operations",339      "group": "authentication",340      "verdict": "pass",341      "scope": "service",342      "severity": "medium",343      "rationale": "Enforced by the service: a credential verified within two minutes on the monotonic clock is required by every sensitive call (QYV-APP-002, fixed); `changePassword` and `rotateMasterKey` verify the password themselves.",344      "evidence": [345        {346          "ref": "Sources/QyvoraWallet/WalletService.swift:316",347          "contains": "func requireFreshAuthentication(within window: TimeInterval = WalletService.authenticationWindow) async throws"348        },349        {350          "ref": "Sources/QyvoraWallet/WalletService.swift:78",351          "contains": "public static let authenticationWindow: TimeInterval = 120"352        },353        {354          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:361",355          "contains": "try await requireFreshAuthentication()"356        },357        {358          "ref": "Sources/QyvoraWallet/WalletService.swift:332",359          "contains": "been verified recently: no signature is made on the strength of an unlocked vault alone."360        },361        {362          "ref": "App/Sources/Security/ReauthenticationSheet.swift:322",363          "contains": "func requiresReauthentication(isPresented: Binding<Bool>, reason: String, onSuccess: @escaping () -> Void) -> some View"364        },365        {366          "ref": "Tests/QyvoraWalletTests/FindingsFreshAuthenticationTests.swift:71",367          "contains": "func everySensitiveCallNeedsAFreshAuthentication()"368        }369      ],370      "reassessed": "2026-12-04, on the application and service code after the fixes of the open findings"371    },372    {373      "id": "WA-PHR-01",374      "title": "Generation and storage of the recovery phrase",375      "group": "recovery-phrase",376      "verdict": "pass",377      "scope": "service",378      "rationale": "24 words from 256 bits of `SystemRandom` entropy (BIP-39, checksum verified by the official vectors); stored only as a vault record; returned once at creation; imports verify word list and checksum; the service checks at every signature that the phrase in the vault still derives the wallet's public account.",379      "evidence": [380        {381          "ref": "Sources/QyvoraCore/HD/BIP39.swift:65",382          "contains": "var entropy = SystemRandom.bytes(wordCount / 3 * 4)"383        },384        {385          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:58",386          "contains": "let words = try BIP39.generate(wordCount: 24)"387        },388        {389          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:605",390          "contains": "The recovery phrase in the vault does not match this wallet's account."391        }392      ],393      "checks": [394        {395          "id": "system-rng-only",396          "type": "grep",397          "description": "No generator other than SystemRandom (SecRandomCopyBytes) in the engine, services or application",398          "globs": [399            "Sources/**/*.swift",400            "App/Sources/**/*.swift"401          ],402          "pattern": "arc4random|drand48|\\bsrand\\(|\\brandom\\(\\)|SystemRandomNumberGenerator|\\.random\\(in:|\\.randomElement\\(|\\.shuffled\\(\\)|GKRandom",403          "expect": "absent",404          "severity": "high",405          "area": "crypto",406          "cwe": "CWE-338",407          "recommendation": "Draw from SystemRandom.bytes only."408        }409      ]410    },411    {412      "id": "WA-PHR-02",413      "title": "Display and entry of the recovery phrase",414      "group": "recovery-phrase",415      "verdict": "pass",416      "scope": "app",417      "severity": "medium",418      "rationale": "Keyboard extensions refused (QYV-APP-005, fixed); words hidden while the screen is captured, warning after a screenshot, no copy and no selection, reveal behind a re-authentication and removed when the screen is left (QYV-APP-006, fixed); warning on a device that looks compromised. Residual: a screenshot cannot be prevented; the words are not masked once revealed.",419      "evidence": [420        {421          "ref": "App/Sources/AppDelegate.swift:51",422          "contains": "shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier) -> Bool"423        },424        {425          "ref": "App/Sources/QyvoraApp.swift:47",426          "contains": "@UIApplicationDelegateAdaptor(QyvoraAppDelegate.self) private var delegate"427        },428        {429          "ref": "Sources/QyvoraUI/SeedPhrase.swift:150",430          "contains": "public static func isHidden(masked: Bool, revealed: Bool, redacted: Bool, captured: Bool) -> Bool"431        },432        {433          "ref": "Sources/QyvoraUI/SeedPhrase.swift:169",434          "contains": "UIApplication.userDidTakeScreenshotNotification"435        },436        {437          "ref": "App/Sources/Security/RevealPhraseView.swift:104",438          "contains": ".warnsAboutScreenshots(of: !words.isEmpty, taken: $screenshotTaken)"439        },440        {441          "ref": "Tests/QyvoraUITests/QyvoraUITests.swift:376",442          "contains": "func theRecoveryWordsAreHiddenWheneverTheSceneIsCaptured()"443        },444        {445          "ref": "App/Sources/Security/RevealPhraseView.swift:96",446          "contains": ".requiresReauthentication(isPresented: $reauthenticate, reason: \"Reveal the recovery phrase\") { reveal() }"447        }448      ],449      "checks": [450        {451          "id": "custom-keyboards-refused",452          "type": "grep",453          "description": "Keyboard extensions are refused application-wide",454          "globs": [455            "App/Sources/**/*.swift"456          ],457          "pattern": "shouldAllowExtensionPointIdentifier",458          "expect": "present",459          "on_unmet": "fail",460          "finding": "QYV-APP-005"461        },462        {463          "id": "screen-capture-handled",464          "type": "grep",465          "description": "The application reacts to screen capture or screenshots of secrets",466          "globs": [467            "Sources/**/*.swift",468            "App/Sources/**/*.swift"469          ],470          "pattern": "isCaptured|userDidTakeScreenshotNotification|sceneCaptureState",471          "expect": "present",472          "on_unmet": "fail",473          "finding": "QYV-APP-006"474        }475      ],476      "reassessed": "2026-12-04, on the application and service code after the fixes of the open findings"477    },478    {479      "id": "WA-BAK-01",480      "title": "Backup file",481      "group": "backup-restore",482      "verdict": "pass",483      "scope": "service",484      "rationale": "\"QYVORA Backup v1\": all records re-encrypted with AES-256-GCM under a key stretched from an independent backup password (own salts, same combiner), header authenticated as associated data, optional signature by the wallet's post-quantum identity with signer pinning on restore, trailing checksum, size limits. Scope of the post-quantum statement: this concerns the protection of data at rest and in transfer on the user's devices. It does not change the security of Bitcoin or Ethereum transactions, which rest on secp256k1 and are not quantum-resistant.",485      "gap": "The backup password is only required to be non-empty (QYV-APP-001).",486      "finding": "QYV-APP-001",487      "evidence": [488        {489          "ref": "Sources/QyvoraRecovery/BackupFile.swift:117",490          "contains": "associated data = magic ‖ version ‖ headerLength ‖ header"491        },492        {493          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:321",494          "contains": "expectedSignerFingerprint: expectedSignerFingerprint"495        },496        {497          "ref": "Sources/QyvoraRecovery/BackupFile.swift:65",498          "contains": "case unexpectedSigner"499        }500      ]501    },502    {503      "id": "WA-BAK-02",504      "title": "Restore",505      "group": "backup-restore",506      "verdict": "pass",507      "scope": "service",508      "rationale": "Everything is verified before a vault is created (decryption, optional signature and signer, presence of a phrase, derivation of the public data); a failure leaves nothing half-created; restore is refused when a wallet already exists.",509      "evidence": [510        {511          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:328",512          "contains": "// everything is verified before the vault is created"513        },514        {515          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:357",516          "contains": "try? await vault.destroy()"517        },518        {519          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:325",520          "contains": "guard profile.kind == nil else { throw WalletError.walletAlreadyExists }"521        }522      ]523    },524    {525      "id": "WA-BAK-03",526      "title": "Device-to-device transfer",527      "group": "backup-restore",528      "verdict": "pass",529      "scope": "service",530      "rationale": "The encrypted backup is wrapped in a hybrid envelope for the receiving device's temporary identity: X25519 and ML-KEM-1024 combined through HKDF over a transcript, AES-256-GCM, signed by the sender; the backup password still applies inside. Scope of the post-quantum statement: this concerns the protection of data at rest and in transfer on the user's devices. It does not change the security of Bitcoin or Ethereum transactions, which rest on secp256k1 and are not quantum-resistant.",531      "gap": "The receiver's fingerprint must be compared by the user on both screens; that screen is not present at the audited commit.",532      "evidence": [533        {534          "ref": "Sources/QyvoraIdentity/HybridEnvelope.swift:48",535          "contains": "The payload stays confidential as long as"536        },537        {538          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:371",539          "contains": "public func createTransferPackage"540        },541        {542          "ref": "Sources/QyvoraWallet/WalletService.swift:118",543          "contains": "Temporary identity of a device waiting for a transfer package (never stored)."544        }545      ]546    },547    {548      "id": "WA-DP-01",549      "title": "Data-protection class and backup exclusion",550      "group": "data-protection",551      "verdict": "pass",552      "scope": "service",553      "rationale": "FileStore writes with NSFileProtectionComplete, sets the protection key on every file and on the directory, and flags them excluded from backups; the entitlement declares the same default; the container is not exposed to file sharing.",554      "gap": "`applyAttributes` is best effort (failures are ignored); the exported backup file is written to the user's chosen location with default attributes, by design.",555      "evidence": [556        {557          "ref": "Sources/QyvoraStorage/FileStore.swift:199",558          "contains": "return protection == .complete ? [.completeFileProtection] : [.completeFileProtectionUnlessOpen]"559        },560        {561          "ref": "Sources/QyvoraStorage/FileStore.swift:227",562          "contains": "values.isExcludedFromBackup = true"563        }564      ],565      "checks": [566        {567          "id": "file-protection-complete",568          "type": "grep",569          "description": "Files are written with NSFileProtectionComplete by default",570          "globs": [571            "Sources/QyvoraStorage/FileStore.swift"572          ],573          "pattern": "protection: Protection = \\.complete",574          "expect": "present",575          "severity": "high",576          "area": "wallet",577          "cwe": "CWE-311",578          "recommendation": "Keep `.complete` as the default protection of FileStore."579        },580        {581          "id": "backup-exclusion",582          "type": "grep",583          "description": "The storage layer excludes its files from backups",584          "globs": [585            "Sources/QyvoraStorage/FileStore.swift"586          ],587          "pattern": "isExcludedFromBackup = true",588          "expect": "present",589          "severity": "high",590          "area": "wallet",591          "cwe": "CWE-530",592          "recommendation": "Restore the backup exclusion in FileStore.applyAttributes."593        },594        {595          "id": "default-data-protection",596          "type": "plist",597          "description": "The entitlements declare NSFileProtectionComplete as the default data protection",598          "path": "App/Resources/Qyvora.entitlements",599          "key": "com.apple.developer.default-data-protection",600          "expect": {601            "equals": "NSFileProtectionComplete"602          },603          "severity": "medium",604          "area": "app",605          "cwe": "CWE-311",606          "recommendation": "Restore the default-data-protection entitlement."607        },608        {609          "id": "no-file-sharing",610          "type": "plist",611          "description": "iTunes / Files sharing of the container is off",612          "path": "App/Resources/Info.plist",613          "key": "UIFileSharingEnabled",614          "expect": "absent-or-false",615          "severity": "high",616          "area": "app",617          "cwe": "CWE-552",618          "recommendation": "Keep UIFileSharingEnabled false."619        }620      ]621    },622    {623      "id": "WA-DP-02",624      "title": "Logs, crash reports and defaults",625      "group": "data-protection",626      "verdict": "pass",627      "scope": "both",628      "rationale": "No logging call anywhere in the engine, the services or the application; errors carry no secret by construction (typed enums); UserDefaults holds appearance and endpoint URLs only; debug launch code is compiled out of Release.",629      "evidence": [630        {631          "ref": "Sources/QyvoraStorage/FileStore.swift:44",632          "contains": "None of them carries file contents or secret data."633        },634        {635          "ref": "Tests/QyvoraVaultTests/VaultTests.swift:897",636          "contains": "neverPrintable"637        }638      ],639      "checks": [640        {641          "id": "no-logging-in-sources",642          "type": "grep",643          "description": "No print / NSLog / os_log / Logger call in the engine, services or application",644          "globs": [645            "Sources/**/*.swift",646            "App/Sources/**/*.swift"647          ],648          "pattern": "^\\s*(print|debugPrint|NSLog|os_log|dump)\\(|\\bLogger\\(",649          "expect": "absent",650          "exclude": [651            "Sources/qyvora-bench/*",652            "App/Sources/Debug*.swift"653          ],654          "severity": "medium",655          "area": "app",656          "cwe": "CWE-532",657          "recommendation": "Remove the logging call or prove that it carries no secret."658        },659        {660          "id": "defaults-non-secret-only",661          "type": "grep",662          "description": "UserDefaults / @AppStorage used only by the settings files (appearance, endpoints), the declarations of the two interface preferences of the wallet screens (hide amounts, dashboard listing: WalletCommon.swift) and the DEBUG-only launch-argument readers",663          "globs": [664            "Sources/**/*.swift",665            "App/Sources/**/*.swift"666          ],667          "pattern": "UserDefaults|@AppStorage",668          "expect": "absent",669          "exclude": [670            "App/Sources/AppModel.swift",671            "App/Sources/AppearanceSettingsView.swift",672            "App/Sources/SettingsView.swift",673            "App/Sources/QyvoraApp.swift",674            "App/Sources/DebugLaunch.swift",675            "App/Sources/Wallet/WalletCommon.swift",676            "App/Sources/Security/SecurityDebug.swift",677            "App/Sources/Wallet/DebugWalletLaunch.swift"678          ],679          "severity": "medium",680          "area": "app",681          "cwe": "CWE-312",682          "on_unmet": "partial",683          "recommendation": "Check that the new use stores no secret and no address; add the file to the allow-list of this check or move the data to the vault.",684          "allow_list_note": "2026-12-04: WalletCommon.swift declares the one Boolean preference of the wallet screens (hide amounts); 2026-12-05: and the dashboard listing choice (the text \"Networks\" or \"Assets\"), moved there from DashboardView.swift so that the allow-list did not have to grow (the read of a launch argument in DebugGallery.swift now goes through DebugLaunch.defaults); SecurityDebug.swift and DebugWalletLaunch.swift are compiled in DEBUG only and read launch arguments. None stores a secret, an address or an amount."685        },686        {687          "id": "debug-code-guarded",688          "type": "grep",689          "description": "Debug launch code is compiled out of Release",690          "globs": [691            "App/Sources/DebugLaunch.swift",692            "App/Sources/DebugGallery.swift"693          ],694          "pattern": "^#if DEBUG",695          "expect": "present",696          "severity": "medium",697          "area": "app",698          "cwe": "CWE-489",699          "recommendation": "Keep debug-only files entirely inside #if DEBUG."700        }701      ]702    },703    {704      "id": "WA-DP-03",705      "title": "Pasteboard and screenshots",706      "group": "data-protection",707      "verdict": "pass",708      "scope": "app",709      "severity": "medium",710      "rationale": "Every copied value is local to the device and expires (60 s sensitive, 600 s otherwise); the phrase is never copied; screen capture hides the words and a screenshot is reported (QYV-APP-006, fixed).",711      "evidence": [712        {713          "ref": "Sources/QyvoraUI/Feedback.swift:68",714          "contains": "options: [.localOnly: true, .expirationDate: Date().addingTimeInterval(lifetime(sensitive: sensitive))])"715        },716        {717          "ref": "Sources/QyvoraUI/Feedback.swift:58",718          "contains": "public static let standardLifetime: TimeInterval = 600"719        },720        {721          "ref": "Sources/QyvoraUI/Feedback.swift:56",722          "contains": "public static let sensitiveLifetime: TimeInterval = 60"723        },724        {725          "ref": "Sources/QyvoraUI/SeedPhrase.swift:150",726          "contains": "public static func isHidden(masked: Bool, revealed: Bool, redacted: Bool, captured: Bool) -> Bool"727        },728        {729          "ref": "Sources/QyvoraUI/SeedPhrase.swift:169",730          "contains": "UIApplication.userDidTakeScreenshotNotification"731        }732      ],733      "checks": [734        {735          "id": "pasteboard-only-in-helper",736          "type": "grep",737          "description": "UIPasteboard is used only by the sanctioned clipboard helper",738          "globs": [739            "Sources/**/*.swift",740            "App/Sources/**/*.swift"741          ],742          "pattern": "UIPasteboard",743          "expect": "absent",744          "exclude": [745            "Sources/QyvoraUI/Feedback.swift"746          ],747          "severity": "medium",748          "area": "app",749          "cwe": "CWE-200",750          "recommendation": "Route every copy through QClipboard.copy(_:sensitive:)."751        },752        {753          "id": "privacy-cover-present",754          "type": "grep",755          "description": "The root view installs the privacy cover when the scene is not active",756          "globs": [757            "App/Sources/RootView.swift"758          ],759          "pattern": "qPrivacyCover\\(isActive:",760          "expect": "present",761          "severity": "medium",762          "area": "app",763          "cwe": "CWE-200",764          "recommendation": "Restore `.qPrivacyCover(isActive:)` on the root view."765        },766        {767          "id": "screen-capture-handled",768          "type": "grep",769          "description": "The application reacts to screen capture or screenshots of secrets",770          "globs": [771            "Sources/**/*.swift",772            "App/Sources/**/*.swift"773          ],774          "pattern": "isCaptured|userDidTakeScreenshotNotification|sceneCaptureState",775          "expect": "present",776          "on_unmet": "fail",777          "finding": "QYV-APP-006"778        }779      ],780      "reassessed": "2026-12-04, on the application and service code after the fixes of the open findings"781    },782    {783      "id": "WA-NET-01",784      "title": "Transport security (ATS, redirects, cookies, trust)",785      "group": "network",786      "verdict": "pass",787      "scope": "both",788      "rationale": "ATS at its default; ephemeral session without cookies, cache or credentials; redirects refused; no trust override; fixed User-Agent, no identifier.",789      "evidence": [790        {791          "ref": "Sources/QyvoraNetworking/HTTP.swift:58",792          "contains": "URLSession transport without cookies"793        },794        {795          "ref": "Sources/QyvoraNetworking/HTTP.swift:87",796          "contains": "c.httpCookieStorage = nil"797        }798      ],799      "checks": [800        {801          "id": "ats-default",802          "type": "plist",803          "description": "Info.plist carries no App Transport Security exception",804          "path": "App/Resources/Info.plist",805          "key": "NSAppTransportSecurity",806          "expect": "absent",807          "severity": "high",808          "area": "app",809          "cwe": "CWE-319",810          "recommendation": "Remove the NSAppTransportSecurity exception (or justify NSAllowsLocalNetworking only)."811        },812        {813          "id": "no-trust-override",814          "type": "grep",815          "description": "No custom server-trust evaluation, TLS downgrade or low-level socket",816          "globs": [817            "Sources/**/*.swift",818            "App/Sources/**/*.swift"819          ],820          "pattern": "URLAuthenticationChallenge|serverTrust|didReceive challenge|tlsMinimumSupportedProtocolVersion|NWConnection|CFStreamCreatePairWithSocket|URLSessionStreamTask",821          "expect": "absent",822          "severity": "high",823          "area": "app",824          "cwe": "CWE-295",825          "recommendation": "Remove the trust override; rely on the system validation."826        },827        {828          "id": "redirects-disabled",829          "type": "grep",830          "description": "The HTTP transport refuses redirects and keeps no cookie, cache or credential",831          "globs": [832            "Sources/QyvoraNetworking/HTTP.swift"833          ],834          "pattern": "willPerformHTTPRedirection",835          "expect": "present",836          "severity": "medium",837          "area": "wallet",838          "cwe": "CWE-601",839          "recommendation": "Keep the NoRedirect delegate."840        },841        {842          "id": "no-http-url-literal",843          "type": "grep",844          "description": "No hard-coded cleartext URL",845          "globs": [846            "Sources/**/*.swift",847            "App/Sources/**/*.swift"848          ],849          "pattern": "\\\"http://[A-Za-z0-9]",850          "expect": "absent",851          "severity": "medium",852          "area": "app",853          "cwe": "CWE-319",854          "recommendation": "Use https."855        }856      ]857    },858    {859      "id": "WA-NET-02",860      "title": "No certificate pinning — rationale",861      "group": "network",862      "verdict": "not-applicable",863      "rationale": "By design: there is no QYVORA server, and the endpoints are public third-party services or the user's own nodes. See MASVS-NETWORK-2 for what a TLS-level attacker can and cannot do; the decisive checks (what is signed, to whom, for how much, on which chain) never depend on an endpoint's honesty.",864      "residual_risk": "low"865    },866    {867      "id": "WA-NET-03",868      "title": "Endpoint validation",869      "group": "network",870      "verdict": "pass",871      "scope": "both",872      "rationale": "Every configured URL must be https, or http to a local or private host (literal private IPv4, localhost, .local, .onion); credentials in URLs are refused; unknown network names are refused; the editor applies the same rule; the service filters again when building clients.",873      "gap": "Info.plist declares no local-networking exception, so ATS blocks the http-to-local case in the application: the feature is unusable rather than unsafe. `.onion` over http is only meaningful behind a Tor proxy, which the application does not provide.",874      "evidence": [875        {876          "ref": "Sources/QyvoraNetworking/HTTP.swift:195",877          "contains": "public static func isAcceptable"878        },879        {880          "ref": "Sources/QyvoraWallet/WalletService.swift:339",881          "contains": "Endpoint not accepted (https required, http only for local hosts)"882        },883        {884          "ref": "App/Sources/EndpointsEditorView.swift:163",885          "contains": "EndpointConfiguration.isAcceptable(candidate)"886        }887      ],888      "residual_risk": "low"889    },890    {891      "id": "WA-NET-04",892      "title": "Chain-identity checks",893      "group": "network",894      "verdict": "pass",895      "scope": "service",896      "rationale": "Before first use of an endpoint list the Esplora endpoints must serve the expected genesis block and every JSON-RPC endpoint must agree on the expected chain id; a mismatch is a `wrongChain` error; changing endpoints resets the verification. Since the multi-chain upgrade the comparison is made by one function for every UTXO indexer (Esplora, Blockbook, Bitcore) against the network's identity block: block 0, or a post-split block for Bitcoin Cash, whose genesis is Bitcoin's.",897      "evidence": [898        {899          "ref": "Sources/QyvoraNetworking/UTXOIndexer.swift:327",900          "contains": "guard hash == identity.hash else {"901        },902        {903          "ref": "Sources/QyvoraNetworking/EthereumRPC.swift:125",904          "contains": "public func verifyChain()"905        },906        {907          "ref": "Sources/QyvoraWallet/WalletService.swift:347",908          "contains": "verifiedChains = []"909        }910      ]911    },912    {913      "id": "WA-NET-05",914      "title": "Cold mode",915      "group": "network",916      "verdict": "pass",917      "scope": "service",918      "rationale": "When on, the gate fails every request with `.offline` before it leaves the device; creation, import, address display and signing keep working.",919      "evidence": [920        {921          "ref": "Sources/QyvoraWallet/WalletService.swift:428",922          "contains": "public func setColdMode"923        },924        {925          "ref": "Sources/QyvoraWallet/WalletService.swift:269",926          "contains": "if gate.isOffline { throw WalletError.offline }"927        }928      ]929    },930    {931      "id": "WA-FRD-01",932      "title": "Address validation",933      "group": "fraud-protection",934      "verdict": "pass",935      "scope": "service",936      "rationale": "Bitcoin: Base58Check and Bech32 / Bech32m decoding with checksum, network and witness-program checks, refusal of unassigned witness versions. Ethereum: EIP-55 verified when mixed case, warning when absent, zero address and token-contract-as-recipient refused.",937      "gap": "No first-payment warning and no malicious-address list (QYV-APP-010).",938      "finding": "QYV-APP-010",939      "evidence": [940        {941          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:473",942          "contains": "guard destination.type != .witnessUnknown"943        },944        {945          "ref": "Sources/QyvoraEthereum/Address.swift:67",946          "contains": "candidate.checksummed.dropFirst(2) != h"947        },948        {949          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:449",950          "contains": "guard token.address != recipient else { throw EthereumRefusal.recipientIsTokenContract }"951        }952      ]953    },954    {955      "id": "WA-FRD-02",956      "title": "Review before signing; what is shown is what is signed",957      "group": "fraud-protection",958      "verdict": "pass",959      "scope": "service",960      "rationale": "Signing takes the review object produced by `prepare…`; these types have no public initializer, so the interface cannot forge or alter one. Before signing the plan is re-validated against the current state; after signing, every signature is verified, the transaction identifier, outputs and lock time are compared with the reviewed plan (Bitcoin) or the signed transaction is decoded and compared field by field with the reviewed one and the sender recovered (Ethereum).",961      "gap": "How the review is presented cannot be assessed: The application screens concerned were not finished at the audited commit; re-assess on the final commit.",962      "evidence": [963        {964          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:616",965          "contains": "The signed transaction differs from the reviewed plan."966        },967        {968          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:639",969          "contains": "decoded.transaction == tx, (try? decoded.sender()) == from"970        },971        {972          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:611",973          "contains": "try BitcoinVerifier.verify(transaction: signed, spentOutputs: plan.plan.inputs.map(\\.output))"974        }975      ],976      "checks": [977        {978          "id": "plan-init-not-public",979          "type": "grep",980          "description": "BitcoinSendPlan / EthereumSendReview declare no public initializer",981          "globs": [982            "Sources/QyvoraWallet/WalletTypes.swift"983          ],984          "pattern": "^\\s*public init\\(id: UUID",985          "expect": "absent",986          "severity": "high",987          "area": "wallet",988          "cwe": "CWE-345",989          "recommendation": "Keep the memberwise initializers of plan and review types internal."990        }991      ]992    },993    {994      "id": "WA-FRD-03",995      "title": "Change detection by derivation",996      "group": "fraud-protection",997      "verdict": "pass",998      "scope": "service",999      "rationale": "Change goes to the next unused address of the internal chain; in a received PSBT an output is treated as the wallet's own only if its script is found by deriving the account's keys, and as change only on the internal chain; everything else counts as sent to others.",1000      "evidence": [1001        {1002          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:499",1003          "contains": "let change = try account.nextUnusedAddress(chain: .change, used: usedChange)"1004        },1005        {1006          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:732",1007          "contains": "isMine: position != nil, isChange: position?.chain == .change"1008        }1009      ]1010    },1011    {1012      "id": "WA-FRD-04",1013      "title": "Blind-signing rules",1014      "group": "fraud-protection",1015      "verdict": "pass",1016      "scope": "service",1017      "rationale": "Call data the wallet cannot decode is shown as raw hexadecimal with a `.blindSigning` warning and refused unless `allowBlindSigning` is passed; on mainnet it is always refused, approvals are limited to revocations and token transfers must be priced. Only SIGHASH_ALL is signed for Bitcoin. No arbitrary-message signing with chain keys.",1018      "evidence": [1019        {1020          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:775",1021          "contains": "Blind signing must be allowed explicitly"1022        },1023        {1024          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:620",1025          "contains": "On mainnet this build does not sign call data it cannot decode"1026        },1027        {1028          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:770",1029          "contains": "Only SIGHASH_ALL is signed"1030        }1031      ]1032    },1033    {1034      "id": "WA-FEE-01",1035      "title": "Bitcoin fee caps and dust",1036      "group": "fees-nonces-utxos",1037      "verdict": "pass",1038      "scope": "service",1039      "rationale": "Hard caps of 1 000 000 sat and 1 000 sat/vB at build time, re-checked at signature and for received PSBTs; warnings for a high absolute fee or fee share; dust outputs refused by the builder and dust change folded into the fee with a warning; a PSBT whose fee cannot be computed is refused.",1040      "evidence": [1041        {1042          "ref": "Sources/QyvoraWallet/WalletService.swift:66",1043          "contains": "public static let bitcoinMaximumFee: UInt64 = 1_000_000"1044        },1045        {1046          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:510",1047          "contains": "request.maximumFee = Self.bitcoinMaximumFee"1048        },1049        {1050          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:745",1051          "contains": "The fee cannot be computed: the amount of an input is missing."1052        },1053        {1054          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:552",1055          "contains": "warnings.append(.dustAddedToFee(amount: plan.fee - required))"1056        }1057      ]1058    },1059    {1060      "id": "WA-FEE-02",1061      "title": "UTXO handling",1062      "group": "fees-nonces-utxos",1063      "verdict": "pass",1064      "scope": "service",1065      "rationale": "Outputs are range-checked when read from the indexer; frozen and unconfirmed outputs are not selected unless asked; outputs spent in the session are set aside until the next synchronisation; a plan is refused when an input is no longer available or changed value; exposure of public keys is tracked per output.",1066      "evidence": [1067        {1068          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:193",1069          "contains": "u.value > 0, u.value <= BitcoinLimits.maxMoney"1070        },1071        {1072          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:579",1073          "contains": "An input of the plan is no longer available. Prepare the payment again."1074        },1075        {1076          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:508",1077          "contains": "minimumConfirmations: coinControl.includeUnconfirmed ? 0 : 1"1078        }1079      ]1080    },1081    {1082      "id": "WA-FEE-03",1083      "title": "Ethereum fees, gas and nonce",1084      "group": "fees-nonces-utxos",1085      "verdict": "pass",1086      "scope": "service",1087      "rationale": "maxFeePerGas = 2 × base fee + tip, refused above 100 000 gwei; gas 21 000 for transfers, estimate × 1.3 + 5 000 capped at 200 000 for token calls; total cost checked against the balance read again on chain. The nonce is the latest count; a pending transaction blocks a new one unless the caller asks to replace it; both counts need agreement of every endpoint and a pending count below the latest is rejected as untrusted.",1088      "evidence": [1089        {1090          "ref": "Sources/QyvoraEthereum/EVMFees.swift:109",1091          "contains": "guard !o1, !o2, !maxFee.isZero, maxFee < maxFeePerGasCeiling, tip <= maxFee else { throw .outOfRange }"1092        },1093        {1094          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:461",1095          "contains": "guard replacePending else { throw EthereumRefusal.pendingTransaction(latestNonce: latest, pendingNonce: pending) }"1096        },1097        {1098          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:490",1099          "contains": "guard gas <= Self.ethereumGasLimitCeiling"1100        }1101      ]1102    },1103    {1104      "id": "WA-RPL-01",1105      "title": "Ethereum replay protection",1106      "group": "replay-protection",1107      "verdict": "pass",1108      "scope": "service",1109      "rationale": "Only EIP-1559 type-2 transactions: the chain id is inside the signed payload and must equal the active network's before signing and before broadcasting a cold-signed transaction.",1110      "evidence": [1111        {1112          "ref": "Sources/QyvoraEthereum/Transaction.swift:96",1113          "contains": "0x02 ‖ rlp([chainId"1114        },1115        {1116          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:575",1117          "contains": "guard tx.chainID == network.chainID"1118        }1119      ]1120    },1121    {1122      "id": "WA-RPL-02",1123      "title": "Bitcoin replay protection",1124      "group": "replay-protection",1125      "verdict": "not-applicable",1126      "rationale": "Bitcoin transactions carry no chain identifier: a transaction valid on Bitcoin is not protected against replay on a fork that shares its history and signature scheme (the historical forks added their own fork identifier). Between the networks the wallet supports, separation comes from distinct keys (coin type 0 versus 1 in the derivation path) and from the genesis-hash check of the endpoints, not from the transaction format.",1127      "evidence": [1128        {1129          "ref": "Sources/QyvoraCore/Networks.swift:62",1130          "contains": "case .testnet, .signet, .litecoinTestnet, .dogecoinTestnet, .bitcoinCashTestnet: return 1"1131        }1132      ],1133      "residual_risk": "low (no live fork sharing Bitcoin's signature rules)"1134    },1135    {1136      "id": "WA-MNG-01",1137      "title": "Mainnet gate: both conditions",1138      "group": "mainnet-gate",1139      "verdict": "pass",1140      "scope": "both",1141      "severity": "low",1142      "rationale": "Mainnet operations require `auditCompleted` or (the build's `QYInternalMainnet` declaration AND the user's opt-in). A stored profile cannot widen the policy; every account accessor, client constructor and network switch calls `requireAllowed`; turning the opt-in off moves the wallet back to test networks.",1143      "gap": "`MainnetPolicy` is process-wide mutable state behind a public `configure`: it protects against mistakes, not against code running inside the application. The key is set in the only Info.plist (QYV-APP-008).",1144      "finding": "QYV-APP-008",1145      "evidence": [1146        {1147          "ref": "Sources/QyvoraCore/Networks.swift:115",1148          "contains": "return auditCompleted || (internalBuild && userOptIn)"1149        },1150        {1151          "ref": "Sources/QyvoraWallet/WalletService.swift:159",1152          "contains": "// A stored profile can never widen what the policy allows."1153        },1154        {1155          "ref": "Sources/QyvoraWallet/WalletService.swift:216",1156          "contains": "func requireAllowed(_ network: BitcoinNetwork) throws"1157        },1158        {1159          "ref": "Sources/QyvoraCore/Networks.swift:90",1160          "contains": "public static let auditCompleted = false"1161        }1162      ],1163      "checks": [1164        {1165          "id": "internal-mainnet-key",1166          "type": "plist",1167          "description": "QYInternalMainnet is not set in the committed Info.plist",1168          "path": "App/Resources/Info.plist",1169          "key": "QYInternalMainnet",1170          "expect": "absent-or-false",1171          "on_unmet": "partial",1172          "finding": "QYV-APP-008"1173        }1174      ]1175    },1176    {1177      "id": "WA-MNG-02",1178      "title": "Limits of an unaudited build, enforced at prepare and at sign",1179      "group": "mainnet-gate",1180      "verdict": "pass",1181      "scope": "service",1182      "rationale": "Bitcoin: at most 0.002 BTC to recipients per transaction, checked when the plan is built (requested amount and actual paid amount), again in `validate` on what will be signed, and for PSBTs at signature and at broadcast. Ethereum: at most 0.05 ETH, token transfers at most 150 USD at a fresh price and only for priced tokens, approvals only to revoke, no undecodable call data — checked when the review is built and again inside `signEthereum`. Fees are bounded at the same places since QYV-SVC-009: Bitcoin fee at most 20 000 sat and 200 sat/vB, Ethereum maximum fee (gas limit × maxFeePerGas) at most 0.01 ETH. A PSBT whose input amounts cannot be verified is not signed on mainnet (QYV-SVC-008).",1183      "gap": "The limits are per transaction, not per day or per balance: they bound one mistake. `prepareSweepOfExposedBitcoin` builds its plan with the same limit enforcement.",1184      "evidence": [1185        {1186          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:708",1187          "contains": "try enforceUnauditedBitcoinLimit(network: network, amount: paidAmount, sendMax: sendMax)"1188        },1189        {1190          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:709",1191          "contains": "try enforceUnauditedBitcoinFeeLimit(network: network, fee: plan.fee, vsize: plan.estimatedVSize)"1192        },1193        {1194          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:773",1195          "contains": "// the ceiling of an unaudited build is checked again on what will actually be signed"1196        },1197        {1198          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:1024",1199          "contains": "try enforceUnauditedBitcoinLimit(network: account.network, amount: before.sentToOthers)"1200        },1201        {1202          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:1018",1203          "contains": "On mainnet this build does not sign such a PSBT"1204        },1205        {1206          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:639",1207          "contains": "try await enforceUnauditedEthereumLimits(tx, network: network)"1208        },1209        {1210          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:753",1211          "contains": "switch feeCeiling.allows(wei: maximumFee, usdPrice: nativePrice) {"1212        },1213        {1214          "ref": "Sources/QyvoraWallet/WalletService.swift:525",1215          "contains": "func enforceUnauditedBitcoinFeeLimit(network: BitcoinNetwork, fee: UInt64, vsize: Int) throws {"1216        },1217        {1218          "ref": "Sources/QyvoraCore/Networks.swift:138",1219          "contains": "public static let limits = Limits(bitcoinSatoshisPerTransaction: 200_000"1220        },1221        {1222          "ref": "Sources/QyvoraCore/Networks.swift:141",1223          "contains": "bitcoinFeeSatoshisPerTransaction: 20_000,"1224        },1225        {1226          "ref": "Tests/QyvoraWalletTests/FindingsFeeLimitTests.swift:63",1227          "contains": "func bitcoinFeeCeilingsAreEnforcedAtPrepareAndAtSign()"1228        }1229      ],1230      "residual_risk": "medium while the engine has no independent review",1231      "reassessed": "2026-12-04, after the fixes of QYV-SVC-008 and QYV-SVC-009"1232    },1233    {1234      "id": "WA-PQC-01",1235      "title": "Post-quantum protection of local storage is stated separately from transaction security",1236      "group": "post-quantum-scope",1237      "verdict": "pass",1238      "scope": "both",1239      "rationale": "What post-quantum algorithms protect: the device-to-device transfer envelope (X25519 + ML-KEM-1024 hybrid) and the identity signatures on backups, envelopes and rotation certificates (ML-DSA, optionally with SLH-DSA). The vault and backup files themselves are protected by symmetric cryptography (AES-256-GCM, Argon2id / PBKDF2), which is not threatened by Shor's algorithm and keeps a comfortable margin against Grover's. What they do not protect: Bitcoin and Ethereum transactions, which are authorised by secp256k1 signatures; a quantum adversary able to break secp256k1 could spend from any address whose public key is known, whatever the wallet does. The application tracks which outputs have an exposed public key and can sweep them to fresh addresses, which reduces exposure and is not quantum resistance.",1240      "gap": "Every user-facing statement must keep this separation; the wording of the final screens and of the site is to be checked on the final commit.",1241      "evidence": [1242        {1243          "ref": "Sources/QyvoraIdentity/HybridEnvelope.swift:48",1244          "contains": "X25519 (CryptoKit) and ML-KEM-1024 (QYVORA engine) together"1245        },1246        {1247          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:639",1248          "contains": "Moves every output whose public key is already on chain to one fresh address"1249        },1250        {1251          "ref": "CLAUDE.md:16",1252          "contains": "It does not make Bitcoin or Ethereum quantum-resistant"1253        }1254      ]1255    },1256    {1257      "id": "WA-EVM-01",1258      "title": "EVM network table: chain identifiers, native coins and decimals of the fourteen networks",1259      "group": "replay-protection",1260      "verdict": "pass",1261      "scope": "service",1262      "rationale": "The chain identifier signs for a chain and the decimals scale what is shown: both equal the public chain registry for the seven main and seven test networks (transcribed by the reviewer, and compared with the registry shipped in eth-utils); an identifier the wallet does not support names no network.",1263      "evidence": [1264        {1265          "ref": "Sources/QyvoraCore/Networks.swift:489",1266          "contains": "case .base: return 8_453"1267        },1268        {1269          "ref": "Sources/QyvoraCore/Networks.swift:703",1270          "contains": "public var nativeDecimals: Int { 18 }"1271        },1272        {1273          "ref": "security/tests/Tests/ConformanceAuditTests/EVMChainsVectors.swift:85",1274          "contains": "@Test func networkTableMatchesTheChainRegistry() {"1275        },1276        {1277          "ref": "security/tests/Tests/DifferentialAuditTests/EVMChainsDiffTests.swift:186",1278          "contains": "@Test func chainIdentifiersExistInTheRegistryOfEthUtils() throws {"1279        }1280      ]1281    },1282    {1283      "id": "WA-EVM-02",1284      "title": "EIP-1559 signing on every EVM network, identical to an independent library",1285      "group": "replay-protection",1286      "verdict": "pass",1287      "scope": "service",1288      "rationale": "Unsigned payload, signing hash, RFC 6979 signature (r, s, yParity), raw transaction, hash and sender are byte-identical to eth-account 0.14.0 for random transactions on the fourteen identifiers of the table and on boundary identifiers up to 2^64 − 1; a signature relabelled for another network never recovers the signer. Only type-2 transactions are produced.",1289      "evidence": [1290        {1291          "ref": "Sources/QyvoraEthereum/Transaction.swift:97",1292          "contains": "public var unsignedPayload: Bytes { [0x02] + RLP.list(fields).encoded }"1293        },1294        {1295          "ref": "security/tests/Tests/DifferentialAuditTests/EVMChainsDiffTests.swift:103",1296          "contains": "@Test func eip1559AcrossChainIdentifiers() throws {"1297        },1298        {1299          "ref": "security/tests/Tests/DifferentialAuditTests/EVMChainsDiffTests.swift:147",1300          "contains": "@Test func aSignatureDoesNotCarryOverToAnotherChain() throws {"1301        }1302      ]1303    },1304    {1305      "id": "WA-EVM-03",1306      "title": "EVM fee rules bound every figure an endpoint supplies",1307      "group": "fees-nonces-utxos",1308      "verdict": "pass",1309      "scope": "service",1310      "rationale": "maxPriorityFeePerGas ≤ maxFeePerGas always; base fee, priority fee and gas price below 10 000 gwei, max fee below 100 000 gwei, checked arithmetic; Polygon's minimum tip and BNB Smart Chain's zero base fee handled; gas limit at most 200 000; on an unaudited mainnet build the maximum fee of a transaction is capped (0.01 ETH, or 5 USD of POL, BNB, AVAX).",1311      "residual_risk": "Fee figures come from the first endpoint that answers (QYV-SVC-014). On test networks only the general bounds apply.",1312      "evidence": [1313        {1314          "ref": "Sources/QyvoraEthereum/EVMFees.swift:109",1315          "contains": "guard !o1, !o2, !maxFee.isZero, maxFee < maxFeePerGasCeiling, tip <= maxFee else { throw .outOfRange }"1316        },1317        {1318          "ref": "security/tests/Tests/PropertyAuditTests/EVMChainsProperties.swift:98",1319          "contains": "@Test func feeRulesHoldForEveryEndpointFigure() {"1320        },1321        {1322          "ref": "security/tests/Sources/FuzzTargets/Targets+EVMChains.swift:109",1323          "contains": "\"evm-fee-quotes\", \"EVM fee rules on figures of a hostile endpoint: priority ≤ max fee, ceilings, network floors, cost and send-max arithmetic without overflow\","1324        }1325      ]1326    },1327    {1328      "id": "WA-EVM-04",1329      "title": "OP-Stack L1 data fee: quoted for the transaction, never assumed zero, counted in the fee, the total and send-max",1330      "group": "fees-nonces-utxos",1331      "verdict": "partial",1332      "scope": "service",1333      "rationale": "On Base and OP networks the L1 data fee is read from the GasPriceOracle predeploy for the very transaction; the answer must be one 32-byte word below 0.1 ETH, a failure refuses the payment; the fee with a margin of one quarter is in the maximum fee, in the total checked against the balance, in the fee ceiling of an unaudited build, and is taken out of a send-max amount. A cold device states that it cannot compute it.",1334      "gap": "The L1 fee is not a field of the signed transaction: the figure shown is a quote of one endpoint and the network charges its own. The engine cannot bound the real charge; the interface must present the figure as an estimate (QYV-APP-082).",1335      "finding": "QYV-APP-082",1336      "evidence": [1337        {1338          "ref": "Sources/QyvoraEthereum/EVMFees.swift:166",1339          "contains": "guard let fee = ERC20.decodeUInt(returned), fee < feeCeiling else { return nil }"1340        },1341        {1342          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:690",1343          "contains": "value = value - l1DataFee"1344        },1345        {1346          "ref": "security/tests/Tests/PropertyAuditTests/EVMChainsProperties.swift:287",1347          "contains": "@Test func l1DataFeeIsNeverSilentlyZero() async throws {"1348        },1349        {1350          "ref": "security/tests/Tests/DifferentialAuditTests/EVMChainsDiffTests.swift:206",1351          "contains": "@Test func opStackOracleCallAndReturnData() throws {"1352        }1353      ]1354    },1355    {1356      "id": "WA-EVM-05",1357      "title": "Chain identity of the endpoints of every EVM network",1358      "group": "network",1359      "verdict": "pass",1360      "scope": "service",1361      "rationale": "Before anything an endpoint says is used, every endpoint of the network must answer the chain identifier of the table (checked once per session and per endpoint list, again after any change of endpoints). An endpoint of another chain configured for a network is refused on each of the fourteen networks.",1362      "residual_risk": "An endpoint that does not answer is not counted; a chain that shares an identifier cannot be told apart.",1363      "evidence": [1364        {1365          "ref": "Sources/QyvoraNetworking/EthereumRPC.swift:130",1366          "contains": "guard id == UInt256(network.chainID) else { throw NetworkError.disagreement("1367        },1368        {1369          "ref": "Sources/QyvoraWallet/WalletService.swift:466",1370          "contains": "let key = \"eth|\\(network.rawValue)|\" + (profile.endpoints.ethereumRPC[network.rawValue] ?? []).joined(separator: \",\")"1371        },1372        {1373          "ref": "Tests/QyvoraNetworkingTests/EVMChainsAuditRegressionTests.swift:100",1374          "contains": "@Test func chainIdentityIsCheckedForEveryPairOfNetworks() async throws {"1375        }1376      ]1377    },1378    {1379      "id": "WA-EVM-06",1380      "title": "Built-in token lists of the EVM networks: pinned decimals, checksummed contracts, unknown tokens kept apart",1381      "group": "fraud-protection",1382      "verdict": "pass",1383      "scope": "service",1384      "rationale": "A built-in row is accepted only with its exact EIP-55 checksum; decimals are pinned in the list and compared with the contract once per session; tokens the indexer reports are described by the chain and quarantined in detectedTokens; a token without a price identifier cannot be sent on an unaudited mainnet build.",1385      "residual_risk": "Custom and detected tokens are described by one endpoint (QYV-SVC-014).",1386      "evidence": [1387        {1388          "ref": "Sources/QyvoraEthereum/ERC20.swift:302",1389          "contains": "guard let a = EthereumAddress(row.3), a.checksummed == row.3 else { return nil }"1390        },1391        {1392          "ref": "security/tests/Tests/ConformanceAuditTests/EVMChainsVectors.swift:186",1393          "contains": "@Test func builtInTokenDecimals() {"1394        },1395        {1396          "ref": "security/tests/Tests/DifferentialAuditTests/EVMChainsDiffTests.swift:267",1397          "contains": "@Test func builtInTokenAddressesCarryTheirChecksum() throws {"1398        }1399      ]1400    },1401    {1402      "id": "WA-MC-01",1403      "title": "Limits table: a ceiling for every main network of every family, applied to the bytes at prepare and at sign",1404      "group": "mainnet-gate",1405      "verdict": "partial",1406      "scope": "service",1407      "rationale": "Each of the thirteen main networks has a value ceiling and a fee ceiling (no default that means unlimited); they are applied to the transaction itself when it is prepared, again when it is signed (hot and cold), and at the broadcast of a cold-signed transaction. A review object altered after the review, a review of another network mode, a price that moved, a transaction signed elsewhere above the ceiling are all refused. Dollar ceilings no longer rest on one price (QYV-SVC-087, corrected on 2026-12-05): a built-in dollar-pegged token is valued at no less than 0.90 USD, every other token and every native coin with a dollar ceiling needs two independent sources that agree within 5 % (the higher is used), and native coins keep their floors.",1408      "gap": "Two sources lying low together, within 5 % of each other, still lift the ceiling of a token that is not pegged to the dollar; a wrapped asset is checked against the second source's price of its underlying. Verdict kept at partial by the agent that made the correction: raising it is the reviewer's decision after the full run.",1409      "finding": "QYV-SVC-087",1410      "evidence": [1411        {1412          "ref": "Sources/QyvoraCore/Networks.swift:446",1413          "contains": "public static func utxoLimits(_ network: BitcoinNetwork) -> UTXOLimits? {"1414        },1415        {1416          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:796",1417          "contains": "try await enforceUnauditedEthereumLimits(tx, network: network)"1418        },1419        {1420          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:386",1421          "contains": "@Test func anAlteredEVMReviewIsNotSigned() async throws {"1422        },1423        {1424          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:350",1425          "contains": "@Test func everyMainNetworkHasCeilingsAndNoTestNetworkHasAny() async throws {"1426        },1427        {1428          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:149",1429          "contains": "@Test func aPriceCloseToZeroDoesNotLiftTheDollarCeilings() async throws {"1430        },1431        {1432          "ref": "Sources/QyvoraWallet/WalletService+Market.swift:152",1433          "contains": "func limitUSDPrice(_ id: String, pricing: LimitPricing = .twoSources) async throws -> Double {"1434        },1435        {1436          "ref": "Sources/QyvoraWallet/WalletService+Market.swift:176",1437          "contains": "guard MainnetPolicy.isPlausibleUSDPrice(agreed, priceID: id) else {"1438        },1439        {1440          "ref": "Sources/QyvoraCore/Networks.swift:989",1441          "contains": "public static func agreedCeilingPrice(_ first: Double, _ second: Double, tolerance: Double = priceAgreementTolerance) -> Double? {"1442        },1443        {1444          "ref": "Sources/QyvoraCore/Networks.swift:969",1445          "contains": "public static func stablecoinCeilingPrice(quote: Double) -> Double? {"1446        },1447        {1448          "ref": "Tests/QyvoraWalletTests/PriceCeilingAuditRegressionTests.swift:243",1449          "contains": "@Test func aTokenThatIsNotPeggedNeedsTwoAgreeingSources() async throws {"1450        },1451        {1452          "ref": "Tests/QyvoraWalletTests/PriceCeilingAuditRegressionTests.swift:171",1453          "contains": "@Test func aLyingPriceDoesNotLiftTheCeilingOfADollarPeggedToken() async throws {"1454        }1455      ],1456      "reassessed": "2026-12-05, after the correction of QYV-SVC-087"1457    },1458    {1459      "id": "WA-MC-02",1460      "title": "Mainnet gate on every family and every entry point",1461      "group": "mainnet-gate",1462      "verdict": "pass",1463      "scope": "service",1464      "rationale": "Both conditions (build declaration and user switch) are required by one rule that every family's entry points reach: synchronization, preparation, signature, broadcast, tracking, token management, the cold envelope by its label and the EVM cold payload by its chain identifier, watch-only import, restored snapshots. A stored profile cannot open the gate. No request leaves the device on a refused call.",1465      "residual_risk": "The user switch is stored in the unauthenticated profile file (QYV-SVC-011): on an internal build, write access to the application container sets it.",1466      "evidence": [1467        {1468          "ref": "Sources/QyvoraWallet/WalletService.swift:342",1469          "contains": "func requireAllowed(_ kind: ChainKind) throws {"1470        },1471        {1472          "ref": "Sources/QyvoraWallet/WalletService+Chains.swift:124",1473          "contains": "try requireAllowed(kind)"1474        },1475        {1476          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:280",1477          "contains": "@Test func everyFamilyIsBehindTheGateAtEveryEntryPoint() async throws {"1478        },1479        {1480          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:327",1481          "contains": "@Test func aHostileStoredProfileDoesNotOpenTheGate() async throws {"1482        }1483      ]1484    },1485    {1486      "id": "WA-MC-03",1487      "title": "Leaving the test networks needs a fresh authentication, through every setter",1488      "group": "authentication",1489      "verdict": "pass",1490      "scope": "service",1491      "rationale": "setNetworkMode(.main), setBitcoinNetwork, setEthereumNetwork and setActiveNetworks require a credential verified within the authentication window when a network goes from test to main; turning the user switch on does as well. Going back to test networks asks nothing.",1492      "evidence": [1493        {1494          "ref": "Sources/QyvoraWallet/WalletService+Chains.swift:240",1495          "contains": "if profile.networkMode != .main || profile.bitcoinNetwork.isTest || profile.ethereumNetwork.isTest { try await requireFreshAuthentication() }"1496        },1497        {1498          "ref": "Sources/QyvoraWallet/WalletService.swift:500",1499          "contains": "if !network.isTest, profile.bitcoinNetwork.isTest { try await requireFreshAuthentication() }"1500        },1501        {1502          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:70",1503          "contains": "@Test func leavingTheTestNetworksAlwaysNeedsAFreshAuthentication() async throws {"1504        }1505      ]1506    },1507    {1508      "id": "WA-MC-04",1509      "title": "Cold-mode envelope: strict form, family bound, review decoded from the payload, signed result verified",1510      "group": "fraud-protection",1511      "verdict": "partial",1512      "scope": "service",1513      "rationale": "qyvtx1|u or s|chain|payload with exactly four parts, a known and active chain, a canonical payload of that family paid and signed by this wallet's account alone; nothing descriptive travels next to the payload, so the cold device can only show what it decodes; the limits and the gate are applied on the cold device; a signed result is verified (signature of this account, canonical, limits) before any request. An EVM transaction travels without envelope and names its network by the chain identifier in its bytes.",1514      "gap": "The network label of a Solana or TRON envelope cannot bind: such a transaction names no network and the key is the same on every network of the chain (recorded by the Solana and TRON areas, which added warnings to the cold review).",1515      "evidence": [1516        {1517          "ref": "Sources/QyvoraWallet/WalletService+Cold.swift:71",1518          "contains": "guard parts.count == 4, parts[1] == \"u\" || parts[1] == \"s\", parts[3].utf8.count <= 40_000 else {"1519        },1520        {1521          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:915",1522          "contains": "guard tx.unsignedPayload == payload else { throw WalletError.invalidPayload(\"The transaction encoding is not canonical.\") }"1523        },1524        {1525          "ref": "security/tests/Tests/PropertyAuditTests/MultichainWalletProperties.swift:254",1526          "contains": "@Test func theEnvelopeBindsFamilyNetworkAndPayload() async throws {"1527        },1528        {1529          "ref": "security/tests/Tests/PropertyAuditTests/MultichainWalletProperties.swift:379",1530          "contains": "@Test func anEVMPayloadNamesItsNetworkItself() async throws {"1531        },1532        {1533          "ref": "security/tests/Sources/FuzzTargets/Targets+MultichainWallet.swift:337",1534          "contains": "\"cold-envelope\", \"Cold-mode transaction text on a cold wallet with every chain enabled: the qyvtx1 envelope (Solana, TRON), the 0x02 payload (EVM), a PSBT; review, then signature of what was reviewed\","1535        }1536      ]1537    },1538    {1539      "id": "WA-MC-05",1540      "title": "Watch-only package v2: public material only, strict reading, chains limited to the accounts received",1541      "group": "key-storage",1542      "verdict": "partial",1543      "scope": "service",1544      "rationale": "The package holds account public keys and addresses only (checked against every private form of the test phrase); a private key in a package is refused; a chain is enabled only when the package carried an account of its family; main-network accounts are left out while the gate is closed; a refused package leaves no wallet.",1545      "gap": "The package is not authenticated. A fingerprint of its accounts exists (watchOnlyFingerprint) but the screens of both devices must show and compare it (QYV-APP-080, high, open).",1546      "finding": "QYV-APP-080",1547      "evidence": [1548        {1549          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:403",1550          "contains": "guard let parsed = try? ExtendedKey.parse(text.trimmingCharacters(in: .whitespacesAndNewlines)), !parsed.version.isPrivate else {"1551        },1552        {1553          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:553",1554          "contains": "public nonisolated static func watchOnlyFingerprint(package input: [String]) throws(WalletError) -> String {"1555        },1556        {1557          "ref": "security/tests/Tests/PropertyAuditTests/MultichainWalletProperties.swift:436",1558          "contains": "@Test func thePackageHoldsPublicMaterialOnlyAndIsReadStrictly() async throws {"1559        },1560        {1561          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:247",1562          "contains": "@Test func aWatchOnlyPackageIsValidatedBeforeAnythingIsCreated() async throws {"1563        }1564      ]1565    },1566    {1567      "id": "WA-MC-06",1568      "title": "Vault account binding v2: the accounts of every family are vouched for by the vault",1569      "group": "key-storage",1570      "verdict": "pass",1571      "scope": "service",1572      "rationale": "The public account data of every family (UTXO account keys by network, EVM, Solana and TRON addresses) is kept in a vault record and compared with the profile file at every unlock; a difference is repaired from the vault and counted; the key derived for a signature is compared with the vault's record. A version-1 record is completed from the recovery phrase; a damaged or future record is rebuilt from the phrase.",1573      "evidence": [1574        {1575          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:170",1576          "contains": "static let currentVersion = 2"1577        },1578        {1579          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:792",1580          "contains": "if let trusted = await trustedPublicData(), trusted.ethereum != from {"1581        },1582        {1583          "ref": "security/tests/Tests/PropertyAuditTests/MultichainWalletProperties.swift:576",1584          "contains": "@Test func theBindingRecordIsReadStrictlyAndRepairsTheProfile() async throws {"1585        }1586      ]1587    },1588    {1589      "id": "WA-MC-07",1590      "title": "Persisted chain snapshots: validated, bounded, tied to account, network and endpoints, never used to build a payment",1591      "group": "data-protection",1592      "verdict": "pass",1593      "scope": "service",1594      "rationale": "One file per network under a constant name; a file of another account, network, endpoint list or version, oversized or with a value out of range is ignored and removed; restored data is flagged as coming from a previous session; payments read their figures again on chain (or need a snapshot of this session on UTXO chains), and token descriptions of a restored file are not used for a review.",1595      "evidence": [1596        {1597          "ref": "Sources/QyvoraWallet/ChainPersistence.swift:113",1598          "contains": "func validated(identity expected: String, address expectedAddress: String) -> SolanaChainRecord? {"1599        },1600        {1601          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:393",1602          "contains": "if let snapshot = evmSnapshots[network], !snapshot.isFromPreviousSession,"1603        },1604        {1605          "ref": "security/tests/Tests/PropertyAuditTests/MultichainWalletProperties.swift:657",1606          "contains": "@Test func persistedChainFilesAreValidatedBoundedAndTiedToTheirAccount() async throws {"1607        },1608        {1609          "ref": "Tests/QyvoraWalletTests/EVMChainsAuditRegressionTests.swift:213",1610          "contains": "@Test func aDetectedTokenOfARestoredSnapshotIsNotUsedForAPayment() async throws {"1611        }1612      ]1613    },1614    {1615      "id": "WA-MC-08",1616      "title": "Address validation across families: one entry point, no address valid for two families",1617      "group": "fraud-protection",1618      "verdict": "partial",1619      "scope": "service",1620      "rationale": "checkAddress is called by prepareSend on every chain; an address of another family or network is refused with a reason that names what it is; the result carries the notes the interface needs (no checksum, off-curve Solana address, legacy Bitcoin Cash form, own address); no text is accepted by two families on any of the 29 networks.",1621      "gap": "The notes are produced by the engine and must be displayed (QYV-APP-082). On test networks an address of one test coin is a valid address of another (shared version bytes): only the network badge tells them apart.",1622      "finding": "QYV-APP-082",1623      "evidence": [1624        {1625          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:271",1626          "contains": "func checkAddress(_ text: String, kind: ChainKind) throws -> AddressCheck {"1627        },1628        {1629          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:445",1630          "contains": "let check = try checkAddress(to, kind: kind)"1631        },1632        {1633          "ref": "security/tests/Tests/PropertyAuditTests/MultichainWalletProperties.swift:118",1634          "contains": "@Test func noAddressIsValidForAnotherFamily() async throws {"1635        },1636        {1637          "ref": "security/tests/Sources/FuzzTargets/Targets+MultichainWallet.swift:524",1638          "contains": "\"check-address\", \"Address validation of every network of every family on arbitrary text: canonical form, own-address detection, and no text valid for two families\","1639        }1640      ]1641    },1642    {1643      "id": "WA-MC-09",1644      "title": "Endpoint configuration: https, private hosts only over http, no credentials, bounded, set with a fresh authentication",1645      "group": "network",1646      "verdict": "pass",1647      "scope": "service",1648      "rationale": "A configuration is accepted only when every URL of every family is https, or http to the device itself or a private network, without user or password; counts, lengths and network names are bounded; the change needs a fresh authentication, forgets what was read from the previous endpoints and verifies chain identity again. A stored configuration is filtered by the same rule when the clients are built.",1649      "evidence": [1650        {1651          "ref": "Sources/QyvoraNetworking/HTTP.swift:342",1652          "contains": "public static func isAcceptable(_ text: String) -> Bool {"1653        },1654        {1655          "ref": "Sources/QyvoraWallet/WalletService.swift:554",1656          "contains": "guard all.count <= 400, all.allSatisfy({ $0.utf8.count <= 300 }) else {"1657        },1658        {1659          "ref": "security/tests/Tests/PropertyAuditTests/EVMChainsProperties.swift:443",1660          "contains": "@Test func endpointConfigurationDecoding() throws {"1661        },1662        {1663          "ref": "Tests/QyvoraNetworkingTests/EVMChainsAuditRegressionTests.swift:83",1664          "contains": "@Test func endpointAcceptanceRule() {"1665        }1666      ]1667    },1668    {1669      "id": "WA-SOL-01",1670      "title": "Solana key derivation and recovery sheet",1671      "group": "recovery-phrase",1672      "verdict": "pass",1673      "scope": "service",1674      "rationale": "The account key is the SLIP-0010 Ed25519 key at m/44'/501'/0'/0' of the BIP-39 seed (the default of Phantom, Solflare and Ledger); the recovery sheet prints the path from the same function and the address derived by the same code, with the note that the address is the public key. Differential: 3 001 random seeds, accounts and styles agree with bip-utils and solders; five vectors of the module derived again.",1675      "evidence": [1676        {1677          "ref": "Sources/QyvoraSolana/SolanaAddress.swift:169",1678          "contains": "case .bip44Change: return DerivationPath([.hardened(44), .hardened(SolanaNetwork.coinType), .hardened(account), .hardened(0)])"1679        },1680        {1681          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:468",1682          "contains": "chain: \"Solana\", networks: \"mainnet-beta, devnet and testnet: the same address\", derivationPath: SolanaKeys.derivationPath().description"1683        },1684        {1685          "ref": "security/tests/Tests/DifferentialAuditTests/SolanaDiffTests.swift:240",1686          "contains": "func accountDerivation()"1687        }1688      ]1689    },1690    {1691      "id": "WA-SOL-02",1692      "title": "Solana signing key in memory",1693      "group": "key-storage",1694      "verdict": "pass",1695      "scope": "service",1696      "rationale": "The BIP-39 seed exists only inside withSeed (vault unlocked, fresh authentication) and is zeroed on every exit path; the SLIP-0010 node is wiped; the 32-byte Ed25519 seed is zeroed by defer, including when the key does not match the account or signing throws. Nothing is captured by an escaping closure, converted to text or logged. Limits of the claim: Swift arrays may leave copies the language does not let the code reach (see the memory-hygiene review), and the Ed25519 primitive is reviewed separately.",1697      "residual_risk": "Copies made by the Swift runtime are outside the control of the code.",1698      "evidence": [1699        {1700          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:670",1701          "contains": "defer { SecureMemory.zero(&secret) }"1702        },1703        {1704          "ref": "Sources/QyvoraSolana/SolanaAddress.swift:181",1705          "contains": "defer { node.wipe() }"1706        },1707        {1708          "ref": "Sources/QyvoraWallet/WalletService.swift:439",1709          "contains": "defer { SecureMemory.zero(&seed) }"1710        }1711      ]1712    },1713    {1714      "id": "WA-SOL-03",1715      "title": "Solana address validation and cross-family confusion",1716      "group": "fraud-protection",1717      "verdict": "partial",1718      "scope": "both",1719      "rationale": "Strict base58 of exactly 32 bytes (no trimming), programs, sysvars and the wrapped-SOL mint refused, a text of another family refused with its family named; notes for \"no checksum\" and for an address that is not a curve point; the planner refuses a recipient that exists and is not a wallet, and warns on off-curve, new and first-time recipients. 70 072 addresses and texts in full mode agree with solders. A Solana address has no checksum: the protection against a mistyped or substituted address is the comparison the interface makes the user do.",1720      "gap": "No checksum exists in the format; the interface must show the notes, the full address and block on critical warnings.",1721      "finding": "QYV-APP-020",1722      "evidence": [1723        {1724          "ref": "Sources/QyvoraSolana/SolanaAddress.swift:63",1725          "contains": "guard (32...44).contains(text.utf8.count), let decoded = Base58.bitcoin.decode(text), decoded.count == 32 else { return nil }"1726        },1727        {1728          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:336",1729          "contains": "guard !SolanaProgram.reserved.contains(key) else { throw WalletError.address(.unsupported(\"This is a Solana program, not a wallet: funds sent there are lost.\")) }"1730        },1731        {1732          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:338",1733          "contains": "if !key.isOnCurve { notes.append("1734        },1735        {1736          "ref": "Sources/QyvoraSolana/SolanaSendPlanner.swift:253",1737          "contains": "if case .other(let owner) = snapshot.recipient { throw .recipientIsNotAWallet(owner: owner) }"1738        },1739        {1740          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:456",1741          "contains": "id: \"solana.off-curve\""1742        }1743      ]1744    },1745    {1746      "id": "WA-SOL-04",1747      "title": "Solana: what is shown is what is signed",1748      "group": "fraud-protection",1749      "verdict": "pass",1750      "scope": "service",1751      "rationale": "The transaction is built locally by the planner (never taken from a server), the review is checked against the decoding of its bytes when it is made and again before signing (QYV-SVC-023), the signature covers message.serialize() of that very value and the signed transaction must decode back to the reviewed message. Tokens move by TransferChecked: mint and decimals are in the signed bytes, so metadata forged by an endpoint cannot make the amount shown differ from the amount moved. On a cold device the review is the decoding of the received bytes, which must be canonical. 30 000 random payments are byte-identical to solders; fuzz targets solana-review and solana-message check that what is reviewed re-encodes to the bytes received.",1752      "finding": "QYV-SVC-023",1753      "evidence": [1754        {1755          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:500",1756          "contains": "static func requireSolanaPayment(_ transaction: SolanaTransaction, matches review: SendReview, owner: SolanaPublicKey) throws {"1757        },1758        {1759          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:732",1760          "contains": "try Self.requireSolanaPayment(details.plan.transaction, matches: review, owner: owner)"1761        },1762        {1763          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:678",1764          "contains": "guard signed.isFullySigned, signed.verifySignatures(), signed.message == transaction.message, signed.id != nil,"1765        },1766        {1767          "ref": "Sources/QyvoraWallet/WalletService+Cold.swift:104",1768          "contains": "guard let bytes = SolanaBase64.decode(payload), let tx = try? SolanaTransaction.decode(bytes), (try? tx.serialize()) == bytes else {"1769        },1770        {1771          "ref": "Sources/QyvoraSolana/SolanaInstructions.swift:149",1772          "contains": "], data: [12] + Endian.le64(amount) + [decimals])"1773        },1774        {1775          "ref": "Tests/QyvoraWalletTests/SolanaAuditRegressionTests.swift:146",1776          "contains": "func aReviewThatDoesNotMatchItsBytesIsNeverSigned()"1777        }1778      ]1779    },1780    {1781      "id": "WA-SOL-05",1782      "title": "Solana blind signing",1783      "group": "fraud-protection",1784      "verdict": "pass",1785      "scope": "service",1786      "rationale": "Only exact layouts of the System, Compute Budget, Token, Token-2022, Associated Token Account and Memo programs are recognised; any other program or layout, and any account taken from an address lookup table, makes the review blind. The hot path signs only the planner's payments; the cold path refuses a blind transaction unless blind signing is allowed explicitly, flags a decodable transaction that is not a payment as critical, and on an unaudited mainnet build signs nothing it cannot decode entirely. Memos cannot disguise a review (QYV-SVC-024).",1787      "finding": "QYV-SVC-024",1788      "evidence": [1789        {1790          "ref": "Sources/QyvoraSolana/SolanaInstructions.swift:323",1791          "contains": "public var requiresBlindSigning: Bool { usesAddressLookupTables || instructions.contains(where: \\.isUnknown) }"1792        },1793        {1794          "ref": "Sources/QyvoraWallet/WalletService+Cold.swift:284",1795          "contains": "if review.requiresBlindSigning, !allowBlindSigning {"1796        },1797        {1798          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:626",1799          "contains": "guard !outflow.blind else { throw WalletError.unauditedLimitUnverifiable(\"On mainnet this build does not sign a Solana transaction it cannot decode entirely.\") }"1800        },1801        {1802          "ref": "Tests/QyvoraSolanaTests/SolanaAuditRegressionTests.swift:183",1803          "contains": "func memosCannotDisguiseTheReview()"1804        }1805      ]1806    },1807    {1808      "id": "WA-SOL-06",1809      "title": "Solana replay protection and cluster binding",1810      "group": "replay-protection",1811      "verdict": "partial",1812      "scope": "service",1813      "rationale": "Replay on the same cluster is prevented by the protocol (recent blockhash, about 150 blocks; a processed signature is refused) and by the service (a review is signed once and re-sent as the same bytes; the same payment is refused while one is pending; an expired review is not signed). Durable nonces are not used and a foreign nonce transaction is blind. A Solana transaction carries no cluster identifier and the account is the same key on every cluster: a test-cluster transaction is now checked against mainnet-beta before it is prepared, signed or relayed (QYV-SVC-022).",1814      "gap": "The cross-cluster check depends on an honest, up-to-date mainnet-beta endpoint and cannot be made by an offline device; the same-payment guard is per session and does not cover cold broadcasts.",1815      "residual_risk": "A signed transaction stays valid for about 150 blocks; see replay_protection.residual_risk.",1816      "finding": "QYV-SVC-022, QYV-SVC-025",1817      "evidence": [1818        {1819          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:551",1820          "contains": "func requireNotValidOnMainnet(_ transaction: SolanaTransaction, network: SolanaNetwork) async throws {"1821        },1822        {1823          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:719",1824          "contains": "if let id = signedReviews[review.id], let sent = sentTransactions[id], let again = try? SolanaTransaction.decode(sent.signed) {"1825        },1826        {1827          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:723",1828          "contains": "guard try await rpc.blockHeight() <= details.lastValidBlockHeight else {"1829        },1830        {1831          "ref": "Sources/QyvoraSolana/SolanaRPC.swift:523",1832          "contains": "default: return .pending"1833        },1834        {1835          "ref": "Tests/QyvoraWalletTests/SolanaAuditRegressionTests.swift:56",1836          "contains": "func aTestClusterTransactionValidOnMainnetIsNeverSigned()"1837        },1838        {1839          "ref": "Tests/QyvoraSolanaTests/SolanaAuditRegressionTests.swift:124",1840          "contains": "func oneEndpointCannotDeclareALiveTransactionDeadOrFailed()"1841        }1842      ]1843    },1844    {1845      "id": "WA-SOL-07",1846      "title": "Solana fees: ceiling and rent",1847      "group": "fees-nonces-utxos",1848      "verdict": "pass",1849      "scope": "service",1850      "rationale": "Signature fee 5 000 lamports; priority fee = ⌈limit × price / 10^6⌉ computed with overflow detection, refused above 0.01 SOL at prepare and at sign on every cluster; the suggested price is clamped to 5 000 … 2 000 000 micro-lamports whatever the endpoint reports; rent minimums from the endpoint must be positive and at most 0.01 SOL; the planner computes on any 64-bit figure without overflow (QYV-SVC-020), never spends more than the balance and leaves the sender empty or rent-exempt; send-max transfers exactly balance − fee. Properties: 200 001 planner cases, 400 001 fee cases, 200 000 send-max cases in full mode; fuzz target solana-planner.",1851      "finding": "QYV-SVC-020",1852      "evidence": [1853        {1854          "ref": "Sources/QyvoraSolana/SolanaSendPlanner.swift:234",1855          "contains": "public static let maximumPriorityFee: UInt64 = 10_000_000"1856        },1857        {1858          "ref": "Sources/QyvoraSolana/SolanaSendPlanner.swift:270",1859          "contains": "guard priorityFee <= maximumPriorityFee else { throw .priorityFeeTooHigh(lamports: priorityFee) }"1860        },1861        {1862          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:623",1863          "contains": "guard outflow.priorityFee <= SolanaSendPlanner.maximumPriorityFee else { throw WalletError.solana(.priorityFeeTooHigh(lamports: outflow.priorityFee)) }"1864        },1865        {1866          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:437",1867          "contains": "guard snapshot.systemAccountRent > 0, snapshot.systemAccountRent <= ceiling, (snapshot.token?.tokenAccountRent ?? 0) <= ceiling else {"1868        },1869        {1870          "ref": "Sources/QyvoraSolana/SolanaRPC.swift:582",1871          "contains": "return min(maximumUnitPrice, max(minimumUnitPrice, percentile))"1872        },1873        {1874          "ref": "Tests/QyvoraSolanaTests/SolanaAuditRegressionTests.swift:64",1875          "contains": "func hostileRentAndBalancesNeverTrapThePlanner()"1876        }1877      ]1878    },1879    {1880      "id": "WA-SOL-08",1881      "title": "Solana per-transaction limits of an unaudited build",1882      "group": "mainnet-gate",1883      "verdict": "pass",1884      "scope": "service",1885      "rationale": "On mainnet-beta an unaudited build signs only a plain payment it decodes entirely, with SOL ≤ 150 USD and each token ≤ 150 USD at a fresh price (no price, no transaction), a priority fee ≤ 0.01 SOL and at most one token-account creation. The figures are computed from the decoded bytes — not from the plan — when the transaction is prepared, in the signing function itself (hot and cold) and before a cold-signed broadcast. A plan or a review above the ceiling cannot be built through the public interface (no public initializer, constant properties), and one forged through the module-internal initializers is still refused.",1886      "residual_risk": "The limits bound one transaction, not the balance; they do not apply to test clusters (hence QYV-SVC-022).",1887      "evidence": [1888        {1889          "ref": "Sources/QyvoraCore/Networks.swift:952",1890          "contains": "public static let solanaLimits = AccountChainLimits(nativeUSDPerTransaction: limits.nativeUSDPerTransaction, feePerTransaction: 10_000_000)"1891        },1892        {1893          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:441",1894          "contains": "try await enforceUnauditedSolanaLimits(plan.transaction, network: network, owner: sender)"1895        },1896        {1897          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:667",1898          "contains": "try await enforceUnauditedSolanaLimits(transaction, network: network, owner: owner)"1899        },1900        {1901          "ref": "Sources/QyvoraWallet/WalletService+Cold.swift:336",1902          "contains": "try await enforceUnauditedSolanaLimits(tx, network: network, owner: owner)"1903        },1904        {1905          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:639",1906          "contains": "guard outflow.lamports <= ceiling else {"1907        },1908        {1909          "ref": "Tests/QyvoraWalletTests/SolanaAuditRegressionTests.swift:211",1910          "contains": "func aSolanaTransactionAboveTheCeilingIsNeverSignedWhateverThePlanSays()"1911        },1912        {1913          "ref": "Tests/QyvoraWalletTests/MultiChainSendTests.swift:697",1914          "contains": "func solanaLimitsApplyWhenPreparingAndWhenSigning()"1915        }1916      ]1917    },1918    {1919      "id": "WA-SOL-09",1920      "title": "Solana mainnet gate (both conditions)",1921      "group": "mainnet-gate",1922      "verdict": "pass",1923      "scope": "service",1924      "rationale": "Every Solana operation on mainnet-beta passes requireAllowed: refused unless the audit is recorded as completed, or the build is internal AND the user switched mainnet on. The account and the client are obtained only through functions that call it. A test-cluster signature can no longer be turned into a mainnet one by a test endpoint (QYV-SVC-022).",1925      "evidence": [1926        {1927          "ref": "Sources/QyvoraWallet/WalletService+Solana.swift:71",1928          "contains": "try requireAllowed(.solana(network))"1929        },1930        {1931          "ref": "Sources/QyvoraWallet/WalletService.swift:343",1932          "contains": "if !kind.isTest, !MainnetPolicy.mainnetEnabled { throw WalletError.mainnetDisabled(WalletError.mainnetText) }"1933        },1934        {1935          "ref": "Sources/QyvoraCore/Networks.swift:565",1936          "contains": "return auditCompleted || (internalBuild && userOptIn)"1937        },1938        {1939          "ref": "Tests/QyvoraWalletTests/MultiChainSendTests.swift:637",1940          "contains": "func theNetworkModeNeedsBothConditionsAndMovesEveryChain()"1941        }1942      ]1943    },1944    {1945      "id": "WA-SOL-10",1946      "title": "Solana endpoint policy",1947      "group": "network",1948      "verdict": "partial",1949      "scope": "both",1950      "rationale": "JSON-RPC over the shared transport (https, or http for local hosts only); answers bounded (8 MiB, capped lists, truncated texts), integers read exactly, strict JSON with bounded depth; the genesis hash of every endpoint is checked once per session. Reads take the first answer (no quorum); broadcasts go to every endpoint with a locally computed identifier; the expiry/failure verdict of a sent transaction and the mainnet blockhash check ask every endpoint. What one lying endpoint can do is bounded by the simulation, the on-chain checks of TransferChecked, the rent and fee ceilings and those two cross-checks; it can still show wrong balances and history, censor, and — for Token-2022 — hide an extension.",1951      "gap": "No quorum on reads; one default endpoint on devnet and on testnet; Token-2022 extension policy rests on one endpoint.",1952      "finding": "QYV-APP-021",1953      "evidence": [1954        {1955          "ref": "Sources/QyvoraSolana/SolanaRPC.swift:175",1956          "contains": "return try await call(method, params, on: endpoint)"1957        },1958        {1959          "ref": "Sources/QyvoraSolana/SolanaRPC.swift:218",1960          "contains": "guard text == network.genesisHash else {"1961        },1962        {1963          "ref": "Sources/QyvoraSolana/SolanaRPC.swift:448",1964          "contains": "guard result.string == id else { throw NetworkError.invalidResponse(\"sendTransaction returned another identifier\") }"1965        },1966        {1967          "ref": "Sources/QyvoraSolana/SolanaRPC.swift:156",1968          "contains": "guard data.count <= Self.maximumResponseBytes else {"1969        },1970        {1971          "ref": "Sources/QyvoraSolana/SolanaNetwork.swift:90",1972          "contains": "\"devnet\": [\"https://api.devnet.solana.com\"],"1973        },1974        {1975          "ref": "Sources/QyvoraSolana/SolanaJSON.swift:270",1976          "contains": "guard depthLeft > 0 else { return nil }"1977        }1978      ]1979    },1980    {1981      "id": "WA-SOL-11",1982      "title": "Solana: the address is the public key (post-quantum scope)",1983      "group": "post-quantum-scope",1984      "verdict": "pass",1985      "scope": "service",1986      "rationale": "A Solana address is the Ed25519 public key itself: it is public as soon as the address is shared or used, unlike a hashed address. Ed25519 offers no protection against a quantum adversary and nothing in QYVORA changes that for Solana transactions; the service states it in the exposure note of the chain. The post-quantum algorithms of the wallet protect local storage, backups and transfers only.",1987      "evidence": [1988        {1989          "ref": "Sources/QyvoraWallet/WalletService+Chains.swift:589",1990          "contains": "A Solana address is the public key of the account itself: sharing it publishes the key."1991        },1992        {1993          "ref": "Sources/QyvoraWallet/Chains.swift:365",1994          "contains": "accountNote: \"One address (m/44'/501'/0'/0'). A Solana address is the Ed25519 public key itself.\","1995        }1996      ]1997    },1998    {1999      "id": "WA-TRON-01",2000      "title": "TRON key derivation and recovery sheet",2001      "group": "recovery-phrase",2002      "verdict": "pass",2003      "scope": "service",2004      "rationale": "The account key is the BIP-32 secp256k1 key at m/44'/195'/0'/0/0 of the BIP-39 seed (what TronLink, Ledger Live and TronWeb derive), on every TRON network. The recovery sheet prints the path from the same function and the address from the same code. Random seeds and indices agree with bip-utils; the account of the test phrase equals TronWeb's.",2005      "evidence": [2006        {2007          "ref": "Sources/QyvoraTron/TronNetwork.swift:113",2008          "contains": "DerivationPath([.hardened(44), .hardened(195), .hardened(0), .normal(0), .normal(index)])"2009        },2010        {2011          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:473",2012          "contains": "chain: \"TRON\", networks: \"mainnet, Nile and Shasta: the same address\", derivationPath: TronPaths.account().description,"2013        },2014        {2015          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:317",2016          "contains": "var tron = try master.derive(TronPaths.account())"2017        },2018        {2019          "ref": "security/tests/Tests/DifferentialAuditTests/TronDiffTests.swift:573",2020          "contains": "func accountDerivation()"2021        },2022        {2023          "ref": "security/tests/Tests/ConformanceAuditTests/TronVectors.swift:277",2024          "contains": "check(TronPaths.account().description == \"m/44'/195'/0'/0/0\""2025        }2026      ]2027    },2028    {2029      "id": "WA-TRON-02",2030      "title": "TRON signing key lives in memory for the duration of a signature",2031      "group": "key-storage",2032      "verdict": "pass",2033      "scope": "service",2034      "rationale": "signTron derives the key under withMasterKey, checks that it gives the account the profile and the vault vouch for, signs, and wipes the derived key and the private scalar on every path. No TRON private key is stored, logged or returned.",2035      "evidence": [2036        {2037          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:608",2038          "contains": "var key = try master.derive(TronPaths.account())"2039        },2040        {2041          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:611",2042          "contains": "defer { SecureMemory.zero(&secret) }"2043        },2044        {2045          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:595",2046          "contains": "if let trusted = await trustedPublicData(), trusted.tron != owner.base58 {"2047        }2048      ]2049    },2050    {2051      "id": "WA-TRON-03",2052      "title": "TRON address validation and cross-family confusion",2053      "group": "fraud-protection",2054      "verdict": "pass",2055      "scope": "service",2056      "rationale": "A recipient must be the Base58Check form (34 characters, T, checksum, prefix 0x41). The hexadecimal 41… form and the EVM 0x… form — the same twenty bytes — are refused with their own sentences, as are the zero address, the mainnet burn address, the wallet's own address and token contracts. A contract recipient is a critical warning; a never-activated recipient is announced with its fee. Random and altered texts agree with an independent strict rule; tronpy accepts the EVM and hexadecimal forms, the wallet does not.",2057      "finding": "QYV-SVC-042",2058      "evidence": [2059        {2060          "ref": "Sources/QyvoraTron/TronAddress.swift:81",2061          "contains": "guard ascii.count == 34, ascii[0] == 0x54, let payload = Base58Check.decode(text), let a = TronAddress(bytes: payload) else { return nil }"2062        },2063        {2064          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:347",2065          "contains": "if TronAddress(hex: t) != nil {"2066        },2067        {2068          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:343",2069          "contains": "if let address = TronAddress(t), address == tronNetwork.burnAddress {"2070        },2071        {2072          "ref": "Sources/QyvoraTron/TronSendPlanner.swift:261",2073          "contains": "if TronBuiltInTokens.token(recipient.address, on: state.network) != nil { throw .recipientIsTokenContract(recipient.address) }"2074        },2075        {2076          "ref": "security/tests/Tests/DifferentialAuditTests/TronDiffTests.swift:140",2077          "contains": "func addressParsing()"2078        },2079        {2080          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:225",2081          "contains": "func theBurnAddressOfTheMainNetworkIsRefused()"2082        }2083      ]2084    },2085    {2086      "id": "WA-TRON-04",2087      "title": "TRON: what is shown is what is signed; nothing a node built is signed",2088      "group": "fraud-protection",2089      "verdict": "pass",2090      "scope": "service",2091      "rationale": "raw_data is encoded on the device from the plan; the transaction id is SHA-256 of those bytes; the review is derived from the same transaction and, before signing, compared with the figures shown; a payload received by a cold device must be the canonical encoding of what it decodes to. The node's createtransaction is never used to sign. Encoding identical to Google's protobuf runtime on random transactions and on 1 096 chain transactions; decoding judged like the runtime plus the stated policy on altered encodings.",2092      "finding": "QYV-SVC-043",2093      "evidence": [2094        {2095          "ref": "Sources/QyvoraTron/TronTransaction.swift:374",2096          "contains": "public var txID: Bytes { SHA256.hash(rawData) }"2097        },2098        {2099          "ref": "Sources/QyvoraTron/TronTransaction.swift:419",2100          "contains": "guard tx.rawData == rawData else { throw .nonCanonical }"2101        },2102        {2103          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:662",2104          "contains": "try Self.requireMatches(review, plan: details.plan)"2105        },2106        {2107          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:617",2108          "contains": "guard signed.transaction == transaction, (try? signed.signers()) == [owner], (try? SignedTronTransaction.decode(signed.serialized)) == signed else {"2109        },2110        {2111          "ref": "security/tests/Tests/DifferentialAuditTests/TronDiffTests.swift:228",2112          "contains": "func rawDataTransactionIDAndSignature()"2113        },2114        {2115          "ref": "security/tests/Tests/DifferentialAuditTests/TronDiffTests.swift:418",2116          "contains": "func decodingOfAlteredRawData()"2117        },2118        {2119          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:276",2120          "contains": "func aReviewThatDoesNotMatchItsTransactionIsNotSigned()"2121        }2122      ]2123    },2124    {2125      "id": "WA-TRON-05",2126      "title": "TRON blind signing",2127      "group": "fraud-protection",2128      "verdict": "pass",2129      "scope": "service",2130      "rationale": "The wallet builds TransferContract and TRC-20 transfer(address,uint256) only. On a cold device a TRC-20 approval is decoded and shown (unlimited approvals flagged critical); any other contract call and any other contract type is refused unless blind signing is allowed explicitly, and refused whatever is passed on an unaudited mainnet.",2131      "evidence": [2132        {2133          "ref": "Sources/QyvoraTron/TronTransaction.swift:482",2134          "contains": "guard allowBlindSigning else { throw Error.blindSigningRefused }"2135        },2136        {2137          "ref": "Sources/QyvoraWallet/WalletService+Cold.swift:294",2138          "contains": "throw WalletError.invalidPayload(\"This contract cannot be decoded. Blind signing must be allowed explicitly.\")"2139        },2140        {2141          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:581",2142          "contains": "case .trc20Approve, .contractCall, .unknownContract:"2143        },2144        {2145          "ref": "security/tests/Tests/PropertyAuditTests/TronProperties.swift:653",2146          "contains": "func theEngineSignsOnlyWhatItDecodesForTheOwnerKey()"2147        }2148      ]2149    },2150    {2151      "id": "WA-TRON-06",2152      "title": "TRON replay protection and network binding",2153      "group": "replay-protection",2154      "verdict": "partial",2155      "scope": "service",2156      "rationale": "A transaction is bound to a recent block (TaPoS), an expiration (120 s by default, never more than 65 minutes at signing) and its own id; the chain refuses duplicates. No chain identifier exists in the format: the reference block is agreed by every answering node and, on a test network, checked against the main network before signing.",2157      "gap": "An offline cold device cannot check which network a payload is for; the label of the envelope decides which rules apply.",2158      "residual_risk": "A test-network payload valid on mainnet can be cold-signed past the gate and the limits (QYV-APP-040, open); a single reachable node gives no cross-check.",2159      "finding": "QYV-SVC-040, QYV-SVC-041, QYV-APP-040",2160      "evidence": [2161        {2162          "ref": "Sources/QyvoraTron/TronClient.swift:483",2163          "contains": "public func referenceBlock() async throws -> (block: TronBlockReference, confirmations: Int)"2164        },2165        {2166          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:664",2167          "contains": "try await requireNotValidOnTronMainnet(details.plan.transaction, network: network)"2168        },2169        {2170          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:604",2171          "contains": "guard transaction.expiration - nowMilliseconds <= Self.tronMaximumSigningWindowMilliseconds else {"2172        },2173        {2174          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:315",2175          "contains": "func aTestNetworkTransactionTheMainNetworkWouldAcceptIsNeverSigned()"2176        },2177        {2178          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:183",2179          "contains": "func aColdDeviceDoesNotSignATransactionValidForMoreThanAnHour()"2180        },2181        {2182          "ref": "Tests/QyvoraTronTests/TronAuditRegressionTests.swift:95",2183          "contains": "func aNodeWithAnotherBlockAtTheSameHeightIsADisagreement()"2184        }2185      ]2186    },2187    {2188      "id": "WA-TRON-07",2189      "title": "TRON fees: fee_limit ceiling, bandwidth, energy, activation",2190      "group": "fees-nonces-utxos",2191      "verdict": "pass",2192      "scope": "service",2193      "rationale": "Fees are computed with checked arithmetic from chain parameters that are bounded when read. fee_limit is the simulated energy plus 25 % at the chain price, refused above 100 TRX (and above the protocol's ceiling) when planning and again when signing, on every network; the worst-case fee of a plan is refused above 100 TRX. Send-max never exceeds the balance; the activation fee of a new recipient is announced. Hostile chain states: no trap, every invariant held.",2194      "evidence": [2195        {2196          "ref": "Sources/QyvoraTron/TronSendPlanner.swift:377",2197          "contains": "guard feeLimit <= cap else { throw .feeLimitTooHigh(requiredSun: feeLimit, capSun: cap) }"2198        },2199        {2200          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:553",2201          "contains": "guard transaction.feeLimit <= feeCeiling else {"2202        },2203        {2204          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:556",2205          "contains": "if let maximumFeeSun, maximumFeeSun > feeCeiling {"2206        },2207        {2208          "ref": "security/tests/Tests/PropertyAuditTests/TronProperties.swift:512",2209          "contains": "func plannerArithmeticHoldsForAnyChainState()"2210        },2211        {2212          "ref": "security/tests/Tests/PropertyAuditTests/TronProperties.swift:622",2213          "contains": "func sendMaxNeverExceedsTheBalance()"2214        },2215        {2216          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:243",2217          "contains": "func aFeeLimitAboveTheCeilingIsNotSignedOnAnyNetwork()"2218        }2219      ]2220    },2221    {2222      "id": "WA-TRON-08",2223      "title": "TRON mainnet gate: both conditions",2224      "group": "mainnet-gate",2225      "verdict": "pass",2226      "scope": "service",2227      "rationale": "Every TRON entry point resolves the account through tronAccount / verifiedTron, which call requireAllowed: the main network needs the build's declaration and the user's switch. The cold path goes through the same function.",2228      "residual_risk": "The gate looks at the network the wallet believes it is on: see WA-TRON-06 for a test-network payload that is valid on mainnet.",2229      "evidence": [2230        {2231          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:78",2232          "contains": "try requireAllowed(.tron(network))"2233        },2234        {2235          "ref": "Sources/QyvoraWallet/WalletService.swift:343",2236          "contains": "if !kind.isTest, !MainnetPolicy.mainnetEnabled { throw WalletError.mainnetDisabled(WalletError.mainnetText) }"2237        },2238        {2239          "ref": "Sources/QyvoraCore/Networks.swift:565",2240          "contains": "return auditCompleted || (internalBuild && userOptIn)"2241        }2242      ]2243    },2244    {2245      "id": "WA-TRON-09",2246      "title": "TRON per-transaction limits at prepare and at sign",2247      "group": "mainnet-gate",2248      "verdict": "pass",2249      "scope": "service",2250      "rationale": "On an unaudited mainnet: TRX amount under the dollar ceiling at a fresh price (no price, no transaction), TRC-20 only for tokens with a known price under their ceiling, nothing else. Applied when the review is prepared, before signing in signAndBroadcastTron, inside signTron (so a cold signature too) and before a cold-signed transaction is broadcast. The figures are read from the bytes: a plan or a review forged inside the module does not lift them, and neither type can be built through the public interface.",2251      "evidence": [2252        {2253          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:493",2254          "contains": "try await enforceTronLimits(plan.transaction, network: network, maximumFeeSun: plan.maximumFeeSun)"2255        },2256        {2257          "ref": "Sources/QyvoraWallet/WalletService+Tron.swift:598",2258          "contains": "try await enforceTronLimits(transaction, network: network, maximumFeeSun: nil)"2259        },2260        {2261          "ref": "Sources/QyvoraWallet/WalletService+Cold.swift:357",2262          "contains": "try await enforceTronLimits(signedTx.transaction, network: network, maximumFeeSun: nil)"2263        },2264        {2265          "ref": "Sources/QyvoraCore/Networks.swift:956",2266          "contains": "public static let tronLimits = AccountChainLimits(nativeUSDPerTransaction: limits.nativeUSDPerTransaction, feePerTransaction: 100_000_000)"2267        },2268        {2269          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:426",2270          "contains": "func aForgedTronPlanAboveTheCeilingIsNotSigned()"2271        }2272      ]2273    },2274    {2275      "id": "WA-TRON-10",2276      "title": "TRON endpoint policy",2277      "group": "network",2278      "verdict": "partial",2279      "scope": "service",2280      "rationale": "Endpoints are https (http for a local host), user-editable, genesis-checked once per session. Reads follow the first usable answer; the reference block alone is agreed between nodes. Answers are size-bounded, strictly parsed and range-checked; no redirect is followed.",2281      "gap": "No quorum on balances, resources, chain parameters, TRC-20 metadata, status and history: one lying node decides what is displayed (endpoint impact table of the review register).",2282      "residual_risk": "Wrong display, bounded fee griefing (≤ fee limit), custom-token decimals (QYV-SVC-044), index-only history.",2283      "finding": "QYV-SVC-044",2284      "evidence": [2285        {2286          "ref": "Sources/QyvoraTron/TronClient.swift:370",2287          "contains": "func first<T: Sendable>(_ bases: [URL], _ path: String, _ body: TronJSON?, _ map: @Sendable (TronJSON) throws -> T) async throws -> T"2288        },2289        {2290          "ref": "Sources/QyvoraTron/TronClient.swift:445",2291          "contains": "guard genesis.number == 0, genesis.idHex == network.genesisBlockID else {"2292        },2293        {2294          "ref": "Sources/QyvoraTron/TronNetwork.swift:148",2295          "contains": "guard EndpointConfiguration.isAcceptable(text), var c = URLComponents(string: text), c.query == nil, c.fragment == nil else { return nil }"2296        },2297        {2298          "ref": "security/tests/Sources/FuzzTargets/Targets+Tron.swift:323",2299          "contains": "\"tron-json\""2300        }2301      ]2302    },2303    {2304      "id": "WA-TRON-11",2305      "title": "TronGrid API key handling",2306      "group": "data-protection",2307      "verdict": "pass",2308      "scope": "service",2309      "rationale": "The key is a vault record, set behind a fresh authentication; the profile stores a boolean; the type redacts itself in every textual form and accepts only letters, digits, '-' and '_' (8 to 128); it is sent as a header to trongrid.io hosts over https only, never in a URL, never to a custom endpoint, and the transport follows no redirect. Test: all requests of a synchronisation, a payment and a failing request are inspected and every file under the application directory is searched.",2310      "evidence": [2311        {2312          "ref": "Sources/QyvoraTron/TronClient.swift:345",2313          "contains": "if let apiKey, grid, url.scheme == \"https\" { r.setValue(apiKey.value, forHTTPHeaderField: \"TRON-PRO-API-KEY\") }"2314        },2315        {2316          "ref": "Sources/QyvoraTron/TronClient.swift:63",2317          "contains": "public var description: String { \"TronAPIKey(redacted)\" }"2318        },2319        {2320          "ref": "Sources/QyvoraWallet/WalletService+Chains.swift:336",2321          "contains": "try await vault.addRecord(type: .setting, payload: payload)"2322        },2323        {2324          "ref": "Tests/QyvoraWalletTests/TronAuditRegressionTests.swift:362",2325          "contains": "func theTronGridKeyGoesToTronGridHostsOnlyAndNowhereElse()"2326        },2327        {2328          "ref": "Tests/QyvoraTronTests/TronAuditRegressionTests.swift:222",2329          "contains": "func theAPIKeyIsNotSentToLookAlikeHosts()"2330        },2331        {2332          "ref": "security/tests/Tests/PropertyAuditTests/TronProperties.swift:841",2333          "contains": "func theAPIKeyTypeHoldsNothingThatBreaksAHeaderAndNeverPrintsItself()"2334        }2335      ]2336    },2337    {2338      "id": "WA-TRON-12",2339      "title": "TRON and post-quantum scope",2340      "group": "post-quantum-scope",2341      "verdict": "pass",2342      "scope": "service",2343      "rationale": "TRON transactions are signed with secp256k1 ECDSA, as the protocol requires: nothing post-quantum protects them. The post-quantum layer protects the vault that holds the seed and the API key, not the chain.",2344      "evidence": [2345        {2346          "ref": "Sources/QyvoraWallet/Chains.swift:332",2347          "contains": "mainCounterpart: .tron, testCounterparts: [.tronNile, .tronShasta], priceID: \"tron\", signatureScheme: \"secp256k1 ECDSA\","2348        }2349      ]2350    },2351    {2352      "id": "WA-UTXO-01",2353      "title": "Litecoin, Dogecoin, Bitcoin Cash: derivation paths, and the recovery sheet prints the paths that are derived",2354      "group": "recovery-phrase",2355      "verdict": "pass",2356      "scope": "service",2357      "rationale": "Accounts are m/84'/2'/0' (Litecoin, native SegWit), m/44'/3'/0' (Dogecoin) and m/44'/145'/0' (Bitcoin Cash), coin type 1 on test networks: the SLIP-0044 values other wallets use. The recovery sheet builds each entry from the same `UTXOAccount` and prints its `accountPath`, its account key (xpub / tpub) and its first address. Account paths, account keys, addresses, public keys, private keys and WIF are compared with bip-utils on random seeds (400 in quick mode, 4 000 in full mode).",2358      "residual_risk": "Extended keys are written with Bitcoin's version bytes (xpub / tpub), not the coin-specific ones some wallets display (Ltub, dgub): the sheet says so. Test networks share coin type 1, hence keys, between coins.",2359      "evidence": [2360        {2361          "ref": "Sources/QyvoraWallet/WalletService+Onboarding.swift:323",2362          "contains": "static func utxoAccountPath(_ network: BitcoinNetwork) -> DerivationPath { StandardPaths.account(network.defaultPurpose, network) }"2363        },2364        {2365          "ref": "Sources/QyvoraWallet/WalletService+Shield.swift:459",2366          "contains": "chain: network.displayName, networks: network.isTest ? \"test network\" : \"main network\", derivationPath: account.accountPath.description,"2367        },2368        {2369          "ref": "Sources/QyvoraCore/Networks.swift:290",2370          "contains": "public var defaultPurpose: UTXOAccountPurpose { supportsSegWit ? .bip84 : .bip44 }"2371        },2372        {2373          "ref": "security/tests/Tests/DifferentialAuditTests/UTXOCoinsDiffTests.swift:335",2374          "contains": "func accountDerivations() throws {"2375        },2376        {2377          "ref": "Tests/QyvoraWalletTests/UTXOCoinTests.swift:98",2378          "contains": "func accountsOfEveryCoinMatchThePublishedVectors() async throws {"2379        }2380      ]2381    },2382    {2383      "id": "WA-UTXO-02",2384      "title": "Address validation of the UTXO coins: no acceptance of another coin's address",2385      "group": "fraud-protection",2386      "verdict": "pass",2387      "scope": "both",2388      "rationale": "An address is accepted only in the encodings of its own network: Litecoin 0x30 / 0x32 / ltc1 (the former 0x05 P2SH form, Bitcoin's own, is refused); Dogecoin 0x1e / 0x16 and no SegWit address; Bitcoin Cash CashAddr with the network's prefix, 20-byte P2PKH and P2SH only. Version bytes and prefixes match the reference clients and bip-utils. CashAddr decoding matches the specification's vectors and bitcash on altered and crafted strings; every single substitution tried is refused. The service refuses a CashAddr without prefix and names the family of a foreign address. The legacy Base58 form of a Bitcoin Cash address — also a Bitcoin address — is accepted, converted, and raises a critical warning in the review.",2389      "gap": "The interface must make the user acknowledge the critical warning before signing and should show the CashAddr form next to what was typed (QYV-APP-060). Test networks of different coins share the Base58 bytes 0x6f / 0xc4, as their reference clients do.",2390      "finding": "QYV-SVC-065",2391      "evidence": [2392        {2393          "ref": "Sources/QyvoraBitcoin/Address.swift:179",2394          "contains": "} else if version == network.deprecatedP2SHVersion {"2395        },2396        {2397          "ref": "Sources/QyvoraBitcoin/Address.swift:147",2398          "contains": "guard decoded.hash.count == 20 else { throw Error.unsupportedAddressType }"2399        },2400        {2401          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:283",2402          "contains": "throw WalletError.address(.missingPrefix(chain: coin, prefix: prefix))"2403        },2404        {2405          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:510",2406          "contains": "static let legacyAddressWarningID = \"bch.legacy-address\""2407        },2408        {2409          "ref": "security/tests/Tests/DifferentialAuditTests/UTXOCoinsDiffTests.swift:243",2410          "contains": "func addressFormatsAndCrossNetworkAcceptance() throws {"2411        },2412        {2413          "ref": "security/tests/Tests/PropertyAuditTests/UTXOCoinsProperties.swift:179",2414          "contains": "func addressScriptRoundTripAndNoCrossCoinAcceptance() throws {"2415        },2416        {2417          "ref": "security/tests/Tests/ConformanceAuditTests/UTXOCoinsVectors.swift:65",2418          "contains": "func cashAddrSpecificationTables() throws {"2419        },2420        {2421          "ref": "Tests/QyvoraWalletTests/UTXOCoinsAddressAuditRegressionTests.swift:53",2422          "contains": "func aLegacyBitcoinCashRecipientIsACriticalWarningOfTheReview() async throws {"2423        }2424      ]2425    },2426    {2427      "id": "WA-UTXO-03",2428      "title": "Replay protection of the UTXO coins",2429      "group": "replay-protection",2430      "verdict": "partial",2431      "scope": "service",2432      "rationale": "Bitcoin Cash: every signature carries SIGHASH_FORKID (0x41) over the fork-id digest; it is invalid on Bitcoin, and a Bitcoin, Litecoin or Dogecoin signature is invalid on Bitcoin Cash (tested both ways on random keys and on main-network transactions). Litecoin and Dogecoin sign the same digest as Bitcoin; a signature is bound to outpoints that exist on one chain only, and the main networks use four distinct coin types, so no key is shared between coins.",2433      "gap": "Bitcoin SV and eCash share Bitcoin Cash's fork id: a payment of coins that predate their splits (2018-11-15, 2020-11-15) can be replayed on those chains. The wallet cannot prevent it; since this audit the review carries a critical warning when every coin of the payment predates a split (heights as the indexer reports them; ancestry not examined). The interface must make the user acknowledge it (QYV-APP-060).",2434      "finding": "QYV-APP-062",2435      "evidence": [2436        {2437          "ref": "Sources/QyvoraBitcoin/Transaction.swift:106",2438          "contains": "scheme == .bip143ForkID ? hasForkID && withoutForkID.isStandard : isStandard"2439        },2440        {2441          "ref": "Sources/QyvoraBitcoin/Signing.swift:110",2442          "contains": "let type = sighashType.adapted(to: scheme)"2443        },2444        {2445          "ref": "security/tests/Tests/PropertyAuditTests/UTXOCoinsProperties.swift:627",2446          "contains": "func replayProtectionBetweenTheChains() throws {"2447        },2448        {2449          "ref": "security/tests/Tests/ConformanceAuditTests/UTXOCoinsVectors.swift:279",2450          "contains": "\"invalid-under-another-scheme\""2451        },2452        {2453          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:516",2454          "contains": "static let lastBlockSharedWithECash = 661_647"2455        },2456        {2457          "ref": "Tests/QyvoraWalletTests/UTXOCoinsAuditRegressionTests.swift:261",2458          "contains": "func bitcoinCashCoinsOlderThanAChainSplitRaiseACriticalWarning() async throws {"2459        }2460      ]2461    },2462    {2463      "id": "WA-UTXO-04",2464      "title": "Dogecoin: every coin is checked against the transaction that created it before it is signed",2465      "group": "fraud-protection",2466      "verdict": "pass",2467      "scope": "service",2468      "rationale": "The original signature hash does not commit to the amounts spent: an indexer understating a coin would turn the difference into fee. Before signing a P2PKH input outside Bitcoin Cash the account requires the previous transaction, recomputes its identifier, and compares the amount and the script; the service fetches the raw transactions and refuses any that does not hash to the identifier asked for. A PSBT reports a fee only from authenticated previous outputs and the account signs a PSBT only when the whole fee is known. On Bitcoin Cash and for Litecoin's P2WPKH inputs the signature commits to the amount: one made under a false amount is invalid on the network (tested).",2469      "residual_risk": "Dogecoin has one default source of raw transactions (a Blockbook instance): without it payments are refused. Cold signing is not offered for these coins by the service.",2470      "finding": "QYV-SVC-064",2471      "evidence": [2472        {2473          "ref": "Sources/QyvoraBitcoin/Account.swift:341",2474          "contains": "} else if requiresPreviousTransactions {"2475        },2476        {2477          "ref": "Sources/QyvoraBitcoin/CoinSelection.swift:156",2478          "contains": "public func isAuthenticated(by previous: BitcoinTransaction) -> Bool {"2479        },2480        {2481          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:937",2482          "contains": "guard let tx = try? BitcoinTransaction(hex: hex, allowWitness: network.supportsSegWit), tx.txid == txid else {"2483        },2484        {2485          "ref": "Sources/QyvoraBitcoin/Account.swift:413",2486          "contains": "guard copy.inputs.allSatisfy({ $0.nonWitnessUTXO != nil }) else { throw PSBTError.nonWitnessUTXORequired }"2487        },2488        {2489          "ref": "Tests/QyvoraWalletTests/UTXOCoinsAuditRegressionTests.swift:192",2490          "contains": "func aLyingIndexerCannotBurnFees() async throws {"2491        },2492        {2493          "ref": "Tests/QyvoraBitcoinTests/UTXOCoinsAuditRegressionTests.swift:106",2494          "contains": "func nothingIsSignedWhenTheFeeIsNotAuthenticated() throws {"2495        },2496        {2497          "ref": "security/tests/Tests/PropertyAuditTests/UTXOCoinsProperties.swift:523",2498          "contains": "func psbtPreviousTransactionsAuthenticateTheFee() throws {"2499        }2500      ]2501    },2502    {2503      "id": "WA-UTXO-05",2504      "title": "Fee floors, ceilings and dust of the UTXO coins",2505      "group": "fees-nonces-utxos",2506      "verdict": "pass",2507      "scope": "service",2508      "rationale": "Per network: a fee floor (Litecoin 1 lit/vB, Dogecoin 0.01 DOGE/kB — the reference wallet's recommended fee —, Bitcoin Cash 1 sat/byte), a ceiling above which nothing is built, and the dust rule of the reference client (Litecoin: Bitcoin Core's formula at 30 000 lit/kvB; Dogecoin: 0.01 DOGE; Bitcoin Cash: 546 sat). The builder conserves value exactly, never creates a dust output, leaves a remainder to the fee only within the cost of a change output, never pays a witness program where SegWit does not exist, and signals replace-by-fee except on Bitcoin Cash. Estimates of an indexer are clamped to the floor and ceiling.",2509      "evidence": [2510        {2511          "ref": "Sources/QyvoraCore/Networks.swift:337",2512          "contains": "return UTXOFeePolicy(minimumFeeRatePerKiloVByte: 1_000_000, maximumFeeRatePerKiloVByte: 100_000_000, dust: .fixed(1_000_000))"2513        },2514        {2515          "ref": "Sources/QyvoraBitcoin/TransactionBuilder.swift:70",2516          "contains": "case witnessScriptNotSupported"2517        },2518        {2519          "ref": "Sources/QyvoraBitcoin/TransactionBuilder.swift:422",2520          "contains": "guard fee <= ceiling else { throw BitcoinBuildError.absurdFee(fee: fee, expected: ceiling) }"2521        },2522        {2523          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:686",2524          "contains": "if let v = estimates[t], let r = FeeRate.fromEstimate(satPerVByte: v) { return (min(r.clamped(to: network), cap), t) }"2525        },2526        {2527          "ref": "security/tests/Tests/PropertyAuditTests/UTXOCoinsProperties.swift:276",2528          "contains": "func builderAndSignatureInvariantsPerCoin() throws {"2529        },2530        {2531          "ref": "security/tests/Tests/PropertyAuditTests/UTXOCoinsProperties.swift:435",2532          "contains": "func feeDustAndLimitConstants() throws {"2533        },2534        {2535          "ref": "security/tests/Tests/ConformanceAuditTests/UTXOCoinsVectors.swift:310",2536          "contains": "func chainConstantsAgainstReferenceClients() {"2537        }2538      ]2539    },2540    {2541      "id": "WA-UTXO-06",2542      "title": "Limits of an unaudited build on Litecoin, Dogecoin and Bitcoin Cash, at prepare and at sign",2543      "group": "mainnet-gate",2544      "verdict": "pass",2545      "scope": "service",2546      "rationale": "On a main network of an unaudited build one transaction sends at most 150 USD of the coin (converted with a fresh price; without one the payment is refused), pays at most 0.001 LTC / 5 DOGE / 0.0005 BCH of fee and at most 200 lit/vB / 1 DOGE/kB / 20 sat/byte. The ceilings are applied when the payment is prepared and again, on the transaction that will be signed, before the vault is used: the value is recomputed from the outputs, the fee from the wallet's own record of the coins, and the output excluded as change must be a script of the wallet's change chain. The plan types have no public initializer and no mutable property; plans altered from inside the module are refused in tests for each of the three coins.",2547      "residual_risk": "The value ceiling depends on one price source (see the price-floor item of the multi-chain wallet audit). The limits bound one transaction, not the balance.",2548      "finding": "QYV-SVC-063",2549      "evidence": [2550        {2551          "ref": "Sources/QyvoraCore/Networks.swift:455",2552          "contains": "return UTXOLimits(value: .usd(limits.nativeUSDPerTransaction), feePerTransaction: 500_000_000, feeRatePerVByte: 100_000)"2553        },2554        {2555          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:778",2556          "contains": "try await enforceUnauditedCoinLimits(network: network, amount: paidAmount, fee: plan.fee, vsize: plan.estimatedVSize)"2557        },2558        {2559          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:919",2560          "contains": "try await enforceUnauditedCoinLimits(network: network, amount: recipients, fee: plan.fee, vsize: plan.plan.estimatedVSize)"2561        },2562        {2563          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:903",2564          "contains": "(0..<limit).contains(where: { (try? account.scriptPubKey(chain: .change, index: $0)) == script }) else {"2565        },2566        {2567          "ref": "Tests/QyvoraWalletTests/UTXOCoinsAuditRegressionTests.swift:80",2568          "contains": "func coinLimitsHoldAtPrepareAndAtSignEvenWithAnAlteredPlan() async throws {"2569        },2570        {2571          "ref": "Tests/QyvoraWalletTests/UTXOCoinTests.swift:479",2572          "contains": "func dogecoinMainnetLimitsAtPrepareAndAtSignAndPreviousTransactions() async throws {"2573        }2574      ]2575    },2576    {2577      "id": "WA-UTXO-07",2578      "title": "Mainnet gate of the UTXO coins: both conditions",2579      "group": "mainnet-gate",2580      "verdict": "pass",2581      "scope": "service",2582      "rationale": "Litecoin, Dogecoin and Bitcoin Cash main networks are refused unless the build allows main networks and the user opted in — the same two conditions as Bitcoin's; the account, the indexers, the synchronization and the payment all pass through the gate, and no request is made for a main network while it is closed.",2583      "evidence": [2584        {2585          "ref": "Sources/QyvoraWallet/WalletService.swift:335",2586          "contains": "if !network.isTest, !MainnetPolicy.mainnetEnabled { throw WalletError.mainnetDisabled(WalletError.mainnetText) }"2587        },2588        {2589          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:230",2590          "contains": "try requireAllowed(network)"2591        },2592        {2593          "ref": "Sources/QyvoraCore/Networks.swift:565",2594          "contains": "return auditCompleted || (internalBuild && userOptIn)"2595        },2596        {2597          "ref": "Tests/QyvoraWalletTests/UTXOCoinTests.swift:454",2598          "contains": "func theCoinsAreBehindTheMainnetGate() async throws {"2599        }2600      ]2601    },2602    {2603      "id": "WA-UTXO-08",2604      "title": "Chain identity of the UTXO coin indexers",2605      "group": "network",2606      "verdict": "pass",2607      "scope": "service",2608      "rationale": "Before anything is read or broadcast each indexer must serve the network's identity block: the genesis block for Litecoin and Dogecoin; block 661648 for Bitcoin Cash (its genesis is Bitcoin's, Bitcoin SV's and eCash's) and block 200000 for its testnet4 (whose genesis is chipnet's). An endpoint on another chain fails the network (wrongChain). The constants were compared with the reference clients' sources and with two or three public indexers each.",2609      "residual_risk": "The check is made once per session and per endpoint list; it identifies the chain, not the honesty of the endpoint.",2610      "evidence": [2611        {2612          "ref": "Sources/QyvoraCore/Networks.swift:363",2613          "contains": "return UTXOChainIdentity(height: 661_648, hash: \"0000000000000000029e471c41818d24b8b74c911071c4ef0b4a0509f9b5a8ce\")"2614        },2615        {2616          "ref": "Sources/QyvoraNetworking/UTXOIndexer.swift:327",2617          "contains": "guard hash == identity.hash else {"2618        },2619        {2620          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:269",2621          "contains": "throw WalletError.wrongChain(text)"2622        },2623        {2624          "ref": "security/tests/Tests/ConformanceAuditTests/UTXOCoinsVectors.swift:310",2625          "contains": "func chainConstantsAgainstReferenceClients() {"2626        },2627        {2628          "ref": "Tests/QyvoraWalletTests/UTXOCoinTests.swift:222",2629          "contains": "func bitcoinCashTestnetIdentityAddressesAndForkIdSpend() async throws {"2630        }2631      ]2632    },2633    {2634      "id": "WA-UTXO-09",2635      "title": "Endpoint policy of the UTXO coins: what one lying indexer can do",2636      "group": "network",2637      "verdict": "partial",2638      "scope": "service",2639      "rationale": "No signature can be obtained for something the user did not review, and no fee above the ceilings can be paid, whatever an indexer answers: amounts are authenticated (previous transactions on Dogecoin, signature commitment on Bitcoin Cash and Litecoin), fee estimates are clamped, identifiers are computed locally, answers are bounded and validated (8 fuzz targets, one trap found and fixed). What an indexer decides is what the wallet displays.",2640      "gap": "Balances, history and confirmations are read from one indexer — the one announcing the highest tip — without cross-check: a lying or compromised endpoint can show a payment that does not exist, hide one, or report false confirmations. Bitcoin Cash Testnet has a single endpoint; Dogecoin has a single source of raw transactions.",2641      "finding": "QYV-APP-061",2642      "evidence": [2643        {2644          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:281",2645          "contains": "private func readingIndexer(_ network: BitcoinNetwork, notes: inout [String]) async throws -> (client: any UTXOIndexer, tip: UTXOChainTip) {"2646        },2647        {2648          "ref": "Sources/QyvoraNetworking/UTXOIndexer.swift:464",2649          "contains": "public static func survey(_ clients: [any UTXOIndexer]) async -> [Survey] {"2650        },2651        {2652          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:463",2653          "contains": "throw WalletError.untrustedResponse(\"transaction \\(checked.txid.prefix(12))… does not involve the address it was listed for\")"2654        },2655        {2656          "ref": "Tests/QyvoraNetworkingTests/UTXOCoinsAuditRegressionTests.swift:62",2657          "contains": "func hostileTipHeightsNeitherTrapNorWinTheSurvey() async throws {"2658        },2659        {2660          "ref": "Tests/QyvoraNetworkingTests/UTXOCoinsAuditRegressionTests.swift:95",2661          "contains": "func aRefusedBroadcastIsNeverReportedAsAlreadyKnown() async throws {"2662        }2663      ]2664    },2665    {2666      "id": "WA-ED-01",2667      "title": "Ed25519 (Solana signatures): conformance and agreement with independent implementations",2668      "group": "key-storage",2669      "verdict": "pass",2670      "scope": "engine",2671      "rationale": "The from-scratch Ed25519 that signs Solana transactions is replayed against RFC 8032 section 7.1, the SLIP-0010 vectors, Wycheproof and the ed25519-speccheck edge cases, and compared with libsodium, OpenSSL, ed25519-dalek (verify_strict, the rule of Solana validators), CryptoKit and an integer transcription of RFC 8032: public keys and signatures byte-identical, verification verdicts identical to dalek and libsodium on adversarial inputs, field, scalar and group arithmetic equal to Python integers. Signing is deterministic, recomputes the public key from the seed and verifies each signature before returning it. Internal tests, not an independent review.",2672      "residual_risk": "Unaudited from-scratch implementation on a signing path: no second line of defence for a Solana signature (docs/THREAT_MODEL.md 5.5).",2673      "evidence": [2674        {2675          "ref": "Sources/QyvoraEd25519/Ed25519.swift:119",2676          "contains": "public static func sign(message: Bytes, seed: Bytes) throws -> Bytes {"2677        },2678        {2679          "ref": "Sources/QyvoraEd25519/Ed25519.swift:143",2680          "contains": "guard verify(signature: signature, message: message, publicKey: publicKey) else { throw Error.signingFailed }"2681        },2682        {2683          "ref": "security/tests/Tests/DifferentialAuditTests/Ed25519DiffTests.swift:237",2684          "contains": "@Test func verificationAgreementOnAdversarialInputs() throws {"2685        },2686        {2687          "ref": "security/tests/Tests/ConformanceAuditTests/Ed25519Vectors.swift:107",2688          "contains": "@Test func speccheckEdgeCases() throws {"2689        },2690        "runner:swift-audit"2691      ]2692    },2693    {2694      "id": "WA-ED-02",2695      "title": "Ed25519 secret path: constant-time construction, processor flag, machine-code and timing checks",2696      "group": "key-storage",2697      "verdict": "partial",2698      "scope": "engine",2699      "rationale": "No secret-dependent branch or memory index at source level; the table of the scalar multiplication is read entirely under a mask; every conditional branch of the compiled secret-path functions was read (two compiler versions) and is re-counted at each audit; public-key derivation and signing set the data-independent-timing flag. The timing tests found one defect (QYV-AUD-006: zero windows added the neutral element and were measurably distinguishable), fixed by a shifted base table. The hash state that held the expanded key and the nonce after use is now erased (QYV-CRY-005).",2700      "gap": "Statistical evidence on Macs only: nothing was timed on an iPhone; a processor without FEAT_DIT cannot be covered by the flag; scalars and points held in structs on the stack cannot be erased from Swift (QYV-CRY-003).",2701      "finding": "QYV-AUD-006, QYV-CRY-005, QYV-CRY-003",2702      "severity": "medium",2703      "residual_risk": "A local attacker with precise timing or memory access is not excluded; independent review required before any recommendation to use real funds.",2704      "evidence": [2705        {2706          "ref": "Sources/QyvoraEd25519/Edwards25519.swift:123",2707          "contains": "static func lookup(_ table: UnsafePointer<EdPoint>, _ index: UInt64) -> EdPoint {"2708        },2709        {2710          "ref": "Sources/QyvoraEd25519/Edwards25519.swift:170",2711          "contains": "add(multiply(scalar: scalar, table: baseTable), baseOffset)"2712        },2713        {2714          "ref": "Sources/QyvoraSymmetric/SHA2.swift:227",2715          "contains": "this one must not outlive it (QYV-CRY-005). `finalize` ends the computation: the instance is not reusable."2716        },2717        "runner:ct-machine-code",2718        "runner:dudect-timing"2719      ],2720      "checks": [2721        {2722          "id": "ed25519-dit",2723          "type": "grep",2724          "description": "Ed25519 public-key derivation and signing set the data-independent-timing flag",2725          "globs": [2726            "Sources/QyvoraEd25519/Ed25519.swift"2727          ],2728          "pattern": "DataIndependentTiming\\.enable\\(\\)",2729          "expect": "present",2730          "severity": "high",2731          "area": "crypto",2732          "cwe": "CWE-208",2733          "recommendation": "Set the flag for the whole body of every function that handles the seed, the expanded key or the nonce."2734        }2735      ]2736    },2737    {2738      "id": "WA-NEW-01",2739      "title": "Sweep of exposed coins (Litecoin, Dogecoin, Bitcoin Cash): ceilings of an unaudited build at prepare and at sign",2740      "group": "transaction-limits",2741      "verdict": "pass",2742      "scope": "service",2743      "rationale": "A sweep is a send-max plan built and signed by the payment functions: the 150 USD value ceiling, the fee and fee-rate ceilings apply when it is prepared and again on the transaction about to be signed, whatever the plan object states; a sweep above the ceiling is not signed on any of the three coins.",2744      "evidence": [2745        {2746          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:919",2747          "contains": "try await enforceUnauditedCoinLimits(network: network, amount: recipients, fee: plan.fee, vsize: plan.plan.estimatedVSize)"2748        },2749        {2750          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:59",2751          "contains": "@Test func aSweepObeysTheCeilingsAndPaysOnlyTheWalletOnEveryCoin() async throws {"2752        }2753      ]2754    },2755    {2756      "id": "WA-NEW-02",2757      "title": "Sweep of exposed coins: the destination is the wallet's own fresh address and cannot be redirected",2758      "group": "transaction-integrity",2759      "verdict": "pass",2760      "scope": "service",2761      "rationale": "The service derives the destination from the account (internal chain, never-used index); the caller passes no address; before signing, every output of a plan presented as a sweep must be a script of the account's change chain (QYV-SVC-101).",2762      "finding": "QYV-SVC-101",2763      "evidence": [2764        {2765          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:862",2766          "contains": "let fresh = try account.nextUnusedAddress(chain: .change, used: usedChange)"2767        },2768        {2769          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:914",2770          "contains": "throw WalletError.stalePlan(\"The sweep does not pay an address of this wallet. Prepare it again.\")"2771        }2772      ]2773    },2774    {2775      "id": "WA-NEW-03",2776      "title": "Sweep on Dogecoin: coins authenticated against their previous transactions",2777      "group": "transaction-integrity",2778      "verdict": "pass",2779      "scope": "service",2780      "rationale": "The sweep is signed by signAndBroadcastCoin: an indexer that misstates an exposed coin obtains no signature (QYV-SVC-064 rule).",2781      "evidence": [2782        {2783          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:966",2784          "contains": "let previous = account.requiresPreviousTransactions ? try await previousTransactions(for: plan.plan, network: network) : [:]"2785        },2786        {2787          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:151",2788          "contains": "@Test func aDogecoinSweepChecksItsCoinsAgainstTheirPreviousTransactions() async throws {"2789        }2790      ]2791    },2792    {2793      "id": "WA-NEW-04",2794      "title": "Persisted synchronization of a UTXO coin: hostile file refused or bounded, tied to account, network and endpoints",2795      "group": "local-storage",2796      "verdict": "pass",2797      "scope": "service",2798      "rationale": "The record is size-capped, bound to an identity (network, account key, endpoint lists), each address is derived again from the account, and the content passes the validation of a synchronization; anything else is removed. Structural mutations and fuzzing never trap and never restore a coin outside the account or the monetary range.",2799      "residual_risk": "The file is not authenticated: a forged, self-consistent record is displayed (flagged as the previous session's) until the next synchronization.",2800      "evidence": [2801        {2802          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:201",2803          "contains": "record.version >= 1, record.version <= UTXOCoinSyncRecord.currentVersion, record.identity == identity, record.network == network,"2804        },2805        {2806          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:180",2807          "contains": "guard address.string == e.address else { throw WalletError.untrustedResponse(\"persisted address\") }"2808        },2809        {2810          "ref": "security/tests/Tests/PropertyAuditTests/NewEntryPointsProperties.swift:161",2811          "contains": "@Test func forgedCoinRecordsAreRefusedOrFlaggedAndBounded() async throws {"2812        },2813        {2814          "ref": "security/tests/Sources/FuzzTargets/Targets+MultichainWallet.swift:596",2815          "contains": "\"utxo-coin-snapshot\", \"Persisted synchronization of a UTXO coin (Litecoin, Dogecoin, Bitcoin Cash) written by a hostile hand and read back through the service's own loader\","2816        }2817      ]2818    },2819    {2820      "id": "WA-NEW-05",2821      "title": "A persisted coin snapshot never feeds a signed transaction",2822      "group": "transaction-integrity",2823      "verdict": "pass",2824      "scope": "service",2825      "rationale": "prepare, sweep, the check before signing and tracking all go through freshCoinSnapshot, which refuses a snapshot of the previous session; the flag is set by the loader. Nothing else of the session state comes from the file (QYV-SVC-100).",2826      "finding": "QYV-SVC-100",2827      "evidence": [2828        {2829          "ref": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:738",2830          "contains": "guard !snapshot.isFromPreviousSession else {"2831        },2832        {2833          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:279",2834          "contains": "@Test func aForgedCoinRecordNeverReachesASignature() async throws {"2835        },2836        {2837          "ref": "security/tests/Tests/PropertyAuditTests/NewEntryPointsProperties.swift:210",2838          "contains": "@Test func aRestoredCoinRecordIsNeverSpentFrom() async throws {"2839        }2840      ]2841    },2842    {2843      "id": "WA-NEW-06",2844      "title": "Fee quotes: behind the mainnet gate, chain-identity checked, no trap on hostile figures, nothing signed",2845      "group": "network",2846      "verdict": "pass",2847      "scope": "service",2848      "rationale": "feeQuote resolves the chain through activeKind (gate), uses the verified clients (identity check, offline refusal), bounds and overflow-checks every figure, and returns an estimate that no later step trusts.",2849      "residual_risk": "An estimate rests on the first answering endpoint of the family.",2850      "evidence": [2851        {2852          "ref": "Sources/QyvoraWallet/WalletService+FeeQuote.swift:121",2853          "contains": "let kind = try activeKind(id)"2854        },2855        {2856          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:177",2857          "contains": "@Test func feeQuoteIsBehindTheMainnetGateAndSilentInColdMode() async throws {"2858        },2859        {2860          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:497",2861          "contains": "@Test func feeQuoteSurvivesHostileFigures() async throws {"2862        }2863      ]2864    },2865    {2866      "id": "WA-NEW-07",2867      "title": "acceptUnverifiedAmounts lifts no ceiling and nothing on an unaudited mainnet build",2868      "group": "transaction-limits",2869      "verdict": "pass",2870      "scope": "service",2871      "rationale": "The flag of the unified cold signing reaches signPSBT only; unverified amounts stay refused on an unaudited mainnet build whatever is passed; value and fee ceilings and the wallet's fee bounds are applied after it.",2872      "gap": "The interface must obtain the flag from a separate, explicit confirmation (QYV-APP-100).",2873      "finding": "QYV-APP-100",2874      "evidence": [2875        {2876          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:1034",2877          "contains": "guard acceptUnverifiedAmounts else {"2878        },2879        {2880          "ref": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:1038",2881          "contains": "try enforceUnauditedBitcoinLimit(network: account.network, amount: before.sentToOthers)"2882        },2883        {2884          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:203",2885          "contains": "@Test func acceptUnverifiedAmountsLiftsNoLimit() async throws {"2886        }2887      ]2888    },2889    {2890      "id": "WA-NEW-08",2891      "title": "Token description of a payment comes from the wallet, on every family; hidden and detected tokens cannot change it",2892      "group": "transaction-integrity",2893      "verdict": "pass",2894      "scope": "service",2895      "rationale": "Showing a hidden token again uses its chain and address only; a detected token of a restored file cannot enter the list (QYV-SVC-102); TRON and Solana payments resolve the token to the wallet's own description like EVM (QYV-SVC-103).",2896      "residual_risk": "Custom tokens keep the description read on chain when they were added (one endpoint); the profile is not authenticated (QYV-SVC-011, QYV-SVC-014).",2897      "evidence": [2898        {2899          "ref": "Sources/QyvoraWallet/WalletService+HiddenTokens.swift:110",2900          "contains": "let key = prefix + hidden.address"2901        },2902        {2903          "ref": "Sources/QyvoraWallet/WalletService+Send.swift:402",2904          "contains": "func tronToken(_ token: ChainToken, network: TronNetwork) throws -> ChainToken {"2905        },2906        {2907          "ref": "Sources/QyvoraWallet/WalletService+Ethereum.swift:455",2908          "contains": "guard !snapshot.isFromPreviousSession else { throw WalletError.notSynchronized(Self.detectedFromPreviousSessionText) }"2909        },2910        {2911          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:576",2912          "contains": "@Test func showingAHiddenTokenAgainChangesNoPaymentMetadata() async throws {"2913        },2914        {2915          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:632",2916          "contains": "@Test func aDetectedTokenOfARestoredSnapshotCannotEnterTheList() async throws {"2917        }2918      ]2919    },2920    {2921      "id": "WA-NEW-10",2922      "title": "Address indices of the profile file cannot trap the wallet or widen a key search",2923      "group": "local-storage",2924      "verdict": "pass",2925      "scope": "service",2926      "rationale": "Used indices are bounded when the profile is read and the account's index arithmetic is saturating or checked (QYV-SVC-104).",2927      "finding": "QYV-SVC-104",2928      "residual_risk": "The profile is not authenticated (QYV-SVC-011).",2929      "evidence": [2930        {2931          "ref": "Sources/QyvoraWallet/WalletTypes.swift:341",2932          "contains": "usedChangeIndices = try get(.usedChangeIndices, usedChangeIndices).mapValues { $0.filter { $0 <= Self.maximumUsedIndex } }"2933        },2934        {2935          "ref": "Sources/QyvoraBitcoin/Account.swift:251",2936          "contains": "guard !overflow else { throw BitcoinAccountError.indexOutOfRange }"2937        },2938        {2939          "ref": "Tests/QyvoraWalletTests/NewEntryPointsAuditRegressionTests.swift:471",2940          "contains": "@Test func hostileAddressIndicesOfAProfileNeitherTrapNorGrowTheSearch() async throws {"2941        }2942      ]2943    },2944    {2945      "id": "WA-NEW-09",2946      "title": "Ed25519 in the start-up self-test with a real RFC 8032 vector",2947      "group": "cryptography",2948      "verdict": "pass",2949      "scope": "service",2950      "rationale": "The self-test derives the public key and signs TEST 1 of RFC 8032 section 7.1, verifies the signature and refuses it for another message; a mismatch fails the self-test like any other primitive.",2951      "gap": "What the application does when the self-test fails is in App/Sources (not reviewed here).",2952      "evidence": [2953        {2954          "ref": "Sources/QyvoraCrypto/QyvoraCrypto.swift:156",2955          "contains": "edSignature.hex == \"e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b\","2956        }2957      ]2958    }2959  ]2960}2961
Files main
Menu

Theme