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

Add and Remove parties #17

Merged
merged 15 commits into from Nov 1, 2021
Merged

Add and Remove parties #17

merged 15 commits into from Nov 1, 2021

Conversation

tudorcebere
Copy link
Contributor

No description provided.

@tudorcebere tudorcebere changed the title Add parties [WIP] Add parties Sep 9, 2021
@elichai
Copy link
Contributor

elichai commented Sep 12, 2021

Hi!
Thanks for contributing :)
The new simulate_dkr_add test seem to fail:

thread 'test::tests::simulate_dkr_add' panicked at 'called `Result::unwrap()` on an `Err` value: FairnessProof', src/test.rs:160:10

EDIT: I see that that's because collect_new_party always returns an error

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/test.rs Outdated Show resolved Hide resolved
@elichai
Copy link
Contributor

elichai commented Sep 13, 2021

Another thing, IIUC the approach you talk is as follows:
t parties calculate their additive shares, they then do PVSS with the additive share in f_i(0)(such that f(0)=Σshareᵢ) and they generate n+1 that everyone sums up.
this requires all n parties to be online to recieve their points, sum them, and verify the commitments.

Instead we could do the following:

Notation: πᵢ(x) is the polynomial representing the Lagrange Coefficient required for interpolation ((x-x₁)(x-x₂)/(x₁-x₂)(x₁-x₃)....)

So t parties come together, and they calculate:
vᵢ = πᵢ(n+1)*yᵢ
Then use SSS and generate polynomials gᵢ(x) with gᵢ(0) = vᵢ, and use PVSS to compute together a polynomial g(x) of degree t-1 where g(0)=Σvᵢ.
Then each party encrypts their point using P_n+1's paillier key and broadcast it, Which then decrypts them and interpolates g(0) to find their point.
Now party n+1 has the point f(n+1) and no party needs to modify their own secret.
(note that P_n+1 will need to check that against the commitments of the PVSS etc. to make sure their not being lied to)

@tudorcebere
Copy link
Contributor Author

I need to take this on paper, if you have any links to check on this, it would be very useful!

src/lib.rs Outdated Show resolved Hide resolved
@tudorcebere tudorcebere changed the title [WIP] Add parties Add parties Oct 18, 2021
src/test.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated
impl JoinMessage {
pub fn distribute() -> (Self, Keys) {
let new_party_key = Keys::create(0);
let (dlog_statement, composite_dlog_proof) = generate_dlog_statement();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused, this is generating a proof for some random paillier key that isn't saved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, @omershlo explained it in the telegram conversation. It confuses me as well, but I understood that it's like system parameters that are submitted, we don't care about the secret at all.

src/add_party.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated
Comment on lines 177 to 181
for refresh_message in refresh_messages.iter() {
if refresh_message.public_key != refresh_messages[0].public_key {
return Err(FsDkrError::BroadcastedPublicKeyError);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the parties signed on this or something? how do you know they actually sent that? (as I think the whole point is that we do not require secure channels)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the key to be generated, all other parties need to validate the same public key. I know that @omershlo mentioned that we should be able to verify everything in the message, but for now, this is good enough and we can continue working on it.

src/refresh_message.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated Show resolved Hide resolved
src/add_party.rs Outdated
ni: h2,
};

let composite_dlog_proof = CompositeDLogProof::prove(&statement, &xhi);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that both proofs and statements needs to be attached and verified, but which of them we use in the h1_h2_N_tilde_vec? The one with the base in h1, right? I've implemented this, tell me if it's fine.

src/test.rs Show resolved Hide resolved
@elichai elichai changed the title Add parties Add and Remove parties Nov 1, 2021
@elichai elichai merged commit dc7e937 into ZenGo-X:main Nov 1, 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

3 participants