Key aspects

  • ZKThreads are a framework that can improve the performance and scalability of decentralized applications (dApps) using zero-knowledge proofs (ZKP).

  • ZKThreads can offer benefits in the form of better user experience, lower transaction costs, and greater security.

  • ZKThreads can be used in various applications such as decentralized exchanges (DEX), session-based gaming, zk-secured middleware, and on-chain AI systems.

Introduction

Security, composability, and interoperability are key to the efficient performance of decentralized applications (dApps), but they are often difficult to balance. ZKThreads proposes a possible solution to this trilemma. In this article, we will explore what ZKThreads are, how they work, how they are different from other zk solutions, some of their benefits and use cases.

What are ZKThreads?

ZKThreads is a zero-knowledge framework that improves the performance and scalability of dApps. They use Starknet capabilities to create a standardized environment for developing and running interoperable applications on the blockchain.

How do ZKThreads work?

1. Implementation of application logic

The process begins with implementing the application logic in the contracts of the ZKThreads application. These contracts are essentially the rules and procedures that govern the operation of an application.

2. Batch transactions

Instead of handling each transaction individually, ZKThreads bundles multiple transactions into a single batch. Therefore, it is more efficient to process them in large quantities.

3. Create tests

Next, a cryptographic proof called a STARK proof is created to ensure that all transactions in the batch are valid and have been processed according to the contract rules.

4. Verification

The STARK test is then sent to the Layer 2 sequencer, where it is verified against the dApp's canonical record. Canonical registration refers to the verified and accepted state of an application.

The ZKThread Verifier, a contract on Starknet, verifies the proof to ensure its accuracy. It checks for double spending, ensures that all transactions are authorized, and controls whether the resulting state is consistent with blockchain rules.

If the test is valid, ZKThread Verifier updates the dApp's canonical state record. If the test is invalid, the changes are rejected, ensuring the integrity of the application.

ZKThreads vs. other ZK solutions

Data management

ZKThreads are designed to store state and transaction data off-chain while using zero-knowledge proofs (ZKP) to validate transactions. transactions. This differs from many traditional zero-knowledge rollups (zk-rollups) that move computing off-chain, but still store transaction data on-chain

By keeping all data off-chain, ZKThreads can significantly reduce the data load on the main blockchain, improving scalability and reducing costs. In contrast, zk-rollups like zkSync periodically publish batch transaction data to the chain, ensuring that the base layer handles data availability.

Interoperability

ZKThreads prioritizes interoperable applications, reducing fragmentation and ensuring that different dApps can interact seamlessly within the same ecosystem. In contrast, other solutions like zkEVM focus more on compatibility.

Validation mechanism

The verification process in ZKThreads involves creating STARK tests that validate the correctness of batch transactions and state changes. These tests are verified against the canonical state of the dApp. In comparison, some zk-rollups like zkSync use zk-SNARK or zk-STARK to create cryptographic proofs that are verified on-chain.

Benefits of ZKThreads

Improved user experience

ZKThreads improves user experience by enabling seamless interaction between different dApps. Users can access multiple applications without having to switch networks.

Lower costs

By grouping transactions and processing them all at once, ZKThreads reduces the number of transactions that must be recorded on the main blockchain. This reduces transaction fees for users, making dApps more affordable.

Additionally, they store state and transaction data off-chain while still maintaining security and integrity through ZKPs. This reduces the data load on the blockchain, leading to lower gas fees.

Improved security

ZKThreads use ZKPs to improve security. ZKPs allow validation of transactions without revealing the underlying data, preserving privacy. Additionally, they ensure that all transactions are processed according to predefined rules, preventing unauthorized activities.

ZKThreads Use Cases

L2 decentralized exchanges

ZKThreads can make DEX on Starknet more efficient by reducing transaction fees for users. Normally, DEXs on Starknet would be impractical as users would have to pay fees for each trade. With ZKThreads, users only pay fees when they withdraw their funds, reducing the overall cost of trading and making DEXs more convenient and affordable.

Session based games

In session-based games, such as poker and chess, ZKThreads can help pool commissions. Instead of paying a commission for each move, players only pay a commission at the end of the game when the final results are recorded on Starknet. This allows developers to create a wider range of games fully on-chain without worrying about high transaction costs.

Shared liquidity infrastructure and Zk-secured middleware

ZKThreads provides a secure and efficient framework for middleware applications, such as oracles and bridges. By building functionality directly within a ZKThread, these applications can leverage ZKPs to ensure security and interoperability.

AI on the chain

ZKThreads offers the computing power needed to run AI models directly on the blockchain. This means that an AI program can be managed within a ZKThread, keeping its core data and operations consistent. These AI models can be used by different applications, such as games, social media platforms, and productivity tools.

Conclusions

ZKThreads is a framework for building scalable and secure dApps using ZKP. They can be used for Starknet DEXs, session-based games, and middleware applications. Unlike other zk solutions, ZKThreads emphasize interoperability, keeping all data off-chain, and using a different verification mechanism. Looking ahead, ZKThreads has the potential to significantly improve the performance and usability of dApps.

Further reading

Disclaimer: This content is presented "as is" for general information and educational purposes only, without representation or warranty of any kind. It should not be construed as financial, legal or other professional advice nor is it intended to recommend the purchase of any specific product or service. You should seek individual advice from suitable professional advisors. As this article is contributed by third parties, please note that the opinions expressed are those of the third party contributor and do not necessarily reflect those of Binance Academy. For more information, read our full legal notice here. Digital asset prices can be volatile. The value of an investment can go down as well as up, and you may not get back the amount invested. Only you are responsible for your investment decisions. Binance Academy is not responsible for any losses you may incur. This material should not be construed as financial, legal or other professional advice. For more information, please see our Terms of Use and Risk Warning.