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

implementing removal/addition of parties #13

Merged
merged 6 commits into from Aug 29, 2021

Conversation

tudorcebere
Copy link
Contributor

No description provided.

@tudorcebere tudorcebere changed the title [WIP] implementing removal/addition of parties implementing removal/addition of parties Aug 29, 2021
src/lib.rs Outdated
@@ -356,7 +352,69 @@ mod tests {
simulation.run().unwrap()
}

fn simulate_dkr(keys: &mut Vec<LocalKey>) {
fn simulate_dkr_removal(keys: &mut Vec<LocalKey>, remove_party_indexes: Vec<usize>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

indexes => indices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏼

@@ -344,6 +327,19 @@ mod tests {
simulate_signing(offline_sign, b"ZenGo");
}

#[test]
fn test_remove_sign_rotate_sign() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to add here a line for description (or instead in the readme file) saying that removing a party is simply done by not broadcasting encrypted messages to this party. If enough parties decided not to broadcast for a specific party index - this party will not be able to reconstruct a rotated key

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏼

if refresh_message.remove_party_indexes.contains(party_index) {
continue;
}
refresh_bucket.push(refresh_message.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

where referesh_bucket is used ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each bucket represents the list of messages that a party identified by the key of the bucket will receive (it's a mutable reference to a list: Imagine something like:

1 -> [m1, m2 m3, m4, m5]
2 -> [m1, m2, m3, m4, m5]
3 -> [m1, m2, m3, m4, m5]
4 -> [m1, m2, m3, m4, m5]
5 -> [m1, m2, m3, m4, m5]

If all the parties are not removing anyone. If they want to remove 4, they will be like

1 -> [m1, m2 m3, m4, m5]
2 -> [m1, m2, m3, m4, m5]
3 -> [m1, m2, m3, m4, m5]
4 -> [m4] // it has access only to it's own refresh message
5 -> [m1, m2, m3, m4, m5]

}

for remove_party_index in remove_party_indexes.iter() {
assert_eq!(broadcast_messages[remove_party_index].len(), 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is being checked in this assertion ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this test, everyone agrees to delete a party (or even multiple ones). I check that the only message that the party has access to it's their own (by default).

}

RefreshMessage::collect(
broadcast_messages[party].clone().as_slice(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The buckets are used here


for remove_party_index in remove_party_indices {
let result = RefreshMessage::collect(
&broadcast_messages[&remove_party_index],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The buckets are used here

@omershlo omershlo merged commit 37daa3d into ZenGo-X:main Aug 29, 2021
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.

None yet

2 participants