Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few Developer Experience Enhancements #178

Open
yashovardhan opened this issue Sep 30, 2024 · 2 comments
Open

Few Developer Experience Enhancements #178

yashovardhan opened this issue Sep 30, 2024 · 2 comments

Comments

@yashovardhan
Copy link
Member

yashovardhan commented Sep 30, 2024

A couple of minor changes that will help our MPC Core Kit Integration:

  1. Can we expose Point & secp256k1 from MPC Core Kit directly instead of fetching it from @tkey/common-types? It feels like an unnecessary addition just for using deleteShare function.

  2. Currently the WEB3AUTH_NETWORK object is like this

    export declare const WEB3AUTH_NETWORK: {
        readonly MAINNET: "sapphire_mainnet";
        readonly DEVNET: "sapphire_devnet";
    };
    

    This is inconsistent with our other SDKs and causes confusion. This was done earlier when sapphire was new in order to make sure people understand MPC only works with Sapphire networks. However it is quite well documented and the dashboard flow makes sure people make sapphire projects. In order to be consistent can we change it to:

    export declare const WEB3AUTH_NETWORK: {
        readonly SAPPHIRE_MAINNET: "sapphire_mainnet";
        readonly SAPPHIRE_DEVNET: "sapphire_devnet";
    };
    
  3. The deleteShare function currently has a lot of extra steps currently

    let factorPub: string | undefined;
        for (const [key, value] of Object.entries(coreKitInstance.getKeyDetails().shareDescriptions)) {
          if (value.length > 0) {
            const parsedData = JSON.parse(value[0]);
            if (parsedData.module === FactorKeyTypeShareDescription.SocialShare) {
              factorPub = key;
            }
          }
        }
    const pub = Point.fromSEC1(secp256k1, factorPub);
    await coreKitInstance.deleteFactor(pub);

    Can we make the process of grabbing a particular share with share description easy? Can getting a point be shifting directly within the deleteFactor function of the SDK? I'm thinking of something like:

    const factorPub = findFactorByShareDescription(FactorKeyTypeShareDescription.SocialShare) // should return an array of matching shares
    await coreKitInstance.deleteFactor(pub[0]);
  4. Additionally, can we have a listFactors function that grabs all the factors from share description and returns an object containing all the available shares?

@ieow
Copy link
Contributor

ieow commented Sep 30, 2024

@matthiasgeihs

@matthiasgeihs
Copy link
Contributor

1.) Sure, nothing against this from my POV. Not sure if @himanshuchawla009 has an opinion?

2.) no problem with that either.

3.) sure, i think we can add such a function.

4.) you mean the secret shares? or the corresponding public keys? isn't that similar / the same as above? (maybe i don't get it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants