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

Provide a simple HTML page to compute proof size and time from parameters #22

Closed
wants to merge 19 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 19, 2024

This PR adds a simple HTML page to the ALBA website that provides user with an interactive model to understand how parameters impact the proof size and adversarial proving time.

Screenshot 2024-09-19 at 22 42 14

@ghost ghost requested review from tolikzinovyev, rrtoledo and curiecrypt September 20, 2024 06:34
@ghost
Copy link
Author

ghost commented Sep 20, 2024

ping @djetchev

@ghost
Copy link
Author

ghost commented Sep 23, 2024

As noted by @tolikzinovyev (see #17 (reply in thread)) and discussed with @rrtoledo it seems my adversary proof time estimates are way over inflated. My skills in combinatorics being what they are (limited) I would appreciate if someone could suggest a more accurate estimate.

docs/alba.js Outdated Show resolved Hide resolved
@tolikzinovyev
Copy link
Member

As noted by @tolikzinovyev (see #17 (reply in thread)) and discussed with @rrtoledo it seems my adversary proof time estimates are way over inflated. My skills in combinatorics being what they are (limited) I would appreciate if someone could suggest a more accurate estimate.

Basically, there are two scenarios. Either there exists an adversarial proof and the adversary can find it very quickly, or there doesn't exists an adversarial proof and so the adversary cannot find one no matter how much computation is done. So I think modeling CPU power is not useful for ALBA.

@ghost
Copy link
Author

ghost commented Sep 23, 2024

So it's just a matter of luck, and there's no way to brute force finding a proof?

@tolikzinovyev
Copy link
Member

Only if grinding proof statement is possible. E.g., the attacker can move his money to new accounts thus creating new signatures. In that case we need to rehash the blockchain state and include it as a seed to the hash function used by ALBA. Then the security becomes computation as opposed to information theoretic. But it kind of is outside the scope for ALBA.

@ghost ghost requested a review from amesgen September 24, 2024 07:50
@ghost ghost force-pushed the proof-proba branch from 7291be1 to ac58415 Compare October 1, 2024 12:39
Copy link

@amesgen amesgen left a comment

Choose a reason for hiding this comment

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

Looks great, only minor comments

(I didn't look at algorithm.md.)

docs/src/intro.md Outdated Show resolved Hide resolved
docs/src/intro.md Outdated Show resolved Hide resolved
docs/src/simulation.md Outdated Show resolved Hide resolved
docs/src/simulation.md Outdated Show resolved Hide resolved
docs/src/simulation.md Outdated Show resolved Hide resolved
docs/src/simulation.md Outdated Show resolved Hide resolved
Comment on lines +24 to +25
if (!S_1_bot && !S_2_bot) {
throw Error("S_1_bot or S_2_bot");
}
Copy link

Choose a reason for hiding this comment

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

  • Currently, this will just silently log this error to the console, potentially confusing users. Maybe use alert or sth like that?
  • One could also implement the remaining two cases in the proof of Corollary 3 in order to handle large n_p values (where this error is currently thrown).

(Doesn't necessarily have to happen in this PR)

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I copy/pasted your code. I think it's good enough for now but obviously throwing exceptions in user-facing code is not great. I don't like alert() but can find a good substitute.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you throw an error and not update the d/q/r parameters depending on S1 and S2?

Copy link
Member

Choose a reason for hiding this comment

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

I think for this simulation we can just use the parameters for the "small case". They in fact work for all cases, it's just, the prover will not have a good worst-case running time. Then we don't need to worry about S_1_bot, etc.

We can borrow the math code from Raphael's implementation.
https://github.com/cardano-scaling/alba/pull/33/files#diff-b0bad697f839908964cc4e445cd9c87a76b4a5f84da347b24a426b61b7d09322R127

docs/alba.js Outdated Show resolved Hide resolved
docs/alba.js Outdated Show resolved Hide resolved
docs/alba.js Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Oct 1, 2024

Thanks for the thorough review @amesgen, I will fix the remaining issues tomorrow.

@tolikzinovyev
Copy link
Member

The simulation looks nice. I would just use a different name for S_p. S_p is normally defined as the honest party's elements. Also, S_p is a set, not a number. Maybe we just call it n?

Arnaud Bailly and others added 4 commits October 18, 2024 15:39
Co-authored-by: amesgen <amesgen@amesgen.de>
Co-authored-by: amesgen <amesgen@amesgen.de>
Co-authored-by: amesgen <amesgen@amesgen.de>
* remove 'unique' qualification for elements of a set (by definition,
all elements in a set are unique...)
* rename `S_p` -> `n`
Comment on lines +24 to +25
if (!S_1_bot && !S_2_bot) {
throw Error("S_1_bot or S_2_bot");
}
Copy link
Member

Choose a reason for hiding this comment

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

I think for this simulation we can just use the parameters for the "small case". They in fact work for all cases, it's just, the prover will not have a good worst-case running time. Then we don't need to worry about S_1_bot, etc.

We can borrow the math code from Raphael's implementation.
https://github.com/cardano-scaling/alba/pull/33/files#diff-b0bad697f839908964cc4e445cd9c87a76b4a5f84da347b24a426b61b7d09322R127

const u = U(n_p_v, n_f_v);
const proba = probabilityOfProof(u, n_p_v, n_f_v, n_v);
// expected prover time is n_p + O (u^2), we neglect the n_p part here
proof_proba.value = proba.toExponential(4);
Copy link
Member

Choose a reason for hiding this comment

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

Confused about what this does.

@rrtoledo
Copy link
Collaborator

Let's merge this with @curiecrypt ongoing documentation efforts

@rrtoledo rrtoledo closed this Nov 11, 2024
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.

4 participants