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

Create Coordinator CLI #59

Merged
merged 7 commits into from
Jul 20, 2023
Merged

Create Coordinator CLI #59

merged 7 commits into from
Jul 20, 2023

Conversation

natalieesk
Copy link
Contributor

This closes #48

Copy link
Contributor

@conradoplg conradoplg 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 great, thanks! Just a couple of improvements to make


input.read_line(&mut identifier_input).unwrap();

let id_value = serde_json::from_str(&identifier_input).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case the user would need to type with quotes, e.g. "2a00000000000000000000000000000000000000000000000000000000000000" which is a bit weird IMO. My suggestion is to use the read_identifier function used in the DKG demo

pub fn read_identifier(input: &mut impl BufRead) -> Result<Identifier, Box<dyn std::error::Error>> {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 9f2c617

Comment on lines 42 to 43
writeln!(logger, "The number of signers: ")?;

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems out of place?

Suggested change
writeln!(logger, "The number of signers: ")?;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, I've deleted it in a later issue but I'll remove it in this PR as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 9f2c617

Comment on lines 32 to 38
writeln!(
logger,
"The number of signers: {}",
participants.participants.len()
)?;
println!("{}", participants.participants.len());

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 needed?

Suggested change
writeln!(
logger,
"The number of signers: {}",
participants.participants.len()
)?;
println!("{}", participants.participants.len());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not. I'll remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 9f2c617

Copy link
Contributor

Choose a reason for hiding this comment

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

These values are not working, I did a successful run using the values from the test, log as follows. So you probably just need to copy those values over

=== STEP 1: CHOOSE PARTICIPANTS ===

Paste the JSON public key package: 
{"signer_pubkeys":{"0300000000000000000000000000000000000000000000000000000000000000":"2cff4148a2f965801fb1f25f1d2a4e5df2f75b3a57cd06f30471c2c774419a41","0100000000000000000000000000000000000000000000000000000000000000":"fc2c9b8e335c132d9ebe0403c9317aac480bbbf8cbdb1bc3730bb68eb60dadf9"},"group_public":"15d21ccd7ee42959562fc8aa63224c8851fb3ec85a3faf66040d380fb9738673","ciphersuite":"FROST(Ed25519, SHA-512)"}
The number of participants: 
2
Identifier for participant 1 (hex encoded):
"0100000000000000000000000000000000000000000000000000000000000000"
Identifier for participant 2 (hex encoded):
"0300000000000000000000000000000000000000000000000000000000000000"
Selected participants:
"0100000000000000000000000000000000000000000000000000000000000000"
"0300000000000000000000000000000000000000000000000000000000000000"
=== STEP 2: CHOOSE MESSAGE AND GENERATE COMMITMENT PACKAGE ===

The message to be signed
74657374
The number of signers: 
Please enter JSON encoded commitments for participant Identifier(
    "0100000000000000000000000000000000000000000000000000000000000000",
):
{"hiding":"5078f5c6d679654bb88a8887242d49cc21a553ed26caed4d52570c6656fb9b92","binding":"936b660d3008d8298b0a7220a327a0813ffedd9d07604bdc73d7cffef63c0da0","ciphersuite":"FROST(Ed25519, SHA-512)"}
Please enter JSON encoded commitments for participant Identifier(
    "0300000000000000000000000000000000000000000000000000000000000000",
):
{"hiding":"91c2469b501fe5af8493f9ae77c8f57999460af317f2d9f2d4378ae0e665860e","binding":"c225618accff2266a45d87dc3219b04c774ca26c8629c4fa483e7e87da820007","ciphersuite":"FROST(Ed25519, SHA-512)"}
Signing Package: {"signing_commitments":{"0100000000000000000000000000000000000000000000000000000000000000":{"hiding":"5078f5c6d679654bb88a8887242d49cc21a553ed26caed4d52570c6656fb9b92","binding":"936b660d3008d8298b0a7220a327a0813ffedd9d07604bdc73d7cffef63c0da0","ciphersuite":"FROST(Ed25519, SHA-512)"},"0300000000000000000000000000000000000000000000000000000000000000":{"hiding":"91c2469b501fe5af8493f9ae77c8f57999460af317f2d9f2d4378ae0e665860e","binding":"c225618accff2266a45d87dc3219b04c774ca26c8629c4fa483e7e87da820007","ciphersuite":"FROST(Ed25519, SHA-512)"}},"message":"74657374","ciphersuite":"FROST(Ed25519, SHA-512)"}
=== STEP 3: BUILD GROUP SIGNATURE ===

The number of signers: 2
2
Please enter JSON encoded signatures for participant Identifier("0100000000000000000000000000000000000000000000000000000000000000"):
{"share":"b97409beff18861f0959530db091a64b812e3fefaa87e1e3d2c039f11d96cc09","ciphersuite":"FROST(Ed25519, SHA-512)"}
Please enter JSON encoded signatures for participant Identifier("0300000000000000000000000000000000000000000000000000000000000000"):
{"share":"9816a14e7cdecfcb240976f564cf98c5640e596b6ddf270379efbef4e9f7db0b","ciphersuite":"FROST(Ed25519, SHA-512)"}
Group signature: "72c948a63797c693e8e978fdb703a1f5a7590472a539da13b71dd6c2b8c1b2a664b7b4af6194439357c5d15f366760fce53c985a186709e74bb0f8e5078ea805"
=== END ===

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I didn't update the message in the test values. Ok, thanks. I'll update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 9f2c617

@ZcashFoundation ZcashFoundation deleted a comment from conradoplg Jul 20, 2023
Fix test values
Improve identifier input so it doesn't need to be in quotes
Remove unecessary text
@conradoplg conradoplg merged commit 58abe8d into main Jul 20, 2023
6 checks passed
@conradoplg conradoplg deleted the coordinator_cli_48 branch July 20, 2023 14:13
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 Signature generation: Coordinator CLI
2 participants