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

semaphore-0.wasm not found #804

Closed
Anas2001 opened this issue Jun 22, 2024 · 3 comments
Closed

semaphore-0.wasm not found #804

Anas2001 opened this issue Jun 22, 2024 · 3 comments
Labels
bug 🐛 Something isn't working

Comments

@Anas2001
Copy link

Describe the bug
When I try to generate a proof with @semaphore-protocol/proof package I get after while an Error Error: Failed to fetch https://unpkg.com/@zk-kit/semaphore-artifacts@4.0.0-beta.11/semaphore-0.wasm: Not Found

To Reproduce
run this example

import { Identity } from "@semaphore-protocol/identity";
import { Group } from "@semaphore-protocol/group";
import { generateProof } from "@semaphore-protocol/proof";

const group = new Group();
const identity = new Identity("private_key_of_wallet");
group.addMember(identity.commitment);
const proof = await generateProof(identity, group, 1, group.root);
console.log(proof);

Expected behavior
to log the proof

Screenshots
no need for this

Technologies (please complete the following information):

  • Node.js version 20.12.2
  • NPM version 10.5.0
  • Solidity version

Additional context
try to call this link https://unpkg.com/@zk-kit/semaphore-artifacts@4.0.0-beta.11/semaphore-0.wasm from browser and get
Cannot find "/semaphore-0.wasm" in @zk-kit/semaphore-artifacts@4.0.0-beta.11

@Anas2001 Anas2001 added the bug 🐛 Something isn't working label Jun 22, 2024
@vplasencia
Copy link
Member

vplasencia commented Jun 22, 2024

Hey @Anas2001

Semaphore v4 does not support groups with one member. It supports groups with greater than or equal to 2 members. With one member in a group there is no anonymity, so it should be fine.

Do you need support for only one member in the group because of your use case?

If you add another member to the group, it should work fine. You may need to update the semaphore version to use the latest which is v4.0.0-beta.13.

@Anas2001
Copy link
Author

Hi @vplasencia

thanks for ur replay :) I wanted only to test the protocol on back-end and front-end. Of course I want to use it for multiple memebrs but the Error message didn't show me if it required at least 2 memebers to work fine. But I fixed the issue thru adding merkleTreeDepth to generateProof-Function const proof = await generateProof(identity, group, message, scope, merkleTreeDepth); and worked fine with only one member 👍 and yes I use the last version semaphore packages. I think you can close this issue but maybe will be better to update the docs bcz it took me a lot of time to figure it out.

@vplasencia
Copy link
Member

vplasencia commented Jun 24, 2024

Hey @Anas2001 it's great to know that you found out how to solve it. Yes, that's another way to make it work, by passing the merkle tree depth parameter. Thank you very much for pointing this out. I just created this issue: #805 to update the documentation to add more information about anonymity in groups and update the generateProof function to support tree depth 0 without passing the tree depth. Then for this case the function will use tree depth 1 directly and it will work.

I added the link of this issue there. Closing this issue, but feel free to add more ideas here or in the new issue. Thank you very much.

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

2 participants