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

feat: Update sign tool v2 using new catalyst-voting crate | NPG-000 #718

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 144 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/sign/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ chain-impl-mockchain = { path = "../chain-libs/chain-impl-mockchain" ,features=
chain-ser = { path = "../chain-libs/chain-ser" }
chain-storage = { path = "../chain-libs/chain-storage" }

catalyst-voting = { git = "https://github.com/input-output-hk/catalyst-libs.git", rev = "d0b5784208abb7c4f2eddf8237099368e070620a" }


hex = "0.4"
cryptoxide = "0.4.2"
Expand All @@ -32,6 +34,6 @@ serde_json = "1.0"
serde_yaml = "0.8.17"
rand = "0.8.3"
bech32 = "0.8"
rand_core = { version = "0.5.1", default-features = false }
rand_core = { version = "0.5.1", default-features = false, features = ["getrandom"] }
ed25519-dalek = "1.0.1"
reqwest = { version = "*", default_features = false, features = [ "blocking","json", "rustls-tls" ] }
21 changes: 19 additions & 2 deletions src/sign/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Generates vote fragments and signs them accordingly
cargo build --release -p sign
```

*Generate raw vote fragment in byte representation*
*Generate raw vote fragment in byte representation using original jorm implementation*

```bash

Expand All @@ -35,6 +35,23 @@ EPOCH=0
SLOT=0
CHOICE=1

./target/release/sign --election-pub-key $ELECTION_PUB_KEY --private-key $ALICE_SK --public-key $ALICE_PK --proposal $PROPOSAL --vote-plan-id $VOTE_PLAN_ID --epoch $EPOCH --slot $SLOT --choice $CHOICE
./target/release/sign v1 --election-pub-key $ELECTION_PUB_KEY --private-key $ALICE_SK --public-key $ALICE_PK --proposal $PROPOSAL --vote-plan-id $VOTE_PLAN_ID --epoch $EPOCH --slot $SLOT --choice $CHOICE

```

*Generate raw vote fragment in byte representation using original `catalyst-voting` crate*

```bash

ELECTION_PUB_KEY=ristretto255_votepk1ppxnuxrqa4728evnp2ues000uvwvwtxmtf77ejc29lknjuqqu44s4cfmja
ALICE_SK=56e367979579e2ce27fbd305892b0706b7dede999a534a864a7430a5c6aefd3c
ALICE_PK=ea084d2d80ed0ab681333d934efc56df3868d13d46a2de3b7f27f40b62e5344d
PROPOSAL=5
VOTE_PLAN_ID=36ad42885189a0ac3438cdb57bc8ac7f6542e05a59d1f2e4d1d38194c9d4ac7b
EPOCH=0
SLOT=0
CHOICE=1

./target/release/sign v2 --election-pub-key $ELECTION_PUB_KEY --private-key $ALICE_SK --public-key $ALICE_PK --proposal $PROPOSAL --vote-plan-id $VOTE_PLAN_ID --epoch $EPOCH --slot $SLOT --choice $CHOICE

```
Loading
Loading