-
Notifications
You must be signed in to change notification settings - Fork 134
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
Error to_affine_exn: Got identity
when using public key retrieved from on-chain state
#530
Comments
Could it be that the public key is not initialized yet, so it's all zeroes? That's what the error message sounds like |
Do you mean it's not on-chain yet? It is stored in this account: B62qmLWZfcbqrQPMky44w6K6Myj9aydbHKE5fG2N6wrXxFbkfEUWdRM You can see there the fields are Query to get on-chain state:
|
I understand the error now - it's because of running stuff multiple times, the first one with fake values. We should address this soon |
So the goal would be to run it the first time in an environment where assertions don't throw |
@garethtdavies you could use the following workaround for now: You can pass in the So this would be the diff in pseudo code + // oraclePublicKey gets passed in as argument
- let oraclePublicKey = this.oraclePublicKey.get();
this.oraclePublicKey.assertEquals(oraclePublicKey); |
Oh! An even simpler workaround would be to warm the cache before doing the transaction: await Mina.fetchAccount(zkAppAddress);
let tx = await Mina.transaction(...) |
I am using an on-chain public key variable in a zkApp for use in signature verification.
The public key is stored onchain and retrieved via
let oraclePublicKey = this.oraclePublicKey.get();
However, when using
oraclePublicKey
it errors with:If I simply override the
oraclePublicKey
with the following, it works just fine:Code example here, with the above hack: https://github.com/garethtdavies/zkAppPool/blob/5176a050c469ebab978fcf9631c7ac6bfd590970/oracle/src/DelegationOracleVerifier.ts#L44
The text was updated successfully, but these errors were encountered: