Lesson 0112 min
REPORT · CHALLENGE · FINALIZE

Code Cannot See Outside the Window

Let a reporter, challenger, and arbitrator complete one round of bringing a real-world result onchain.

OBJECTIVESAfter this lesson, you should be able to:
  • Separate a data source, an initial report, and a final result
  • Explain how a challenge window and economic bond can correct an error
  • Judge why an unchallenged wrong report can still enter settlement
COURSE POSITIONStep 1 of 4
  1. PREVIOUSCourse introduction
  2. CURRENTCode Cannot See Outside the Window

    Let a reporter, challenger, and arbitrator complete one round of bringing a real-world result onchain.

  3. NEXTWhy Is One API Result Not Enough?
BEFORE YOU READ

Think about these questions first.

Choose an answer before opening the explanation. You can add anything unexpected to your review list.

Q01Why can an honest oracle reporter still be wrong?
SHORT ANSWER

Honesty means no deliberate lie, not perfect information. A reporter can read a bad source, misread rules, or face an outage; the oracle needs a correction process, not an infallible person.

Compared with your prediction:

Smart contracts can verify balances, signatures, and state transitions, but they cannot see a launch, a match, or the weather outside the chain. An oracle is not simply an API call: it is a process for deciding who may report, who may challenge, and what an error costs.

A source, a report, and a final result are different

The prediction market asks: “Will humans return to the Moon before 2028?” The price can move onchain, but whether the event happened must come from outside. A complete oracle flow has at least three layers:

  1. Data source: official records, APIs, or evidence that may be delayed, conflicting, or manipulated.
  2. Initial report: a participant writes YES or NO and locks a bond.
  3. Final result: only after the challenge window and dispute process may a market read the result and pay out.
ORACLE SIMULATION虚拟担保 · 非投资建议
ORACLE 001 · REPORT / CHALLENGE / FINALIZE

现实结果如何进入链上?

2028 年前,人类会再次踏上月球吗?

数据源状态来源冲突未经核验的社交媒体账户
数据源
02初始报告
03挑战窗口
04最终结果
当前阶段等待报告状态机
初始报告未报告尚未比较
最终结果未报告发送给市场结算
担保风险0积分锁定中
结算交接未交接等待最终化
现实证据与参与者实验真相可展开
揭开数据源记录(教学用真相)
YES

初报与官方记录相反,必须依靠挑战期纠错。

报告者Primary Reporter
可用积分
1,000
锁定担保
0
正确 / 错误
0 / 0
挑战者Challenger
可用积分
1,000
锁定担保
0
正确 / 错误
0 / 0

数据源是现实世界的输入;担保金是让参与者在错误报告时付出代价的激励。两者都不能被价格本身替代。

观察提示

预言机不是把 API 结果复制上链,而是把一组带激励、担保和争议流程的事实输入接入结算。

预言机事件2 EVENTS
  1. 02

    数据源为「未经核验的社交媒体账户」,状态 CONFLICTING。

  2. 01

    等待报告:2028 年前,人类会再次踏上月球吗?

ACTION HISTORYExperiment timeline
1 state snapshots

Use the slider to return to an earlier step. Continuing from there replaces the later history with a new sequence.

Initial state
View experiment records →

Why a challenge window matters

If a report settled immediately, a delayed or manipulated source would directly trigger payouts. A challenge window gives other participants a public interval to submit the opposite result and lock a bond that proves they are willing to bear the risk.

This lab simplifies the window to two blocks. Advancing time changes the deadline, not the report. Only after the window ends can the protocol finalize the report or enter arbitration. Real systems may use timestamps, dispute rounds, voting, or decentralized evidence, but the question is the same: when can an error be detected, and why would an honest participant step forward?

A bond makes an opinion accountable

The Primary Reporter and Challenger both lock credits. With no challenge, the reporter gets the bond back, even if the result is wrong; with a challenge, the arbitrator reads the evidence, the correct side receives both bonds, and the wrong side absorbs the loss.

This is not magic correctness. It puts attack cost, discovery reward, and time into the state machine. An attacker may still control a source, collude, or make honest challenges too expensive.

Expand: how this step works
submit(outcome, bond):
  lock(reporter, bond)
  open(challengeWindow)

challenge(oppositeOutcome, bond):
  lock(challenger, bond)

after window:
  if no challenge:
    finalize(reportedOutcome)
  else:
    winner = evidence == reportedOutcome ? reporter : challenger
    winner receives both bonds

Production systems add source aggregation, reputation, commit/reveal, governance, Sybil resistance, and upgrade controls. This lab compresses those concerns into observable bonds and events so the trust boundary stays visible.

Why the market cannot repair a bad fact by itself

An order book knows how many credits traders will exchange for a position; it does not know whether the Moon launch or match actually happened. If an oracle writes the wrong result into settlement, a later price rebound cannot automatically reverse payouts.

That is why serious systems separate price discovery from fact reporting. The first handles beliefs and liquidity; the second handles sources, challenges, and disputes. Clear module boundaries make risks easier to test and explain.

KNOWLEDGE CHECK

What is the most important job of an oracle challenge window?

Five questions for evaluating an oracle

After the lab, explain:

  1. What is the different role of a data source and a reporter?
  2. Why should a report not trigger a payout immediately?
  3. Why must a challenger lock a bond?
  4. Why can a wrong report still finalize when nobody challenges it?
  5. When should a prediction market read the final result?

Oracles are the reality interface for onchain finance: prediction markets, lending collateral ratios, stablecoin reserves, and liquidation prices all depend on them. Understanding their boundary is part of understanding blockchain finance itself.

LESSON RECAPComplete the exercise and knowledge check first