Skip to content

Conversation

@ieow
Copy link
Contributor

@ieow ieow commented Jan 22, 2025

No description provided.

Copy link
Contributor

@matthiasgeihs matthiasgeihs left a comment

Choose a reason for hiding this comment

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

some comments

Comment on lines 170 to 171
secp256k1: TssMetadata;
ed25519: TssMetadata;
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this a Record of KeyType and TssMetadata instead of fixing the entries here?

@ieow ieow changed the title feat: initial commit for multicurve feat: support multicurve Feb 12, 2025
@ieow ieow marked this pull request as ready for review February 12, 2025 02:45
@matthiasgeihs matthiasgeihs self-requested a review February 24, 2025 10:10
serverEncs: EncryptedMessage[];
};

export interface ITssMetadata {
Copy link

@lwin-kyaw lwin-kyaw Feb 24, 2025

Choose a reason for hiding this comment

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

I think it would be good if we can provide some comments for the interface fields

scopedStore,
nonce,
tss,
version,

Choose a reason for hiding this comment

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

Should we validate the value of version here, in case user provides values rather than "1.0.0" or "0.0.1"?

if (tss[tsstag]) {
metadata.tss[tsstag] = {};
Object.keys(tss[tsstag]).forEach((tssKeyType) => {
metadata.tss[tsstag][tssKeyType] = TssMetadata.fromJSON(tss[tsstag][tssKeyType]);

Choose a reason for hiding this comment

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

Should we do further validations here too?
The value tss is any as specified in type StringifiedType.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should check whether tssKeyType is a valid key type, right?

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor Author

@ieow ieow Feb 25, 2025

Choose a reason for hiding this comment

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

Not possible, as legacy tkey tss metadata might not have tssKeyType defined
It is possible for new format.
will try to add keytype for new format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added checking of instance of object and check for tssKeyTypes

tssNonces,
factorPubs,
factorEncs,
} = value;

Choose a reason for hiding this comment

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

We should do some validations here, too.
The input is { [key: string] : any } type

Copy link
Contributor

@matthiasgeihs matthiasgeihs left a comment

Choose a reason for hiding this comment

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

this is a big PR with a lot of changes.
many well done.
however, there is some things that look unfinished.
there is a lot of seemingly leftover commented out code and todo comments.
moreover, the package.json points to a local torus.js dependency.
these things need to be tidied up before this can be merged.
there is also valuable comments by others that need to be addressed.

PS:
for the future, i'd suggest keeping a PR in draft as long as local dependencies are used, so that it's clear that this is not ready to be merged.


static fromJSON(value: StringifiedType): AuthMetadata {
const { data, sig } = value;
// need to inject legacyMetadata flag
Copy link
Contributor

Choose a reason for hiding this comment

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

is this comment a TODO? or can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not a todo.
It remind that for tkeyTss deserialization, legacyMetadata Flag needed to be injected as we are trying to force upgrade the metadata format to v1.0.0 from v0.0.1 when the legacyMetadataFlag is false

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 what this means. where do you inject the flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

4 participants