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

feat: key details #21

Merged
merged 15 commits into from
May 13, 2024
Merged

feat: key details #21

merged 15 commits into from
May 13, 2024

Conversation

guru-web3
Copy link
Contributor

No description provided.

}

public func getKeyDetails() async throws -> MpcKeyDetails {
guard let finalKeyDetails = try self.tkey?.get_key_details() else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that we want to mix details of the metadata key with the signing key, these are different things?

Consider separate methods. Also, reconstructing the key would return KeyDetails by default, so why the need to fetch it again?

Copy link
Contributor Author

@guru-web3 guru-web3 May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in mpc web we have the same logic to get tss pub and attach
for ref
`
public getKeyDetails(): MPCKeyDetails {
this.checkReady();
const tkeyDetails = this.tKey.getKeyDetails();
const tssPubKey = this.state.tssPubKey ? Point.fromBufferSEC1(this.state.tssPubKey).toTkeyPoint() : undefined;

const factors = this.tKey.metadata.factorPubs ? this.tKey.metadata.factorPubs[this.tKey.tssTag] : [];
const keyDetails: MPCKeyDetails = {
  // use tkey's for now
  requiredFactors: tkeyDetails.requiredShares,
  threshold: tkeyDetails.threshold,
  totalFactors: factors.length + 1,
  shareDescriptions: this.tKey.getMetadata().getShareDescription(),
  metadataPubKey: tkeyDetails.pubKey,
  tssPubKey,
};
  return keyDetails;
}

`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I get that. It doesn't answer the original questions though. This may also need to be changed there depending on the answers here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let get it match with the web version first. (v2)
we can file pr and discuss if the changes is needed for mpc core kit web ( especially v3 that is in working)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ieow Ok, approve it if you're happy with it. Think we'll have to come back it change it though, however not blocking this PR from going in.

Comment on lines +159 to +160
let tssTag = try TssModule.get_tss_tag(threshold_key: self.tkey!)
let tssPubKey = try await TssModule.get_tss_pub_key(threshold_key: self.tkey!, tss_tag: tssTag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need the tss index.

Consider returning this as a sub struct of:

tss_tag
tss_index
verifier
verifier_id

However what you return here will depend on what you want to use it for, is it just for display?

Copy link
Contributor

@metalurgical metalurgical May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since multiple tss-tag can exist, this struct will also not be singular but a sub item in an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following the same return type as web version let me know @ieow we can implement this too in web first?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would not encourage client to use the tags as we now have soft-nonce index for the multi-wallet.

@guru-web3 guru-web3 marked this pull request as ready for review May 13, 2024 04:15
@guru-web3 guru-web3 changed the base branch from main to fix/get-tss-pub May 13, 2024 04:15
@ieow ieow changed the base branch from fix/get-tss-pub to main May 13, 2024 10:42
Copy link
Collaborator

@ieow ieow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ieow ieow merged commit f77f77f into main May 13, 2024
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

Successfully merging this pull request may close these issues.

3 participants