Repository navigation
fix(platform-wallet)!: check identity creation keys and funding in the Rust core - #5645
Claudius-Maginificent wants to merge 31 commits into
Conversation
…evel
DIP-11 requires a new identity to hold at least one authentication key at
each security level. The wallet registered AUTH keys at MASTER, CRITICAL and
HIGH only, and every host (FFI, Swift, Kotlin) kept its own copy of the slot
table.
rs-platform-wallet now owns the single creation layout
(`IdentityCreationKeyLayout`): AUTH MASTER/CRITICAL/HIGH and TRANSFER
CRITICAL at ids 0-3, the optional DashPay ENC/DEC pair at 4-5, and a new
AUTH/MEDIUM ECDSA_SECP256K1 key at the next free id (4, or 6 with DashPay).
Existing ids and derivation slots do not move. The FFI, the JNI bridge,
Swift and Kotlin read the layout from Rust and only marshal it.
Every identity-creating entry point (asset-lock registration, from
addresses, invitation claim, shielded pool) takes `IdentityCreationKeys`
instead of a raw key map. This pre-flight refuses, with a typed
`IdentityCreationKeysError`, a set that lacks an enabled AUTH key AT
MASTER, CRITICAL, HIGH and MEDIUM. It checks levels and structure, never
key types, so an ECDSA_HASH160 set plus a MEDIUM key passes.
Backward compatibility: the rule applies to new creations only. Discovery,
sync, signing and recovery of existing identities are untouched. The one
exemption is resuming a tracked registration asset lock
(`FromExistingAssetLock { consume_invitation_voucher: false }`) whose
persisted amount cannot pay for the DIP-11 key set at the current platform
version's fee schedule (computed with the versioned
`calculate_min_required_fee`). Such a lock was funded for the four
pre-DIP-11 keys, so it resumes with exactly those, at no extra fee, and the
exemption is logged at info with the outpoint. Rust decides it
(`IdentityWallet::resume_key_layout`, `creation_keys_for_funding`, and the
new `platform_wallet_resume_identity_key_layout` FFI); hosts never compare
amounts. A lock built first and funded for the full set, fresh funding and
invitation reclaims always get the DIP-11 check.
Known gap: an interrupted registration started after this change whose lock
was funded below the 5-key minimum is grandfathered too, since the tracked
lock records no provenance. Follow-up (option A): persist the creation
layout on the tracked lock in every persister (SQLite, SwiftData, Room).
Breaking for callers: `register_identity_with_funding`,
`register_from_addresses`, `claim_invitation` and
`shielded_identity_create_from_pool` take `IdentityCreationKeys`; the
derive/preview FFIs take an `IdentityCreationKeyLayoutFFI` instead of a key
count. Dash Evo Tool stops compiling: it calls
`register_identity_with_funding` with its own key map (no MEDIUM key) and
must add an AUTH/MEDIUM key or adopt `IdentityCreationKeyLayout`, then build
the keys with `IdentityWallet::creation_keys_for_funding`.
Swift and Kotlin changes are unbuilt (no Xcode or JDK on the build host).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he exact legacy resume keys `register_identity_with_funding` now refuses a `FromWalletBalance` amount below the versioned minimum for its keys (`AssetLockInsufficientFunds`) before any lock is built or broadcast, and raises a drain's floor to it, mirroring the address-funding floor. A fresh registration built by this crate can therefore never turn into an underfunded lock that later resumes under the pre-DIP-11 exemption. The remaining gap is a lock built outside this path and funded below the DIP-11 minimum; the follow-up (persist the creation layout on the tracked lock) is unchanged. The exempt resume accepts exactly the four pre-DIP-11 keys (ids 0-3: AUTH MASTER, CRITICAL, HIGH, TRANSFER CRITICAL; any key type) and refuses any other set with `IdentityCreationKeysError::NotLegacyResumeLayout`, so a host that derives the wrong layout gets a typed error instead of signing a set the lock cannot fund. Rust also owns the creation minimums hosts used to copy: `IdentityWallet::identity_creation_min_funding_duffs` and `identity_creation_from_addresses_min_fees`, exposed through `platform_wallet_identity_creation_min_funding_duffs`, `platform_wallet_identity_creation_from_addresses_min_fees` (+ `_free`) and the matching JNI exports. The FFI registration and resume paths run the creation check before touching either signer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… apps Swift and Kotlin drop their copies of the identity-create fee schedule (per-key cost, base cost, asset-lock base, address input cost, the dead 228k constant) and the minimum arithmetic built on them. The minimum funding and the address-funded fee per input count come from the new Rust queries; a failed query is shown and blocks submit instead of falling back to zero. Kotlin's input packing is capped at the protocol's maximum input count Rust reports. Swift parses a resume's outpoint before deriving or persisting any key and fails the submission on a malformed one, with no fresh-layout fallback. The new Swift and Kotlin resume-layout docs no longer split the existing resume docs, and the resume KDoc states that the layout comes from `resumeKeyLayout`. Swift and Kotlin are unbuilt (no Xcode or JDK on the build host). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
|
⛔ Final review complete — 1 blocking finding(s) (commit abbcf4e) · triage: critical |
…o a stacked PR Split #5645 so this PR carries only the Rust core in rs-platform-wallet (canonical creation key layout, MEDIUM key, IdentityCreationKeys pre-flight, funding floor, amount-gated resume) plus the minimal FFI wiring the existing registration entry points need to compile against the new wallet API. Returned to their v5.1-dev state here and restored in the stacked bindings PR: - the identity_creation_key_layout FFI module (layout, minimum funding, address-funded minimum fees and their frees) and its golden files - platform_wallet_resume_identity_key_layout - the layout-based signatures of dash_sdk_derive_and_persist_identity_keys and platform_wallet_preview_identity_registration_key_set - the new JNI entry points and the layout-taking previewRegistrationKeySet - every Swift and Kotlin change Kept: the existing registration FFIs (address-funded, wallet-funded, resume, invitation claim, shielded create) build IdentityCreationKeys from the decoded keys and map the typed refusal to ErrorInvalidParameter, with the wiring tests that exercise them. Until the bindings PR lands, Swift and Kotlin still send four keys without a MEDIUM authentication key, so new identity creation in the example apps is refused by the pre-flight. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Split: this PR keeps the Rust core ( 🤖 Co-authored by Claudius the Magnificent AI Agent |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The new DashPay layout creates seven keys, but both current protocol snapshots, including the latest v15 snapshot, still enforce a maximum of six keys. Such registrations are rejected by DPP before execution, so the primary DashPay creation path cannot succeed. The wallet also has non-blocking correctness gaps around resume affordability, legacy-resume provenance, and disabled key zero handling; wallet tests covering these changes remain queued.
🔴 1 blocking | 🟡 4 suggestion(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: 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:
criticalbygpt-6.1-sol(effort low) — This is a large, intricate change to identity key handling and registration funding inrs-platform-wallet, directly affecting cryptographic keys, signatures, asset-lock construction, and funds movement. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:186-195: Seven-key DashPay layout exceeds the protocol identity key limit
`NewIdentityWithDashPayKeys` adds encryption and decryption keys at ids 4 and 5, then appends authentication/medium at id 6, producing seven keys. DPP's identity-creation structure validation rejects key sets larger than `platform_version.dpp.state_transitions.identities.max_public_keys_in_creation`; the v4 table selected by both the v14 and v15 platform snapshots still sets that limit to 6. Therefore every DashPay identity using this layout is rejected before registration. Update the appropriate versioned protocol limit and gate the layout until that limit is active, or keep the layout within the existing limit.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:491-503: Resume affordability is not checked against the submitted key set
`resume_exemption` compares the tracked amount only with the five-key `NewIdentity` minimum. If a tracked lock contains enough value for five keys but less than the fee for the actual supplied set, `creation_keys_for_funding` accepts that set as a normal identity creation, while `enforce_identity_create_floor` deliberately leaves `FromExistingAssetLock` unchanged. The wallet can then sign and submit a transition that DPP deterministically rejects for insufficient asset-lock funding. For every non-legacy existing-lock resume, compare the tracked amount with the fee computed from the actual validated keys before signing.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:491-503: Legacy resume exemption is based on amount rather than lock provenance
`resume_exemption` uses only the persisted amount and does not inspect the tracked lock's funding type or creation provenance. A low-value tracked non-registration lock can therefore be reported by `resume_key_layout` as an `AssetLockResume`; the later resolver rejects mismatched funding roles, but the host has already been instructed to derive the wrong four-key layout. More importantly, an externally created low-value lock tracked as an identity registration can be grandfathered into the four-key path even though it was not an interrupted pre-DIP-11 registration. The exemption should be restricted to explicitly identified legacy registration locks, with creation provenance persisted through the tracked-lock storage and persisters.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:615-619: Key zero validation accepts a disabled key
`check_key_zero` verifies only the purpose and security level. A caller can supply a disabled master authentication key at id 0 and another enabled master authentication key at a different id, allowing `new_identity` to pass because the per-level scan finds the second key. When the key map is converted into `IdentityPublicKeyInCreation`, `disabled_at` is not represented and the id-0 key is registered as enabled. Require key zero to have `disabled_at().is_none()` so the pre-flight cannot silently change the caller's disabled key into an enabled identity key.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:200-203: Avoid allocating all layout slots to count keys
`key_count` constructs the complete slot vector, including cloned contract bounds for the DashPay layout, only to obtain its length. This method feeds sizing and fee-related queries, so the allocation is unnecessary. Return the statically known count for each layout variant instead.
…IUM key A creation may carry at most max_public_keys_in_creation (6) keys, so the DashPay layout with a MEDIUM authentication key (7 keys) was refused by consensus, and no system contract accepts a MEDIUM signature anyway. - NewIdentity is keys 0-3 and NewIdentityWithDashPayKeys adds the DashPay pair at 4-5, exactly what hosts register today. - The pre-flight requires an AUTHENTICATION key at MASTER, CRITICAL and HIGH (key 0 MASTER) and refuses any disabled key, since a key in creation carries no disabled state. - The AssetLockResume layout and the amount-gated legacy resume exemption are gone: a resume re-derives the NewIdentity layout, which is now the same four keys. - The funding floor also covers a tracked lock being resumed or reclaimed: one that cannot pay for its keys is refused before the finality wait or any signing. An untracked lock is still left to the funding resolver. - Every layout is run through the dpp creation structure validation at the latest platform version, so a layout over the key limit fails a test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYjpfLux1ByK7fGF7SG
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The Rust wallet now fixes the prior six-key layout, disabled-key, and tracked-lock affordability issues. However, IdentityCreationKeys::new_identity still accepts key maps that DPP deterministically rejects, allowing funding resolution and asset-lock construction before failure; this contradicts the PR's primary pre-lock validation guarantee. CI has no reported failed code checks, but several checks remain pending.
🔴 1 blocking | 🟡 2 suggestion(s) | 💬 2 nitpick(s)
2 finding(s) not shown inline (the lines are not part of this PR's diff)
💬 Nitpick: Stale placeholder-identity documentation after keys refactor
packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs:36-40
The method summary says the caller constructs the placeholder Identity, but the signature now accepts validated IdentityCreationKeys and the wallet builds the placeholder at lines 100–105. The argument documentation was updated, so the summary is the remaining stale description of the old API contract.
/// This method is a thin wrapper over `put_with_address_funding`
/// plus `IdentityManager::add_identity`. The caller passes the
/// new identity's keys (validated by
/// [`IdentityCreationKeys::new_identity`]) and both signers; the
/// wallet builds the placeholder `Identity` and carries no key
/// material itself.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality)
🟡 Suggestion: Document the public platform-wallet API break in the changelog
CHANGELOG.md:1-7
This PR changes the public registration APIs from raw key maps or identity arguments to IdentityCreationKeys and adds a public PlatformWalletError variant. The repository records breaking platform-wallet API migrations in the Unreleased changelog, but this change leaves CHANGELOG.md untouched. Add a migration note for downstream Rust consumers such as Dash Evo Tool; the PR description alone will not remain available as release documentation.
source: gpt-6.1-sol (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor)
1 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.
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: 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:
criticalbygpt-6.1-sol(effort low) — This is a large, intricate change to identity key handling, cryptographic signing inputs, asset-lock funding and registration flows in the Rust wallet core, directly affecting funds movement and key handling. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:226-255: Creation preflight accepts consensus-invalid key sets
`IdentityCreationKeys::new_identity` checks required authentication roles, key-zero placement, map/key-id consistency, and disabled state, but it does not run the versioned DPP creation-structure validation. A caller can therefore pass seven keys with all required roles, two MASTER keys, duplicate public-key data under different IDs, an invalid purpose/security-level combination, or key data with invalid size for its key type. The wrapper returns `Ok`, and `register_identity_with_funding` then proceeds to `enforce_identity_create_floor` and funding resolution, which can build or resume an asset lock before the resulting transition is rejected by Platform. The new layout test only validates the built-in layouts directly through DPP; it does not validate arbitrary maps accepted by `new_identity`. Invoke DPP's platform-version-aware structure validation from this preflight, or expose an equivalent owner-level validation result, before any funding resolver or signer is reached. Add regression coverage for over-limit, duplicate-data, multiple-master, and invalid purpose/security-level inputs.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:171-173: Avoid allocating all layout slots to count keys
(existing thread: https://github.com/dashpay/platform/pull/5645#discussion_r4405627517)
`key_count` constructs the complete slot vector solely to return its length. For the DashPay layout this also constructs and clones the contract-bound document-type strings. The slot table should remain the source for callers that need metadata, but this count-only helper can avoid materializing it; the allocation is small and not blocking, but the method is explicitly documented as a fee-sizing helper.
In `packages/rs-platform-wallet/src/wallet/identity/network/registration.rs`:
- [NITPICK] packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:187-189: Stale `keys_map` reference in placeholder comment
The registration argument is now named `keys` and has type `IdentityCreationKeys`, but the comment still refers to a `keys_map` deep clone. This makes the comment describe an identifier and ownership model that no longer exists.
In `packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs`:
- [NITPICK] packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs:36-40: Stale placeholder-identity documentation after keys refactor
The method summary says the caller constructs the placeholder `Identity`, but the signature now accepts validated `IdentityCreationKeys` and the wallet builds the placeholder at lines 100–105. The argument documentation was updated, so the summary is the remaining stale description of the old API contract.
In `CHANGELOG.md`:
- [SUGGESTION] CHANGELOG.md:1-7: Document the public platform-wallet API break in the changelog
This PR changes the public registration APIs from raw key maps or identity arguments to `IdentityCreationKeys` and adds a public `PlatformWalletError` variant. The repository records breaking platform-wallet API migrations in the Unreleased changelog, but this change leaves `CHANGELOG.md` untouched. Add a migration note for downstream Rust consumers such as Dash Evo Tool; the PR description alone will not remain available as release documentation.
…ation would refuse IdentityCreationKeys::new_identity takes the platform version and runs dpp's versioned identity-create structure validation after the wallet's own checks, so a key set over the creation limit, with duplicate key data, a second MASTER key, a purpose at a disallowed level, or a wrongly sized hash key is refused before any asset lock is built, waited on or signed. The FFI reads the version from the wallet, so an unknown wallet handle now reports NotFound ahead of a key-set fault. identity_create_from_shielded_pool becomes pub(crate), closing the one way around the pre-flight. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYjpfLux1ByK7fGF7SG
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The new DPP structure preflight and funding checks cover the main asset-lock paths, but the validated key wrapper does not retain or recheck the protocol version used for validation. A native caller can validate keys under an older protocol version and then submit them through a newer wallet, allowing funding resolution and signing before Platform rejects the transition. Address-funded and shielded creation paths also miss specific preflight checks. CI currently shows Kotlin tests and policy/PR Hygiene checks still pending or in progress, with no failed code check reported.
🔴 1 blocking | 🟡 3 suggestion(s) | 💬 1 nitpick(s)
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Invitation claims bypass the versioned identity-creation funding floor
packages/rs-sdk/src/platform/dashpay/invitation.rs:852-879
IdentityWallet::claim_invitation now validates the key wrapper but converts it back to a raw map and delegates to Sdk::claim_invitation, which only validates key shape and does not compare the fetched voucher output with the versioned identity-creation fee for those keys. MIN_INVITATION_DUFFS is a fixed creation-time floor rather than the selected protocol fee, so an externally supplied or legacy voucher, or a voucher used after a higher fee schedule is active, can still reach proof construction and signing before Platform rejects it. After selecting the voucher output, check its amount against the same versioned fee calculation before constructing or submitting the claim.
source: gpt-6.1-sol (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor)
💬 Nitpick: Stale placeholder-identity documentation after keys refactor
packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs:36-40
The method introduction still says that the caller constructs the placeholder Identity, but the signature now accepts IdentityCreationKeys and the method constructs the placeholder internally at lines 100–105. The argument documentation was updated, so the preceding description should be brought into agreement with the new ownership model.
/// This method is a thin wrapper over `put_with_address_funding`
/// plus `IdentityManager::add_identity`. The caller supplies the
/// validated keys and both signers; the wallet builds the placeholder
/// [`Identity`] from those keys and carries no key material.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, platform-versioning)
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:
criticalbygpt-6.1-sol(effort low) — This is a large, intricate change to identity key handling, cryptographic signing inputs, asset-lock funding validation, and FFI registration paths, directly affecting funds movement and key security in files such as creation_keys.rs and identity registration functions. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— ffi-engineer (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:249-294: Creation-key validation is not bound to the wallet's active protocol version
`IdentityCreationKeys::new_identity` validates against the caller-supplied `PlatformVersion`, but `IdentityCreationKeys` stores only the keys. The registration methods subsequently trust the wrapper without checking it against `self.sdk.version()`. For example, the existing test demonstrates that a 19-byte `ECDSA_HASH160` key is accepted under protocol 13 and rejected by the current validation rules; a native caller can construct that wrapper with protocol 13 and pass it to a wallet using a newer protocol. The wallet can then enforce funding, resolve or resume an asset lock, and reach signing before the SDK's later structure check rejects the transition. Retain the validation version in the wrapper and verify it at every write boundary, or rerun the owner-level validation using the wallet's active version before funding or signing.
In `packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs:87-104: Preflight address-funded registrations against the versioned fee floor
`register_from_addresses` accepts the validated key wrapper but immediately constructs the placeholder identity and calls `put_with_address_funding_fetching_nonces`. The new `identity_creation_from_addresses_min_fees` helper is advisory only and is not used by this write path. The SDK constructor signs the identity and address witnesses before `ensure_valid_state_transition_structure`; it does not reject an input map whose credits cannot cover the versioned fee for the actual input count and optional output. Add an owner-level preflight using the actual keys, input count, and output before either signer is reached.
- [NITPICK] packages/rs-platform-wallet/src/wallet/identity/network/register_from_addresses.rs:36-40: Stale placeholder-identity documentation after keys refactor
The method introduction still says that the caller constructs the placeholder `Identity`, but the signature now accepts `IdentityCreationKeys` and the method constructs the placeholder internally at lines 100–105. The argument documentation was updated, so the preceding description should be brought into agreement with the new ownership model.
In `packages/rs-platform-wallet-ffi/src/shielded_send.rs`:
- [SUGGESTION] packages/rs-platform-wallet-ffi/src/shielded_send.rs:956-973: Shielded identity creation omits shielded-only key restrictions from preflight
The shielded FFI entry point now calls the generic `IdentityCreationKeys::new_identity` validator, but shielded identity creation has additional consensus restrictions. Drive's versioned shielded-proof validation rejects contract-group-bound keys and keys carrying budgets or expiries, while the generic creation validator accepts those fields and the shared decoder permits them. The wallet reserves shielded notes before `build_identity_create_from_shielded_pool_transition` runs, so an invalid key set can consume note-reservation work and only fail later. Add a shielded-specific owner-level validation context or method and cover both contract-bound and limited keys before note reservation.
In `packages/rs-sdk/src/platform/dashpay/invitation.rs`:
- [SUGGESTION] packages/rs-sdk/src/platform/dashpay/invitation.rs:852-879: Invitation claims bypass the versioned identity-creation funding floor
`IdentityWallet::claim_invitation` now validates the key wrapper but converts it back to a raw map and delegates to `Sdk::claim_invitation`, which only validates key shape and does not compare the fetched voucher output with the versioned identity-creation fee for those keys. `MIN_INVITATION_DUFFS` is a fixed creation-time floor rather than the selected protocol fee, so an externally supplied or legacy voucher, or a voucher used after a higher fee schedule is active, can still reach proof construction and signing before Platform rejects it. After selecting the voucher output, check its amount against the same versioned fee calculation before constructing or submitting the claim.
romchornyi
left a comment
There was a problem hiding this comment.
🟡 1 major (inline) · 10 non-blocking recommendations · no blockers — reviewed at 3a3293329b
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | An under-funded lock and a disabled key registered as enabled are real problems, now refused before any lock is built. The floor is the same calculate_min_required_fee drive-abci applies. Requiring CRITICAL and HIGH is wallet policy: consensus accepts other sets (see the major). Leaving out the MEDIUM key is justified by the six-key limit. |
| 2 · Architecture | 🟡 one shape concern | rs-platform-wallet is the right owner of the layout and the floor. dpp's active_version_range_for_keys_in_creation, which consensus reaches through StateTransition::active_version_range for identity create, update, create-from-addresses and create-from-pool, becomes pub for a client. That is the shape reverted on #5460, and the public StateTransition::active_version_range() already gives the wallet the same answer (recommendation 1). |
| 3 · Completeness | 🟡 untracked gaps | Several threads closed as out of scope have no issue (listed below). #6062, which two of them cite, is about shielded builders reading Sdk::version(), not about the operation clone. |
| 4 · Code | 🟡 1 major | The floor matches consensus at PV13–16. The key sets of SwiftExampleApp, KotlinExampleApp and dashwallet-ios pass. Every entry point validates before any signer is touched. |
Major (inline)
creation_keys.rs#L286: the mandatory CRITICAL and HIGH authentication keys refuse the consensus-valid custom key sets that Dash Evo Tool's Advanced mode lets users build.
Checked after the merge of v5.2-dev: IdentityCreationKeys is NotSent in payment_delivery; creation submits with the pinned operation SDK inside with_funded_lock; the shielded pre-flight runs after ensure_not_on_runtime and inside catch_spend_panic.
Untracked gaps (threads closed as out of scope with no issue):
- the floor refusal comes before the consumed, role and voucher refusals (recommendation 4);
- the shielded worker maps an in-operation key refusal to
ErrorWalletOperation; - the operation clone no longer raises the source SDK's version (recommendation 6).
10 non-blocking recommendations
-
Keep
active_version_range_for_keys_in_creationprivate —state_transition/mod.rs#L1111. Consensus reaches it at every protocol version, and as apub fnit invites client edits that would move shipped versions. The wallet can build the transition it already builds inasset_lock_create_min_duffsand askStateTransition::active_version_range(). That also removes a drift: the wallet passesALL_VERSIONSfor every create kind, while consensus uses11..=for create-from-addresses and12..=for create-from-pool. (verified by reading) -
A failed version refresh is reported as the caller's mistake —
creation_keys.rs#L467.refresh_protocol_version()never returnsErr: it logs and keeps the old version, so the?never fires. Offline, valid V1 or group-bound keys come back asInactiveKeyFormat, which hosts get asErrorInvalidParameterand show as invalid keys.refresh_protocol_version_or_failurewould let this return the transport fault, asValidationUnavailabledoes. (verified by reading) -
A key that has already expired passes the pre-flight — the check runs dpp's structure rules only. drive-abci's identity-create state v1 refuses a key whose
expires_atis at or before the block time (validate_identity_public_keys_limits), and returns the action that partially uses the asset lock, so the lock is charged. The FFI acceptshas_expires_at; the docs name an expiry given in seconds instead of milliseconds as the likely way to get one. No current host sends an expiry. An offline check against the wall clock closes the case the PR states it refuses: "before it locks my DASH". (verified by reading) -
Code 29 now carries the opposite remedy — the floor reuses
AssetLockInsufficientFunds(creation_keys.rs#L420).- The Swift and Kotlin docs for code 29 tell hosts that "an exact-amount build can confirm a smaller amount". The floor needs a larger one, and for a resumed tracked lock no amount works.
availableis the requested amount, not the balance.- The floor also runs before the resolver's checks, so a consumed lock, a top-up lock or an unauthorised voucher below the floor gets code 29 instead of its own refusal.
A dedicated variant, or running the floor after the role checks, keeps the remedies apart. (verified by reading)
-
Wildcard arms over
AssetLockFunding—creation_keys.rs#L443funding => Ok(funding)and#L520_ => None. A new funding variant would skip the floor silently;fund_from_asset_lock.rsnames every variant. The FFI'sPlatformWalletError::IdentityCreationKeys(..)arm (error.rs#L1796) has the same shape overIdentityCreationKeysError. (verified by reading) -
The operation clone stops version learning —
sdk.rs#L1111setsversion_pinned, somaybe_update_protocol_versionreturns early for every proved response of the operation. Before this PR, those responses (address nonces, wait-for-result) raised the wallet SDK's version. The pinned flag also turns the protocol gate's probe into a refusal. I found no gated request on the creation paths, but did not trace every query insideSdk::claim_invitation. (verified by reading) -
Three FFI entry points hold the wallet storage read lock across the network refresh —
identity_registration_funded_with_signer.rs#L131,#L306andidentity_registration_with_signer.rs#L521runidentity_creation_keysinsidewith_item. A queued wallet add or remove then blocks every wallet FFI call for the length of the probe.invitation.rsalready clones the wallet out first. (verified by reading) -
The shielded pre-flight has no CI run —
tests-rs-workspace.ymlfilters platform-wallet and platform-wallet-ffi withnot test(~shield)(L552), and the shielded phase runs other crates. Soshould_revalidate_creation_keys_before_shielded_key_derivationandshould_refuse_a_shielded_create_platform_would_refuse_before_any_signingdo not run. (verified by reading) -
Address-funded registration has no floor —
register_from_addresses.rs#L96validates the keys but never comparesinputswithidentity_creation_from_addresses_min_fees. (verified by reading) -
Smaller:
KeyType::can_sign_state_transitionscopies drive-abci'sSUPPORTED_KEY_TYPESwith only a comment between them (tracked in #6402; a drive-abci test asserting both sets match would hold them together).- Every write re-runs
new_identitythroughvalidate_for_operation, so theIdentityCreationKeystype guarantees nothing a write relies on. The breaking signature buys the version refresh, which could live inside the write. - The description says an unpinned SDK starts at protocol 13;
min_protocol_versionis 14.
Review details
Reviewed in levels: idea, architecture, completeness, then code. The code level used a general code review and specialist lanes for funds and security, and for compatibility and FFI, plus edge-case lanes (failure injection, crash and restart, ownership and legacy data, cross-layer parity, tests).
The lanes read ce1fbbbffc. The merge of v5.2-dev that followed (3a3293329b) was checked for the payment class, the pinned submission, the shielded ordering and every line cited here. The major, the SDK's starting version, the expired-key path and the code-29 docs were checked again before posting. Nothing was built or run.
🤖 Reviewed with Claude Code
| && key.key_type().can_sign_state_transitions() => {} | ||
| _ => return Err(IdentityCreationKeysError::KeyZeroNotMasterAuthentication), | ||
| } | ||
| for security_level in REQUIRED_AUTHENTICATION_LEVELS { |
There was a problem hiding this comment.
Major: requiring AUTHENTICATION keys at CRITICAL and HIGH refuses the custom key sets Dash Evo Tool's Advanced mode builds
Dash Evo Tool (v1.0-dev) has an Advanced key mode on its add-identity screen. There the user can change levels and remove keys with "−" (src/ui/identity/add_new_identity_screen/mod.rs, around L1030), and the set goes to register_identity_with_funding (src/wallet_backend/identity_ops.rs, around L360).
Sequence:
- A user removes the HIGH key.
- The set is still valid for consensus: MASTER at id 0, within the limit, accepted by
validate_identity_public_keys_structure. - After the platform bump this loop returns
MissingAuthenticationKey { HIGH }, and the caller has no way to opt out.
The description says Dash Evo Tool's key set "passes unchanged", which holds for its default set only.
Consensus accepts such an identity, and MASTER can add keys later. The CRITICAL+HIGH requirement is therefore wallet policy, not a creation rule. That is a reasonable default, but it should be a maintainer's decision whether callers that build their own key set may waive it (for example, the level check could apply only to the wallet's own layouts), or whether the refusal stays and goes into Breaking Changes as such.
There was a problem hiding this comment.
Addressed in 82bcfeceaa75b970a4743f27fa840164884f8fdd. register_identity_with_funding_and_custom_keys (Rust) and platform_wallet_register_identity_with_custom_keys_signer (C) take the caller's key map plus the AUTHENTICATION levels it omits (CRITICAL, HIGH or both). register_identity_with_funding keeps the full requirement, so Advanced mode switches to the new call and lists the levels the user removed or changed. MASTER at key 0, Platform's key rules and the funding minimum stay enforced on both paths. The Breaking changes section now describes this.
🤖 Co-authored by Claudius the Magnificent AI Agent
Refuse a new-identity key whose expiry is at or before the current time before any asset lock is built, using the DPP expiry predicate Platform applies at block time. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw reviewed an earlier commit, not yet this one. Wait for the missing reviews, or a writer can post |
…istration Add a separate entry point (Rust and C) for caller-built key sets that names the CRITICAL or HIGH authentication levels it deliberately omits. The default entry points keep the full key policy; MASTER at key 0, Platform key rules and the funding minimum are always enforced. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…try point Document the accepted omission levels in the C header, pin the preflight order in the default-export tests, and simplify the omission policy without changing behaviour. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…et-dip11-identity-key-layout <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- Invitation tests use a key type removed from current v5.2-dev —
packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:1326-1328(new)
Impact: The PR conflicts with the current target branch, and resolving only the visible FFI conflict still leaves a wallet test that cannot compile on the merged branch.
New on this head: This revision adds a device-clock expiry check to identity creation and reruns it when each wallet write starts, before funding or signing begins. The change is wallet policy, not a consensus change. PastaClaw review and PR Hygiene were pending, and no Rust build or test result was reported for this head.
A pattern across this PR's review rounds
This is review round 12, and the PR has drawn 10 blocking findings so far. 5 of them share 3 underlying causes. They are listed with the other findings as usual; fixing the cause is likely to be cheaper than fixing each case.
1. Pinning rules does not establish network rules (5 earlier finding(s))
identity_creation_keys checks the SDK’s stored version and refreshes only when a key format appears too new; a successful check does not establish which rules the network is running. validate_for_operation pins the version later, so it can freeze an unverified version or pick up a different one from the first check. On the shielded path, that second check can refuse the very same keys and report a different error to the caller.
Already tracked: #6062
2. Passing preflight does not make keys usable at submission (2 new in this round, 3 earlier finding(s))
IdentityCreationKeys::new_identity starts with DPP’s structure check, which does not establish whether the required keys can sign or whether the node permits their contract bounds. The expiry check exposes the same gap over time: now_ms() can substitute zero for an unusable clock reading, and register_identity_with_funding can wait for finality and retry without revisiting that reading. Drive-ABCI decides expiry at block time, which the wallet cannot establish before committing funds.
Already tracked: #6402
In this round: A pre-epoch device clock lets expired keys pass funding preflight; Registration can pay a penalty when a key expires during asset-lock finality
3. Lock affordability is decided before resume eligibility (2 earlier finding(s))
Both the former resume_exemption and the current enforce_identity_create_floor decide what a tracked lock can fund using its amount before the funding resolver checks its role, identity index, and consumed status. Removing the legacy layout changed the consequence, not the split: a lock that cannot be resumed can now look like a funding shortfall.
Suggested decision (narrow what this PR promises): Limit the new mandatory preflight to the existing non-expiring wallet layouts and the asset-lock fee floor at the operation’s selected SDK version. Leave custom-key registration on its existing submission path rather than requiring IdentityCreationKeys for it. State that the floor checks affordability, not resume eligibility, and that the selected version is not proof of network acceptance. Keep the agreed follow-ups deferred and file a tracking issue for any remaining custom-key preflight limitation.
🔴 1 blocking | 🟡 4 suggestion(s)
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Preserve creation-key error codes from shielded worker revalidation
Impact: A shielded creation caller whose key expires during seed resolution gets a generic wallet-operation error rather than the invalid-parameter error it would receive for the same key at entry.
packages/rs-platform-wallet-ffi/src/shielded_send.rs:1515
The caller loses the result code that distinguishes bad input from a wallet failure. The FFI preflight uses the standard conversion, which maps ExpiredKey to ErrorInvalidParameter; after seed resolution, the wallet revalidates before reserving notes and can return the same refusal. This arm sends it to map_spend_result, whose fallback returns ErrorWalletOperation. The merge preserves NotSent, but it does not preserve the code, and expiry now makes the mismatch reachable even without a protocol-version change. Use the standard conversion for IdentityCreationKeys here so it also preserves ErrorUnknown for ValidationUnavailable.
Err(e @ PlatformWalletError::IdentityCreationKeys(_)) => e.into(),
Err(e) => map_spend_result(Err(e), IDENTITY_CREATE_FROM_POOL_OPERATION),
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: ffi-engineer); grok-4.7 (phase2-reviewer: security-auditor)
🟡 Suggestion: Registration can pay a penalty when a key expires during asset-lock finality
Impact: A caller registering with a short-lived authentication key can lose part of the asset lock without receiving an identity if the key expires while the wallet waits for the funding proof.
packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:233-240
A caller who supplies a still-valid V1 HIGH authentication key to register_identity_with_funding can pay for a refusal the wallet could detect before signing. The new expiry check runs at operation entry, but the funding resolver can wait 300 seconds for InstantSend and then wait without a deadline for a ChainLock. Once the proof is ready, this closure passes the original keys to the SDK, which signs and checks structure without rechecking expiry. Mempool admission does not run full state validation for IdentityCreate; if the transition is included at or after expiry, identity_create/state/v1 returns a PartiallyUseAssetLockAction and charges the lock without creating the identity. Keep the entry check and reuse the expiry check just before each signing attempt, including after a proof upgrade. Route a late refusal through the funded-lock handling so it names a resumable lock only when no earlier attempt may have reached Platform.
Raised as blocking. An independent pass did not find a failure someone would actually hit, so it does not block: The paid refusal is reachable: the wallet checks expiry before waiting for finality, the SDK does not recheck it before signing, and block validation can charge the asset lock without creating the identity. But the base already accepted the same V1 keys, waited for the same proof, and submitted through the same SDK path to the same paid refusal. The new check rejects keys that are already expired at entry; rechecking after finality would close a pre-existing gap.
source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality); grok-4.7 (phase2-reviewer: security-auditor)
Still open from earlier rounds (1)
- 🟡 Suggestion: Preserve consumed and funding-mismatch errors before applying the resume floor —
packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:528-534(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.2-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 8: grok-4.7 (standing in for gpt-6.2-astra) (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This is a large, intricate change to identity key validation, protocol-versioned creation rules, asset-lock funding, signing, and FFI registration paths, directly affecting key handling and funds movement in files such aswallet/identity/network/creation_keys.rsand the identity registration functions. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
ce1fbbbf): 2 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed, 1 not confirmed (no longer blocking) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer,grok-4.7(standing in forgpt-6.2-astra) — security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
Several findings on this PR share an underlying cause (the review's "pattern" section): Pinning rules does not establish network rules; Passing preflight does not make keys usable at submission; Lock affordability is decided before resume eligibility. When you fix the findings below, fix the cause, not only the reported case. The review suggests (narrow what this PR promises): Limit the new mandatory preflight to the existing non-expiring wallet layouts and the asset-lock fee floor at the operation’s selected SDK version. Leave custom-key registration on its existing submission path rather than requiring `IdentityCreationKeys` for it. State that the floor checks affordability, not resume eligibility, and that the selected version is not proof of network acceptance. Keep the agreed follow-ups deferred and file a tracking issue for any remaining custom-key preflight limitation. If that decision is not yours to make, say so to the PR's author or maintainer.
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/creation_keys.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:1326-1328: Invitation tests use a key type removed from current v5.2-dev
Impact: The PR conflicts with the current target branch, and resolving only the visible FFI conflict still leaves a wallet test that cannot compile on the merged branch.
The invitation tests must be migrated before this PR can land on `v5.2-dev`. Base commit `3ea5daa1dd6` (#5519) removes the `dpp::secp256k1` re-export and changes the SDK's `ParsedInvitation::voucher_key` to `EcdsaSecretKey`. A static merge check reports a conflict in `packages/rs-platform-wallet-ffi/src/invitation.rs`, but not in this file: this PR's `ParsedInvitation` fixture would merge unchanged and refer to the removed type when Rust compiles the wallet tests. Update this fixture to `dashcore::ecdsa::EcdsaSecretKey::from_bytes` and use `from_bytes` and `to_bytes` in the added FFI test at `invitation.rs:1149–1150`. This is a target-branch integration failure, not a reported CI failure on the assigned head.
_Raised on code unchanged since the last review, and confirmed by an independent pass: When this PR is merged into current v5.2-dev, the Rust workspace checks compile the PR's invitation fixture in creation_keys.rs. That fixture merges unchanged, but target commit 3ea5daa1dd6 removed dpp::secp256k1 and changed ParsedInvitation::voucher_key to EcdsaSecretKey, so the wallet test target cannot compile._
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:287-290: A pre-epoch device clock lets expired keys pass funding preflight
Impact: A caller supplying a time-limited key on a device whose clock is set before 1970 can fund a Core asset lock even though the wallet could not establish that the key is still valid.
A clock read that cannot produce Unix time should not authorize funding for a time-limited key. `now_ms()` replaces the pre-epoch error with zero, so every positive expiry passes the new gate, including one already in the past. Funding can then broadcast the Core lock, and if the registration reaches block execution, Platform still checks expiry against block time and can charge the lock for the refusal. Use a fallible clock read for keys with an expiry and report a local clock error when it fails; leave non-expiring keys unaffected. This handles the explicit clock error without trying to detect ordinary clock skew.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:528-534: Preserve consumed and funding-mismatch errors before applying the resume floor
(carried; thread: https://github.com/dashpay/platform/pull/5645#discussion_r4600204167)
In `packages/rs-platform-wallet-ffi/src/shielded_send.rs`:
- [SUGGESTION] packages/rs-platform-wallet-ffi/src/shielded_send.rs:1515: Preserve creation-key error codes from shielded worker revalidation
Impact: A shielded creation caller whose key expires during seed resolution gets a generic wallet-operation error rather than the invalid-parameter error it would receive for the same key at entry.
The caller loses the result code that distinguishes bad input from a wallet failure. The FFI preflight uses the standard conversion, which maps `ExpiredKey` to `ErrorInvalidParameter`; after seed resolution, the wallet revalidates before reserving notes and can return the same refusal. This arm sends it to `map_spend_result`, whose fallback returns `ErrorWalletOperation`. The merge preserves `NotSent`, but it does not preserve the code, and expiry now makes the mismatch reachable even without a protocol-version change. Use the standard conversion for `IdentityCreationKeys` here so it also preserves `ErrorUnknown` for `ValidationUnavailable`.
In `packages/rs-platform-wallet/src/wallet/identity/network/registration.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:233-240: Registration can pay a penalty when a key expires during asset-lock finality
Impact: A caller registering with a short-lived authentication key can lose part of the asset lock without receiving an identity if the key expires while the wallet waits for the funding proof.
A caller who supplies a still-valid V1 HIGH authentication key to `register_identity_with_funding` can pay for a refusal the wallet could detect before signing. The new expiry check runs at operation entry, but the funding resolver can wait 300 seconds for InstantSend and then wait without a deadline for a ChainLock. Once the proof is ready, this closure passes the original keys to the SDK, which signs and checks structure without rechecking expiry. Mempool admission does not run full state validation for `IdentityCreate`; if the transition is included at or after expiry, `identity_create/state/v1` returns a `PartiallyUseAssetLockAction` and charges the lock without creating the identity. Keep the entry check and reuse the expiry check just before each signing attempt, including after a proof upgrade. Route a late refusal through the funded-lock handling so it names a resumable lock only when no earlier attempt may have reached Platform.
_Raised as blocking. An independent pass did not find a failure someone would actually hit, so it does not block: The paid refusal is reachable: the wallet checks expiry before waiting for finality, the SDK does not recheck it before signing, and block validation can charge the asset lock without creating the identity. But the base already accepted the same V1 keys, waited for the same proof, and submitted through the same SDK path to the same paid refusal. The new check rejects keys that are already expired at entry; rechecking after finality would close a pre-existing gap._
Refuse a key set whose identity-create transition would exceed the maximum state-transition size before funding, and require the tracked asset lock amount when resuming a registration so the funding minimum is always checked. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…et-dip11-identity-key-layout <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Replies to the review-body items of the latest review:
🤖 Co-authored by Claudius the Magnificent AI Agent |
|
Waiting for bot review — thepastaclaw reviewed an earlier commit, not yet this one. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- Custom registration saves external keys as recoverable from the funding wallet’s seed —
packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:105-109(new)
Impact: A caller who registers an externally held key gets a successful identity registration but a persisted recovery path that cannot reproduce that key.
New on this head: This revision adds explicit CRITICAL and HIGH omissions for caller-built registration keys, checks expiry and signed transition size before funding, and refuses to resume untracked locks. Rust workspace and wasm32 tests, Kotlin and Swift SDK build and test checks, and the Swift frozen-schema check passed; only review and hygiene checks remained pending.
A pattern across this PR's review rounds
This is review round 13, and the PR has drawn 11 blocking findings so far. 1 of them share 3 underlying causes. They are listed with the other findings as usual; fixing the cause is likely to be cheaper than fixing each case.
1. Local expiry checks cannot guarantee submission validity (2 earlier finding(s))
IdentityCreationKeys::validate checks expiry using the device clock, but register_identity_with_funding validates only before funding resolution. The resolver may wait for finality and retry until the key expires, while Drive-ABCI makes the final expiry decision at block time; the wallet cannot establish that future guarantee locally.
Already tracked: #6402
2. Registration lacks explicit input provenance (1 new in this round, 2 earlier finding(s))
The shared registration path carries raw keys and funding through separate phases without retaining their ownership and eligibility provenance. apply_identity_create_floor checks a tracked lock's amount before the resolver checks its role or consumed state, while finish_accepted_registration records every successful key set as DerivedAtKeyId, including externally held custom keys; each new registration mode therefore exposes another incorrect assumption about wallet-owned inputs.
In this round: Custom registration saves external keys as recoverable from the funding wallet’s seed
3. Wallet preflight duplicates consensus wire rules (1 new in this round, 1 earlier finding(s))
validate_asset_lock_create_size manually decides which key types receive possession signatures and how large those signatures are, while DPP's identity-create builder uses is_unique_key_type() and separate consensus signing allowlists exist elsewhere. The values agree today, but fixes to one copy can leave the preflight authorizing a transition whose actual builder produces different bytes or size.
In this round: Registration preflight models the signed wire size separately from the builder
Suggested decision (narrow what this PR promises): Narrow this PR to wallet-owned layouts and a best-effort preflight at a stated SDK snapshot: remove or gate custom external-key registration until the registration context preserves key provenance, and state that expiry during finality and resume eligibility are not guaranteed by the preflight. Keep the funding floor explicitly limited to an amount check, or move it after the resolver has established that the tracked lock is eligible. Do not describe the local size calculation as identical to DPP's builder unless the measurement is shared with the canonical construction path; otherwise document it as a limitation and track it.
🔴 1 blocking | 🟡 6 suggestion(s)
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Registration can pay a penalty when a key expires during asset-lock finality
Impact: A caller whose key expires while the wallet waits for the asset-lock proof can lose credits from that lock without receiving an identity.
packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:256-269
The wallet can submit a registration it could already tell will be refused for expiry. The early check protects keys that are expired before funding, but the InstantSend wait or ChainLock fallback can outlast a key that was still valid then. The submission closure signs the saved placeholder without rechecking the clock, including on retries. Drive-ABCI compares the expiry with block time and can apply PartiallyUseAssetLockAction, charging a penalty and processing fees. Keep the early check and recheck expiry before each signing attempt. Route a local refusal through the funded-lock handling without reporting NotSent or discarding an earlier ambiguous submission outcome.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality); grok-4.7 (phase2-reviewer: security-auditor)
🟡 Suggestion: Preserve creation-key error codes from shielded worker revalidation
Impact: A shielded registration caller receives a generic wallet-operation error if a key expires during mnemonic resolution rather than before preflight.
packages/rs-platform-wallet-ffi/src/shielded_send.rs:1515
The host loses the distinction between invalid keys and a wallet failure depending on which check notices the problem. Initial preflight uses the typed FFI conversion, but shielded_identity_create_from_pool revalidates after mnemonic resolution, before note reservation. Its IdentityCreationKeys error reaches spend_result_code through map_spend_result and falls through to ErrorWalletOperation. Use the same conversion in map_identity_create_result to preserve ErrorInvalidParameter and the separate ValidationUnavailable mapping. The surrounding code already attaches the worker error’s payment class.
Err(e @ PlatformWalletError::IdentityCreationKeys(_)) => e.into(),
Err(e) => map_spend_result(Err(e), IDENTITY_CREATE_FROM_POOL_OPERATION),
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.2-astra (phase2-reviewer: architecture-layering, ffi-engineer, rust-quality); grok-4.7 (phase2-reviewer: security-auditor)
Still open from earlier rounds (2)
- 🟡 Suggestion: A pre-epoch device clock lets expired keys pass funding preflight —
packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:298-300(thread) - 🟡 Suggestion: Preserve consumed and funding-mismatch errors before applying the resume floor —
packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:504-511(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.2-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 8: grok-4.7 (standing in for gpt-6.2-astra) (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This large cross-cutting diff changes identity key validation, cryptographic signing inputs, asset-lock funding and registration flows in rs-platform-wallet, directly affecting key handling and funds movement. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
ce1fbbbf): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer,grok-4.7(standing in forgpt-6.2-astra) — security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
Several findings on this PR share an underlying cause (the review's "pattern" section): Local expiry checks cannot guarantee submission validity; Registration lacks explicit input provenance; Wallet preflight duplicates consensus wire rules. When you fix the findings below, fix the cause, not only the reported case. The review suggests (narrow what this PR promises): Narrow this PR to wallet-owned layouts and a best-effort preflight at a stated SDK snapshot: remove or gate custom external-key registration until the registration context preserves key provenance, and state that expiry during finality and resume eligibility are not guaranteed by the preflight. Keep the funding floor explicitly limited to an amount check, or move it after the resolver has established that the tracked lock is eligible. Do not describe the local size calculation as identical to DPP's builder unless the measurement is shared with the canonical construction path; otherwise document it as a limitation and track it. If that decision is not yours to make, say so to the PR's author or maintainer.
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/registration.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:105-109: Custom registration saves external keys as recoverable from the funding wallet’s seed
Impact: A caller who registers an externally held key gets a successful identity registration but a persisted recovery path that cannot reproduce that key.
A successful custom registration writes incorrect key recovery data. A caller can use the new Rust or C entry point to fund from the wallet, supply an externally held ECDSA MASTER key at ID 0, and explicitly omit CRITICAL and HIGH. That key set passes the creation checks, and the separate identity signer proves possession without proving derivation from the funding wallet. The shared success path nevertheless passes `DerivedAtKeyId` at line 322, so `record_new_identity` emits a `(wallet_id, identity_index, key_id)` breadcrumb for the external key. SQLite round-trips those coordinates, and Swift can turn them into a seed-based signing path whose public-key binding check then fails. Carry per-key provenance separately from the omission policy: emit coordinates only for established wallet derivations, and leave unverified keys unrecorded, as address-funded registration does. Cover the custom success path by checking the persisted key row.
_Confirmed by an independent pass: An app can call the new custom registration API with sufficient wallet funding, an externally held ECDSA MASTER key at ID 0, and explicit CRITICAL and HIGH waivers; the external identity signer proves possession, so registration can succeed. The wallet then persists that key as recoverable from the funding wallet’s seed, even though deriving from the recorded path produces a different public key and the Swift signer’s binding check rejects it._
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:256-269: Registration can pay a penalty when a key expires during asset-lock finality
Impact: A caller whose key expires while the wallet waits for the asset-lock proof can lose credits from that lock without receiving an identity.
The wallet can submit a registration it could already tell will be refused for expiry. The early check protects keys that are expired before funding, but the InstantSend wait or ChainLock fallback can outlast a key that was still valid then. The submission closure signs the saved placeholder without rechecking the clock, including on retries. Drive-ABCI compares the expiry with block time and can apply `PartiallyUseAssetLockAction`, charging a penalty and processing fees. Keep the early check and recheck expiry before each signing attempt. Route a local refusal through the funded-lock handling without reporting `NotSent` or discarding an earlier ambiguous submission outcome.
In `packages/rs-platform-wallet-ffi/src/shielded_send.rs`:
- [SUGGESTION] packages/rs-platform-wallet-ffi/src/shielded_send.rs:1515: Preserve creation-key error codes from shielded worker revalidation
Impact: A shielded registration caller receives a generic wallet-operation error if a key expires during mnemonic resolution rather than before preflight.
The host loses the distinction between invalid keys and a wallet failure depending on which check notices the problem. Initial preflight uses the typed FFI conversion, but `shielded_identity_create_from_pool` revalidates after mnemonic resolution, before note reservation. Its `IdentityCreationKeys` error reaches `spend_result_code` through `map_spend_result` and falls through to `ErrorWalletOperation`. Use the same conversion in `map_identity_create_result` to preserve `ErrorInvalidParameter` and the separate `ValidationUnavailable` mapping. The surrounding code already attaches the worker error’s payment class.
In `packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:399-425: Registration preflight models the signed wire size separately from the builder
Impact: Callers near the transition size limit can get a funding decision based on a smaller encoding than the one the SDK checks at submission.
Sharing the maximum size does not make the two measurements agree. The new wallet preflight independently lists which key types carry possession signatures and their byte lengths, while DPP’s identity-create builder selects those keys with `is_unique_key_type()`. The signature lengths agree today, but the placeholder also uses height `0`, whose varint is shorter than a current ChainLock height; the SDK’s existing fallback estimate accounts for that by using `u32::MAX`. Keep the decision to check before funding in the wallet, but put the signed-size calculation alongside DPP’s identity-create builder so it can share the possession predicate and signature-size constants. Use a size bound consistent with the SDK’s ChainLock fallback, and compare the estimate with an actually signed encoding.
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:298-300: A pre-epoch device clock lets expired keys pass funding preflight
(carried; thread: https://github.com/dashpay/platform/pull/5645#discussion_r4768910707)
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:504-511: Preserve consumed and funding-mismatch errors before applying the resume floor
(carried; thread: https://github.com/dashpay/platform/pull/5645#discussion_r4600204167)
In `packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs`:
- [SUGGESTION] packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs:109-112: The custom C registration API leaves ownership of the returned handle undocumented
Impact: A C caller that only needs the returned ID can discard the handle and leave a managed identity in the process-wide registry.
The registered handle remains allocated until the caller releases it. The custom export points to the original funded export’s safety docs, which cover the two input signers but not the output handle. On success the shared implementation inserts a separate `ManagedIdentity` in `MANAGED_IDENTITY_STORAGE`. Existing funded-registration consumers show the contract: JNI destroys the handle when it only needs the ID, and Swift transfers it to an object that destroys it on deinitialization. Document that both outputs must be writable, are valid on success, and that the caller must release the handle with `managed_identity_destroy` even if it only uses the ID.
| let keys = self | ||
| .prepare_creation_keys(keys, allow_missing_levels) | ||
| .await?; | ||
| self.register_identity_with_funding(funding, identity_index, keys, signer, core, settings) | ||
| .await |
There was a problem hiding this comment.
⏭️ Deferred (maintainer decision; not blocking) at
abbcf4e2; see the replies below.
🔴 Blocking: Custom registration saves external keys as recoverable from the funding wallet’s seed
Impact: A caller who registers an externally held key gets a successful identity registration but a persisted recovery path that cannot reproduce that key.
A successful custom registration writes incorrect key recovery data. A caller can use the new Rust or C entry point to fund from the wallet, supply an externally held ECDSA MASTER key at ID 0, and explicitly omit CRITICAL and HIGH. That key set passes the creation checks, and the separate identity signer proves possession without proving derivation from the funding wallet. The shared success path nevertheless passes DerivedAtKeyId at line 322, so record_new_identity emits a (wallet_id, identity_index, key_id) breadcrumb for the external key. SQLite round-trips those coordinates, and Swift can turn them into a seed-based signing path whose public-key binding check then fails. Carry per-key provenance separately from the omission policy: emit coordinates only for established wallet derivations, and leave unverified keys unrecorded, as address-funded registration does. Cover the custom success path by checking the persisted key row.
Confirmed by an independent pass: An app can call the new custom registration API with sufficient wallet funding, an externally held ECDSA MASTER key at ID 0, and explicit CRITICAL and HIGH waivers; the external identity signer proves possession, so registration can succeed. The wallet then persists that key as recoverable from the funding wallet’s seed, even though deriving from the recorded path produces a different public key and the Swift signer’s binding check rejects it.
source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality); grok-4.7 (phase2-reviewer: security-auditor)
There was a problem hiding this comment.
Per maintainer decision, tracked in #6460.
🤖 Co-authored by Claudius the Magnificent AI Agent
There was a problem hiding this comment.
Deferred (re-reviewed at abbcf4e2): You're right that removing the custom endpoint would not fix recovery metadata: the base already allowed the same caller-built keys and separate signer, then recorded them as DerivedAtKeyId. #6460 covers that shared persistence path.
Use DPP's possession-signature rule and the widest ChainLock proof encodings when estimating the identity-create size before funding, and document that callers release the identity handle both funded C exports return. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…argin policy Replace the bare list of omitted authentication levels with a CreationKeyPolicy that also carries an expiry margin. The default policy requires every authentication level and refuses keys that expire within 15 minutes; a zero margin is an explicit opt-out. The C export takes the policy as one struct. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the standard FFI conversion for shielded worker revalidation so key refusals report invalid input with NotSent delivery. Distinguish expired keys from keys expiring within the safety margin and map each variant explicitly. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…et-dip11-identity-key-layout <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Document the 15-minute refusal on the default Rust registration path. Publish the default in Rust and C and check their equality at compile time. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…et-dip11-identity-key-layout
…et-dip11-identity-key-layout
…et-dip11-identity-key-layout
|
Replies to the latest review body:
🤖 Co-authored by Claudius the Magnificent AI Agent |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- Custom registration aborts the iOS host when called from a wallet sync callback —
packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs:190-204(new)
Impact: An iOS C host that resumes a pending registration directly from its platform-address sync completion callback loses the process instead of getting a result.
New on this head: This revision adds a configurable expiry margin for caller-built identity keys, checks the signed ChainLock size and funding minimum before resolving an asset lock, and preserves typed creation-key refusals across FFI. The latest CI checks show Rust workspace, wasm32, Swift, Kotlin, and Dashmate tests passed; only this review and PR Hygiene remain pending.
A pattern across this PR's review rounds
This is review round 14, and the PR has drawn 12 blocking findings so far. 1 of them share 2 underlying causes. They are listed with the other findings as usual; fixing the cause is likely to be cheaper than fixing each case.
1. Validated keys are not bound to the signer (1 new in this round, 1 earlier finding(s))
IdentityCreationKeys validates public keys and policy, but carries no evidence that the separate identity signer holds those keys or that the funding wallet derived them. The shared registration path can therefore fund a lock before the DPP builder asks the signer for proof of possession, then record DerivedAtKeyId on success even though a valid signature does not establish seed ownership.
Already tracked: #6460
In this round: Custom registration can fund a lock before discovering that its signer lacks a required key
2. Expiry preflight only sees the device clock at entry (2 earlier finding(s))
IdentityCreationKeys::validate treats now_ms() as a usable clock reading even when a pre-epoch clock has been replaced with zero. A valid reading and a larger margin still say nothing about when the finality wait will end or what block time Drive-ABCI will use to judge expiry.
Already tracked: #6480
Suggested decision (narrow what this PR promises): Keep custom registration, but define it as a preflight for caller-managed keys, not a guarantee that registration will succeed or that the keys can be recovered from the wallet seed. Gate custom funding on the supplied signer reporting that it can provide the possession signatures DPP will request, and document that this checks availability now, not whether signing will succeed later. Keep the agreed recovery and post-finality expiry work in their existing follow-up issues.
🔴 1 blocking | 🟡 3 suggestion(s)
Still open from earlier rounds (2)
- 🟡 Suggestion: A pre-epoch device clock lets expired keys pass funding preflight —
packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:329-338(thread) - 🟡 Suggestion: Preserve consumed and funding-mismatch errors before applying the resume floor —
packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:549-556(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: The C key-row documentation promises a chain error for keys registration refuses locally
Impact: A C or Swift integrator can expect a paid consensus refusal for a near-expiry key when default registration actually returns ErrorInvalidParameter without funding or sending.
packages/rs-platform-wallet-ffi/src/identity_registration_with_signer.rs:134-135
A key that expires in ten minutes on an otherwise valid registration at protocol 14 or later returns a local error under the new default policy. The shared decoder preserves the expiry timestamp, then wallet preflight returns ExpiresWithinMargin, which FFI maps to ErrorInvalidParameter. The decoder still does not duplicate consensus validation, but the unchanged promise that callers see the chain's error no longer holds. Distinguish creation preflight from Platform's block-time rule without implying that the creation margin applies to key updates.
/// Platform enforces these rules at validation. For identity creation, the
/// wallet also checks expiry against the device clock before funding or
/// signing. An expired key or one expiring at or before the creation policy's
/// cutoff returns `ErrorInvalidParameter` locally. Passing preflight does not
/// guarantee that the key will still be valid at block time.
source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, 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.2-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 8: gpt-6.2-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The new creation_keys.rs logic and its integration into registration.rs make intricate changes to which identity keys the wallet accepts and how it checks funding before building or signing an asset lock. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
ce1fbbbf): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed; 1 suggestion(s) on unchanged code listed as follow-up candidates - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
Several findings on this PR share an underlying cause (the review's "pattern" section): Validated keys are not bound to the signer; Expiry preflight only sees the device clock at entry. When you fix the findings below, fix the cause, not only the reported case. The review suggests (narrow what this PR promises): Keep custom registration, but define it as a preflight for caller-managed keys, not a guarantee that registration will succeed or that the keys can be recovered from the wallet seed. Gate custom funding on the supplied signer reporting that it can provide the possession signatures DPP will request, and document that this checks availability now, not whether signing will succeed later. Keep the agreed recovery and post-finality expiry work in their existing follow-up issues. If that decision is not yours to make, say so to the PR's author or maintainer.
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-ffi/src/identity_registration_funded_with_signer.rs`:
- [BLOCKING] packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs:190-204: Custom registration aborts the iOS host when called from a wallet sync callback
Impact: An iOS C host that resumes a pending registration directly from its platform-address sync completion callback loses the process instead of getting a result.
An iOS host can exit before registration validates the keys or touches funding. A host with a live wallet, a saved registration outpoint, and valid key-policy and signer arguments can call this new export from `on_platform_address_sync_completed_fn` to resume once sync completes. The callback is invoked inline during the sync pass, inside Tokio's `Handle::block_on`. The shared funded helper then calls `block_on_worker`, which calls `Runtime::block_on` on that same thread with no runtime guard. Tokio panics before spawning the registration future, and neither iOS profile can unwind into `catch_funding_panic`. Use `ensure_not_on_runtime` before the funded helper blocks, as the shielded identity-create export does, so the caller can move the request to another thread and both outputs remain untouched.
_Confirmed by an independent pass: An iOS client resuming an interrupted identity registration can pass its saved asset-lock outpoint, live wallet and signer handles, and valid key and policy arguments to the new custom registration export directly from `on_platform_address_sync_completed_fn`. The callback runs inline inside Tokio's `Handle::block_on`, so the funded helper's nested `Runtime::block_on` panics before the registration future starts. Both iOS profiles use `panic = "abort"`, so `catch_funding_panic` cannot return an error and the host app terminates before validation or funding._
In `packages/rs-platform-wallet/src/wallet/identity/network/registration.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:173-180: Custom registration can fund a lock before discovering that its signer lacks a required key
Impact: A caller whose configured signer lacks a private key required by its custom key set can broadcast a Core lock and then have to resume with a different signer or key set.
DASH can already be in a Core asset lock when the wallet first discovers that the supplied signer does not hold a required key. The new custom entry point accepts the key map and signer separately: for example, one ECDSA MASTER key at ID 0 with CRITICAL and HIGH explicitly waived can pass the key, size, and amount checks even if the signer does not hold that key. Fresh wallet funding can then broadcast the lock before DPP calls `identity_signer.sign` for proof of possession. Check the signer's reported capability for the keys DPP marks `is_unique_key_type()` before funding, using `can_sign_with` to detect missing keys without requesting a signature. Keep sign-time error handling: a positive capability check cannot guarantee the signer will still be available after finality.
In `packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:329-338: A pre-epoch device clock lets expired keys pass funding preflight
(carried; thread: https://github.com/dashpay/platform/pull/5645#discussion_r4768910707)
- [SUGGESTION] packages/rs-platform-wallet/src/wallet/identity/network/creation_keys.rs:549-556: Preserve consumed and funding-mismatch errors before applying the resume floor
(carried; thread: https://github.com/dashpay/platform/pull/5645#discussion_r4600204167)
| platform_wallet_register_identity_with_funding_signer_inner( | ||
| wallet_handle, | ||
| funding, | ||
| identity_index, | ||
| identity_pubkeys, | ||
| identity_pubkeys_count, | ||
| signer_handle, | ||
| core_signer_handle, | ||
| out_identity_id, | ||
| out_identity_handle, | ||
| CreationKeyPolicy { | ||
| allow_missing_levels: levels, | ||
| expiry_margin: Duration::from_secs(expiry_margin_secs), | ||
| }, | ||
| ) |
There was a problem hiding this comment.
🔴 Blocking: Custom registration aborts the iOS host when called from a wallet sync callback
Impact: An iOS C host that resumes a pending registration directly from its platform-address sync completion callback loses the process instead of getting a result.
An iOS host can exit before registration validates the keys or touches funding. A host with a live wallet, a saved registration outpoint, and valid key-policy and signer arguments can call this new export from on_platform_address_sync_completed_fn to resume once sync completes. The callback is invoked inline during the sync pass, inside Tokio's Handle::block_on. The shared funded helper then calls block_on_worker, which calls Runtime::block_on on that same thread with no runtime guard. Tokio panics before spawning the registration future, and neither iOS profile can unwind into catch_funding_panic. Use ensure_not_on_runtime before the funded helper blocks, as the shielded identity-create export does, so the caller can move the request to another thread and both outputs remain untouched.
Confirmed by an independent pass: An iOS client resuming an interrupted identity registration can pass its saved asset-lock outpoint, live wallet and signer handles, and valid key and policy arguments to the new custom registration export directly from on_platform_address_sync_completed_fn. The callback runs inline inside Tokio's Handle::block_on, so the funded helper's nested Runtime::block_on panics before the registration future starts. Both iOS profiles use panic = "abort", so catch_funding_panic cannot return an error and the host app terminates before validation or funding.
source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor)
| let (sdk, keys) = keys.validate_for_operation(&self.sdk)?; | ||
| let user_fee_increase = settings | ||
| .and_then(|s| s.user_fee_increase) | ||
| .unwrap_or_default(); | ||
| validate_asset_lock_create_size(&keys, user_fee_increase, sdk.version())?; | ||
| let funding = self | ||
| .enforce_identity_create_floor(funding, &keys, sdk.version()) | ||
| .await?; |
There was a problem hiding this comment.
🟡 Suggestion: Custom registration can fund a lock before discovering that its signer lacks a required key
Impact: A caller whose configured signer lacks a private key required by its custom key set can broadcast a Core lock and then have to resume with a different signer or key set.
DASH can already be in a Core asset lock when the wallet first discovers that the supplied signer does not hold a required key. The new custom entry point accepts the key map and signer separately: for example, one ECDSA MASTER key at ID 0 with CRITICAL and HIGH explicitly waived can pass the key, size, and amount checks even if the signer does not hold that key. Fresh wallet funding can then broadcast the lock before DPP calls identity_signer.sign for proof of possession. Check the signer's reported capability for the keys DPP marks is_unique_key_type() before funding, using can_sign_with to detect missing keys without requesting a signature. Keep sign-time error handling: a positive capability check cannot guarantee the signer will still be available after finality.
source: gpt-6.2-astra (phase2-reviewer: architecture-layering)
| let keys = self | ||
| .prepare_creation_keys(keys, allow_missing_levels) | ||
| .await?; | ||
| self.register_identity_with_funding(funding, identity_index, keys, signer, core, settings) | ||
| .await |
There was a problem hiding this comment.
Deferred (re-reviewed at abbcf4e2): You're right that removing the custom endpoint would not fix recovery metadata: the base already allowed the same caller-built keys and separate signer, then recorded them as DerivedAtKeyId. #6460 covers that shared persistence path.
TL;DR
The wallet's Rust core now decides which keys a new identity gets and how much it must be funded with. Before anything is signed or broadcast, it checks that the key set can create a working identity and that the asset lock can pay for it. The wallet keeps its default key layout and requires any key with an expiry date to stay valid for more than 15 minutes. Apps with an advanced key editor can choose that margin and allow the user to omit either or both of the keys normally required for tokens and documents. Existing identities keep working, and users can resume interrupted registrations that meet the funding and key checks.
This PR can land on its own. The current Swift and Kotlin apps already send key sets that pass the new check. The stacked PR #5647 then moves the layout and minimum-funding rules out of the apps and into Rust.
User story
As a wallet user, I want the wallet to refuse an identity it can't create before it locks my DASH, so that I'm not left with a stuck registration or an identity that can't sign the actions I need.
Scenario
Base flow
Actual behavior
Expected behavior
Detailed discussion
Layout. Each entry in the wallet’s two default layouts is an ECDSA_SECP256K1 key whose ID equals its DIP-9 key index.
No AUTHENTICATION/MEDIUM key. DIP-11 asks for an authentication key at every level, MEDIUM included. We leave MEDIUM out:
max_public_keys_in_creationis 6 in every protocol version, and the DashPay layout already uses all six slots. A MEDIUM key would have made 7, which consensus refuses.The constant
REQUIRED_AUTHENTICATION_LEVELScarries a comment explaining this.Pre-flight.
IdentityWallet::identity_creation_keys(async) builds the validated key set, and the existing identity-creation paths take that validated set. The default check requires:For caller-built keys,
register_identity_with_funding_and_custom_keystakes the raw key map and aCreationKeyPolicy. The wallet preserves that policy through pre-flight, protocol-version refresh and revalidation at the start of the operation. The default requires every authentication level in the wallet layout and more than 15 minutes of remaining validity for any expiring key. A custom policy can waive CRITICAL, HIGH, or both and set a different margin. With a zero margin, an expiring key passes the expiry check if it is still valid. Rust exposes the default (900 seconds) asCreationKeyPolicy::DEFAULT_EXPIRY_MARGIN_SECS.It then checks that the key formats are active at the wallet SDK's current protocol version (dpp's
active_version_range_for_keys_in_creation, made public for this) and runs dpp'svalidate_identity_public_keys_structureat that version, so no consensus rule is copied here and a caller cannot choose another version. An unpinned SDK starts mainnet and testnet at protocol version 14 by default. When a format such as ML-DSA-65 is inactive at the SDK’s current version, the wallet attempts a proved version refresh and validates again. A disabled or unsuccessful proof lookup leaves the wallet validating at its current version. A pinned SDK keeps its configured version.Every creation write validates the key set again before funding or signing, at an operation version pinned with the new
Sdk::clone_with_pinned_version. Validation, fees and submission share the pinned version, so a proved response arriving mid-operation cannot change the rules between pre-flight and broadcast. The copy keeps its own operation version and shares transport, nonce caches and verified version observations with the source SDK. Key types stay free, so caller-built HASH160 sets pass, provided their data is a 20-byte hash where that version requires it. Secp256k1 key data is left to proof of possession.The wallet returns
ExpiredKeyfor a key that has already expired andExpiresWithinMarginwhen a still-valid key expires at or before the policy cutoff. FFI explicitly maps eachIdentityCreationKeysErrorvariant. When validation cannot run,ValidationUnavailablemaps toErrorUnknown. Every key-set refusal maps toErrorInvalidParameter, including refusals from shielded worker revalidation, which carryNotSent.StructureRefusednames the consensus reasons.Size limit (both funded registration entry points). The wallet measures a serialized IdentityCreate with DPP's possession-signature rule, the required signature sizes and the widest ChainLock proof encoding before resolving the asset lock. The estimate is an upper bound and can exceed the actual size by a few bytes. The wallet refuses a key set at pre-flight if the estimate exceeds the limit, including borderline cases. It applies the same versioned size check as SDK broadcast. Registrations that fit with ChainLock can still fall back to it if the InstantSend proof makes them too large.
Funding floor (both funded registration entry points). The minimum is
calculate_min_required_feefor the actual keys:FromExistingAssetLock, both resume and invitation-voucher reclaim): refused when the persisted amount is below the minimum, before the finality wait or any signing.AssetLockNotTrackedif the amount lookup finds no tracked lock. Retry after synchronization has restored the lock. The amount is checked on the new attempt.claim_invitationuses its own funding flow.App-facing minimums.
identity_creation_min_funding_duffsandidentity_creation_from_addresses_min_feesreturn the minimum for each layout, so #5647 can remove fee constants from the apps.Consensus check of the layouts. A test runs every layout through dpp's
validate_identity_public_keys_structure, which drive-abci applies to asset-lock, address-funded and shielded identity creates. The same test runs the address-fundedIdentityCreateFromAddressesTransition::validate_structure. Both run atPlatformVersion::latest(). A control case proves one key over the limit fails withMaxIdentityPublicKeyLimitReached.FFI in this PR.
platform-wallet-ffiruns pre-flight on its worker runtime after looking up the wallet handle, before calling either signer. C functions available before this PR keep their signatures. The newplatform_wallet_register_identity_with_custom_keys_signerexport takes aCreationKeyPolicyFFIpointer containing the level-byte array, its count and the expiry margin in seconds. UsePLATFORM_WALLET_DEFAULT_CREATION_KEY_EXPIRY_MARGIN_SECSfor the default (900 seconds). Pass a null outpoint for wallet-balance funding or a tracked registration outpoint to resume. Callers release the identity handle returned by either funded C function withmanaged_identity_destroy. An unknown handle returnsNotFoundahead of a Rust key-set refusal. On the shielded path an unknown wallet or a manager without shielded configured returnsErrorWalletOperationfirst. The app-facing layout and minimum queries are in #5647. That PR needs the async constructor, the policy argument where it calls the custom endpoint, and the typed creation-key errors.rs-platform-walletmakes the pre-flight and funding decisions. The bindings marshal arguments and return the resulting errors.Breaking Changes
register_identity_with_fundingandclaim_invitationreplace their raw key maps withIdentityCreationKeys.register_from_addressesreplaces its&Identityparameter with the same validated set.PlatformWallet::shielded_identity_create_from_pooltakes that set in place of its vector of key pairs. Dash Evo Tool must migrate on its next Platform bump. Its default HASH160 key set can usewallet.identity().identity_creation_keys(keys).await. Its advanced mode can call the custom funded entry point with aCreationKeyPolicythat lists the authentication levels the user omitted. The wallet refuses a set missing a required level that the policy did not waive.IdentityWallet::identity_creation_keysconstructor.IdentityCreationKeysErrortype includesExpiredKeyfor an expired key andExpiresWithinMarginfor a still-valid key with too little time left. Other variants includeInactiveKeyFormat,StructureRefused,ValidationUnavailableandCannotWaiveAuthenticationLevel. Exhaustive matches must handleExpiresWithinMarginwhen updating from an earlier PR head.identity_create_from_shielded_poolis now crate-private. Migrate toPlatformWallet::shielded_identity_create_from_pooland pass the validated key set.PlatformWalletError::IdentityCreationKeysvariant.CreationKeyPolicy. Its C counterpart takes aCreationKeyPolicyFFIpointer. Other additive APIs includedash_sdk::Sdk::clone_with_pinned_versionand DPP'sactive_version_range_for_keys_in_creation.ErrorInvalidParameter). Shielded worker key refusals also returnErrorInvalidParameterwithNotSent. Both funded paths refuse an asset lock below the minimum for its keys before signing (ErrorAssetLockInsufficientFunds).Testing
New Rust tests cover:
Sdk::clone_with_pinned_versionkeeps its version while the source SDK ratchets;register_identity_with_fundingfor fresh and resumed funding, before any signer is reached;should_pass_dpp_creation_structure_validation_for_every_layout);ErrorInvalidParameterandNotSentfor a creation-key refusal.Verification:
cargo clippy -p platform-wallet -p platform-wallet-ffi -p rs-unified-sdk-jni --all-targets --features platform-wallet-ffi/shielded -- -D warningspassed on an earlier revision.cargo fmt --allandcargo clippy -p platform-wallet -p platform-wallet-ffi --all-targets --all-features -- -D warningspassed on the updated wallet and FFI code.cargo nextest run -p platform-wallet -p platform-wallet-ffi --all-features --no-fail-fastpassed 4,006 tests and skipped 8. The shielded result and expiry-message regressions failed before the fix and passed afterward.PLATFORM_WALLET_DEFAULT_CREATION_KEY_EXPIRY_MARGIN_SECSwith the value 900.Checklist
🤖 Generated with Claude Code
🤖 Co-authored by Claudius the Magnificent AI Agent
PR Hygiene ·
abbcf4edpp(packages/rs-dpp/src/identity/identity_public_key/key_type.rs,packages/rs-dpp/src/state_transition/mod.rs) — QuantumExplorer or shumkovrs-platform-wallet-ffi(packages/rs-platform-wallet-ffi/src/error.rs,packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs,packages/rs-platform-wallet-ffi/src/identity_registration_with_signer.rsand 3 more) — HashEngineering or ZocoLini or llbartekll or romchornyirs-platform-wallet(packages/rs-platform-wallet/src/error.rs,packages/rs-platform-wallet/src/lib.rs,packages/rs-platform-wallet/src/test_support.rsand 14 more) — HashEngineering or ZocoLini or llbartekll or romchornyirust-sdk(packages/rs-sdk/src/sdk.rs) — lklimek or shumkovWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit