Repository navigation
fix(wallet): refuse Core and Platform sends to someone else's private address - #1113
Conversation
… address Shielding from Core or Platform always deposits into the paying wallet's own shielded pool: the ShieldFromAssetLock and ShieldFromBalance tasks carry no recipient. The Send screen still accepted any typed private address for those sources, so a payment meant for another wallet landed back in the sender's own pool while the app reported success. The route check now refuses a Core or Platform source paired with a private address unless it is the wallet's own (the Shield flow's own-pool marker, or the wallet's account-0 address compared as decoded bytes). The refusal happens before any backend task is built and tells the user to pay from the Shielded Balance instead. Fails closed while the own address is not cached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
|
🔍 Review in progress — actively reviewing now (commit 1929e69) · triage: critical · Phase 2 only (no Phase 1 for this repository) |
|
Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (no Phase 1 for this repository)
The PR correctly blocks Core and Platform shield operations from accepting another wallet’s private address while preserving own-pool shielding and Shielded Balance transfers. The guard is applied before task construction, and the backend shield tasks independently deposit into the sender’s account-0 shielded address; current Test Suite and Clippy checks are still in progress.
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a contained UI routing and validation change affecting send behavior, but the diff does not itself perform or alter funds movement, transaction construction, signing, or backend processing. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
|
/skip-bots |
|
Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
/skip-bots |
|
Policy satisfied — this can merge. |
…1147) With Core or Platform as the source and another wallet's private address typed, the Send form offered an enabled Shield DASH button and a fee estimate. It refused only on click. The #1113 route check now lives in one function that also drives the form: the refusal shows under the address as soon as it applies, and Shield DASH is turned off with the same explanation on hover. The route check still refuses with the same error, so the guard itself is unchanged. The address suggestions popup stayed open after the field lost focus. It drew above a blocking dialog's dimmed backdrop, and its arrow and Enter keys kept working behind the dialog. AddressInput now closes the popup while a modal layer blocks the field. Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q Co-authored-by: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
TL;DR: Sending from your Core wallet or Platform balance to another person's private (shielded) address quietly put the money into your own private balance and still showed success. The app now stops that send before anything happens and tells you to pay private addresses from your Shielded Balance. Moving your own funds into your own private balance works as before.
User story
As a wallet user, I want a payment to someone's private address to either reach them or be refused, so that I never believe I paid someone when the money stayed with me.
Scenario
Base flow
Wallet › Send, choose Core Wallet (or Platform Addresses) as the source, paste another wallet's private (shielded) address, enter an amount, press Send and confirm.
Actual behavior
The funds are shielded into the sender's own private balance. The typed address is ignored, the recipient receives nothing, and the app reports success.
Expected behavior
Detailed discussion
Root cause:
validated_send_routeinsrc/ui/wallets/send_screen.rsaccepts any (Core | Platform, Shielded) pair;send_core_to_shieldedandsend_platform_to_shieldeddispatchShieldFromAssetLock/ShieldFromBalance, which carry no recipient, and the backend deposits intoshielded_default_address(seed_hash, 0)(src/backend_task/shielded/mod.rs).Fix (UI route check only, no backend task changes):
shielded_destination_is_own_pool()accepts the Shield preset's own-pool marker or an address whose decoded bytes equal the wallet's account-0 shielded address (so hex and case variants match).validated_send_routerefuses everything else before a task or confirmation dialog exists. It fails closed while the wallet's own shielded address is not yet known. The MCP shield tools take no recipient and are unaffected.The Send screen redesign (#1112) contains an equivalent guard with compatible wording.
Known limitations
Testing
ui::wallets::send_screenlib tests: 74 passed; clippy--all-features --lib --tests -D warningsclean.🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
PR Hygiene ·
1929e69src/ui/wallets/send_screen.rs) — approved by lklimekWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit