โ‚ฟ
ฮž
โ—Ž
โŸ
โ—ˆ
โฌก
โฌข
โ—‡
๐Ÿ”—

TheBlocks

Adversarial-Resilient Settlement Protocol

โšก Live on Sepolia๐Ÿ›ก๏ธ Multi-Oracle BFT
โŸ 
ETH/USD BFT Consensus
Loading...
0/0 oracles healthy

๐Ÿ’น Create Trade / Transfer Rights

Oracle-validated transfers with FIFO ordering | Queue: #0 | Next ID: 1

Transfers (1/100)

Transfer #1

โฑ๏ธ Optional Timeout

๐Ÿ“Š Trade Summary

Total ETH
0.0000
USD Value
$0.00
ETH/USD Rate
$0.00
Transfers
1
๐Ÿ“ก Live Chainlink Price

Please connect your wallet to create a trade

๐Ÿ† TriHacker Tournament 2025

Hackathon Requirements

All 5 requirements implemented and verified

โœ“๐Ÿ“ก

Multi-Oracle

Chainlink + Pyth + API3 + SyncedFeed

4 Oracles Live
โœ“โฑ๏ธ

Async Settlement

7-State FSM Flow

Cross-Block Safe
โœ“โณ

Partial Finality

Progressive Commitment

BFT Validated
โœ“๐Ÿ›ก๏ธ

Oracle Resistance

Byzantine Median

Faulty API3 Handled
โœ“๐ŸŽฏ

Attack Model

Flash Loan + MEV Defense

FIFO Queue
โš ๏ธ ADVERSARIAL CONDITION

Unreliable Oracle Defense

Your protocol's oracle may behave adversarially

ATTACKโŒ

1. Incorrect Values

Oracle reports 30% off

โœ“ Byzantine median rejects >5% deviation
MAX_DEVIATION = 5%
ATTACKโฐ

2. Outdated Data

Oracle provides stale prices

โœ“ Per-oracle staleness thresholds
MAX_STALENESS = 60-3600s
ATTACK๐Ÿšซ

3. Missed Updates

Oracle fails to update

โœ“ Fail tracking (3 fails = disabled)
MAX_FAIL_COUNT = 3
ATTACK๐Ÿ”€

4. Conflicting Values

Multiple oracles disagree

โœ“ Byzantine median from 5 oracles
BFT: 3/5 consensus
๐Ÿ›ก๏ธ

All 4 Adversarial Conditions Defended

Multi-oracle BFT aggregation: Byzantine Median + Staleness Checks + Fail Tracking + Confidence Weighting

๐Ÿงช Run Attack Simulator
๐Ÿง  INTELLIGENT SYSTEM

How Our Multi-Oracle BFT System Works

Self-healing architecture that maintains accuracy even with faulty oracles

โšกINTELLIGENT MULTI-ORACLE AGGREGATIONโšก
Data Sources
LIVE
โ›“๏ธ
Chainlink
LIVE
๐Ÿ”ฎ
Pyth
FAULTY
โš ๏ธ
API3
BACKUP
๐Ÿ’Ž
Redstone
FALLBACK
๐Ÿ”„
SyncedFeed
โ–ผ
โฑ๏ธ
STEP 1
STALENESS CHECK

Filter out outdated oracle data

โ€ขChainlink: MAX_STALENESS = 3600s (1 hour)
โ€ขPyth: MAX_STALENESS = 60s (real-time)
โ€ขAPI3: DETECTED STALE โ†’ EXCLUDED โŒ
๐Ÿ“Š
STEP 2
DEVIATION CHECK

Detect manipulation attempts

๐Ÿ›ก๏ธ
STEP 3
BYZANTINE MEDIAN

Fault-tolerant price calculation

โš–๏ธ
STEP 4
CONFIDENCE WEIGHTING

Weighted average by reliability

โ–ผ
โœ…
FINAL PRICE
Byzantine Fault Tolerant
๐Ÿ›ก๏ธ Secureโšก Real-time๐Ÿ”’ Verified
Live Oracle
Faulty (Excluded)
Backup Oracle
Fallback Feed
โšก

Handling Faulty API3 Oracle (Hackathon Condition)

The hackathon requires our system to work even when API3 returns stale/incorrect data. Here's how we handle it:

1๏ธโƒฃ

Detection

API3 data on Sepolia is stale (updatedAt > 24h ago). Our staleness check automatically detects this.

if (age > MAX_STALENESS) โ†’ exclude
2๏ธโƒฃ

Fallback

When API3 is excluded, SyncedPriceFeed activates as replacement - it derives price from Chainlink + Pyth.

SyncedFeed = median(CL, Pyth)
3๏ธโƒฃ

Continuity

System continues operating with 4/5 oracles. BFT still maintains correctness with 3+ valid sources.

BFT: โŒŠ(n-1)/3โŒ‹ = 1 fault tolerated

๐Ÿ”„ Settlement Transaction Flow

1
๐Ÿ“

Create

User submits settlement with transfers

2
๐Ÿ“‹

Queue

FIFO ordering prevents MEV

3
๐Ÿ”

Deposit

Funds locked in escrow

4
โœ…

Execute

Oracle-validated transfer

๐Ÿ›ก๏ธ 3-Phase Finality: TENTATIVE โ†’ SEMI_FINAL โ†’ FINAL (BFT Validated)

Built for TriHacker Tournament 2025 | Scaffold-ETH 2 โ€ข Solidity โ€ข Next.js