ZK circuits tools in the Aptos ecosystem #708
-
Discord user IDNo response Describe your question in detail.Hello, I'm looking at https://github.com/aptos-labs/keyless-zk-proofs. Is there a circom verification key generator in Move? What error, if any, are you getting?No response What have you tried or looked at? Or how can we reproduce the error?No response Which operating system are you using?N/A Which SDK or tool are you using? (if any)N/A Describe your environment or tooling in detailNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
@khemiriwalid if you have compiled your circom circuit and use snarkjs to generate the proving key and the verification key (assuming the underlying curve is bn254), you can then use our snarkjs-to-aptos converter to get an verifier move module that can be (almost) directly used in your dapp contract. |
Beta Was this translation helpful? Give feedback.
-
Awesome! |
Beta Was this translation helpful? Give feedback.
-
Hi @khemiriwalid, can you clarify what are you trying to do? Give more context? In principle, you can compile our circuit with |
Beta Was this translation helpful? Give feedback.
-
Hello @alinush , more context : Our solution involves building smart accounts with predefined capabilities at different granularity levels(each key or sub-key is configured to do a very specific set of on-chain actions/permissions). We need to secure and control the on-chain behavior of normal users' on-chain accounts by defining the allowed on-chain actions. Our goal is to build an off-chain trust-minimized/trustless engine that secures and controls the account's on-chain behavior based on the user's preferences and intended behavior using ZKPs. We define and configure the on-chain behavior of a smart account in advance(Scope). Then, we prove via ZK that the transaction behavior is compliant and aligned with the defined on-chain behavior of a smart account. We’re checking the technical feasibility of such a concept within account abstraction(AA) in the Aptos Blockchain. So, I'm asking about the proof generation in JavaScript and, more precisely, "const { proof, publicSignals } = await snarkjs.groth16.fullProve(circuitInputs, witnessGenerationPath, provingKeyPath);" is this proof transmitted in the transaction to be verified in the move module generated by your snarkjs-to-aptos converter, or does it need some transformation? |
Beta Was this translation helpful? Give feedback.
I see: you want to implement keyless signature verification in Move / in AA.
I don't think we can assist you in the engineering part at this low level of a detail.
Sure, the Groth16 proof is currently included in transactions for keyless accounts (you can see this here:$\sigma_\mathsf{txn}$ includes the Groth16 ZKP $\pi$ ).
Yes, you will need your Move module to verify this proof (amongst many other things). I don't know how much of the Groth16 verification code
snarkjs-to-aptos
will generate for you but, judging by the README, it should generate all of it.Nonetheless, I would say: proceed slowly, with great caution! In particular, make sure you understand the keyless design fully: