semaphore-protocol / semaphore

A zero-knowledge protocol for anonymous interactions.
https://semaphore.pse.dev
MIT License
929 stars 211 forks source link

Refactor generate proof function when a group has only one member and tree depth 0 #805

Closed vplasencia closed 3 months ago

vplasencia commented 5 months ago

Description

When there is 1 member in the group and you want to generate a proof without passing the tree depth, there will be an error because tree depth 0 is not supported to generate a proof and one member is tree depth 0. It's true that in a group with 1 member there is no anonymity but for testing purposes it's better to also support tree depth 0 when generating a proof for groups with 1 member without passing the tree depth parameter.

Tasks:

More context: https://github.com/semaphore-protocol/semaphore/issues/804