ما هي Oracles ولماذا يحتاجها Web3؟ | What Are Blockchain Oracles and Why Does Web3 Need Them?
تعلّم ببساطة، خطوة بخطوة
Learn simply, step by step
معلومة واضحة، ثم خطوة جديدة.
Clear knowledge, one step at a time.
ما هي Oracles ولماذا يحتاجها Web3؟ What Are Blockchain Oracles and Why Does Web3 Need Them?
لفهم Blockchain Oracles، يجب أولًا معرفة أن العقود الذكية تعمل داخل البلوكتشين، لكنها لا تستطيع بمفردها معرفة ما يحدث خارج الشبكة. وهنا تأتي وظيفة الـ Oracles التي تساعد العقود الذكية على استخدام بيانات من العالم الخارجي.

ما هي Blockchain Oracles؟
الـ Oracle هي خدمة أو نظام يساعد العقود الذكية في الحصول على بيانات لا توجد مباشرة داخل البلوكتشين.
قد تكون هذه البيانات أسعار العملات الرقمية، أسعار الأصول، حالة الطقس، نتائج الأحداث، أو أي معلومات خارجية يحتاج إليها العقد لتنفيذ شروطه.
بمعنى مبسط، تعمل Oracles كحلقة اتصال بين العالم الخارجي والبلوكتشين.
لماذا لا يحصل العقد الذكي على البيانات مباشرة؟
العقد الذكي يعمل داخل بيئة البلوكتشين، ويجب أن تكون عملية تنفيذه قابلة للتحقق بشكل متسق بواسطة الشبكة.
لذلك لا يمكن للعقد ببساطة فتح موقع ويب أو الاتصال مباشرة بواجهة API خارجية أثناء التنفيذ كما تفعل التطبيقات التقليدية.
إذا احتاج العقد إلى بيانات خارجية، فيجب توفير هذه البيانات له بطريقة يمكن استخدامها داخل بيئة البلوكتشين، وهنا تظهر أهمية Oracles.
كيف تعمل Oracles؟
يمكن تبسيط العملية في أربع مراحل:
1. مصدر البيانات: تأتي المعلومات من مصدر أو عدة مصادر خارج البلوكتشين.
2. Oracle Network: تجمع شبكة Oracle البيانات وتتحقق منها أو تجمع نتائج عدة مصادر وفق تصميم النظام.
3. Smart Contract: تصل النتيجة إلى العقد الذكي بطريقة يستطيع استخدامها.
4. Web3 Application: يستخدم العقد البيانات لتنفيذ منطق التطبيق أو البروتوكول.
وبالتالي يمكن تلخيص المسار بالشكل التالي:
External Data → Oracle → Smart Contract → Web3 / DeFi Application
مثال: أسعار العملات في DeFi
لنفترض أن بروتوكول إقراض يحتاج إلى معرفة سعر ETH حتى يستطيع حساب قيمة الضمان الخاص بالمستخدم.
العقد الذكي لا يعرف سعر ETH في الأسواق الخارجية تلقائيًا، لذلك يحتاج إلى مصدر بيانات يوفر له سعرًا يمكن استخدامه في الحسابات.
إذا انخفضت قيمة الضمان عن النسبة المطلوبة، فقد يستخدم البروتوكول هذه البيانات لاتخاذ الإجراء المحدد في قواعده، مثل بدء عملية التصفية.
أين تُستخدم Blockchain Oracles؟
توجد استخدامات عديدة للـ Oracles داخل Web3، ومنها:
DeFi: توفير أسعار الأصول المستخدمة في الإقراض والاقتراض والمشتقات وغيرها.
التأمين اللامركزي: توفير معلومات خارجية قد تحدد ما إذا كانت شروط وثيقة معينة قد تحققت.
الألعاب وWeb3: إدخال نتائج أو بيانات خارجية يمكن استخدامها داخل اللعبة.
الأسواق التنبؤية: توفير نتائج الأحداث التي تعتمد عليها تسوية بعض الأسواق.
ما هي Oracle Problem؟
إحدى أهم المشكلات هي أن العقد الذكي قد يكون آمنًا، لكن القرار الذي يتخذه يعتمد على بيانات خارجية غير صحيحة أو تم التلاعب بها.
إذا اعتمد نظام مهم على مصدر بيانات واحد فقط، فقد يتحول هذا المصدر إلى Single Point of Failure.
فقد يتوقف المصدر، أو يرسل بيانات خاطئة، أو يتعرض للتلاعب، وبالتالي قد يتخذ العقد الذكي قرارًا اعتمادًا على معلومات غير دقيقة.
لماذا تُستخدم عدة مصادر للبيانات؟
إحدى الطرق المستخدمة لتقليل مخاطر الاعتماد على مصدر واحد هي جمع البيانات من عدة مصادر أو عدة مشغلين مستقلين ثم تجميع النتائج.
هذا لا يعني اختفاء المخاطر بالكامل، لكنه يمكن أن يقلل الاعتماد على جهة واحدة ويحسن مقاومة النظام للأخطاء أو التلاعب حسب تصميم شبكة Oracle.
هل كل Oracles تعمل بنفس الطريقة؟
لا. توجد تصميمات وأنواع مختلفة حسب البيانات والوظيفة المطلوبة.
Data Oracles: توفر بيانات مثل أسعار الأصول والطقس وغيرها.
Event Oracles: تنقل معلومات مرتبطة بنتيجة حدث معين.
Compute Oracles: يمكن أن تساعد في تنفيذ عمليات حسابية خارج البلوكتشين وإعادة النتائج إلى التطبيقات.
كما توجد شبكات Oracle لامركزية تستخدم عدة مصادر وعُقد بدل الاعتماد على مزود واحد.
هل استخدام Oracle يعني أن النظام آمن؟
ليس بالضرورة. أمان التطبيق يعتمد على عدة أجزاء: العقد الذكي نفسه، تصميم Oracle، جودة مصادر البيانات، طريقة تجميع النتائج، وإدارة الصلاحيات.
لذلك يجب تقييم النظام كاملًا وليس مجرد التأكد من وجود Oracle.
ما علاقة Oracles بمخاطر DeFi؟
بيانات الأسعار قد تكون جزءًا أساسيًا من بروتوكولات الإقراض والاقتراض والمشتقات وغيرها. لذلك يمكن أن يؤدي خلل كبير في بيانات Oracle إلى قرارات غير صحيحة داخل البروتوكول.
ولهذا من المهم قبل استخدام بروتوكولات غير معروفة فحص المشروع والعقود المرتبطة به. ويمكنك استخدام
Token Security Checker من TheCrypTechAI
كإحدى خطوات البحث الأولية عند التعامل مع توكنات جديدة.
مصدر إضافي
للتعمق أكثر في كيفية استخدام Oracles مع العقود الذكية، يمكنك الاطلاع على
دليل Ethereum الرسمي حول Oracles
.
الخلاصة
Blockchain Oracles تساعد العقود الذكية على استخدام معلومات مصدرها خارج البلوكتشين.
الفكرة الأساسية هي:
بيانات خارجية ← Oracle ← عقد ذكي ← تطبيق Web3.
لكن إدخال البيانات الخارجية يضيف طبقة جديدة من المخاطر، ولهذا تعتبر جودة المصادر وطريقة التحقق والتجميع واللامركزية من العناصر المهمة عند تقييم أنظمة Oracle.
في الدرس التالي سنتعرف على Layer 2 وكيف تساعد هذه الشبكات في زيادة قدرة البلوكتشين على معالجة المعاملات وتقليل التكلفة.
To understand Blockchain Oracles, it is important to know that smart contracts operate inside the blockchain environment and cannot independently access information from the outside world. Oracles provide a way for smart contracts to use external data.

What Are Blockchain Oracles?
An Oracle is a service or system that helps smart contracts obtain information that does not exist directly on the blockchain.
This information may include cryptocurrency prices, asset values, weather data, event results, or other external information required by a smart contract.
In simple terms, oracles act as a connection between the outside world and the blockchain.
Why Can't Smart Contracts Access External Data Directly?
Smart contracts execute inside the blockchain environment, where their execution must remain deterministic and verifiable by the network.
A smart contract therefore cannot simply open a website or directly request information from an external API during execution in the same way a traditional application can.
When external information is required, that data must be delivered on-chain in a form the smart contract can use. This is where oracles become important.
How Do Blockchain Oracles Work?
The process can be simplified into four stages:
1. External Data: Information originates from one or more sources outside the blockchain.
2. Oracle Network: The oracle system collects the data and may verify or aggregate information from multiple sources.
3. Smart Contract: The resulting data is delivered in a form that the smart contract can use.
4. Web3 Application: The contract uses that information to execute the application's or protocol's logic.
The basic flow can therefore be represented as:
External Data → Oracle → Smart Contract → Web3 / DeFi Application
Example: Asset Prices in DeFi
Imagine a lending protocol that needs to know the price of ETH to calculate the value of a user's collateral.
The smart contract does not automatically know the market price of ETH on external markets. It therefore needs a data source that can provide a usable price.
If the value of the collateral falls below the required level, the protocol may use this information to perform an action defined by its rules, such as initiating liquidation.
Where Are Blockchain Oracles Used?
Oracles can support many Web3 use cases, including:
DeFi: Providing asset prices for lending, borrowing, derivatives, and other financial applications.
Decentralized Insurance: Providing external information that may determine whether specific conditions have been met.
Web3 Gaming: Bringing external events or data into blockchain-based games.
Prediction Markets: Providing event outcomes used to settle certain markets.
What Is the Oracle Problem?
A smart contract itself may function correctly while still receiving incorrect or manipulated external information.
If an important system depends on only one data source, that source can become a Single Point of Failure.
The source could become unavailable, provide incorrect information, or potentially be manipulated. The smart contract could then make decisions based on inaccurate data.
Why Use Multiple Data Sources?
One approach to reducing dependence on a single source is to collect information from multiple independent sources or operators and aggregate the results.
This does not eliminate every risk, but depending on the oracle design, it can reduce reliance on one provider and improve resistance to errors or manipulation.
Do All Oracles Work the Same Way?
No. Different oracle designs exist depending on the type of information or functionality required.
Data Oracles: Deliver information such as asset prices, weather data, and other external values.
Event Oracles: Provide information about the outcome of particular events.
Compute Oracles: Can perform certain computations outside the blockchain and return the results for on-chain applications.
Decentralized oracle networks can also use multiple independent nodes and data sources instead of relying on a single provider.
Does Using an Oracle Make a System Safe?
Not necessarily. The security of an application depends on several components, including its smart contracts, oracle architecture, data sources, aggregation methods, and permission management.
For this reason, the complete system should be evaluated rather than assuming that the presence of an oracle automatically makes a protocol secure.
How Are Oracles Related to DeFi Risks?
Price data can be critical to lending, borrowing, derivatives, and other DeFi protocols. A serious problem with oracle data may therefore cause incorrect decisions inside a protocol.
Before interacting with unfamiliar projects, it is useful to research the associated contracts and tokens. You can use the
TheCrypTechAI Token Security Checker
as one initial research step when evaluating unfamiliar tokens.
Learn More
To learn more about how smart contracts use external information, read the
official Ethereum guide to Oracles
.
Key Takeaway
Blockchain Oracles allow smart contracts to use information that originates outside the blockchain.
The basic concept is:
External Data → Oracle → Smart Contract → Web3 Application.
However, bringing external information on-chain introduces another layer of risk. Data quality, source selection, aggregation methods, and decentralization are therefore important factors when evaluating an oracle system.
In the next lesson, we will explore Layer 2 networks and how they can increase blockchain transaction capacity while reducing costs.
اختبر فهمك
Check Your Understanding
سؤالان سريعان لتثبيت أهم ما تعلمته.
Two quick questions to reinforce the key ideas.