Liquid Stake with compassSOL for an 7.50% APY from staking, MEV + fees

Enjoy the freedom of liquid staking in Solana Defi while delegating your stake to the high performance Solana Compass validator. Stake or unstake at any time here, or with a Jupiter swap.

Benefit from our high staking returns and over 2 years experience operating a Solana validator, and receive additional yield from priority fees + MEV tips

Earn 6.5% APY staking with Solana Compass

Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 6.5% APY yield on your SOL, while supporting us to create new guides and tools. Learn more

Stake your SOL

  1. Click to connect your wallet
  2. Enter the amount you wish to stake
  3. Kick back and enjoy your returns
  4. Unstake from your wallet or our staking dashboard

Earn 6.5% APY staking with Solana Compass

Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 6.5% APY yield on your SOL, while supporting us to create new guides and tools.

Learn more

The Next Era Of Solana Scaling | Swen Schäferjohann

By Lightspeed

Published on 2024-07-03

Dive into Solana's latest scaling innovation - ZK Compression. Learn how this groundbreaking technology is reshaping the blockchain landscape and enabling unprecedented scalability.

The notes below are AI generated and may not be 100% accurate. Watch the video to be sure!

The Dawn of ZK Compression on Solana

Solana, the high-performance blockchain known for its speed and efficiency, has taken a giant leap forward in its scaling capabilities with the introduction of ZK Compression. This groundbreaking technology, developed by Light Protocol, promises to revolutionize how developers build and scale applications on the Solana network. In a recent episode of the Lightspeed podcast, Swen Schäferjohann, the co-founder of Light Protocol, sat down to discuss this innovation that has set the Solana ecosystem abuzz.

ZK Compression, officially released on June 21, 2024, represents a significant milestone in Solana's journey towards mainstream adoption. It addresses one of the most pressing challenges faced by blockchain networks: the high cost of on-chain state storage. By enabling developers to compress multiple account states into a single account, ZK Compression drastically reduces the cost and complexity of scaling applications on Solana.

The Genesis of Light Protocol

The story of ZK Compression begins with the founding of Light Protocol in the summer of 2021. Swen Schäferjohann and his childhood friend Joe came together with a vision to bring privacy to the Solana ecosystem. Initially focused on building private voting systems using zero-knowledge proofs, the team quickly recognized the potential of Solana's low-cost infrastructure for implementing privacy features that were prohibitively expensive on other networks.

Light Protocol's journey took an unexpected turn during the bear market of 2022-2023. As the team continued to refine their zero-knowledge proof implementations, they made a crucial observation: the technology they were developing for privacy could be repurposed to solve Solana's growing state storage challenges. This realization led to a pivot that would ultimately result in the creation of ZK Compression.

Understanding Solana's State Storage Challenge

To appreciate the significance of ZK Compression, it's essential to understand the unique architecture of Solana and the challenges it faces. Unlike Ethereum, where smart contracts and data are tightly coupled, Solana uses a model where data is stored in separate "accounts." Each account represents a piece of state, such as a user's token balance or an NFT's metadata.

While this model enables Solana's high performance and parallelization capabilities, it comes with a cost. Validators must keep all active accounts in fast-access memory (RAM), which is expensive. To prevent abuse and compensate validators, Solana implements a "rent" system where users must lock up SOL tokens to keep their accounts active.

As Solana gained popularity, the cost of creating and maintaining these accounts became a significant barrier to scaling. Swen explains, "Right now, a single token account costs a little bit less than $1 to instantiate. Now, imagine you actually want to scale to larger user bases and instantiate an account for each of them. The cost of that is quite constraining."

How ZK Compression Works

ZK Compression tackles this challenge head-on by allowing developers to compress multiple account states into a single on-chain account. Here's how it works:

  1. Multiple account states are combined and hashed recursively into a compact 32-byte "state root."
  2. This state root is stored on-chain, while the full account data is stored off-chain in the Solana ledger.
  3. When a transaction needs to access or modify the compressed data, it provides a proof that the data corresponds to the on-chain state root.
  4. The proof is verified on-chain, allowing the transaction to proceed if valid.

The key innovation lies in the use of zero-knowledge proofs, specifically SNARKs (Succinct Non-interactive Arguments of Knowledge), to compress the Merkle proofs used in this process. As Swen describes, "We're using a SNARK to compress these Merkle proofs... previously with the cNFT, so compressed NFT, plain compression if you will, just like plain Merkle proofs into a small proof."

This compression reduces the proof size from potentially hundreds of bytes to a constant 128 bytes, regardless of the number of accounts being compressed. This dramatic reduction in data size enables developers to work within Solana's transaction size limits while still interacting with multiple compressed accounts in a single transaction.

The Impact on Scalability

The introduction of ZK Compression has far-reaching implications for Solana's scalability. By reducing the cost of state storage, it enables applications to serve much larger user bases without resorting to layer-2 solutions or sacrificing the benefits of Solana's L1.

Swen provides a compelling example: "You have apps like Drip, but also protocols like Helium, Hivemapper, who want to serve a lot of users and they don't want to build their own L2, L3, whatever. They want to use the L1. Compression is a great way to do that, right? So to go on the L1 and benefit from the L1, while still scaling to a lot of users."

This capability is particularly crucial for applications that require frequent, small transactions or need to manage large datasets. For instance, decentralized finance (DeFi) protocols can now handle more users and assets without prohibitive costs, while gaming applications can store more in-game assets and state efficiently.

ZK Compression vs. Rollups: Clearing the Confusion

The release of ZK Compression sparked some confusion in the crypto community, with some drawing comparisons to zero-knowledge rollups used in Ethereum scaling. However, Swen and the Lightspeed hosts were quick to clarify the distinctions.

Unlike rollups, which batch multiple transactions off-chain and submit them as a single transaction, ZK Compression operates entirely on Solana's L1. Each transaction using compressed data still interacts directly with the on-chain program, maintaining full composability with other Solana applications.

Mert, one of the podcast hosts, emphasizes this point: "The transactions are still regular transactions, right? You just send them to the chain as usual." This key difference means that ZK Compression doesn't introduce new trust assumptions or compromise Solana's security model.

The team deliberately chose not to use the term "rollup" to avoid confusion. As Swen explains, "If you start from first principles, yeah, they share like some, let's say similarities. But there's no way that I'd call this a rollup, it would cause first of all, 10 times the outrage and like a hundred times confusion."

The Photon Indexer: Enabling Efficient Data Access

Alongside ZK Compression, Light Protocol has introduced the Photon Indexer, an essential tool for working with compressed data. This open-source indexer watches the Solana ledger, accumulates state changes, and provides efficient access to compressed data.

Developers can run the Photon Indexer locally or use a hosted version, which offers additional optimizations for complex queries and metadata enhancements. This infrastructure ensures that applications can efficiently read and write compressed data without sacrificing performance.

Implications for Solana's Future

The introduction of ZK Compression represents more than just a technical improvement; it's a paradigm shift in how developers can approach building on Solana. By providing a solution to the state storage challenge, it opens up new possibilities for application design and user scalability.

Moreover, ZK Compression demonstrates Solana's ability to innovate and address its unique challenges without simply copying solutions from other blockchains. As Mert points out, "Solana has its own technical insufficiencies that are independent from [Ethereum's]. And so you should start from those and then work your way up instead of trying to retrofit random concepts across different problem sets."

This innovation also positions Solana well for future developments in blockchain technology. The introduction of Merkleized state through ZK Compression lays the groundwork for more advanced zero-knowledge applications, potentially including privacy features that were part of Light Protocol's original vision.

Adoption and Future Development

Since its release, ZK Compression has garnered significant interest from the Solana developer community. Projects like Drip, Helium, and Hivemapper are already exploring how to leverage this technology to scale their applications.

The open-source nature of both the ZK Compression protocol and the Photon Indexer encourages community involvement and rapid iteration. As more developers adopt and build upon this technology, we can expect to see a new wave of scalable, efficient applications emerging on the Solana network.

Looking ahead, the Light Protocol team and the broader Solana ecosystem are likely to continue refining and expanding upon the capabilities introduced by ZK Compression. This may include further optimizations to reduce computational overhead, enhanced tooling for developers, and potentially new compression techniques that build upon the foundations laid by this breakthrough.

Conclusion: A New Chapter in Solana's Scalability Story

ZK Compression marks the beginning of a new era for Solana, one where the network's renowned speed and low transaction costs are complemented by highly efficient state storage. This innovation addresses one of the key bottlenecks in blockchain scalability, positioning Solana as a leader in the race to achieve mainstream adoption of blockchain technology.

As the ecosystem embraces and builds upon this technology, we can expect to see a proliferation of applications that can serve millions of users directly on Solana's L1. This not only enhances Solana's value proposition but also pushes the boundaries of what's possible in the broader blockchain space.

The story of ZK Compression is a testament to the power of innovation and the importance of addressing blockchain challenges from first principles. As Solana continues to evolve and grow, technologies like ZK Compression will play a crucial role in shaping the future of decentralized applications and finance.

Facts + Figures

  • ZK Compression was officially released on June 21, 2024, by Light Protocol.
  • The technology allows developers to compress multiple account states into a single on-chain account on Solana.
  • A single token account on Solana currently costs slightly less than $1 to instantiate.
  • ZK Compression reduces Merkle proof sizes from potentially hundreds of bytes to a constant 128 bytes.
  • The Photon Indexer, an open-source tool, has been released alongside ZK Compression to facilitate efficient data access.
  • Light Protocol's journey began in summer 2021, initially focused on building private voting systems using zero-knowledge proofs on Solana.
  • The team pivoted from privacy-focused applications to scaling solutions during the bear market of 2022-2023.
  • ZK Compression uses SNARKs (Succinct Non-interactive Arguments of Knowledge) to compress Merkle proofs.
  • The technology operates entirely on Solana's L1, maintaining full composability with other Solana applications.
  • Projects like Drip, Helium, and Hivemapper are exploring the use of ZK Compression to scale their applications.
  • Solana's unique account model separates data storage from smart contracts, unlike Ethereum's coupled approach.
  • ZK Compression introduces Merkleized state to Solana, laying groundwork for more advanced zero-knowledge applications.
  • The development of ZK Compression involved collaboration with the Solana Foundation and other ecosystem partners.
  • Light Protocol's work on ZK Compression builds upon the earlier implementation of compressed NFTs (cNFTs) on Solana.
  • The technology is designed to work within Solana's transaction size limit of approximately 1.2 kilobytes.

Questions Answered

What is ZK Compression?

ZK Compression is a scaling solution developed for Solana that allows multiple account states to be compressed into a single on-chain account. It uses zero-knowledge proofs, specifically SNARKs, to compress Merkle proofs and reduce the amount of data stored on-chain. This technology enables developers to create more scalable applications on Solana by significantly reducing the cost of state storage.

How does ZK Compression differ from rollups?

ZK Compression is fundamentally different from rollups used in Ethereum scaling. Unlike rollups, which batch multiple transactions off-chain and submit them as a single transaction, ZK Compression operates entirely on Solana's L1. Each transaction using compressed data still interacts directly with the on-chain program, maintaining full composability with other Solana applications. ZK Compression doesn't introduce new trust assumptions or compromise Solana's security model.

What problem does ZK Compression solve for Solana?

ZK Compression addresses the high cost of on-chain state storage on Solana. As Solana gained popularity, the cost of creating and maintaining accounts became a significant barrier to scaling applications. By allowing developers to compress multiple account states into a single account, ZK Compression drastically reduces the cost of scaling applications on Solana, enabling them to serve much larger user bases without resorting to layer-2 solutions.

How can developers start using ZK Compression?

Developers can get started with ZK Compression by visiting zk compression.com, where comprehensive documentation is available. All the code for ZK Compression, including the core protocol and the RPC implementation (Photon Indexer), is open-source. Developers can run the Photon Indexer locally or use a hosted version for efficient data access and management of compressed accounts.

What is the Photon Indexer?

The Photon Indexer is an open-source tool released alongside ZK Compression to facilitate efficient data access for compressed accounts. It watches the Solana ledger, accumulates state changes, and provides developers with efficient access to compressed data. The Photon Indexer can be run locally or used as a hosted service, offering additional optimizations for complex queries and metadata enhancements.

How does ZK Compression impact Solana's scalability?

ZK Compression significantly enhances Solana's scalability by reducing the cost and complexity of managing large amounts of on-chain state. This allows applications to serve much larger user bases without sacrificing the benefits of Solana's L1. It's particularly beneficial for applications that require frequent, small transactions or need to manage large datasets, such as DeFi protocols and gaming applications.

What types of applications can benefit most from ZK Compression?

Applications that require managing large numbers of user accounts or storing significant amounts of data can benefit greatly from ZK Compression. Examples include DeFi protocols that need to handle many user balances, gaming applications with numerous in-game assets, and projects like Helium and Hivemapper that deal with large-scale data management and frequent small transactions.

How does ZK Compression relate to privacy features on Solana?

While ZK Compression itself doesn't directly implement privacy features, it lays the groundwork for more advanced zero-knowledge applications on Solana. The technology introduces Merkleized state to Solana, which could potentially be leveraged in the future for privacy-preserving transactions or computations, aligning with Light Protocol's original vision of bringing privacy features to the Solana ecosystem.

Related Content

The Future Of Solana In 2024 & Beyond | Zano Sherwani

Dive into the future of Solana with Jito co-founder Zano Sherwani as he discusses MEV, Firedancer, restaking, and the evolving blockchain landscape.

Solana Ecosystem Call: February 2024

Dive into the latest Solana developments with Dan Romero, Brian Johnson, and key project launches in this packed ecosystem call

Breakpoint 2023: Firedancer Update

An introduction to Firedancer, a new high-performance validator for the Solana blockchain, aimed at enhancing network speed and reliability.

Breakpoint 2023: Star Atlas Session

A visionary presentation on Star Atlas's intersection of gaming and blockchain on the Solana platform.

Breakpoint 2023: Solang: Running Solidity Natively on Solana

An introduction to Solang, a tool that compiles Solidity code to run natively on the Solana blockchain.

Breakpoint 2023: School of Solana by Ackee Blockchain

Ackee Blockchain's latest initiative, the School of Solana, offers free, online blockchain developer education.

Breakpoint 2023: A World in a Grain of Sand: State Compression on Solana

Exploring the possibilities of blockchain scalability with state compression technology on Solana.

Researching the Solana Ecosystem: Challenges, Learnings, and Opportunities

An exploration of the current state and future possibilities within the Solana Ecosystem

Breakpoint 2023: Widening the Design Space of AMMs with Solana

Joe Corey discusses innovative mechanisms for AMMs leveraging Solana’s high-performance blockchain

Leveraging NFTs & Zero-Knowledge Proofs in Solana's Ecosystem

An exploration of how NFTs and Zero-Knowledge Proofs could shape the future of Solana's blockchain ecosystem.

How Firedancer Will Unlock Solana's Scaling Roadmap | Lucas Bruder, Liam Heeger

Discover how Firedancer, Solana's new validator client, aims to revolutionize blockchain performance and unlock unprecedented scalability for the network.

How to Instantly Unstake + Withdraw SOL from Solana Staking

Learn how to unstake SOL from Solana staking and withdraw your SOL from Solana staking.

Hold Me Higher, Tinydancer: Deep Dive into Solana's First Light Client

An in-depth look into the breakthrough light client technology for the Solana blockchain and its potential impact on the ecosystem.

Breakpoint 2023: Social Media on Solana

An in-depth look at the evolving landscape of social media on the Solana blockchain from the perspectives of key industry players.

Breakpoint 2023: Water from a Stone: Liquid Staking on Solana

A deep dive into the evolving landscape of liquid staking on the Solana blockchain featuring key industry players.