The Ultimate Guide to Zero-Knowledge Proofs: zk-SNARKs vs zk-STARKs

Paulina Lewandowska

14 Apr 2023
The Ultimate Guide to Zero-Knowledge Proofs: zk-SNARKs vs zk-STARKs

Introduction

As blockchain and cryptocurrency have risen in popularity, zero-knowledge proofs have become increasingly important in cryptography. These types of proofs allow for one party to prove they know certain information without actually revealing the information, making them useful for confidential transactions. In this blog post, we will compare the differences between the two most commonly used kinds of zero-knowledge proofs: zk-SNARKs vs zk-STARKs.

What are Zero Knowledge Proofs?

In cryptography, zero-knowledge proofs are a type of protocol that enables one party to prove to another party that a statement is true without revealing any additional information beyond the statement's truthfulness. In other words, zero-knowledge proofs allow one party to demonstrate knowledge of a particular fact without disclosing any other information that could be used to derive the same knowledge. This makes them useful for applications that require secure and private transactions, such as in blockchain and cryptocurrency, where they can be used to verify transactions without revealing any sensitive information. Zero-knowledge proofs are becoming increasingly important in cryptography due to their potential applications in privacy-preserving systems and secure transactions.

In the Mina Protocol video below, you will learn more details:

https://www.youtube.com/watch?v=GvwYJDzzI-g&pp=ygUVWmVyby1Lbm93bGVkZ2UgUHJvb2Zz

Zk-SNARKs vs zk-STARKs: what’s the difference?

In the realm of zero-knowledge proofs, there are two types: k-SNARKs and zk-STARKs. The distinguishing factor between the two lies in their approach to generating proofs. While zk-SNARKs utilize a trusted setup in which a group of trusted individuals generate a set of public parameters to generate proofs that can be reused indefinitely, zk-STARKs employ a more computationally intensive method that negates the need for a trusted setup.

Zk-SNARKs vs zk-STARKs

When comparing Zk-SNARKs and zk-STARKs, one key difference is their level of transparency. Zk-SNARKs are considered less transparent than zk-STARKs due to their reliance on a secret key that is only known to trusted setup participants, which could compromise the system's security if leaked or compromised. However, zk-STARKs are completely transparent and don't rely on assumptions or secret keys, making them more appealing to those who prioritize both transparency and security.

In terms of proof generation time and size, Zk-SNARKs are generally less efficient than zk-STARKs. However, zk-STARKs have the advantage of scalability and can handle more complex computations. Additionally, zk-STARKs are post-quantum secure, while Zk-SNARKs are not, making them resistant to attacks from quantum computers. Another important consideration is that zk-STARKs are more scalable and can handle larger computations compared to zk-SNARKs.

Zk-SNARKs explained

Zk-SNARKs have become increasingly popular due to their efficiency and privacy-preserving features, making them applicable in various real-life scenarios such as in blockchain, where they can be deployed to prove ownership of digital assets without revealing sensitive information. Additionally, Zk-SNARKs have played a crucial role in voting systems by ensuring the accurate counting of votes while maintaining voter anonymity. One of the most notable applications of Zk-SNARKs can be observed in Zcash, a private cryptocurrency, which allows users to transact anonymously while concealing transaction data. However, concerns about potential security risks have been raised regarding the use of trusted setups in Zk-SNARKs, as a compromised trusted setup can put the entire system's privacy at risk.

Zk-STARKs explained

Rather than requiring a trusted setup like zk-SNARKs do, zk-STARKs were developed as a better alternative, which is more resistant to attacks. This is because the trusted setup of zk-SNARKs is vulnerable to malicious use should it be compromised. Despite this, zk-STARKs require more calculations to generate a proof, making them less efficient overall. Still, recent developments have paved the way for more efficient zk-STARKs, making it a promising replacement to zk-SNARKs.

According to their use cases, zk-SNARKs and zk-STARKs differ not only in efficiency and trusted setups. Applications that require fast and efficient proof verification, such as privacy-preserving transactions in cryptocurrencies, typically use zk-SNARKs. In contrast, zk-STARKs are more appropriate for applications that require transparency and no trusted setup, such as voting systems and decentralized autonomous organizations (DAOs). Additionally, it's worth noting that although zk-SNARKs and zk-STARKs are the most prominent types of zero-knowledge proofs, there are other variants such as Bulletproofs and Aurora that offer different trade-offs in efficiency and security, depending on the specific use case.

How to implement zk proof in the project?

When implementing zero-knowledge proof in a project, there are various technical steps involved, and depending on the type of zero-knowledge proof used, different methods and tools are available, such as zk-SNARKs vs zk-STARKs. For instance, when using zk-SNARKs, developers must utilize a trusted setup to produce the public parameters that will be used to generate and authenticate the proofs. The process requires the selection of the appropriate trusted setup ceremony, the setup of necessary infrastructure and assigning the participants who will generate the parameters. After the trusted setup, developers must include the appropriate libraries such as libsnark in their code and develop the functions required to generate and authenticate the proofs.

When it comes to zk-STARKs, a different approach is necessary for developers since trusted setup isn't required. To prove the computations, they need to utilize tools like circom and snarkjs to generate the circuits and tools such as groth16 and marlin to verify and generate the proofs. This includes choosing the appropriate tools and libraries, creating circuits, and ensuring full implementation of verification functions and proof generation.

A deep understanding of the cryptographic protocols involved, as well as having access to the necessary tools and libraries, are crucial requirements for developers when implementing zero-knowledge proof in a project. Additionally, developers must ensure that the proofs generated by the system are correct, secure, and efficient without compromising the users' privacy or security. Testing and debugging play a critical role during the process, and developers must ensure the system undergoes thorough testing before deploying it to production.

Conclusion

Zero-knowledge proofs have become increasingly crucial in cryptography, particularly in blockchain and cryptocurrency. The most commonly used types of zero-knowledge proofs are zk-SNARKs and zk-STARKs, which vary in their approach to generating proofs, level of transparency, proof generation time and size, scalability, and post-quantum security. To implement zero-knowledge proof in a project, developers must possess a thorough understanding of the cryptographic protocols employed, access to the necessary tools and libraries, and ensure the system undergoes comprehensive testing before deployment. Different technical steps and methods are required depending on the zero-knowledge proof used. As the use of zero-knowledge proofs continues to expand, comprehending the trade-offs between different types and effectively implementing them in various applications while safeguarding privacy and security is of utmost importance.

Most viewed


Never miss a story

Stay updated about Nextrope news as it happens.

You are subscribed

Master UI Component Creation with AI: The Ultimate Guide for Developers

Gracjan Prusik

24 Mar 2025
Master UI Component Creation with AI: The Ultimate Guide for Developers

Introduction

Modern frontend development is evolving rapidly, and creating UI components with AI tools is helping developers save time while enhancing interface quality. With AI, we can not only speed up the creation of UI components but also improve their quality, optimize styles, and ensure better accessibility.

This article explores how creating UI components with AI is transforming frontend development by saving time and improving workflows. Specifically, we will discuss:

  • Generating components from images,
  • AI for style analysis and optimization,
  • Automatic style conversion and code migration,
  • AI in generating UI animations.

Creating UI Components with AI from Images

One of the interesting applications of AI in frontend development is the ability to generate components from an image. AI can recognize the structure of the interface and generate HTML/CSS or JSX code that matches the provided image. One of the most popular tools for UI creation is Lovable.

For testing, let's see how the tool performs in creating a simple contact form from the page you are currently on, which is Nextrope.

Query:

"Recreate the image I've sent you in Next.js using CSS."

Sample image used in the query:

The result received:

Tworzenie komponentów UI - Wygenerowany widok

Lovable did an excellent job transforming the image into code. The view is fully responsive. It’s important to remember that the more precise the request, the better the AI will replicate the expected view. However, even with a simple command, the tool performed surprisingly well.

Of course, AI has its limitations. It still makes quite a few mistakes. The generated code still requires review and fixes from the developer, but in some cases, the entire process is significantly sped up—correcting the code often takes less time than creating the component from scratch.

Optimizing UI Components with AI Tools for Style Improvements

This problem of inaccurate code reproduction by AI can be partially addressed by using it to analyze and improve styles. Tools like ChatGPT, DeepSeek and Claude are capable of not only generating code but also diagnosing CSS errors and suggesting why a particular style might not be working as expected.

Simple example: Why is the div not centered?

Query: "Why is this div not centered?"

AI analyzes the code and provides the following response:

Problem: The parent container does not have a defined width or display: flex.
Solution: Add the appropriate styles to the parent container.

.parent {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

AI for Automatic Style Conversion and Code Migration in UI Components

AI can assist with style conversion between different technologies, such as transferring code from traditional CSS to Styled Components or Tailwind CSS.

Let's assume we have a style written in traditional CSS:

.button {
  background-color: blue;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: darkblue;
}

We can use AI for automatic conversion to Styled Components:

import styled from "styled-components";

const Button = styled.button`
  background-color: blue;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s ease;

  &:hover {
    background-color: darkblue;
  }
`;

export default Button;

AI can also assist in migrating code between frameworks, such as from React to Vue or from CSS to Tailwind.

This makes style migration easier and faster.

How AI Enhances UI Animation Creation

Animations are crucial for enhancing user experience in interfaces, but they are not always provided in the project specification. In such cases, developers have to come up with how the animations should look, which can be time-consuming and require significant creativity. AI, in this context, becomes helpful because it can automatically generate CSS animations or animations using libraries like Framer Motion, saving both time and effort.

Example: Automatically Generated Button Animation

Suppose we need to add a subtle scaling animation to a button but don't have a ready-made animation design. Instead of creating it from scratch, AI can generate the code that meets our needs.

Code generated by AI:

import { motion } from "framer-motion";

const AnimatedButton = () => (
  <motion.button
    whileHover={{ scale: 1.1 }}
    whileTap={{ scale: 0.9 }}
    className="bg-blue-500 text-white px-4 py-2 rounded-lg"
  >
    Press me
  </motion.button>
);

In this way, AI accelerates the animation creation process, providing developers with a simple and quick option to achieve the desired effect without the need to manually design animations from scratch.

Summary

AI significantly accelerates the creation of UI components. We can generate ready-made components from images, optimize styles, transform code between technologies, and create animations in just a few seconds. Tools like ChatGPT, DeepSeek, Claude and Lovable are a huge help for frontend developers, enabling faster and more efficient work.

In the next part of the series, we will take a look at:

If you want to learn more about how AI is impacting the entire automation of frontend processes and changing the role of developers, check out our blog article: AI in Frontend Automation – How It's Changing the Developer's Job?

Follow us to stay updated!

AI in Real Estate: How Does It Support the Housing Market?

Miłosz Mach

18 Mar 2025
AI in Real Estate: How Does It Support the Housing Market?

The digital transformation is reshaping numerous sectors of the economy, and real estate is no exception. By 2025, AI will no longer be a mere gadget but a powerful tool that facilitates customer interactions, streamlines decision-making processes, and optimizes sales operations. Simultaneously, blockchain technology ensures security, transparency, and scalability in transactions. With this article, we launch a series of publications exploring AI in business, focusing today on the application of artificial intelligence within the real estate industry.

AI vs. Tradition: Key Implementations of AI in Real Estate

Designing, selling, and managing properties—traditional methods are increasingly giving way to data-driven decision-making.

Breakthroughs in Customer Service

AI-powered chatbots and virtual assistants are revolutionizing how companies interact with their customers. These tools handle hundreds of inquiries simultaneously, personalize offers, and guide clients through the purchasing process. Implementing AI agents can lead to higher-quality leads for developers and automate responses to most standard customer queries. However, technical challenges in deploying such systems include:

  • Integration with existing real estate databases: Chatbots must have access to up-to-date listings, prices, and availability.
  • Personalization of communication: Systems must adapt their interactions to individual customer needs.
  • Management of industry-specific knowledge: Chatbots require specialized expertise about local real estate markets.

Advanced Data Analysis

Cognitive AI systems utilize deep learning to analyze complex relationships within the real estate market, such as macroeconomic trends, local zoning plans, and user behavior on social media platforms. Deploying such solutions necessitates:

  • Collecting high-quality historical data.
  • Building infrastructure for real-time data processing.
  • Developing appropriate machine learning models.
  • Continuously monitoring and updating models based on new data.

Intelligent Design

Generative artificial intelligence is revolutionizing architectural design. These advanced algorithms can produce dozens of building design variants that account for site constraints, legal requirements, energy efficiency considerations, and aesthetic preferences.

Optimizing Building Energy Efficiency

Smart building management systems (BMS) leverage AI to optimize energy consumption while maintaining resident comfort. Reinforcement learning algorithms analyze data from temperature, humidity, and air quality sensors to adjust heating, cooling, and ventilation parameters effectively.

Integration of AI with Blockchain in Real Estate

The convergence of AI with blockchain technology opens up new possibilities for the real estate sector. Blockchain is a distributed database where information is stored in immutable "blocks." It ensures transaction security and data transparency while AI analyzes these data points to derive actionable insights. In practice, this means that ownership histories, all transactions, and property modifications are recorded in an unalterable format, with AI aiding in interpreting these records and informing decision-making processes.

AI has the potential to bring significant value to the real estate sector—estimated between $110 billion and $180 billion by experts at McKinsey & Company.

Key development directions over the coming years include:

  • Autonomous negotiation systems: AI agents equipped with game theory strategies capable of conducting complex negotiations.
  • AI in urban planning: Algorithms designed to plan city development and optimize spatial allocation.
  • Property tokenization: Leveraging blockchain technology to divide properties into digital tokens that enable fractional investment opportunities.

Conclusion

For companies today, the question is no longer "if" but "how" to implement AI to maximize benefits and enhance competitiveness. A strategic approach begins with identifying specific business challenges followed by selecting appropriate technologies.

What values could AI potentially bring to your organization?
  • Reduction of operational costs through automation
  • Enhanced customer experience and shorter transaction times
  • Increased accuracy in forecasts and valuations, minimizing business risks
Nextrope Logo

Want to implement AI in your real estate business?

Nextrope specializes in implementing AI and blockchain solutions tailored to specific business needs. Our expertise allows us to:

  • Create intelligent chatbots that serve customers 24/7
  • Implement analytical systems for property valuation
  • Build secure blockchain solutions for real estate transactions
Schedule a free consultation

Or check out other articles from the "AI in Business" series