Skip to content

surjection: Fix test condition failures in probabilistic tests#355

Open
mllwchrry wants to merge 1 commit intoBlockstreamResearch:masterfrom
mllwchrry:fix-surjection-test
Open

surjection: Fix test condition failures in probabilistic tests#355
mllwchrry wants to merge 1 commit intoBlockstreamResearch:masterfrom
mllwchrry:fix-surjection-test

Conversation

@mllwchrry
Copy link
Copy Markdown
Collaborator

Fixes two CI failures:

@real-or-random
Copy link
Copy Markdown
Member

real-or-random commented Mar 24, 2026

@apoelstra

I can't remember why we have this randomized design where proof initialization does rejection sampling and can fail. It's explained here how it works: https://github.com/BlockstreamResearch/secp256k1-zkp/blob/master/src/modules/surjection/surjection.md#initialization But I don't see the point. Can you provide an intuition for this for context?

I mean, one could simply put the input asset at a random position in the subset and then sample some other input assets to add to the subset. The probability that this looks random can be determined mathematically and doesn't need to be estimated "experimentally".

I feel like I don't understand what's going on here.


if (n_inputs >= 3) {
/* succeed in 10*n_inputs tries (probability of failure e^-10) */
/* succeed in 100*n_inputs tries (probability of failure e^-300) */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder what e is.

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.

2 participants