-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
} | ||
|
||
public func getKeyDetails() async throws -> MpcKeyDetails { | ||
guard let finalKeyDetails = try self.tkey?.get_key_details() else { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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;
}
`
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.