Replies: 3 comments 5 replies
-
I guess you have tried compiling them to wasm and executing them on NEAR. What if proper host functions are implemented so that zk primitives run natively? Potentially even that won't be enough, given the restriction that the execution must be in less than one second.
Do you have some project live or code you can share? |
Beta Was this translation helpful? Give feedback.
-
@abacabadabacaba What's your opinion? |
Beta Was this translation helpful? Give feedback.
-
The purpose of using snark-friendly hash on VM-level is very rare: for building snark-friendly Merkle trees. Generally, most of the issues are solvable without snark-friendly hash functions on the VM side. If you are finding a tradeoff between CPU and zk, look at sinsemilla hash - with plookup it is cheap, and on CPU side it is not very expensive. |
Beta Was this translation helpful? Give feedback.
-
(Initially brought up in the NEAR Zero Knowledge Community Group)
From first hand experience trying to implement a ZK-SNARK application on NEAR, there seems to be a lack of resources regarding SNARK-friendly hash functions. Out of all the Rust implementations that are out there, they all exceed maximum GAS.
Popular Poseidon implementation in Rust cannot run once without exceeding GAS.
A reimplementation of some of the common SNARK-friendly hash functions and/or precompiles would be super useful for the ZK community.
As a proof of concept, we have optimized MiMC Sponge to run efficiently (can be executed more than 25 times in a single transaction), compatible with common frameworks (such as Circom, Zokrates).
Beta Was this translation helpful? Give feedback.
All reactions