Web3Auth / mpc-core-kit

16 stars 5 forks source link

[v3] Can't access the SEC1 and ed25519 PubKey during read mode #159

Open AyushBherwani1998 opened 5 months ago

AyushBherwani1998 commented 5 months ago

Description

Can't access the SEC1 and ed25519 PubKey when the requiredFactors are greater than 0, ideally we should allow them to read the pub key.

metalurgical commented 5 months ago

This test passed, which shouldn't be reconstructing the key and should achieve the same result.

 await t.test("#Get TSS Public Key", async function () {
      const coreKitInstance = newCoreKitInstance();

      await coreKitInstance.init({ handleRedirectResult: false });

      checkPubKey = coreKitInstance.getTssPublicKey();
 });

Could you provide more information about how to reproduce this?

AyushBherwani1998 commented 5 months ago

I tried to access the getTssPublicKey when coreKitInstance.status was REQUIRED_SHARE which would be ideal case if someone had MFA enabled, and they did social login.

You can try to access the pub key here: https://github.com/Web3Auth/mpc-core-kit/blob/fad1b51eddd254c9f1330fbf8fb2b2bb92c5a76c/demo/redirect-flow-example/src/App.tsx#L114

I think in the test the MFA is not enabled, and it might be using default hased factor?

metalurgical commented 4 months ago

Have double checked this, in order to get the TSS public key tKey required reconstruction.

Have removed this check here: https://github.com/tkey/tkey/pull/290

Though for the ed25519 public key you might be looking for this method in tKey (doesn't appear to have any requirement on reconstruction), however the seed will obviously remain encrypted)?

    // core.ts
    getEd25519PublicKey()