## Computational Framework [[ZKP/ZKP Base Layer/ZKP Blockchain/Technical Build Application Layer/Smart Contract Execution Environments EVM|Substrate's EVM pallet]] executes smart contracts for [[ZKP/Data Marketplace/Intro|marketplace]] [[ZKP/Data Marketplace/High-Level Overview/Smart Contract Operations|operations]] using a stack-based architecture, with 256-bit addressable memory and unified state storage in [[Patricia Tries]] through the state management system [85]. [[Proof of Space (PoSp)]] commitments verify off-chain data storage reliability through custom pallets [79]. ## [[ZKP/ZKP Base Layer/ZKP Blockchain/Performance/Storage Layer|Storage]] Model and [[Off-Chain Data Management with IPFS and Filecoin|Off-Chain Integration]] The EVM pallet's key-value storage model is supplemented by off-chain IPFS storage secured by PoSp, managed through off-chain workers, balancing on-chain efficiency with off-chain scalability [85][87]. ## Weight Mechanics The weight-based fee model manages computational resources with operation costs converted from gas (e.g., MUL: 5 gas equivalent, CALL: 700 gas equivalent) and distributes fees to validators and storage providers through the native fee distribution mechanism [81]. [[ZKP/Data Marketplace/Technical Basis/Cryptographic Foundations/Lifecycle of zk-SNARKs|ZKP verification]] costs approximately 200,000 gas equivalent weight as specified in the base layer. ## Contract Deployment Smart contract deployment through the EVM pallet requires 7-12 million gas equivalent weight, reflecting the integration of [[ZKP/ZKP Base Layer/Core Concepts/Zero-Knowledge Proofs|ZKPs]], [[Proof of Intelligence (PoI)]] validation, and [[Proof of Space (PoSp)]] storage within the runtime environment [80]. ## Weight Optimization Strategies The marketplace design incorporates several optimization approaches within the framework: ## Batch Processing Combining multiple operations into single transactions through batch utilities to reduce overhead [86]. ## Precompiles Leveraging specialized EVM pallet functions for ZKP verification, which enable the base verification cost of 200,000 gas equivalent weight as specified in the base layer [82]. See also: [[ZKP/Data Marketplace/Technical Basis/Cryptographic Foundations/Cryptographic Foundations of Zero-Knowledge Proofs|Cryptographic Foundations of Zero-Knowledge Proofs]]