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

Zcash FROST keygen / sign #65

Merged
merged 80 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
f38a91b
Setup stub
drewstone Jan 29, 2024
7ab5029
Merge branch 'main' into drew/zcashfrost
drewstone Jan 30, 2024
a0245a3
Integrate frost keygen and sign
drewstone Jan 31, 2024
fa91973
Clippy, fmt, renaming
drewstone Jan 31, 2024
fbe1d7a
cleanup: remove refresh/rotation, unused imports for test
drewstone Jan 31, 2024
7ff50fb
fix: return err if invalid signature
drewstone Jan 31, 2024
5500f5a
feat: add repair protocol rounds
drewstone Feb 1, 2024
22ef129
fix: use macros to reduce code duplication
drewstone Feb 1, 2024
b2cf48d
Update before removing repair
drewstone Feb 1, 2024
9a9af60
delete: repair logic
drewstone Feb 1, 2024
170450a
Update protocols/zcash-frost/src/protocols/keygen.rs
drewstone Feb 2, 2024
c5bf2ae
fmt
drewstone Feb 2, 2024
e3b25f4
fix: keygen to completion, failing at tangle runtime
drewstone Feb 6, 2024
85d8c03
cleanup: remove printlns
drewstone Feb 6, 2024
5c9a4bc
Update against main tangle
drewstone Feb 7, 2024
cf1b7fc
fix: git link
drewstone Feb 7, 2024
92eb136
Merge main
drewstone Feb 8, 2024
f3a1c12
Merge main
drewstone Feb 8, 2024
f3135c8
Get test running
drewstone Feb 8, 2024
316b524
Keygen test working, sign not working
drewstone Feb 9, 2024
0369386
Cleanup
drewstone Feb 12, 2024
949aa9d
Update readme
drewstone Feb 12, 2024
802ee3b
fix: successful keygen/sign against drew/fix-for-frost
drewstone Feb 14, 2024
6d22dac
add remaining sig schemes, more cleanup
drewstone Feb 14, 2024
b038bba
Fix ed448
drewstone Feb 14, 2024
a37ac65
Cleanup errors
drewstone Feb 14, 2024
de2ae2d
fix: string
drewstone Feb 14, 2024
3ef1e3d
fix: clippy w/ nightly, debug broken schemes
drewstone Feb 15, 2024
12f3970
fix: other protocols
drewstone Feb 15, 2024
827c14a
merge main
drewstone Feb 15, 2024
9266db3
Merge branch 'main' into drew/zcashfrost
drewstone Feb 15, 2024
5fc0f8d
clippy fix
drewstone Feb 15, 2024
e3e5a0a
change all to nightly
drewstone Feb 15, 2024
16d86fe
use nightly-2023-09-28 in CI job
salman01zp Feb 15, 2024
ac15f3e
add target
salman01zp Feb 16, 2024
ac35138
use latest nightly
salman01zp Feb 16, 2024
cc2c097
revert latest nightly
salman01zp Feb 16, 2024
2f74642
Update RolesHandler + push Cargo.lock
salman01zp Feb 17, 2024
367e34d
cargo b -r works
drewstone Feb 17, 2024
ab28b9d
fix dfns bug introduced
drewstone Feb 17, 2024
6edda8d
Fmt
drewstone Feb 19, 2024
584da73
Merge branch 'main' into drew/zcashfrost
drewstone Feb 19, 2024
9e9a2fc
Cargo update
drewstone Feb 19, 2024
66e0d0e
Merge branch 'main' into drew/zcashfrost
drewstone Feb 21, 2024
4e55f2a
Merge branch 'main' into drew/zcashfrost
drewstone Feb 22, 2024
bdcf70e
Update using the new macros
drewstone Feb 23, 2024
85c5a9e
fix: clippy
drewstone Feb 23, 2024
d964506
Merge main
drewstone Feb 23, 2024
687446e
cargo update
drewstone Feb 23, 2024
483c7bd
Merge branch 'main' into drew/zcashfrost
drewstone Feb 23, 2024
10f86ee
Fix tests
drewstone Feb 23, 2024
862cc56
feature: generalize dfns - wip
drewstone Feb 26, 2024
2dd6342
update
drewstone Feb 26, 2024
082dbe0
Dedup code
Feb 26, 2024
2588823
use rust nightly 1.78.0 in pipeline
Feb 26, 2024
2d2a5bc
Cleanup, bump rust version
Feb 26, 2024
faba669
revert toolchain
Feb 26, 2024
07df94b
Merge branch 'drew/dfns-generalize' of https://github.com/webb-tools/…
Feb 26, 2024
35f383d
merge branch drew/dfns-generalize
Feb 26, 2024
8574f19
Add spawn_blocking around blocking task
Feb 27, 2024
8128513
Refactor channels (merge code)
Feb 27, 2024
b2d75ee
Pull in main
Feb 27, 2024
49f99f8
Update JobsApi functions
Feb 27, 2024
459bd27
Update signing to generalize curves
drewstone Feb 27, 2024
428962c
Get zcash tests working
Feb 28, 2024
796253c
Merge branch 'drew/zcashfrost' of https://github.com/webb-tools/gadge…
Feb 28, 2024
691f9be
pull in origin/HEAD
Feb 28, 2024
cbbd250
Update README.md
drewstone Feb 28, 2024
9a3b572
Update gadget-common/src/utils.rs
drewstone Feb 28, 2024
11c276d
Remove create party refresh and reuse
drewstone Feb 28, 2024
b4fc80f
Get DFNS keygen working
Feb 28, 2024
d51dc72
Refactor DFNS keygen
Feb 28, 2024
7e4f569
Allow generalization of SecurityLevel and Digest
Feb 28, 2024
71231c0
clippy lints
Feb 29, 2024
9bab079
Get signing test passing
Feb 29, 2024
11445c8
Get key refresh test passing
Mar 1, 2024
06225fa
Improve logging
Mar 1, 2024
ca99def
debugging
Mar 1, 2024
b0b6c5b
improve logging
Mar 1, 2024
6c5d900
revert util.rs
Mar 1, 2024
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
475 changes: 435 additions & 40 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"protocols/mp-ecdsa",
"protocols/dfns-cggmp21",
"protocols/zk-saas",
"protocols/zcash-frost",
"protocols/stub",
"test-utils",
"protocol-macros"
Expand All @@ -21,6 +22,7 @@ stub-protocol = { path = "./protocols/stub" }
test-utils = { path = "./test-utils" }
protocol-macros = { path = "./protocol-macros" }
dfns-cggmp21-protocol = { path = "./protocols/dfns-cggmp21" }
zcash-frost-protocol = { path = "./protocols/zcash-frost" }

pallet-jobs-rpc-runtime-api = { git = "https://github.com/webb-tools/tangle" }
pallet-jobs = { git = "https://github.com/webb-tools/tangle" }
Expand All @@ -34,6 +36,17 @@ multi-party-ecdsa = { git = "https://github.com/webb-tools/cggmp-threshold-ecdsa
round-based = { git = "https://github.com/webb-tools/round-based-protocol", features = [] }
curv = { package = "curv-kzen", version = "0.10.0" }
dfns-cggmp21 = { package = "cggmp21", version = "0.1.1", default-features = false }
udigest = { version = "0.1", features = ["std", "derive"]}
frost-core = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-ed25519 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-ed448 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-p256 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-p384 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-redjubjub = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-ristretto255 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-secp256k1 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-rerandomized = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-taproot = { git = "https://github.com/LIT-Protocol/frost.git" }

sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
Expand Down Expand Up @@ -128,3 +141,4 @@ subxt = "0.33.0"
anyhow = "1.0.79"
libsecp256k1 = "0.7.1"
rayon = { version = "1.8.0" }
thiserror = { version = "1.0" }
163 changes: 0 additions & 163 deletions protocols/dfns-cggmp21/src/protocols/state_machine.rs

This file was deleted.

2 changes: 1 addition & 1 deletion protocols/dfns-cggmp21/src/protocols/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(clippy::type_complexity, clippy::too_many_arguments)]
//! When delivering messages to an async protocol, we want o make sure we don't mix up voting and public key gossip messages
//! When delivering messages to an async protocol, we want to make sure we don't mix up voting and public key gossip messages
//! Thus, this file contains a function that takes a channel from the gadget to the async protocol and splits it into two channels
use dfns_cggmp21::round_based::{Incoming, MessageDestination, MessageType, Outgoing, PartyIndex};
use futures::{Stream, StreamExt};
Expand Down
57 changes: 57 additions & 0 deletions protocols/zcash-frost/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[package]
name = "zcash-frost-protocol"
version = "0.1.0"
edition = "2021"

[dependencies]
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "time", "net"] }
gadget-common = { workspace = true }
gadget-core = { workspace = true }
protocol-macros = { workspace = true }
async-trait = { workspace = true }
log = { workspace = true }
curv = { workspace = true }
futures = { workspace = true }
itertools = { workspace = true }
bincode2 = { workspace = true }
round-based = { git = "https://github.com/ZenGo-X/round-based-protocol" }
digest = "0.10"
sha2 = "0.10"
rand_core = "0.6"
rand_chacha = { version = "0.3", default-features = false }
dfns-cggmp21 = { workspace = true }

udigest = { workspace = true }
frost-core = { workspace = true }
frost-ed25519 = { workspace = true }
frost-ed448 = { workspace = true }
frost-p256 = { workspace = true }
frost-p384 = { workspace = true }
frost-redjubjub = { workspace = true }
frost-ristretto255 = { workspace = true }
frost-secp256k1 = { workspace = true }
frost-rerandomized = { workspace = true }
frost-taproot = { workspace = true }

pallet-jobs-rpc-runtime-api = { workspace = true, features = ["std"] }
pallet-jobs = { workspace = true, features = ["std"] }
tangle-primitives = { workspace = true, features = ["std"] }

sp-core = { workspace = true, features = ["std"] }
sp-io = { workspace = true, features = ["std"] }
sp-api = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }
sp-application-crypto = { workspace = true, features = ["std"] }

sc-client-api = { workspace = true }

frame-support = { workspace = true }
parity-scale-codec = { workspace = true }

serde = { version = "1.0.193", features = ["derive"] }
rand = { workspace = true }
hex = { workspace = true }

[dev-dependencies]
test-utils = { workspace = true }
29 changes: 29 additions & 0 deletions protocols/zcash-frost/src/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// ================= Common ======================== //
pub const ZCASH_FROST_KEYGEN_PROTOCOL_NAME: &str = "/tangle/zcash-frost/keygen/1";
pub const ZCASH_FROST_SIGNING_PROTOCOL_NAME: &str = "/tangle/zcash-frost/signing/1";

// ============= Signing Protocol ======================= //

pub mod signing_worker {
use std::time::Duration;

// the maximum number of tasks that the work manager tries to assign
pub const MAX_RUNNING_TASKS: usize = 2;

// the maximum number of tasks that can be enqueued,
// enqueued here implies not actively running but listening for messages
pub const MAX_ENQUEUED_TASKS: usize = 10;

// How often to poll the jobs to check completion status
pub const JOB_POLL_INTERVAL: Duration = Duration::from_millis(500);
}

// ============= Keygen Protocol ======================= //

pub mod keygen_worker {
/// the maximum number of tasks that the work manager tries to assign
/// at any given time for the keygen protocol.
pub const MAX_RUNNING_TASKS: usize = 2;
/// the maximum number of tasks that can be enqueued.
pub const MAX_ENQUEUED_TASKS: usize = 10;
}
Loading
Loading