Skip to content

feat(platform-wallet)!: private contact requests derive the sender's per-contact shielded address - #5902

Merged
QuantumExplorer merged 12 commits into
v5.1-devfrom
claude/dashpay-private-request-derived-address
Nov 17, 2026
Merged

QuantumExplorer merged 12 commits into
v5.1-devfrom
claude/dashpay-private-request-derived-address

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

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 shieldedAddress must 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 targets v5.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_address parameter, 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, and v5.1-dev is merged into this branch. It does not depend on #5288.

What was done?

Wallet (packages/rs-platform-wallet)

  • send_reserved_private_contact_request derives the address with IdentityWallet::contact_shielded_address, from the request's sender, recipient and account reference, exactly as send_claimed_contact_request does for an ordinary request.
  • The shielded_address: Option<[u8; 43]> parameter is removed from send_private_contact_request, accept_private_contact_request and accept_contact_request_replying_in_kind, on PlatformWallet and on the DashPay view, and from the internal functions between them.
  • The conditions for a request to carry an address are those of feat(platform-wallet)!: contact requests carry the sender's per-contact shielded address #5901: the identity's shielded account was prepared in this session and is still the identity's, its viewing keys are bound, and the network's contact requests have the encryptedShieldedAddress property. 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_request and platform_wallet_manager_accept_contact_request_replying_in_kind lose their shielded_address pointer parameter.

Swift and Kotlin SDKs, JNI (packages/swift-sdk, packages/kotlin-sdk, packages/rs-unified-sdk-jni)

  • sendPrivateContactRequest, acceptPrivateContactRequest and acceptContactRequestReplyingInKind lose their shieldedAddress parameter, 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, Swift PrivateContactInfo.shieldedAddress, Kotlin's contact type).

Example, Swift:

// before: the app picks the address, and nothing stops it from reusing one
try await wallet.sendPrivateContactRequest(
    from: me, to: contact, shieldedAddress: someAddress, ...)

// after: the wallet derives the address for this contact
try await wallet.sendPrivateContactRequest(from: me, to: contact, ...)

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 on contact_shielded_address, so they still prove that what that function answers is what the request carries. What the function derives is covered by shielded/contact_address_tests.rs from 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.
  • Kotlin 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)
  • After merging 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 test cargo 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 check of platform-wallet and platform-wallet-ffi, each with and without the shielded feature, and of rs-unified-sdk-jni with its default features
  • cargo clippy on platform-wallet and platform-wallet-ffi (--features shielded --lib --tests) and on rs-unified-sdk-jni: no warnings
  • Kotlin: ./gradlew :sdk:compileDebugKotlin :sdk:compileDebugAndroidTestKotlin :app:compileDebugKotlin (BUILD SUCCESSFUL)
  • cargo fmt --all -- --check and python3 scripts/check_sdk_parity_manifest.py

Not tested:

  • The Swift SDK was not compiled locally; each call into the three C functions was checked against the new signatures by reading. The Swift CI job compiles it.
  • rs-unified-sdk-jni without the shielded feature was not compiled.
  • FfiSmokeTest was compiled, not run; it needs an emulator and a rebuilt native library.
  • No test sends a private request from a wallet whose identity shielded account is prepared, end to end, and nothing was run against a network.

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 on v5.1-dev and are in no release.

Checklist:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updated APIs
    • Private contact request sending, private acceptance, and in-kind replies no longer accept a caller-supplied shielded address. The wallet now derives the Orchard address included with each request or reply.
    • These changes apply across the Kotlin, Swift, and Rust SDK interfaces. Review your integrations and update calls to the affected methods.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Private contact-request send and accept APIs no longer take a caller-supplied shielded address. The wallet derives the Orchard address used by each request or reply. Rust, JNI, Kotlin, and Swift interfaces and their call sites now use the updated signatures.

Changes: Private contact address flow

Layer / File(s) Summary
Wallet address derivation and request handling
packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs, packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs
Private request sending derives the optional contact shielded address from the sender, recipient, and account reference. Test hooks and tests cover the derived address and updated send and accept calls.
Rust wallet APIs and FFI
packages/rs-platform-wallet/src/wallet/platform_wallet.rs, packages/rs-platform-wallet-ffi/src/private_contact_request.rs
Rust wallet and FFI function signatures remove the caller-supplied address. The FFI no longer reads or forwards it; existing payment callback handling remains.
SDK bindings and smoke tests
packages/rs-unified-sdk-jni/src/dashpay.rs, packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/{ffi/DashpayNative.kt,wallet/PlatformWalletManager.kt}, packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PrivateContactRequests.swift, packages/kotlin-sdk/sdk/src/androidTest/kotlin/org/dashfoundation/dashsdk/FfiSmokeTest.kt
JNI, Kotlin, and Swift APIs and calls remove the address argument. JNI address validation is removed, and Kotlin smoke-test calls use the revised signatures.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PlatformWalletManager
  participant private_contact_request_FFI
  participant private_contact_requests
  PlatformWalletManager->>private_contact_request_FFI: send or accept without shielded address
  private_contact_request_FFI->>private_contact_requests: invoke wallet operation
  private_contact_requests->>private_contact_requests: derive contact address for private request
Loading

Suggested reviewers: shumkov, thepastaclaw, romchornyi

Merge Risk: Minimal · up to 99852

Private contact requests now derive the sender's per-contact shielded address inside the wallet instead of taking one from the caller. The Rust, FFI, JNI, Kotlin and Swift signatures are updated consistently. No concrete defect was found, so the merge risk is minimal. The author notes the change depends on #5901 landing first and that Swift and non-shielded JNI builds were not compiled locally.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: private contact requests no longer take a caller-supplied shielded address and instead derive the sender's per-contact Orchard address in the wallet. The raw summary c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: private contact requests no longer take a caller-supplied shielded address and instead derive the sender's per-contact Orchard address in the wallet. The raw summary confirms the removal of the shielded_address parameter across the Rust wallet, FFI, JNI, Swift, and Kotlin layers, and the PR objectives state the same derivation behavior. The title also flags the breaking API change with '!'. It is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 60d1e62 and 9985274.

Files selected for processing: 9

  • packages/kotlin-sdk/sdk/src/androidTest/kotlin/org/dashfoundation/dashsdk/FfiSmokeTest.kt
  • packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/ffi/DashpayNative.kt
  • packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/wallet/PlatformWalletManager.kt
  • packages/rs-platform-wallet-ffi/src/private_contact_request.rs
  • packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs
  • packages/rs-platform-wallet/src/wallet/identity/network/private_contact_requests.rs
  • packages/rs-platform-wallet/src/wallet/platform_wallet.rs
  • packages/rs-unified-sdk-jni/src/dashpay.rs
  • packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PrivateContactRequests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@thepastaclaw

thepastaclaw commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 9985274) · triage: normal

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: critical by gpt-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); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-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; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — ffi-engineer (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-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]`.

QuantumExplorer and others added 9 commits November 17, 2026 14:59
`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]>
@QuantumExplorer
QuantumExplorer force-pushed the claude/dashpay-contact-address-send branch from 27f9632 to 2716064 Compare November 17, 2026 08:23
@QuantumExplorer
QuantumExplorer force-pushed the claude/dashpay-private-request-derived-address branch from 13b83da to b99395f Compare November 17, 2026 08:23

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: critical by gpt-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); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-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; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — ffi-engineer (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-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)

Base automatically changed from claude/dashpay-contact-address-send to v5.1-dev November 17, 2026 12:35
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-self-review Waiting for the author to post /self-reviewed label Nov 17, 2026
…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]>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 17, 2026
…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]>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: normal by gpt-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); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-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; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — ffi-engineer (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-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.

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 17, 2026
…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]>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 17, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: normal by gpt-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); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-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; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — ffi-engineer (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-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.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 17, 2026
@QuantumExplorer
QuantumExplorer merged commit 4505fc5 into v5.1-dev Nov 17, 2026
28 of 29 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/dashpay-private-request-derived-address branch November 17, 2026 15:09
@github-actions github-actions Bot removed the waiting-self-review Waiting for the author to post /self-reviewed label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants