0Pricing
Web3 & DApp Development Fundamentals · บทเรียน

โรลอัป

แบบ Optimistic และ ZK

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

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

What Is a Rollup?

A rollup executes transactions on a Layer 2 and posts the transaction data (and a state commitment) back to Layer 1.

The L1 stores enough information to reconstruct and verify the L2 state, which is what gives rollups their security.

Two Main Types

There are two dominant rollup families:

  • Optimistic Rollups — assume transactions are valid, allow challenges
  • ZK Rollups — prove validity with cryptographic proofs

They differ in how they convince L1 the L2 state is correct.

Optimistic Rollups

Optimistic rollups assume every batch is valid by default — hence optimistic.

They post the new state to L1 without proving it immediately, relying on the threat of fraud proofs to keep operators honest.

Fraud Proofs and the Challenge Window

After a batch is posted, a challenge window (often ~7 days) opens. Anyone can submit a fraud proof showing the batch was invalid.

If a valid challenge succeeds, the bad batch is reverted and the dishonest operator is penalized.

post batch -> 7-day challenge window
  no valid challenge -> finalized
  valid fraud proof  -> batch reverted

Withdrawal Delays

The challenge window means withdrawing from an optimistic rollup back to L1 takes time (often a week).

Liquidity providers offer instant withdrawals for a fee by fronting the funds during the wait.

ZK Rollups

ZK rollups generate a cryptographic validity proof (a zero-knowledge proof) for each batch.

L1 verifies the proof mathematically, so there is no need to trust the operator or wait for a challenge period.

Validity Proofs

A validity proof (such as a SNARK or STARK) demonstrates that the new state was computed correctly from the old state and the transactions.

If the proof verifies, the state is definitively correct — no challenges needed.

proof = prove(oldState, txs, newState)
L1.verify(proof) == true
-> newState accepted instantly

Faster Finality on ZK

Because ZK proofs are verified immediately, ZK rollups offer fast finality and quick withdrawals.

The trade-off is that generating proofs is computationally expensive and historically harder for general smart contracts.

Optimistic vs ZK Trade-offs

Comparing the two:

  • Optimistic: EVM-compatible, cheaper proving, slow withdrawals
  • ZK: instant finality, fast withdrawals, complex proving

Both post data to L1, so both inherit Ethereum security.

Data Availability

Rollups must publish transaction data so anyone can reconstruct the state — this is data availability.

Posting data to L1 (calldata or blobs) is a major cost; innovations like EIP-4844 blobs made it much cheaper.

Putting It Together

Rollups execute off-chain and settle on L1. Optimistic rollups assume validity and use fraud proofs; ZK rollups prove validity cryptographically. Data availability anchors their security.

Next we look at moving assets between layers with bridges.

Quick Check

Test your rollup knowledge.

Recap: Rollups

You learned that:

  • Rollups execute off-chain and settle data on L1
  • Optimistic rollups use fraud proofs + a challenge window
  • ZK rollups use validity proofs for instant finality
  • Data availability on L1 anchors security

Next: bridging assets between layers.

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

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

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

คุณจะเรียนรู้อะไรในบทเรียน “โรลอัป”

แบบ Optimistic และ ZK คุณปฏิบัติ Web3 & DApp Development Fundamentals ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Web3 & DApp Development Fundamentals หรือไม่

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

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

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

ฉันเขียนและรันโค้ดในบทเรียน Web3 & DApp Development Fundamentals นี้ได้ไหม

ได้ บทเรียน Web3 & DApp Development Fundamentals ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

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

  1. เหตุใดจึงต้องใช้เลเยอร์ 2
  2. โรลอัป
  3. การเชื่อมสินทรัพย์
  4. การเลือกเลเยอร์ 2
← กลับไปที่ Web3 & DApp Development Fundamentals