Closed gubsheep closed 3 months ago
This issue has existed since this commit c88175bb2de96dd39d9954247fbe7a280716fd4e
@zkfriendly yess, I found the problem and I'm currently working to solve it.
@zkfriendly yess, I found the problem and I'm currently working to solve it.
@cedoor Ow, I was working on a fix at same time too!
@cedoor Ow, I was working on a fix at same time too!
Ahh please, take a look at the assignees before working on the next task. Sorry for this misunderstanding!
Describe the bug Initialize two fresh Semaphore identities: a
new Identity()
with empty args, and anothernew Identity(<private key>)
passing in the private key generated for the first identity. These two identities will have different public keys and commitments, though they should be identical.To Reproduce Steps to reproduce the behavior:
const id1 = new Identity()
const privkey = id1.privateKey
.const id2 = new Identity(privkey)
.Expected behavior
Screenshots
id1
in this screenshot was generated as a fresh Semaphore identity with no args passed into constructor.id2
is generated withid1
's private key passed as argument to constructor. Both of these Identities appear to have the same privateKey, but have different publicKey and commitment values.Technologies (please complete the following information):
Additional context
Prepending the private key with
0x
prefix does not solve the issue: for example, runconst id3 = new Identity('0x' + privkey)
. Now,id3
's commitment and publicKey will be different from both the freshly generated Semaphore ID as well as the identity generated by passing in the first privateKey as a constructor argument.