feat(signer,sdk): sign DotNS identity via explicit legacy signer#214
Closed
ReinhardHatko wants to merge 1 commit into
Closed
feat(signer,sdk): sign DotNS identity via explicit legacy signer#214ReinhardHatko wants to merge 1 commit into
ReinhardHatko wants to merge 1 commit into
Conversation
`signMessageWithDotNsIdentity` required the account that owns the DotNS / People username to appear in the connected-accounts list. On Proof-of-Personhood / product-account hosts (e.g. Polkadot Desktop) the host exposes only a per-dapp product account and never *enumerates* the user's identity account — so the owner resolved from the name was never found, and signing failed with "no connected wallet account matches that AccountId." Probing Polkadot Desktop showed such hosts still sign with an account when it is named explicitly via `host_sign_raw_with_legacy_account`, even though they withhold it from `getLegacyAccounts()` enumeration. Route through that path: - HostProvider.signRawWithLegacyAccount(publicKey, data), built on a shared `legacySignerFor(publicKey)` helper now also used by `mapAccounts`. - SignerManager.signRawWithLegacyAccount(publicKey, data) (delegates). - signMessageWithDotNsIdentity prefers an already-connected account (no extra prompt) and otherwise signs via the explicit legacy signer, instead of throwing when the owner isn't enumerable.
mordamax
reviewed
Jun 15, 2026
| throw new Error("Host provider is disconnected"); | ||
| } | ||
| return this.accountsProvider.getLegacyAccountSigner({ | ||
| dotNsIdentifier: "", |
Contributor
Author
There was a problem hiding this comment.
AFAIK yes, to get the legacy account signer you just leave the dotns identifier empty
Member
|
Closing since its been completed in: #212 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #212 (
feat/dotns-identity-signing) — merge that first; this targets its branch.Problem
signMessageWithDotNsIdentityresolves the username → ownerAccountId, then signs by finding that account in the connected-accounts list. On Proof-of-Personhood / product-account hosts (e.g. Polkadot Desktop) the host exposes only a per-dapp product account and never enumerates the user's identity account — so the owner is never found and signing fails with:That makes DotNS-identity signing unusable on exactly the hosts the product targets.
Fix
Probing Polkadot Desktop confirmed these hosts will still sign with an account when it is named explicitly via
host_sign_raw_with_legacy_account, even though they withhold it fromgetLegacyAccounts()enumeration. So:HostProvider.signRawWithLegacyAccount(publicKey, data)— signs with an account named by public key, via a sharedlegacySignerFor(publicKey)helper now also used bymapAccounts(dedupes the legacy-account construction).SignerManager.signRawWithLegacyAccount(publicKey, data)— thin delegation, mirrorsgetUserId/createRingVRFProof.signMessageWithDotNsIdentitynow prefers an already-connected account (no extra prompt) and otherwise signs via the explicit legacy signer, instead of throwing when the owner isn't enumerable.Validation
getLegacyAccounts()enumeration but signs when named explicitly — the case this PR unblocks.tsc --noEmitclean forsigner+sdk; existing signer suite passes (102/102).🤖 Generated with Claude Code