Repository navigation
feat(platform-wallet)!: private contact requests derive the sender's per-contact shielded address - #5902
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Final review complete — no blockers (commit 9985274) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The wallet-side derivation and cross-layer parameter removal are consistent, and no blocking correctness or interoperability issue is present. The remaining meaningful gap is that private-send tests bypass the real prepared-account derivation; the new test override also has a guard API that can silently lose or overwrite state. Kotlin CI passed, with no failed code checks reported.
🟡 2 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Exercise real address derivation through a private request
packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:5377-5384
The address-carrying private-request fixtures install give_every_contact, and contact_shielded_address returns from that hook before examining the sender, recipient, account reference, prepared account, viewing keys, or network schema. The separate shielded/contact_address_tests.rs tests the derivation helper directly, but no test verifies the new private-send connection between PreparedContactRequest.account_reference, the sender's prepared account, and the request payload. A swapped sender/recipient or incorrect reference at the private call site could therefore leave both test groups passing. Add a shielded wallet-level test that prepares the sender's actual identity account, sends without the override, and compares the carried address with AccountViewingKeys::contact_address for the request tuple; a private acceptance reply should also be covered if practical to verify the reversed roles.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: rust-quality)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 6: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 7: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.1-sol(effort low) — This is an intricate cross-language change to shielded address derivation and identity/key handling in private contact request signing, including placement-lock concurrency behavior. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:5377-5384: Exercise real address derivation through a private request
The address-carrying private-request fixtures install `give_every_contact`, and `contact_shielded_address` returns from that hook before examining the sender, recipient, account reference, prepared account, viewing keys, or network schema. The separate `shielded/contact_address_tests.rs` tests the derivation helper directly, but no test verifies the new private-send connection between `PreparedContactRequest.account_reference`, the sender's prepared account, and the request payload. A swapped sender/recipient or incorrect reference at the private call site could therefore leave both test groups passing. Add a shielded wallet-level test that prepares the sender's actual identity account, sends without the override, and compares the carried address with `AccountViewingKeys::contact_address` for the request tuple; a private acceptance reply should also be covered if practical to verify the reversed roles.
In `packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:156-168: Make the test override guard non-discardable and nestable
The new `GivenAddress` guard unconditionally resets the thread-local value to `None` on drop. Calling `give_every_contact(address);` as a statement silently disables the hook immediately, and nested guards cause the inner guard to clear the outer guard's value. The current call sites bind the guard explicitly, so this is not a present test failure, but the helper's API permits future tests to unknowingly exercise the real `None` path or lose an enclosing override. Store the previous value in the guard and mark it `#[must_use]`.
`ContactRequestInput` takes an optional 43-byte shielded payment address. The SDK encrypts it under the request's shared key with an IV of its own and writes it as `encryptedShieldedAddress`. It refuses the address where the network's contact requests have no such property, which they gain with DashPay v3 at protocol version 15. The wallet's write helper passes the address through; the wallet does not supply one yet. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…tact shielded address When a public contact request is sent, the wallet derives the shielded payment address the sending identity gives that contact and hands it to the SDK, which encrypts it into the request. The address is the one the identity's shielded account derives for this request alone, so every contact gets a different one. The request carries an address only when the identity's shielded account was prepared in this session, which proves with the seed that the identity holds the account's slot, is still the account of that slot, has its viewing keys bound, and the connected network's contact requests have the property. It goes without one otherwise. The send is refused if the address would be one already given to another contact. The identity wallet, which sends contact requests, holds no shielded keys, so it shares the platform wallet's viewing keys and prepared accounts through `ContactShieldedAddresses`. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…k's protocol version first An unpinned SDK starts mainnet and testnet at protocol version 13 and takes the context provider's DashPay contract at its own version. With supplied identities and local key callbacks nothing reads from the network before the contract is resolved, so that contract had no property for the address and the request was refused, on a network that accepts it. `create_contact_request` now establishes protocol version 15 before it resolves the contract, when the input carries an address. A request without one resolves the contract as before, with no extra read. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…d contacts The check that refuses an address already given to another contact compared against pending outgoing requests only. A request leaves that map once its contact establishes, so the addresses given to established contacts were not compared. `other_sent_account_references` lists both. Two smaller changes to the same path: - A request that goes without an address logs why, at debug level. The request is still sent, so that was not visible anywhere. - `proven_account_keys` checks the preparation under the viewing keys' read lock, so the keys it returns are the ones bound while the preparation stood. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…vation constant The protocol version a contact request's shielded address exists from was a constant local to the SDK. It is now `DASHPAY_CONTACT_REQUEST_SHIELDED_ADDRESS_INITIAL_PROTOCOL_VERSION` in `feature_initial_protocol_versions`, next to the other activations the SDK gates on. No behaviour change. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ot settled yet A public request held after its broadcast, with no proof of the outcome yet, may already be on Platform with its account reference. The check that refuses an address already given to another contact did not compare against it. `other_sent_account_references` now lists those requests too. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…he proved key The address a contact request carries comes from the identity's prepared shielded account. The preparation is recorded by identity id, so an identity removed and added back at the same slot was given an address without having been proved. `contact_shielded_address` now asks `is_prepared_for` under the wallet-manager lock it reads the identity with: the preparation stands and the identity still carries the key the seed proved. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…account by number A bind now refuses an account number of the identity range in the caller's list. The test passed the identity's account that way to have its keys bound without a preparation; the fixture's bind already adds it, for the identity the wallet holds. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…s per-contact shielded address A private DashPay contact request took the shielded address it carries from the host app, so giving each contact a different address depended on every host. The wallet now derives it as it does for a contact request document: `send_reserved_private_contact_request` calls `IdentityWallet::contact_shielded_address` with the request's sender, recipient and account reference. The `shielded_address` parameter is removed from `send_private_contact_request`, `accept_private_contact_request` and `accept_contact_request_replying_in_kind` in the wallet, from the three `platform_wallet_manager_*` C functions, from the JNI bridge, and from the Swift and Kotlin SDK methods. The address a contact gave us, read from a received request, is unchanged at every layer. The private contact request tests that need a request carrying a known address give it through a test-only hook on `contact_shielded_address`; `shielded/contact_address_tests.rs` covers what that function derives. Co-Authored-By: Claude Fable 5.2 <[email protected]>
27f9632 to
2716064
Compare
13b83da to
b99395f
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The wallet-owned derivation and removal of the host-supplied shielded-address parameter are consistently propagated through the Rust, FFI, JNI, Swift, and Kotlin layers, with no blocking correctness or consensus issue found. Two previously reported test-quality suggestions remain valid, and the changed API left one stale Rustdoc reference. The Kotlin CI check is still in progress; no failed code check is reported.
🟡 2 suggestion(s) | 💬 1 nitpick(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
1 finding(s) not shown inline (the lines are not part of this PR's diff)
💬 Nitpick: Update Rustdoc for the removed shielded_address parameter
packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:1844-1848
accept_private_contact_request no longer accepts a shielded_address argument, but its public Rustdoc still describes shielded_address as an input alongside pay. This contradicts the new API and does not explain that the wallet now derives the reply address for the contact.
/// Accept a contact request that came privately, replying privately: as
/// [`Self::accept_contact_request_with_external_signer`], with the reply
/// sent by [`Self::send_private_contact_request`], signed by `signer`,
/// paid for by `pay`; the wallet derives the shielded address it gives the
/// contact for private payments.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, ffi-engineer, rust-quality, security-auditor)
Still open from earlier rounds (1)
- 🟡 Suggestion: Make the test override guard non-discardable and nestable —
packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:182-193(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.1-sol(effort low) — This is a cross-language, multi-layer change that alters shielded payment-address derivation and identity key handling in private contact-request flows, a critical cryptographic and funds-related surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:5531-5536: Exercise real address derivation through a private request
The private-request integration fixture installs `give_every_contact(shielded_address)` before sending, so it verifies propagation, serialization, reading, and storage of an injected address rather than the new production derivation path. The direct derivation tests do not prove that `send_reserved_private_contact_request` threads the prepared account, viewing-key, network-schema, and `account_reference` conditions into the serialized private request. Add an integration fixture that prepares the sender's shielded account, sends without the hook, and compares the received address with the expected derived address; cover the private reply path if it uses the same wiring.
- [NITPICK] packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:1844-1848: Update Rustdoc for the removed shielded_address parameter
`accept_private_contact_request` no longer accepts a `shielded_address` argument, but its public Rustdoc still describes `shielded_address` as an input alongside `pay`. This contradicts the new API and does not explain that the wallet now derives the reply address for the contact.
In `packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:182-193: Make the test override guard non-discardable and nestable
(carried; thread: https://github.com/dashpay/platform/pull/5902#discussion_r4558241820)
|
Bots are done — your move: post |
…ivate-request-derived-address The contact request's shielded address merged to v5.1-dev as one commit (#5901). The three files this branch does not change take v5.1-dev's version. contact_shielded_address.rs is v5.1-dev's file with this branch's test hook added. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
…the wallet derives The private request tests handed the send a fixed address through a test hook, so none showed the send passing the derived address into the request it seals. The new test prepares the sender's identity shielded account against its seed, sends a private request with no address handed to it, and has the recipient read from the store the address that account derives for the request's sender, recipient and account reference. The hook's guard is must_use and puts back the value it replaced, so a guard dropped at once or nested in another does not clear an address a test still relies on. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The current head correctly keeps private contact-address derivation inside the wallet and adds an integration test that exercises the real derivation path without the test override. No blocking correctness, security, consensus, layering, or FFI issues were found. CI checks for the current head are still in progress, with no reported code-check failure in the supplied snapshot.
💬 1 nitpick(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
1 finding(s) not shown inline (the lines are not part of this PR's diff)
💬 Nitpick: Update Rustdoc for the removed shielded_address parameter
packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:1844-1848
The accept_private_contact_request signature no longer accepts shielded_address, but this Rustdoc still describes it as an argument and says it supplies the address the contact may pay. The reply address is now derived by the wallet through send_private_contact_request, so the documentation should describe wallet-owned derivation instead of a caller-provided parameter.
/// Accept a contact request that came privately, replying privately: as
/// [`Self::accept_contact_request_with_external_signer`], with the reply
/// sent by [`Self::send_private_contact_request`], signed by `signer`, and
/// paid for by `pay`. The reply's shielded address is derived by the wallet
/// for this contact.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, ffi-engineer, rust-quality, security-auditor)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a cross-language wallet API and behavior change involving shielded-address derivation and contact-request construction, but it does not itself alter cryptographic implementations, funds movement, consensus, or persistent storage. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - 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— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs`:
- [NITPICK] packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs:1844-1848: Update Rustdoc for the removed shielded_address parameter
The `accept_private_contact_request` signature no longer accepts `shielded_address`, but this Rustdoc still describes it as an argument and says it supplies the address the contact may pay. The reply address is now derived by the wallet through `send_private_contact_request`, so the documentation should describe wallet-owned derivation instead of a caller-provided parameter.
|
Bots are done — your move: post |
…hielded address The doc of accept_private_contact_request still named the removed shielded_address parameter. The reply's address is the one the wallet derives for the contact. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The reviewed head consistently moves private contact-request shielded-address derivation into the wallet-owned helper and removes the host-supplied parameter across the Rust, FFI, JNI, Swift, and Kotlin layers. No in-scope defects were found; the CI snapshot shows no failed code checks, although workspace tests and review checks were still in progress.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a cross-language behavioral change spanning wallet logic and multiple FFI/SDK APIs, but it does not directly alter consensus, cryptography, signatures, or storage migration surfaces. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - 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— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
|
Bots are done — your move: post |
Basic explanation
What this does: A private DashPay contact request can carry a private (shielded) payment address for the contact. Until now the app using the wallet had to supply that address. Now the wallet works it out itself, one address per contact, the same way it already does for ordinary contact requests in #5901. The app can no longer pass one in.
Value: An app can no longer hand the same shielded address to two contacts by mistake, which would let them see they are paying the same person and would stop the wallet from telling their payments apart. Private and ordinary contact requests now give a contact the same address for the same request, and two devices restored from one seed agree on it.
Risks: Low to medium. Three calls in the Rust wallet, the C interface, the Swift SDK and the Kotlin SDK lose a parameter, so apps that pass
shieldedAddressmust drop it. A private request now goes out without an address when the identity's shielded account was not prepared in this session, where before the app could supply one. This pull request is stacked on #5901, which now targetsv5.1-dev, and cannot merge before it.Issue being fixed or feature implemented
The DashPay shielded payment addresses DIP (dashpay/dips#195) requires that a wallet never gives the same shielded address to two contacts. #5901 makes the wallet derive the address for ordinary contact requests. Private contact requests still took the address from the host app, through an optional
shielded_addressparameter, so the rule depended on every host getting it right.Base branch.
v5.1-dev. #5901, which adds the derivation this change calls, is merged there, andv5.1-devis merged into this branch. It does not depend on #5288.What was done?
Wallet (
packages/rs-platform-wallet)send_reserved_private_contact_requestderives the address withIdentityWallet::contact_shielded_address, from the request's sender, recipient and account reference, exactly assend_claimed_contact_requestdoes for an ordinary request.shielded_address: Option<[u8; 43]>parameter is removed fromsend_private_contact_request,accept_private_contact_requestandaccept_contact_request_replying_in_kind, onPlatformWalletand on the DashPay view, and from the internal functions between them.encryptedShieldedAddressproperty. Otherwise the request goes out without an address.C interface (
packages/rs-platform-wallet-ffi)platform_wallet_manager_send_private_contact_request,platform_wallet_manager_accept_private_contact_requestandplatform_wallet_manager_accept_contact_request_replying_in_kindlose theirshielded_addresspointer parameter.Swift and Kotlin SDKs, JNI (
packages/swift-sdk,packages/kotlin-sdk,packages/rs-unified-sdk-jni)sendPrivateContactRequest,acceptPrivateContactRequestandacceptContactRequestReplyingInKindlose theirshieldedAddressparameter, with their callers in the example apps.The address a contact gave us, read from a received request, is unchanged at every layer (
PrivateContactFFI.shielded_address, SwiftPrivateContactInfo.shieldedAddress, Kotlin's contact type).Example, Swift:
How Has This Been Tested?
Changed tests:
rs-platform-wallet,private_contact_requests.rs: 73 call sites drop the argument. The two fixtures that need a request carrying a known address (read, store and forget of a received address) give it through a test-only hook oncontact_shielded_address, so they still prove that what that function answers is what the request carries. What the function derives is covered byshielded/contact_address_tests.rsfrom feat(platform-wallet)!: contact requests carry the sender's per-contact shielded address #5901. A further test sends a private request with no hook from an identity whose shielded account is prepared, and the recipient reads from the store the address that account derives for the request. The hook's guard is#[must_use]and puts back the value it replaced.rs-platform-wallet-ffi,private_contact_request.rs: six calls drop the null pointer.FfiSmokeTest: the three probes drop the argument. They used to be refused for a 42-byte address and are now refused for the null resolver.Run locally:
cargo test -p platform-wallet --features shielded --lib -- shielded private_contact contact_request contact_address platform_wallet:: wallet_lifecycle should_list_the_reference(613 passed)cargo test -p platform-wallet --all-features --lib -- --skip shield(1777 passed)v5.1-dev: the first command again (614 passed),cargo test -p dash-sdk --features mocks --lib dashpay(127 passed),cargo test -p platform-wallet-ffi --features shielded(616 passed), and with the new testcargo test -p platform-wallet --features shielded --lib -- private_contact contact_request contact_address(249 passed)cargo test -p platform-wallet-ffi --features shielded(616 passed)cargo checkofplatform-walletandplatform-wallet-ffi, each with and without theshieldedfeature, and ofrs-unified-sdk-jniwith its default featurescargo clippyonplatform-walletandplatform-wallet-ffi(--features shielded --lib --tests) and onrs-unified-sdk-jni: no warnings./gradlew :sdk:compileDebugKotlin :sdk:compileDebugAndroidTestKotlin :app:compileDebugKotlin(BUILD SUCCESSFUL)cargo fmt --all -- --checkandpython3 scripts/check_sdk_parity_manifest.pyNot tested:
rs-unified-sdk-jniwithout theshieldedfeature was not compiled.FfiSmokeTestwas compiled, not run; it needs an emulator and a rebuilt native library.Breaking Changes
No consensus change.
API: three calls lose the parameter that carried a host-chosen shielded address, in the Rust wallet (
shielded_address), the C interface (shielded_address), Swift (shieldedAddress:) and Kotlin (shieldedAddress). Callers remove the argument. These calls exist only onv5.1-devand are in no release.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit