-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
e6517ef
to
dacbc86
Compare
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.
This is great, thanks! Just a couple of improvements to make
coordinator/src/step_1.rs
Outdated
|
||
input.read_line(&mut identifier_input).unwrap(); | ||
|
||
let id_value = serde_json::from_str(&identifier_input).unwrap(); |
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 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
frost-zcash-demo/dkg/src/inputs.rs
Line 88 in 5f65160
pub fn read_identifier(input: &mut impl BufRead) -> Result<Identifier, Box<dyn std::error::Error>> { |
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.
Done in 9f2c617
coordinator/src/step_2.rs
Outdated
writeln!(logger, "The number of signers: ")?; | ||
|
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.
This seems out of place?
writeln!(logger, "The number of signers: ")?; |
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.
Oh yes, I've deleted it in a later issue but I'll remove it in this PR as well
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.
Done in 9f2c617
coordinator/src/step_3.rs
Outdated
writeln!( | ||
logger, | ||
"The number of signers: {}", | ||
participants.participants.len() | ||
)?; | ||
println!("{}", participants.participants.len()); | ||
|
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.
Is this needed?
writeln!( | |
logger, | |
"The number of signers: {}", | |
participants.participants.len() | |
)?; | |
println!("{}", participants.participants.len()); |
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.
Probably not. I'll remove
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.
Done in 9f2c617
coordinator/src/tests/values.md
Outdated
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.
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 ===
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.
Ah I didn't update the message in the test values. Ok, thanks. I'll update
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.
Done in 9f2c617
Fix test values Improve identifier input so it doesn't need to be in quotes Remove unecessary text
This closes #48