Miden Pioneers: Composability Labs is Building Spark, a Superfast Onchain CLOB with a State-minimized Approach
Polygon Miden enables developers to build unique applications that extend Ethereum’s feature set
Let’s start with a problem: State bloat.
In simple terms, the more a blockchain is used, the more state it drags around. This creates a paradox. True scale requires a system that can handle high usage, but high usage, in a decentralized-systems context, bogs down protocols and can drive up fees. The more successful a blockchain becomes, the slower and more expensive (i.e. unappealing) it appears to be, as more and more data is added.
Polygon Miden reimagines blockchain design by baking in state minimization.
Block production and verification, on Polygon Miden, are possible without needing to store the entire state of the zkVM rollup. Instead, with the power of zero-knowledge (ZK) proofs, users store their own data and the rollup only keeps track of verifiable commitments to that data. If a user’s state changes, a ZK proof (ZKP) can confirm the validity of the state change.
In other words, ZKPs help minimize state bloat in Polygon Miden—and create an opportunity for builders on Polygon Miden to take advantage of its unique feature set.
All of this is context for this week’s deep dive into a Miden Pioneer.
Composability Labs is building Spark, a central limit order book (CLOB) that leverages Polygon Miden’s inbuilt state minimization features. Spark has been designed with spot and perpetual exchange features in mind, leveraging Miden’s unique account and note architecture.
CLOBs like Spark will be especially important in an expanded AggLayer universe, which offers an industry-wide solution to state bloat. By creating cryptographic guarantees for cross-chain interoperability, the AggLayer creates an environment that feels like a single chain, but where state and liquidity are shared across a web of chains.
Below, you’ll learn what Spark is, why it’s valuable, and how minimizing state bloat is key to how Composability Labs designed their approach to spot and perpetual markets.
What is Spark?
Spark is an extremely fast, onchain decentralized order book that will deploy on Polygon Miden using a state-minimized design.
Following extensive research and development of DeFi CLOBs over the past two years, we believe the optimal implementation of order books in the cryptocurrency space is expected to be achieved within state-minimized environments
Polygon Miden represents the future of order book-based DeFi, due in large part to its state-minimized environment.
What value does Spark bring to users?
Let's compare Spark, a CLOB that will deploy on Polygon Miden, with existing market solutions:
Building on Polygon Miden offers users capital efficiency while maintaining the trustlessness expected of DEXes, avoiding state bloat, and remaining resistant to centralized censorship. Whereas many AMMs execute orders off-chain for capital efficiency, the unique architecture of Polygon Miden means all of this execution can be done efficiently onchain.
Spark addresses critical execution issues in DeFi and enhances trading efficiency. Here are some of the key points of value Spark offers:
- Onchain execution. By moving execution onchain, Spark ensures greater transparency and security than off-chain solutions. This is particularly important for users who prioritize trust and verifiability in their trading activities.
- Advanced order types and market depth: Spark supports advanced order types and provides a transparent view of market depth and liquidity. This is essential for professional, institutional, and experienced retail traders who require precise execution and detailed trading data.
- Transparency: Spark's on-chain order book provides ease of access to transaction data.
- Reduction of tradeoffs in off-chain solutions: While off-chain order books are common in the crypto industry, they come with tradeoffs such as reduced transparency and potential security risks. Spark mitigates these issues by bringing the order book on-chain.
- Support for trading strategies and algorithms: Spark incorporates standard practices on how traders run their strategies or algorithms, which is crucial for efficient and effective trading operations.
Overall, Spark enhances the Ethereum DeFi landscape by providing a high-performance and transparent trading infrastructure that meets the needs of various types of traders.
How is Composability Labs approaching the design of a perpetuals/spot market in Spark?
The mission at Composability Labs is to move the execution of decentralized finance onchain and build high-performance, order-book-based protocols. Polygon Miden's native features, like account abstraction implemented through accounts and notes, improve user experience by ensuring efficiency and sovereignty.
Because every account in Polygon Miden is represented by a smart contract, assets are stored locally in accounts (rather than in global token contracts). This makes exploiting potential bugs more difficult, as every account needs to be attacked individually.
And it’s also where speed and state-minimization enter: A state-minimized design makes a locally-executed, onchain CLOB possible.
Additional features, like an onchain price oracle, are needed for perpetual markets. Although research is ongoing, there are plans to include order book spot prices as an oracle. Doing so could enable multiple notes to be consumed in one transaction, an approach that would allow concurrent transactions.
So the design of Polygon Miden foregrounds improving efficiency and user experience with a focus on autonomy and scalability.
Order books are the tech backbone of all the products for professional, institutional, and experienced retail traders who require precise execution, advanced order types, and a transparent view of market depth and liquidity. They are also preferable in high liquidity markets where detailed trading data is essential.
Building a state-minimized, onchain order book means taking DeFi to the next level.
What is Polygon Miden again?
Polygon Miden uses design elements from both Bitcoin and Ethereum.
It takes the concept of Bitcoin UTXOs (unspent transaction outputs) and makes them infinitely customizable by allowing developers to add custom logic that is executed when consuming these UTXOs—which on Polygon Miden are called Notes. You can think of a Polygon Miden Note as a cryptographic cashier's check, with some attached logic that allows a user to deposit this cryptographic cashier’s check only if certain conditions are met.
Polygon Miden takes the concept of programmable smart contracts from Ethereum a step further by enabling client-side proving of transactions. This is only possible with ZK. In practice, here’s what it looks like: when executing a transaction on Polygon Miden, users run the transaction locally. Then, they submit the ZKP of the transaction to the rollup, without having to reveal anything about the transaction itself.
If Bitcoin and Ethereum are single-threaded computers, then Polygon Miden is a GPU, meaning transactions on Polygon Miden can be processed in parallel, providing a massive unlock in transaction performance.
* * *
Spark, built by Composability Labs, demonstrates what’s possible when Ethereum’s feature set is extended, and execution of ZKPs occur locally. Their state-minimized approach to designing a CLOB promises to bring new and better UX to the Ethereum DeFi landscape.
Tune into the blog and our social channels to keep up with updates about Polygon.
The future of Web3 is aggregated.
Website | Twitter | Forum | Telegram | Discord | Instagram | LinkedIn | Polygon Knowledge Layer