diff --git a/vision.md b/vision.md index e8c91c3..f7a08b2 100644 --- a/vision.md +++ b/vision.md @@ -1,8 +1,35 @@ -# SoLUSH: Running Intelligence On-Chain +# Sovraigns: Intelligence Where LLMs Can't Reach -In decentralized finance, systems often involve tasks such as determining optimal liquidity ranges for automated market makers, allocating staking rewards in a way that balances fairness and participation incentives, or dynamically adjusting collateralization ratios to minimize risks in lending protocols. These challenges are critical for ensuring the efficiency and stability of protocols, yet they are particularly difficult to address without centralization. Off-chain solutions often rely on external computation and centralized entities or oracles, introducing trust dependencies and undermining the decentralized ethos of blockchain systems. +## The DeFi Intelligence Paradox -Artificial intelligence is increasingly being explored in decentralized finance to enhance token ecosystems and liquidity management. This shift represents a practical application of AI tools aimed at addressing complex optimization problems directly within blockchain ecosystems. While large language models (LLMs) dominate discussions around AI innovation due to their general-purpose capabilities, they are poorly suited to the demands of decentralized adaptive systems. In contrast, **genetic algorithms** (GAs) offer a more natural and efficient fit for systems requiring iterative improvements, combining computational simplicity with adaptive behavior. +Decentralized finance protocols are caught in an impossible dilemma. They desperately need sophisticated optimization to remain competitive - determining optimal liquidity ranges for automated market makers, dynamically adjusting collateralization ratios, allocating staking rewards efficiently. Yet the very nature of their decentralization prevents them from using modern AI solutions. + +**The paradox is stark:** +1. **Protocols need intelligence** - Complex market dynamics and adversarial environments require adaptive, sophisticated algorithms +2. **They can't trust centralized AI** - Using OpenAI APIs or centralized optimizers defeats the entire purpose of decentralization +3. **They can't run AI on-chain** - Even simple neural networks would cost millions in gas fees + +This creates a fundamental barrier: **DeFi protocols need intelligence to compete, but using intelligence makes them centralized.** + +Current "solutions" like external oracles and trusted computation providers are just band-aids that reintroduce the very centralization DeFi was meant to eliminate. When a protocol relies on Chainlink for price feeds or Gauntlet for parameter optimization, they're trusting a centralized entity that could be compromised, censored, or simply fail. + +## Sovraigns: Bringing Intelligence On-Chain + +We've solved this paradox. Sovraigns enables verifiable intelligence directly within blockchain systems through a breakthrough combination of **genetic algorithms**, **zero-knowledge proofs**, and **based rollups**. This isn't just another optimization tool; it's the missing piece that allows DeFi to achieve true autonomy. + +The key innovation: algorithms are evolved off-chain, registered on a sidechain after validation, and then executed with zero-knowledge proofs whenever protocols need optimization. The proofs are batched in a based rollup that inherits Ethereum's security, enabling trustless intelligence at scale. + +## The Market Opportunity + +The inefficiencies in DeFi represent a massive, growing market: + +- **Uniswap V3 LPs lose ~$400M annually** from suboptimal position management +- **Lending protocols sacrifice ~$300M yearly** through conservative parameters +- **MEV and arbitrage extract ~$800M annually** from predictable protocol behavior + +This totals over **$1.5 billion in annual value destruction** - and that's just from the top protocols. As DeFi grows and becomes more complex, this problem compounds. With DeFi TVL exceeding $50B and growing, the market for intelligent optimization could reach **$10B+ within 5 years**. + +Current solutions like Gauntlet and Chaos Labs capture only a fraction of this value while requiring trust. Sovraigns can address the entire market with trustless, verifiable intelligence. ## **Introduction to Genetic Algorithms** @@ -13,11 +40,11 @@ Genetic algorithms (GAs) are optimization techniques inspired by the process of - **Selection:** The process of choosing the best-performing solutions to carry forward. - **Crossover and Mutation:** Methods to combine and modify solutions, creating new ones that explore the problem space. -Through repeated iterations, GAs converge toward optimal or near-optimal solutions, making them highly effective for solving complex, dynamic problems. GAs have recently gained momentum with the development of the [Push 3 language](http://faculty.hampshire.edu/lspector/push3-description.html) by Lee Spector. Push 3’s compact and efficient architecture shares similarities with stack-based virtual machine systems like the Ethereum Virtual Machine (EVM). Although not designed specifically for EVMs, Push 3’s simplicity and flexibility make it conceptually compatible with blockchain execution environments. Push 3 has achieved milestones such as evolving [programs for quantum computers](https://faculty.hampshire.edu/lspector/aqcp/) and supporting autoconstructive evolution. A Push 3 VM could facilitate the deployment of genetic algorithms in decentralized systems, leveraging Push 3’s support for expressive program evolution and adaptive behavior in tasks like resource optimization. +Through repeated iterations, GAs converge toward optimal or near-optimal solutions, making them highly effective for solving complex, dynamic problems. The [Push 3 language](http://faculty.hampshire.edu/lspector/push3-description.html) by Lee Spector provides a particularly suitable foundation for genetic programming with its stack-based architecture and support for multiple typed stacks. Push 3 has demonstrated powerful capabilities including evolving [programs for quantum computers](https://faculty.hampshire.edu/lspector/aqcp/) and supporting autoconstructive evolution. Its design principles make it well-suited for implementation within zero-knowledge virtual machines, where its stack-based operations can be efficiently encoded as cryptographic constraints. ## On Agents -An agent is defined as an entity capable of perceiving its environment, processing information, and taking autonomous actions to achieve specific objectives. LLMs can be structured into agents using frameworks that provide memory and feedback loops, but they do not fit on-chain and, at the same time, cannot securely manage secrets like private keys. Without either of these capabilities, LLM-based agents require external key management, increasing risks and undermining decentralized security principles. In contrast, genetic algorithms exhibit agentic characteristics by evolving their behavior over time to meet specific goals. When deployed on-chain within smart contracts, GAs can autonomously adapt to real-time inputs and optimize decisions, all while operating entirely within the secure and deterministic framework of blockchain systems. +An agent is defined as an entity capable of perceiving its environment, processing information, and taking autonomous actions to achieve specific objectives. LLMs can be structured into agents using frameworks that provide memory and feedback loops, but they do not fit on-chain and, at the same time, cannot securely manage secrets like private keys. Without either of these capabilities, LLM-based agents require external key management, increasing risks and undermining decentralized security principles. In contrast, genetic algorithms exhibit agentic characteristics by evolving their behavior over time to meet specific goals. In the Sovraigns architecture, GAs execute off-chain with zero-knowledge proofs, enabling them to adapt to real-time inputs and optimize decisions while maintaining verifiable correctness and privacy. --- @@ -26,7 +53,7 @@ An agent is defined as an entity capable of perceiving its environment, processi 1. **Efficiency and Feasibility for Blockchain Execution** - **LLMs are resource-intensive:** The computational complexity and size of LLMs make them impractical for direct execution in decentralized environments, where every operation incurs costs. Running even the simplest inference for an LLM would require off-chain computation and trust in external oracles, undermining decentralization. - - **GAs are lightweight:** Genetic algorithms, by design, are computationally efficient. Their iterative, population-based approach to optimization fits naturally into resource-constrained environments. This efficiency ensures GAs can evolve and execute entirely on-chain, preserving transparency and trustless execution. + - **GAs are lightweight:** Genetic algorithms, by design, are computationally efficient. Their iterative, population-based approach to optimization fits naturally into resource-constrained environments. While traditional approaches might execute GAs directly on-chain, Sovraigns leverages zero-knowledge proofs to enable off-chain execution with on-chain verification, combining efficiency with verifiable correctness. 2. **Evolution vs. Training** @@ -41,29 +68,65 @@ An agent is defined as an entity capable of perceiving its environment, processi --- -## **Theoretical Framework for Decentralized Genetic Programming** +## **Theoretical Framework: Zero-Knowledge Intelligence on Based Rollups** -A protocol providing agents as a service could leverage genetic programming to address complex problems within blockchain environments. Central to such a system would be the development of a Push 3 Virtual Machine (VM), enabling efficient execution of genetic algorithms. Furthermore, this protocol would combines on-chain smart contracts with off-chain optimization to evolve and deploy efficient algorithms for DeFi tasks. +Sovraigns combines genetic programming with zero-knowledge proofs and based rollups to create the first truly decentralized intelligence layer for DeFi. The system leverages a custom Push 3 VM implementation in OpenVM for verifiable execution, with all coordination happening on a based rollup that inherits Ethereum's security. -### On-Chain: Tasks and Deployment -1. **Task Creation**: Optimization problems are registered as "Tasks" in the "Registry." Each Task includes: - - A fitness function (goal criteria). - - Evaluation parameters (data and conditions). - - A population of algorithms (initially empty). -2. **Agent Deployment**: The best-performing algorithm from the population is selected and deployed to the relevant smart contract. Read through this [real-life usecase explaining the applicability of agents to DeFi](example.md). When better algorithms are discovered, the on-chain agent is updated. +### Architecture Overview -### Off-Chain: Evolution and Validation -1. **Task Selection**: Optimizers (network participants) fetch a Task from the Registry. -2. **Algorithm Evolution**: - - Optimizers run simulations locally using synthetic or historical blockchain data. - - Genetic algorithms are applied to evolve better solutions, improving fitness scores. -3. **Submission and Validation**: Improved algorithms are submitted to a "Validator Pool," which verifies the results. Validators vote on whether to accept the new algorithm into the population, replacing weaker ones. -4. **Incentives**: Successful submissions earn rewards for the Optimizer. +The protocol operates across three layers: +1. **Based Rollup (Sidechain)**: Coordination, task registry, and algorithm storage +2. **Off-Chain Compute**: Algorithm evolution and ZK proof generation +3. **Ethereum L1**: Final settlement and protocol integration + +### Based Rollup: Decentralized Coordination +1. **Task Registration**: DeFi protocols register optimization tasks on the based rollup, including: + - Fitness functions (optimization goals) + - Evaluation parameters and constraints + - Reward pools for successful optimizations + +2. **Algorithm Registry**: The best algorithms for each task are registered on-chain after council validation + - Algorithm hashes stored on-chain for verification + - ZK proofs verify the exact algorithm (matching hash) was executed + - Version history maintained for auditability + - Permissionless access for all protocols + +3. **Execution Requests**: When protocols need optimization: + - Send request to based rollup with current data + - Request triggers off-chain execution + - Multiple requests batched for efficiency + +### Off-Chain: Evolution and Zero-Knowledge Execution +1. **Algorithm Evolution**: + - Optimizers run genetic algorithms using standard Push 3 implementations + - Evolution happens on local high-performance infrastructure + - Best solutions submitted to council for validation + - No ZK proofs needed during evolution phase + +2. **Zero-Knowledge Proof Generation** (triggered by on-chain requests): + - Registered algorithms execute in OpenVM with request data + - OpenVM verifies the algorithm matches the on-chain hash + - STARK proofs generated via Plonky3 + - Proofs include complete execution trace and results + - Multiple proofs batched into rollup blocks + +3. **Council Validation**: + - Distributed validators verify algorithm improvements + - Consensus required before on-chain registration + - Ensures quality without centralized control + +### L1 Integration: Trustless Protocol Updates +1. **State Bridge**: Based rollup posts state roots to Ethereum +2. **Proof Verification**: Smart contracts verify STARK proofs +3. **Action Execution**: DeFi protocols execute optimizations based on verified results ### Key Components -- **Registry (on-chain)**: Manages Tasks and stores algorithm populations. -- **Optimizers (off-chain)**: Compete to evolve better solutions. -- **Validator Pool (off-chain)**: Ensures the quality and legitimacy of submissions. +- **Registry (based rollup)**: Task and algorithm management with ZK verification +- **OpenVM Runtime**: Custom Push 3 implementation for genetic programming +- **Optimizers (off-chain)**: Compete to evolve better solutions +- **Council (distributed)**: Validates algorithm quality before registration +- **Proof Aggregator**: Batches multiple ZK proofs for efficient verification +- **State Bridge**: Synchronizes rollup state with Ethereum L1 ![Components](/components.png)