0Pricing
Blockchain Smart Contracts with Solidity · บทเรียน

ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป

เปรียบเทียบออปติมิสติกโรลอัปกับซีโร่-นอลเลจโรลอัป พร้อมสำรวจกลไกและข้อแลกเปลี่ยนของแต่ละแบบ

ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป เป็นบทเรียน Blockchain Smart Contracts with Solidity ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Blockchain Smart Contracts with Solidity และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Blockchain Smart Contracts with Solidity มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Welcome to Rollups Deep Dive

In the previous lesson, we explored Layer 2 solutions for scaling blockchains. Today, we'll dive deeper into the two most prominent types of rollups: Optimistic Rollups and Zero-Knowledge (ZK) Rollups.

These technologies are crucial for making decentralized applications faster and cheaper to use.

What are Optimistic Rollups?

Optimistic Rollups operate on the assumption that all transactions processed off-chain are valid. They 'optimistically' believe everything is correct, without immediate cryptographic proof.

  • Transactions are bundled together off-chain.
  • A summary (state root) is posted to the Layer 1 (L1) blockchain.
  • This reduces L1 congestion and transaction costs significantly.

Fraud Proofs & Challenge Period

Since Optimistic Rollups don't verify transactions immediately, they rely on a challenge period. During this time (typically 7 days), anyone can submit a fraud proof if they detect an invalid transaction.

If fraud is proven, the invalid transaction is reverted, and the party responsible for the fraud is penalized.

Optimistic Withdrawal Delays

The challenge period creates a necessary delay for withdrawals. If you want to move assets from an Optimistic Rollup back to Layer 1, you must wait until the challenge period expires.

This ensures there's enough time for any potential fraud to be detected and proven, securing your funds.

Optimistic Rollups: Pros & Cons

Here's a quick look at the advantages and disadvantages:

  • Pros: Generally simpler to implement, highly compatible with the Ethereum Virtual Machine (EVM), allowing easy migration of existing dApps.
  • Cons: Long withdrawal delays (due to challenge period), requires active monitoring for fraud (though usually handled by network participants).

What are ZK-Rollups?

Zero-Knowledge (ZK) Rollups take a different approach. Instead of assuming validity, they use advanced cryptography to prove that transactions are valid before posting them to L1.

They generate a concise cryptographic proof (a 'validity proof') for a batch of off-chain transactions.

Validity Proofs in Action

When a ZK-Rollup processes transactions off-chain, it creates a special mathematical proof (like a ZK-SNARK or ZK-STARK). This proof confirms the correctness of all transactions in the batch without revealing any underlying data.

This proof is then submitted to L1, where it's instantly verified by a smart contract. If the proof is valid, the transactions are confirmed.

ZK-Rollups: Pros & Cons

Let's weigh the benefits and drawbacks of ZK-Rollups:

  • Pros: Instant finality (no withdrawal delay), stronger security guarantees (mathematically proven validity), potential for privacy features.
  • Cons: Extremely complex to build and maintain, high computational cost for generating proofs, historically less EVM-compatible (though ZK-EVMs are changing this).

Key Differences at a Glance

Here's a summary of the core distinctions between the two rollup types:

  • Verification: Optimistic uses fraud proofs (after the fact); ZK uses validity proofs (before the fact).
  • Withdrawals: Optimistic has a challenge period delay; ZK has immediate withdrawals.
  • Security: Optimistic relies on economic incentives and active monitoring; ZK relies on cryptographic certainty.

Choosing the Right Rollup

Both Optimistic and ZK Rollups offer significant scaling benefits, but their trade-offs make them suitable for different use cases:

  • Optimistic: Great for general-purpose dApps that benefit from EVM compatibility and can tolerate withdrawal delays.
  • ZK-Rollups: Ideal for applications requiring instant finality, high security, and potentially privacy, often at a higher development cost.

Test Your Knowledge!

Based on what you've learned, which statements correctly describe a key characteristic of either Optimistic or ZK Rollups?

Recap: Rollups Compared

We've explored the core differences between Optimistic and ZK Rollups. Optimistic Rollups assume validity and use fraud proofs with a challenge period, leading to withdrawal delays. ZK-Rollups use cryptographic validity proofs for instant verification and faster withdrawals.

Both are vital for scaling Ethereum, offering different balances of security, speed, and complexity for various decentralized applications.

คำถามที่พบบ่อย

บทเรียน “ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Blockchain Smart Contracts with Solidity ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Blockchain Smart Contracts with Solidity มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป”

เปรียบเทียบออปติมิสติกโรลอัปกับซีโร่-นอลเลจโรลอัป พร้อมสำรวจกลไกและข้อแลกเปลี่ยนของแต่ละแบบ คุณปฏิบัติ Blockchain Smart Contracts with Solidity ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Blockchain Smart Contracts with Solidity หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Blockchain Smart Contracts with Solidity บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Blockchain Smart Contracts with Solidity นี้ได้ไหม

ได้ บทเรียน Blockchain Smart Contracts with Solidity ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. บทนำสู่โซลูชันการขยายระบบ L2
  2. ออปติมิสติกโรลอัปเทียบกับ ZK โรลอัป
  3. การสื่อสารข้ามเชนและบริดจ์
  4. ความพร้อมใช้งานของข้อมูลและ Validium
← กลับไปที่ Blockchain Smart Contracts with Solidity