Replies: 1 comment
-
@gakonst would appreciate your thoughts! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What's the best practice of writing invariant tests when it involves some form of off-chain ZK proof generation?
For better context, I'll give an example as follows. I want to write an invariant test for a UTXO-styled shielded pool such that users should only be able to withdraw amount not more than what it has deposited into the shielded pool. When the user deposits, it will need to generate a ZK proof off-chain and submit that proof on-chain together with the deposited tokens. When the user withdraws, it will also need to generate another ZK proof off-chain (to prove the ownership of the assets) and submit that proof on-chain.
To deal with such an invariant test, it will perhaps involve taking in some random inputs of deposit amount and withdraw amount, and use these amounts for off-chain ZK proof generation. How do we deal with the off-chain part? It will also requires off-chain state sync as we need to know the deposited UTXO note commitment before we can generate the withdraw proof.
Beta Was this translation helpful? Give feedback.
All reactions