Precompiled Contract
Last updated
Last updated
Zytron provides superior ZK processing compared to Layer 2 Solutions: 10X faster and 200X cheaper in gas cost. Precompiled contracts offer more advanced functions, especially for handling resource-intensive operations. Precompiling operations like elliptic curve point addition, scalar multiplication, and pairing is crucial for efficient and secure on-chain zkSNARK verification.
Performance Optimization: Precompiled contracts are often highly optimized in the underlying code and tightly integrated with the blockchain itself. This significantly enhances computations, such as cryptographic operations, making them very suitable for zkSNARK-based applications.
Reduced Gas Costs: Using precompiled contracts significantly lowers gas fees. For example, using a native Babyjubjub contract to verify a shuffle (cite) reveal proof costs as much as 7,629,888 gas.
Increased Transaction Speed: The gas limit per Ethereum block is 30 million. Since zkSNARK-based on-chain verification consumes a lot of gas, using precompiled contracts can effectively reduce this overhead, allowing more transactions to be processed per block. For instance, using the native Babyjubjub contract, a block can only accommodate three revel proofs, whereas using a precompiled contract, it can accommodate much more.
Time Savings in Development: With precompiled contracts, developers do not need to write complex cryptographic operations or deploy and compile their own contract versions, greatly improving development efficiency.
Security: The only precompiled elliptic curve in Ethereum is altbn128, which offers a security level of only 100 to 110 bits (https://a16zcrypto.com/posts/article/snark-security-and-performance/). Therefore, we can provide a more secure, SNARK-friendly elliptic curve.