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

Undisclosed members are brute forceable without a per message nonce #3

Open
OR13 opened this issue Sep 4, 2021 · 7 comments
Open
Labels
bug Something isn't working

Comments

@OR13
Copy link
Sponsor Member

OR13 commented Sep 4, 2021

Without a per message nonce, revealing a path gives the verifier the ability brute force other messages.

@OR13 OR13 added the bug Something isn't working label Sep 4, 2021
@OR13
Copy link
Sponsor Member Author

OR13 commented Sep 4, 2021

I think this issue is solvable be encoding the nonces in the first proof, and then discloses the nonces along side the disclosed paths in subsequent derivations.... this will definitely increase the proof size.

@OR13
Copy link
Sponsor Member Author

OR13 commented Sep 4, 2021

probably this PoC code here would need to be modified: https://github.com/transmute-industries/merkle-disclosure-proof-2021/blob/main/src/merkle/merkle.ts#L74

@quartzjer
Copy link

I'm not sure this paper exactly discusses this issue, though it does show requiring the nonce on each leaf value.

There's also a mention here about the need for nonces.

@OR13
Copy link
Sponsor Member Author

OR13 commented Sep 4, 2021

It would be preferable to deterministically generate nonces for each message, I wonder if there is a named algorithm for this process, that is already a standard.

A naive solution might look like:

const rootNonce = crypto.getRandomBytes(32);
  const messagesWithNonces = messages.map((m, i)=>{
  return { message: m, nonce: hash(m + i + rootNonce) }
});

Then so long as the rootNonce is not revealed, per message nonces can be recomputed during the derivation process.

@quartzjer
Copy link

It was many years ago, but if I recall correctly the that was almost exactly the pattern we used (in an IoT context). I never found a formal algorithm for it.

@tmarkovski
Copy link

It would be preferable to deterministically generate nonces for each message, I wonder if there is a named algorithm for this process, that is already a standard.

If you factor in your secret key in the process, then depending on key type, one could utilize hash_to_field standardized algorithms.

@OR13
Copy link
Sponsor Member Author

OR13 commented Sep 25, 2021

I believe this issue is now addressed as of: #7

the specific encoding remains subject to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants