Dynamic Gas Refund and Circuit Verifiability
Execution Environment
Coprocessor runs multi-language mixed tasks off-chain in LLVM IR. At the end of each task, the actual execution time (ms) and memory peak are written into MetricsLog. This data is hashed and signed on-chain for the rate calculation contract to read.
Refund Formula
refund = α · (gas_est – gas_real) if gas_real < gas_est
• α is determined by governance (initial value 0.6).
• The difference in LA is directly returned to the user to avoid overpaying for conservative estimates.
• If gas_real exceeds the estimate by more than 10%, the excess amount is automatically deducted from the Prover's collateral, forcing nodes to optimize proof generation.
Circuit Verifiability Process
1. After the circuit is open-sourced, anyone can submit Poseidon hash and corresponding CID in the VerifiedCircuits contract.
2. Trail of Bits' formal toolchain performs SMT checks on circuit execution, verifying no overflows or undefined behavior; the result is hashed and written back to the same contract.
3. Governance can only inject the new circuit address into the Verifier after the SMT hash matches, ensuring alignment of on-chain verification keys with the audit version.
LA Integration Points
Event LA Flow
Submit New Circuit Requires staking LA to apply for audit, full amount burned on verification failure
Successful Launch 50% of stake returned, 50% goes to reward pool to incentivize auditors
Gas Refund Overpaid portion returned to user address immediately in LA form
In this way, the same LA simultaneously drives the three channels of "rate optimization," "security auditing," and "user experience," allowing the Coprocessor to maintain high throughput while having a clear cost-security self-regulation mechanism.