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

WIP: DKG demo #36

Merged
merged 5 commits into from
Jun 29, 2023
Merged

WIP: DKG demo #36

merged 5 commits into from
Jun 29, 2023

Conversation

conradoplg
Copy link
Contributor

Creates a demo for the DKG.

It's a WIP because it's missing tests. They will be a bit complex but I'll give it a shot soon.

However I did some refactorings that may be useful for other demos:

  • Use serde to read and print structs. This saves a lot of code!
  • Use impl std::io::Write and writeln! for printing. This allows using the format syntax, without calling format! explicitly, allows removing the custom Logger trait, and should work for printing to terminal or to a string for testing.
  • Use Box<dyn std::error::Error> for return types. This allows returning mostly any type of error, including FROST error or our own errors.
  • Use eyre to return our own errors instead trying to find matching errors in the library.

dkg/src/cli.rs Outdated Show resolved Hide resolved
dkg/src/inputs.rs Outdated Show resolved Hide resolved
dkg/src/inputs.rs Outdated Show resolved Hide resolved
dkg/src/inputs.rs Outdated Show resolved Hide resolved
dkg/src/inputs.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@natalieesk natalieesk left a comment

Choose a reason for hiding this comment

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

The program is erroring at the moment. I've left a comment about why I think this is happening. Other than that just some typos and questions I have about the error handling.

@@ -0,0 +1,16 @@
[package]
name = "dkg"
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance this would get published? Any better names perhaps?

Copy link
Contributor

@natalieesk natalieesk Jun 28, 2023

Choose a reason for hiding this comment

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

We could rename them to something like frost-project-demo or something like that. But this won't get published so I don't think it's necessary.

Copy link
Contributor

@natalieesk natalieesk left a comment

Choose a reason for hiding this comment

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

Looks good!

@natalieesk natalieesk marked this pull request as ready for review June 28, 2023 08:19
@natalieesk natalieesk marked this pull request as draft June 28, 2023 08:20
@conradoplg conradoplg marked this pull request as ready for review June 28, 2023 16:57
@conradoplg
Copy link
Contributor Author

If you'd like feel free to merge this and I can work on tests in a separate PR

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.

Demo for Distributed Key Generation (DKG)
3 participants