Repository navigation
Description
Expected Behavior
IdentityWallet::invitation_claim_status_for_identity reports claimed_by_this_wallet as Some(true) for an invitation identity this wallet's earlier claim created, whatever key type that claim used as its master key, or None (unknown) when the wallet cannot tell. Some(false) should mean "not this wallet's claim".
Current Behavior
The wallet-aware status (added in #5536) derives only the wallet's ECDSA master authentication key at identity_index and labels it ECDSA_SECP256K1 (claimant_master_public_key). It then compares that key with the claimed identity (invitation_claimed_by_this_wallet).
The claim API itself accepts a BLS12_381 master key (key id 0). The shared predicate identity_holds_master_key recognizes ECDSA and BLS keys. So the claim's own preflight would classify a retry correctly as ClaimedByThisWallet. The status path, however, never builds a BLS candidate.
The result: an identity that a BLS-backed claim from this wallet created, and that the wallet has not recorded, has no matching ECDSA master key. The status returns Some(false), which reaches Swift as claimedByThisWallet == false.
Not reachable from any current host. iOS and Android sign through the mnemonic resolver, which only signs ECDSA keys (resolver_supports_key_type). Wallets registered with the manager are external-signable. A BLS-backed claim therefore cannot be signed by these hosts today. It becomes reachable once a host signs identity keys with BLS, or once a resident-key wallet with an in-process BLS signer uses the claim.
Possible Solution
Either:
- Defensive (small): when the claimed identity holds no matching ECDSA master key but does hold a BLS12_381 key at
SecurityLevel::MASTER, returnNone(unknown) instead ofSome(false). The wallet cannot derive that key type here, so it should not claim a definitive "no". Add a regression test for a landed, unrecorded BLS-backed claim. - Complete: derive the wallet's BLS master key at
identity_indexas well (derive_identity_key_bytesalready mapsBLS12_381toKeyDerivationType::BLSfor resident wallets). Compare both candidates; for a resolver-backed wallet this needs a BLS-capable resolver.
Steps to Reproduce (for bugs)
Natural reproduction is not possible with current hosts (see above). In a unit test:
- Build an identity whose only MASTER authentication key is a BLS12_381 key derived from the test wallet at index
n. - Do not record it in the wallet's identity manager.
- Call
invitation_claimed_by_this_wallet(Some(&identity), n, InvitationClaimantKey::Master(&master)). - Observe
Some(false).
Context
Low impact: latent, no user-facing path today. Found by review on #5536 (dashpay/dashwallet-ios#1224, item 8). Related: #5536.
Your Environment
platform feat/invitation-claim-preflight @ 5be60e7cde (base v5.1-dev).
Activity