Skip to content

feat(platform-wallet)!: contact requests carry the sender's per-contact shielded address - #5901

Open
QuantumExplorer wants to merge 12 commits into
feat/dashpay-shielded-tipsfrom
claude/dashpay-contact-address-send
Open

QuantumExplorer wants to merge 12 commits into
feat/dashpay-shielded-tipsfrom
claude/dashpay-contact-address-send

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: When the wallet sends a DashPay contact request, it now includes a private (shielded) payment address made for that one contact, encrypted so that only the contact can read it. The wallet works the address out itself, from the contact request and the sending identity's shielded account. The host app does not choose it.

Value: A contact can pay the sender privately, and the sender can tell which contact a payment was meant to come from, because every contact gets a different address. Two devices restored from one seed derive the same address for the same request, with nothing to store or keep in step. Until now nothing in the wallet filled the contract field that #5892 added.

Risks: Low to medium. Sending a contact request changes in three ways. It makes one more network read (the DashPay contract) when the identity's shielded account is ready. It holds the identity placement lock from deriving the address until the request is signed. And a request goes out without an address when the account was not prepared in this session, without telling the host app yet. This pull request is stacked on #5288 and cannot merge before it. Recipients do nothing with the address yet; reading it is a later change.

Issue being fixed or feature implemented

The DashPay shielded payment addresses DIP (dashpay/dips#195) has a wallet give each contact a different shielded address, carried in the contact request as encryptedShieldedAddress. The contract field is in #5892 and the derivation rule in #5893, both merged. Nothing sends an address yet.

Base branch. The address comes from the identity shielded account, which #5288 adds, so this is based on feat/dashpay-shielded-tips. That branch does not have #5893 and #5897 yet, so until it merges v5.1-dev the diff here also shows those two. The changes of this pull request are the last two commits: about 630 lines in rs-sdk, rs-sdk-cxx and rs-platform-wallet.

What was done?

SDK (packages/rs-sdk/src/platform/dashpay/contact_request.rs)

  • ContactRequestInput takes an optional shielded_address, 43 raw bytes.
  • create_contact_request encrypts it under the request's shared key, with an IV of its own, and writes it as encryptedShieldedAddress.
  • It refuses the address when the network's contactRequest type has no such property, which it gains with DashPay v3 at protocol version 15.
  • When the input carries an address, it first establishes that the network runs protocol version 15 or later. An unpinned SDK starts below that and would otherwise resolve a DashPay contract without the property, and refuse the address on a network that accepts it. A request without an address makes no extra read.

Wallet (packages/rs-platform-wallet)

  • IdentityWallet::contact_shielded_address derives the address for a request from its sender, recipient and account reference, with AccountViewingKeys::contact_address.
  • send_claimed_contact_request calls it after the account reference is known and passes the address to the SDK.
  • The request carries an address only when all of these hold:
    • the identity's shielded account was prepared in this session (prepare_shielded_identity_address), which proves with the seed that the identity holds the account's slot;
    • it is still the account of the slot the identity holds;
    • its viewing keys are bound;
    • the connected network's contact requests have the property. The contract is read from the network, since the bundled schema is the latest one.
  • Otherwise the request goes out without an address.
  • The send is refused if the address would be one already given to another contact (pending, established, or sent and not settled yet), which takes a collision in 87 bits of a keyed hash.
  • A request that goes without an address logs the reason at debug level.
  • The identity wallet sends contact requests and holds no shielded keys, so it shares the platform wallet's viewing keys and prepared accounts through a new ContactShieldedAddresses.

Example, a contact request from an identity whose shielded account was prepared, on a network at protocol version 15:

before: toUserId, encryptedPublicKey, senderKeyIndex, recipientKeyIndex, accountReference
after : the same, plus encryptedShieldedAddress (64 bytes)

The same request from an identity whose account was not prepared, or on a network before protocol version 15, is sent as before.

How Has This Been Tested?

New tests:

  • rs-sdk, contact_request.rs: the field encrypts to 64 bytes that decrypt back, with a different IV each time, and is refused against a protocol version 14 contract. An SDK seeded at protocol version 14 learns the network's version before it resolves the contract for a request with an address, and makes no version lookup for a request without one.
  • rs-platform-wallet, managed_identity/contact_requests.rs: the requests compared for a collision include those sent to established contacts, and a request whose broadcast is not settled yet.
  • rs-platform-wallet, shielded/contact_address_tests.rs: the derived address is the one the identity's own account derives, the same for the same request and different for another contact or another account reference; no address before the account is prepared, after the preparation is cleared, on a network without the property, or for an identity the wallet does not hold.

Run locally:

  • cargo test -p dash-sdk --lib dashpay::contact_request (18 passed)
  • cargo test -p platform-wallet --features shielded --lib -- contact_address shielded::keys (17 passed)
  • cargo test -p platform-wallet --features shielded --lib -- contact_request contact_address contact_shielded viewing_key_bind tips:: profile should_list_the_reference (290 passed)
  • cargo clippy -p platform-wallet --features shielded --all-targets
  • cargo check of platform-wallet with and without the shielded feature, and of dash-sdk-cxx

Not tested: the collision refusal, since a collision cannot be produced, and a full send against a network.

Breaking Changes

No consensus change.

Rust source compatibility: dash_sdk's ContactRequestInput gains the field shielded_address, so code that builds it with a struct literal must set it (None keeps today's behaviour).

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

QuantumExplorer and others added 5 commits November 13, 2026 03:54
`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 <noreply@anthropic.com>
…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's placement is held from the
derivation until the request is signed.

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 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@github-actions

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-11-12T22:50:30.827Z

@thepastaclaw

thepastaclaw commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

⛔ Final review complete — 1 blocking finding(s) (commit 27f9632) · triage: critical

@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

Verified the findings against d83cf98: three blocking issues remain in lifecycle lock ordering, preparation invalidation, and SDK capability discovery, alongside three non-blocking suggestions. This was a static review; Kotlin SDK build/tests remain pending, completed checks pass, and the two newer base commits do not resolve these issues or introduce merge conflicts. The independently confirmed proposal-fee estimate defect comes from the separately merged #5897 and is recorded as a non-blocking follow-up.

🔴 3 blocking | 🟡 3 suggestion(s)

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: platform-versioning); 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 a large, cross-cutting change that introduces shielded-address derivation and encryption, alters key-handling and contact-request serialization, and adds protocol-version-gated 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 — platform-versioning (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/contact_requests.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs:1074-1077: Preserve lifecycle-before-placement ordering through signing
  The placement read guard remains held until line 1146, but signing first awaits `GatedSigner::hold_gate_after_signing`, which acquires the generation lifecycle read guard. This reverses `send_shielded_tip`'s lifecycle → placement order. Tokio's write-preferring locks make a permanent cycle possible: the contact send holds placement while awaiting its signer; discovery queues a placement writer; a tip send holds lifecycle and queues its placement reader behind discovery; removal queues the lifecycle writer; then the contact signature returns and its lifecycle reader queues behind removal. Completing the signer and network responses cannot release this cycle. Release placement before acquiring lifecycle, then reacquire placement and revalidate the derived account in canonical order before accepting/publishing the signature, or otherwise enforce one acquisition order without recursively acquiring lifecycle. Add a deterministic contention test covering these four operations.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs:1074-1077: Expose whether the wallet included a shielded address
  The wallet deliberately sends without an address when preparation, account ownership, bound keys, or network support is absent, but these cases produce neither a structured diagnostic nor an inclusion indicator in the wallet's returned/persisted `ContactRequest`. Consequently, a successful wallet send does not tell the host whether the new feature was used, which makes missing preparation and compatibility downgrades difficult to diagnose. Preserve the optional-field behavior, but expose inclusion status or log the specific omission reason. This concern is at the wallet API boundary: the SDK's `SendContactRequestResult` does include the submitted document and can be inspected directly.

In `packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-62: Keep the preparation and selected viewing keys in one valid generation
  `standing_account()` checks the coordinator generation only at this instant; neither the preparation nor its coordinator is retained while the viewing-key read awaits. Clear can complete after that check, invalidate the preparation, and unregister the receiving account, while this method still returns keys and the send proceeds through contract fetching and signing with an address. A Clear followed by a rebind before the key read can also make the old seed-proven preparation authorize keys installed by the new binding. The placement lock excludes identity moves, not Clear or viewing-key installation, and there is no later preparation check. Carry a preparation/key lease tied to the same coordinator generation and seed-proven account through the final signing/publication checks, and serialize it appropriately with Clear and rebinding. Add suspended-send tests for Clear and Clear-plus-rebind; the existing sequential Clear test does not cover this window. The newer base's operation-admission mechanism is relevant, but this send path does not acquire it.

In `packages/rs-sdk/src/platform/dashpay/contact_request.rs`:
- [BLOCKING] packages/rs-sdk/src/platform/dashpay/contact_request.rs:468-479: Discover network capability before resolving the address-capable contract
  A fresh unpinned mainnet/testnet SDK starts at protocol version 13. With `RecipientIdentity::Identity` and local ECDH/xpub callbacks, no proved network read occurs before `fetch_dashpay_contract()`. That helper accepts the context provider's contract at `self.version()`, so the new property check rejects `shielded_address: Some(...)` even when the connected network runs protocol version 15. Signing cannot reach its nonce query to discover the newer version because document creation already failed. The wallet's explicit contract fetch masks this for wallet callers, but direct SDK callers remain broken. Establish the protocol requirement or fetch the authoritative network contract inside `create_contact_request` before resolving the schema when an address is supplied, leaving the legacy `None` path unchanged. Test the public creation API from the default protocol floor with supplied identities, and inspect/decrypt the resulting property; also cover `None` and a genuinely unsupported network.
- [SUGGESTION] packages/rs-sdk/src/platform/dashpay/contact_request.rs:111-114: Record the public Rust input change as breaking
  Adding an `Option` field to this publicly constructible struct still breaks downstream struct literals. The PR description correctly identifies the migration, but the title lacks the breaking-change marker required by the repository's PR template, and the Unreleased changelog has no retained migration note. Mark the PR title as breaking and document that existing callers must add `shielded_address: None` to retain their behavior. This is a Rust source-compatibility change, not a reason to allocate a PlatformVersion generation.

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:79-85: Include established contacts in the issued-index collision check
  `sent_contact_requests()` contains pending outgoing requests. Once a relationship establishes, its outgoing request is held in `established_contacts()[...].outgoing_request`, so its issued index disappears from this comparison set. Both `DashPayState::outgoing_request()` and `prior_sent_account_reference()` already account for these two storage locations. Although an 87-bit collision is extraordinarily unlikely, the advertised refusal currently excludes established relationships. Include their outgoing references when collecting comparison candidates, and test candidate collection independently of the hash so coverage does not require finding an actual collision.
Out-of-scope follow-up suggestions (1)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • Proposal surcharge is missing from returned fee estimates — The proposal-fee change from separately merged #5897 supplies additional_fixed_fee_cost, but paid-event validation adds it only to balance admission, not the returned FeeResult. CheckTx uses that result directly for gas_wanted, omitting 20,000,000,000 credits per proposal even though execution adds the surcharge. This code was imported unchanged through the v5.1-dev merge and is independent of contact-address sending.
    • Follow-up: Open a focused follow-up PR for #5897 in the shared fee-validation/estimation implementation, with protocol-appropriate versioning and CheckTx coverage proving the fixed component is reported and charged exactly once.

…orm into claude/dashpay-contact-address-send
@QuantumExplorer QuantumExplorer added this to the v5.1.0 milestone Nov 13, 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 feature remains correctly placed across the SDK and wallet layers, but source inspection confirms two blocking correctness/security issues and three non-blocking API/state gaps at the reviewed head. The previously reported lifecycle lock-order deadlock is not substantiated: the generation code intentionally acquires its gate after external signing and then holds it through publication, while placement writers do not acquire that lifecycle gate.

🔴 2 blocking | 🟡 3 suggestion(s)

Still open from earlier rounds (5)

  • 🟡 Suggestion: Record the public Rust input change as breaking — packages/rs-sdk/src/platform/dashpay/contact_request.rs:111-114 (thread)
  • 🟡 Suggestion: Expose whether the wallet included a shielded address — packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs:1074-1077 (thread)
  • 🟡 Suggestion: Include established contacts in the issued-index collision check — packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:79-85 (thread)
  • 🔴 Blocking: Discover network capability before resolving the address-capable contract — packages/rs-sdk/src/platform/dashpay/contact_request.rs:468-479 (thread)
  • 🔴 Blocking: Keep the preparation and selected viewing keys in one valid generation — packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-62 (thread)
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: platform-versioning); 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 large, intricate change that modifies cryptographic address derivation and encryption, shielded key handling, and peer-facing contact-request serialization in contact_request.rs and contact_shielded_address.rs.
  • 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 — platform-versioning (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-sdk/src/platform/dashpay/contact_request.rs`:
- [SUGGESTION] packages/rs-sdk/src/platform/dashpay/contact_request.rs:111-114: Record the public Rust input change as breaking
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928396)
- [BLOCKING] packages/rs-sdk/src/platform/dashpay/contact_request.rs:468-479: Discover network capability before resolving the address-capable contract
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928364)

In `packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs:1074-1077: Expose whether the wallet included a shielded address
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928388)

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:79-85: Include established contacts in the issued-index collision check
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928375)

In `packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-62: Keep the preparation and selected viewing keys in one valid generation
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928352)

…orm into claude/dashpay-contact-address-send

The base added `PreparedTipAccount::coordinator` beside this branch's
`standing_account`. Both are kept.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@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 new shielded contact-address path is present, but the current implementation still has two blocking correctness issues: capability detection can trust an SDK context-provider contract instead of the connected network, and prepared-account validation is not synchronized with the viewing-key snapshot. Several non-blocking API and collision-state gaps also remain; the CI snapshot contains no failed code checks.

🔴 2 blocking | 🟡 3 suggestion(s)

Still open from earlier rounds (5)

  • 🟡 Suggestion: Record the public Rust input change as breaking — packages/rs-sdk/src/platform/dashpay/contact_request.rs:111-114 (thread)
  • 🟡 Suggestion: Expose whether the wallet included a shielded address — packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs:1074-1077 (thread)
  • 🟡 Suggestion: Include established contacts in the issued-index collision check — packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:79-85 (thread)
  • 🔴 Blocking: Discover network capability before resolving the address-capable contract — packages/rs-sdk/src/platform/dashpay/contact_request.rs:455-479 (thread)
  • 🔴 Blocking: Keep the preparation and selected viewing keys in one valid generation — packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-62 (thread)
Follow-up candidates (optional) (1)

New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.

🟡 Suggestion: Preserve the shielded-address option in the CXX contact-request adapter
packages/rs-sdk-cxx/src/client.rs:556-564

The Rust SDK input now accepts an optional shielded address, but the CXX adapter always constructs it as None, and the CXX ContactRequestInput bridge has no corresponding field. Direct C++ callers therefore cannot use the new address-bearing contact-request feature even when the network and wallet support it. Add an optional fixed-size address field to the bridge and marshal it, or explicitly document and expose that this binding intentionally does not support the feature.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality)

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: platform-versioning); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 8: 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 large, intricate change that modifies cryptographic address derivation, viewing-key handling, encryption, and protocol-version-gated contact-request serialization in the wallet and SDK.
  • 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)
  • Code unchanged since the last final review (e7965fde): 1 new suggestion(s) listed as follow-up candidates, not posted inline
  • 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 — platform-versioning (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-sdk/src/platform/dashpay/contact_request.rs`:
- [SUGGESTION] packages/rs-sdk/src/platform/dashpay/contact_request.rs:111-114: Record the public Rust input change as breaking
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928396)
- [BLOCKING] packages/rs-sdk/src/platform/dashpay/contact_request.rs:455-479: Discover network capability before resolving the address-capable contract
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928364)

In `packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/contact_requests.rs:1074-1077: Expose whether the wallet included a shielded address
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928388)

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:79-85: Include established contacts in the issued-index collision check
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928375)

In `packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-62: Keep the preparation and selected viewing keys in one valid generation
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928352)

QuantumExplorer and others added 3 commits November 15, 2026 15:15
…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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
…orm into claude/dashpay-contact-address-send

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@QuantumExplorer QuantumExplorer changed the title feat(platform-wallet): contact requests carry the sender's per-contact shielded address feat(platform-wallet)!: contact requests carry the sender's per-contact shielded address Nov 15, 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 contact-request feature is correctly gated and the pending/established collision set is now covered. One blocking lifecycle race remains: Clear and rebind can occur after cloned viewing keys are returned but before signing, allowing publication of an address derived from stale key material; the in-flight unconfirmed-request collision case is also omitted. The CI snapshot shows no failed code checks, with only the review check still in progress.

🔴 1 blocking | 🟡 2 suggestion(s)

Still open from earlier rounds (1)

  • 🔴 Blocking: Keep the preparation and selected viewing keys in one valid generation — packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:51-61 (thread)
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: platform-versioning); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 8: 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 large, intricate change that modifies shielded address derivation, encryption, and key-handling logic in contact requests, while also adding protocol-version activation 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 — platform-versioning (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-sdk/src/platform/dashpay/contact_request.rs`:
- [SUGGESTION] packages/rs-sdk/src/platform/dashpay/contact_request.rs:37-39: Use the shared activation constant for the DashPay v3 gate
  The new `SHIELDED_ADDRESS_INITIAL_PROTOCOL_VERSION` is a second local definition of protocol version 15. Protocol feature activation constants belong in `packages/rs-platform-version/src/version/feature_initial_protocol_versions.rs`, which is already used by other SDK gates. Add a named DashPay shielded-address activation constant to that shared table and import it here so future protocol-version changes or backports cannot leave this SDK compatibility probe out of sync with the protocol definitions.

In `packages/rs-platform-wallet/src/wallet/identity/state/managed_identity/contact_requests.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/state/managed_identity/contact_requests.rs:73-88: Include unconfirmed contact requests in the issued-index collision check
  `other_sent_account_references` now includes pending and established requests, but it still omits `dashpay.unconfirmed_public_requests`. An unconfirmed request may already have reached the network and carries its `account_reference`; until a proved read settles it, that reference remains potentially issued. A concurrent request to another contact can therefore omit an address that may already be published and pass the 87-bit collision check. Include unconfirmed requests in the candidate collection and add a test covering a request held after broadcast but before settlement.

In `packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:51-61: Keep the preparation and selected viewing keys in one valid generation
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928352)

QuantumExplorer and others added 2 commits November 15, 2026 19:34
…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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>

@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 optional shielded-address path still has a blocking lifecycle race: a clear can invalidate the prepared coordinator after the address keys are checked but before the request is signed and published. Two additional suggestions remain around preserving the legacy addressless send when the capability probe fails and serializing the collision check with concurrent publication. No completed code check is failing on this head; the PastaClaw review check is still in progress.

🔴 1 blocking

Still open from earlier rounds (1)

  • 🔴 Blocking: Keep the preparation and selected viewing keys in one valid generation — packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-61 (thread)
Follow-up candidates (optional) (2)

New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.

🟡 Suggestion: Fall back to an addressless request when the capability probe fails
packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:106-112

The shielded address is an optional enhancement, but any DAPI, proof, or contract-decoding error from contact_requests_carry_shielded_address() is propagated with ?. A transient failure in this additional schema read therefore aborts an otherwise valid legacy contact request before signing, instead of preserving the existing addressless send behavior. Treat inability to inspect the optional capability as a downgrade to None, while logging the probe error.

let carries_address = match self.contact_requests_carry_shielded_address().await {
    Ok(carries_address) => carries_address,
    Err(error) => {
        tracing::debug!(
            identity = %owner_id,
            %error,
            "could not inspect the DashPay contact-request schema; sending without a shielded address"
        );
        return Ok(None);
    }
};
if !carries_address {
    without_address(
        owner_id,
        "the network's contact requests do not carry a shielded address yet",
    );
    return Ok(None);
}

source: gpt-6.1-sol (phase2-reviewer: rust-quality)

🟡 Suggestion: Serialize the collision check with contact-request publication
packages/rs-platform-wallet/src/wallet/identity/network/contact_shielded_address.rs:114-119

The collision check reads other_sent_account_references before the request proceeds through schema reads, host signing, broadcast, and later bookkeeping. The identity placement read lock permits concurrent sends, while the public claim only serializes sends to the same recipient and the new reference is recorded later. Two concurrent sends to different recipients can therefore both pass without seeing the other's reference; if their derived indices collide, both requests can publish the same per-contact address despite the explicit collision guard. Reserve the derived index under a shared per-wallet send lock, or serialize the check with the transition that records an issued or unconfirmed request and retain that reservation until non-delivery is definitive.

source: 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: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 6: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 8: 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 large, cross-cutting change that modifies cryptographic address derivation and encryption, shielded key handling, and peer-facing contact-request serialization in the wallet and SDK.
  • 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)
  • Code unchanged since the last final review (b445f180): 2 new suggestion(s) listed as follow-up candidates, not posted inline
  • 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 — platform-versioning (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/shielded/contact_address.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/shielded/contact_address.rs:48-61: Keep the preparation and selected viewing keys in one valid generation
  (carried; thread: https://github.com/dashpay/platform/pull/5901#discussion_r4557928352)

This branch has not been deployed

No deployments
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