polkadart icon indicating copy to clipboard operation
polkadart copied to clipboard

Couldn't get keypair from public key

Open AlaaElattar opened this issue 1 year ago • 1 comments

  • There should be method to get keypair of any public key.
  • The existing one requires that the one i search for to be already initialized on my keyring.
  • I expect it to be something like this
    const keyring = new Keyring({ type: sigType });
    signer = keyring.addFromAddress(this.twin.accountId);

  • I need to verify a signature with knowing only the address or public key.

AlaaElattar avatar Jun 23 '24 13:06 AlaaElattar

I don't think it makes sense to make a KeyPair without a private key. I mean, it is a pair. But indeed we are missing a method to verify signatures from other address. I will make a PR adding a signatureVerify function just like the following: https://github.com/polkadot-js/common/blob/master/packages/util-crypto/src/signature/verify.spec.ts

leonardocustodio avatar Jun 27 '24 22:06 leonardocustodio