# CLAUDE.md Guidance for Claude Code working in this repository. Read `readme.md` first: it carries the shape, the security model and the reasoning. Conventions are `~/git/architecture` (`generic.md` for the workspace shape and ยง14 for how epics are executed, `gitea-runners.md` for `runs-on:` labels). This file is the things that will bite you. ## Work is filed before it is done Epics (`epic` label) and their children (`child` label) live on `blackbeard/wallet` at git.lair.cafe. The commit that implements a child closes it with `Closes #N`. When an investigation contradicts an issue, comment on the issue rather than quietly building the right thing; the correction is the valuable half of the history. ## The boundary is the security model - The webview never receives a secret, a seed, a mnemonic, or a private key, and never decodes a transaction itself. If a command needs to show the user what they are signing, Rust decodes it and returns a summary. - Every plugin permission goes into `crates/wallet-app/capabilities/*.json` deliberately, with a reason in the description. No `allow-all`. - Amounts are `wallet_entities::Amount`: integer base units plus decimals, serialised as strings. No `f64` touches a balance, ever. - Ramp providers open in the system browser, never in the wallet's webview. ## Things that will bite you - Quantus mainnet is spec 152 and verifies extrinsic signatures under the FIPS 204 context `QUANTUS_EXTRINSIC` (from spec 148). A signature made with the empty context is cryptographically valid and rejected by the chain. - The account id is Poseidon2 of the public key, so the signature carries the public key on the wire. ML-DSA-65 is the default for new accounts; ML-DSA-87 must stay decodable because dev-genesis, legacy and MPC accounts use it. - Derivation is `m/44'/189189'/account'/change'/index'`, every level hardened. Convention in the other Quantus wallets: index `0'` is ML-DSA-87, `1'` is ML-DSA-65. Match it or an imported mnemonic shows an empty wallet. - The keystore file format is quantus-cli's (Argon2id + AES-256-GCM). It is shared with the CLI and the browser extension; do not invent a second one. - `cargo test` regenerates `ui/src/api/generated` via ts-rs; commit the result with the entities change or CI fails on drift. ## Gates ``` cargo fmt --check --all cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace pnpm --dir ui typecheck && pnpm --dir ui lint && pnpm --dir ui build ```