Sarma: simple primitive to achieve private execution on EVM, even cross-chain.
Prize Pool
Prize Pool
Prize Pool
Prize Pool
This project implements a single primitive called Sarma, which achieves public/private execution duality on any EVM. It also works cross-chain on multiple EVM chains. The user can write the public part of the Smart Contracts using Solidity as usual. When private execution and addressing is needed, Sarma, the encrypted UTXO-style blob achieves privacy. The private part of the Smart Contract is written in Noir.
The implementation is inspired by Aleo, which uses a single primitive called "record", which is an encrypted "struct" visible to the owner. However, Aleo stores the "records" in a Sparse Merkle Tree, not suitable for EVM considering the cost of storage. To get around this problem, I separate the public and private address spaces. The Smart Contract EVM calls act as "mules", not knowing what they are executing, and each call can be made from a different address. This achieves revealing of minimal information. In addition, to achieve non-interactive handover of the "records" that I call "Sarmas" from one private address (owner) to another, I use El Gamal encryption. The EVM code can create, move and destroy Sarmas only upon ZK proof verification of authorization. Moreover, the Sarma can be moved cross-chain, which not only achieves cross-chain private execution, but makes the bridges safer and less corruptible as they do not know what they are moving across.