Skip to content

Commit

Permalink
docs: update Ywallet demo section for phase 2 (#652)
Browse files Browse the repository at this point in the history
* docs: update Ywallet demo section for phase 2

* fix unrelated SecretPackage -> KeyPackage

* Update book/src/zcash/ywallet-demo.md
  • Loading branch information
conradoplg authored May 30, 2024
1 parent 3ebe7a1 commit 96f1144
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 37 deletions.
2 changes: 1 addition & 1 deletion book/src/tutorial/trusted-dealer.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ to generate signatures.
```

```admonish danger
The `SecretPackage` contents must be stored securely. For example:
The `KeyPackage` contents must be stored securely. For example:
- Make sure other users in the system can't read it;
- If possible, use the OS secure storage such that the package
Expand Down
61 changes: 25 additions & 36 deletions book/src/zcash/ywallet-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,71 +161,60 @@ When prompted, paste the UFVK generated previously.
The program will print a SIGHASH and a Randomizer.

Now you will need to simulate two participants and a Coordinator to sign the
transaction. It's probably easier to open three terminals.
transaction, and the FROST server that handles communications between them.
It's probably easier to open four terminals.

In the first one, the Coordinator, run (in the same folder where key
generation was run):
In the first one, the server, run (in the same folder where key generation was
run):

```
cargo run --bin coordinator --features redpallas -- --cli
RUST_LOG=debug cargo run --bin server --features redpallas --
```

In the second one, the Coordinator, run (in the same folder where key generation
was run):

```
cargo run --bin coordinator --features redpallas -- --http -r -
```

And then:

- It should read the public key package from `public-key-package.json`.
- Type `2` for the number of participants.
- Paste the identifier of the first participant, you can see it in
`key-package-1.json`. If you used trusted dealer key generation, it will be
`0100000000000000000000000000000000000000000000000000000000000000`.
- Copy the session ID that is printed.


Create a new terminal, for participant 1, and run:
In the third terminal, Participant 1, run the following, replacing
`<SESSION_ID>` with the session ID you have just copied:

```
cargo run --bin participant --features redpallas -- --cli --key-package key-package-1.json
cargo run --bin participant --features redpallas -- --cli --key-package key-package-1.json -s <SESSION_ID>
```

And then:

- Copy the SigningCommitments line and paste into the Coordinator CLI.

Go back to the coordinator and:

- Paste the second identifier, e.g.
`0200000000000000000000000000000000000000000000000000000000000000`.

Create a new terminal, for participant 2, and run:
In the fourth terminal, for Participant 2, run the following, again replacing
the session ID:

```
cargo run --bin participant --features redpallas -- --cli --key-package key-package-2.json
cargo run --bin participant --features redpallas -- --cli --key-package key-package-2.json -s <SESSION_ID>
```

And then:
Go back to the Coordinator CLI:

- Copy the SigningCommitments line and paste into the Coordinator CLI.
- When prompted for the message to be signed, paste the SIGHASH printed by the
signer above (just the hex value, e.g.
``4d065453cfa4cfb4f98dbc9cff60c4a3904ed91c523b8ef8d67d28bea7f12ea3``).

You should be at the Coordinator CLI. Paste the Randomizer generated by the
signer before and copy the Signing Package line that it was printed by the
Coordinator CLI before the Randomizer prompt.
- When prompted for the randomizer, paste the randomizer printed by the signer
above (again just the hex value)

```admonish warning
If you prefer to pass the randomizer as a file by using the `--randomizer`
argument, you will need to convert it to binary format.
```

Switch to participant 1 and:

- Paste the Signing Package
- Paste the Randomizer printed by the signer before.
- Copy the SignatureShare line and paste it into the Coordinator CLI.

Do the same for participant 2.

You should be at the Coordinator CLI. It has just printed the final
FROST-generated signature. Hurrah! Copy it (just the hex value).
The protocol should run and complete succesfully. You should still be at the
Coordinator CLI. It has just printed the final FROST-generated signature.
Hurrah! Copy it (just the hex value).

Go back to the signer and paste the signature. It will write the raw signed
transaction to the file you specified.
Expand Down

0 comments on commit 96f1144

Please sign in to comment.