What if smart contracts could see, hear, and understand the world around them? That's where AI oracles come in.
Inherently, smart contracts are limited in that they don't have the ability to access external data or perform complex computations. AI oracles act as a bridge between blockchain and the dynamic, data-rich reality that surrounds us.
The Oracle Problem in Blockchain
Smart contracts, while powerful, operate within a closed environment. They cannot natively access real-world data like stock prices, weather conditions, or the outcome of a sports match. This limitation, known as the 'Oracle Problem', significantly restricts their potential applications.
Imagine a smart contract designed to automatically release funds upon the arrival of a shipment. Without an oracle, the contract would be blind to the shipment's status, rendering it useless.
AI oracles address the 'Oracle Problem' by securely providing external data and computations to smart contracts. They act as trusted intermediaries, fetching information from various sources, validating it, and feeding it to the blockchain in a format that smart contracts can understand. This enables smart contracts to interact with the real world, triggering actions based on external events and data.
Core Components of an AI Oracle
An AI oracle is a complex system comprising several key components:
- Data sources: AI oracles tap into various data sources, including APIs, sensors, web scraping, and even other blockchains. The choice of data sources depends on the specific use case and the type of data required.
- Data aggregation and validation: Since data from a single source might be unreliable or prone to manipulation, AI oracles often aggregate data from multiple sources. They then employ various techniques to validate the data, such as:
- Consensus mechanisms: Multiple oracles independently fetch and validate the same data, reaching a consensus on its accuracy
- Reputation systems: Oracles with a proven track record of providing accurate data are given higher trust scores
- Machine learning: Advanced algorithms can be used to detect anomalies and inconsistencies in data
- Verification layer: This component employs cryptographic techniques to ensure that the data being transmitted to the blockchain is both authentic and tamper-proof. Protocols like ChainwireORA exemplify this, providing verifiable and secure data streams.
- Compute-enabled layer: In addition to transmitting raw data, AI oracles can perform off-chain computations on the data before feeding it to smart contracts. This might involve data analysis, machine learning models, or natural language processing — depending on the use case — all without burdening the network with excessive computations.
- API interfaces: AI oracles provide secure, well-defined APIs that allow smart contracts to request specific data or computations, serving seamless communication between the oracle and the blockchain. Clean interfaces facilitate ease of integration, providing developers with dashboards and tools to manage the oracle, configure data feeds, and monitor performance, thus lowering barriers to adoption.
- Blockchain integration: AI oracles write the fetched and validated data onto the blockchain in a secure and tamper-proof manner. This ensures that the data is accessible to smart contracts and can be used to trigger actions on the blockchain with AI.
Types of AI Oracle Designs
AI oracles come in various designs, each with its own trade-offs:
- Centralised oracles: These oracles are operated by a single entity or organisation. They offer simplicity and efficiency but are susceptible to single points of failure and censorship risks.
- Decentralised oracles: These oracles distribute trust among multiple independent node operators, making them more secure and resistant to manipulation. However, they can be more complex and less efficient than centralised oracles.
- Hybrid oracles: These oracles combine elements of both centralised and decentralised designs, aiming to strike a balance between security, efficiency, and decentralisation.
Why AI Oracles Are Playing a Bigger Part in Blockchain Evolution
{{ai-oracles-benefits}}
Example: AI Oracle in Parametric Insurance
The insurance industry is ripe for disruption by AI oracles, particularly in parametric insurance. Traditional insurance claims processing can be slow, complex, and prone to disputes. Parametric insurance, on the other hand, relies on predefined triggers and payouts based on verifiable data, eliminating the need for lengthy claims assessments.
AI oracles can play a crucial role in parametric insurance by providing the necessary data triggers. For instance, consider a travel insurance policy that automatically pays out if a flight is delayed beyond a certain threshold. An AI oracle could fetch real-time flight data from a verified source and feed it to the smart contract. If the delay exceeds the predefined limit, the smart contract would automatically execute the payout to the policyholder.
AI Oracles in aelf
aelf, designed as an AI-centric blockchain, has integrated artificial intelligence into its core infrastructure. As outlined in the White Paper 2.0, the planned introduction of AI oracles in 2025 marks a significant step towards a more intelligent, sophisticated aelf network.
While many AI oracle solutions focus on ensuring the integrity of the AI computation process itself (i.e., using Zero-Knowledge Proofs or ZKPs to verify each step in the calculation and reasoning process), aelf believes that more can be done to ensure the tamper-proof nature of the higher-layer AI Agent application that interacts with the AI model.
By prioritising the integrity of the APIs called by the LLM and the AI Agent application itself, the data processed and the actions taken by the AI agent can then be more trustworthy and secure.
AI Oracle on aelf: The Steps That Will Be Implemented
aelf's AI oracle implementation will involve a combination of on-chain and off-chain components working in tandem.
1. On-Chain Components
The on-chain components will reside on the aelf blockchain (with potential future deployment on other chains like Ethereum). They will include:
- Node pledge management: This manages the AI Agent Service Nodes. Nodes joining the network must stake a certain amount of ELF tokens, ensuring they have a vested interest in acting honestly.
- Reputation system: This system evaluates the operational status of nodes, potentially in conjunction with committee assessments. For instance, offline nodes might be downgraded.
- Cost and revenue settlement: This component handles the financial aspects, settling revenue for nodes that provide computational services and charging fees for dApp calls to the oracle network
- AI Agent Scheduler: This intelligently deploys and schedules AI Agent Service code based on the current computational load of the network, ensuring efficient resource utilisation
- AI Agent Factory: This crucial component generates custom contracts tailored to any user-defined AI Agent logic. It acts as a bridge between the foundational framework contract and the user-defined contract, forwarding dApp call interfaces and interacting with the fee and income settlement contract. It also mediates between the AI Agent Service and user-defined contracts, ensuring consistent handling of all calls and inference results.
2. Off-Chain Components
The off-chain components will consist of:
- TLS notary nodes: These nodes will utilise the TLS Notary mechanism, an attestation mechanism that ensures the integrity and security of network communications. It verifies that the API provided by the underlying LLM (whether centralised or decentralised) remains untampered from the data source to the local endpoint. This allows the AI Agent Service to authenticate data from external servers without needing to fully trust them. Evidence from TLS Notary can be used in the on-chain verification process.
- Decentralised AI agent service nodes (SGX environment): These nodes will form a decentralised AI Agent computing network leveraging Intel's SGX technology. SGX creates a 'trusted execution environment' at the hardware level, ensuring secure and reliable data processing. The AI Agent Service operates within this SGX environment, guaranteeing that even node operators cannot access the specifics of its execution. This protects the AI Agent code from tampering and, combined with blockchain's immutability, promises to provide a high degree of trust and security.
AI Oracle Features for Developers
aelf aims to make AI oracle usage developer-friendly by providing a comprehensive SDK and framework. Web3 developers only have to focus on their custom core logic and configure the necessary interaction interfaces. The framework then automates the generation, scheduling, and deployment of the AI Agent Services to the oracle network. It will also trigger the AI Agent Factory to generate the corresponding AI smart contracts.
For simpler AI call logic, this entire process will be automated. However, for more complex AI Agent Services, like those involving memory or embeddings, developers will need to implement these services themselves using the provided interface documentation.
In addition to custom AI logic, the aelf AI Oracle also supports traditional oracle services like price feeds and random number generation.
In Closing
As blockchain technology continues to evolve, AI oracles will play an increasingly vital role in bridging the gap between on-chain and off-chain data. With advancements in AI and blockchain interoperability, we can expect to see even more sophisticated and powerful oracle solutions emerge, along with more blockchain platforms jumping on the Web3 and AI bandwagon.
This fusion of AI and blockchain is exemplified by layer 1s like aelf, which promises to deliver greater value to users and developers through AI-powered dApps. That requires reliance on trustworthy, verifiable data in the automation process; aelf's implementation of AI oracles showcases a thoughtful approach that prioritises both the integrity of the AI computation process and the security of the higher-layer AI Agent application.
This 'best of both worlds' state is not easy to achieve. But by combining on-chain and off-chain components, leveraging technologies like TLS Notary and SGX, and providing a developer-friendly framework, we may not need an oracle to predict that aelf is doing its part to pave the way.
*Disclaimer: The information provided on this blog does not constitute investment advice, financial advice, trading advice, or any other form of professional advice. aelf makes no guarantees or warranties about the accuracy, completeness, or timeliness of the information on this blog. You should not make any investment decisions based solely on the information provided on this blog. You should always consult with a qualified financial or legal advisor before making any investment decisions.
About aelf
aelf, an AI-enhanced Layer 1 blockchain network, leverages the robust C# programming language for efficiency and scalability across its sophisticated multi-layered architecture. Founded in 2017 with its global hub in Singapore, aelf is a pioneer in the industry, leading Asia in evolving blockchain with state-of-the-art AI integration to ensure an efficient, low-cost, and highly secure platform that is both developer and end-user friendly. Aligned with its progressive vision, aelf is committed to fostering innovation within its ecosystem and advancing Web3 and AI technology adoption.
For more information about aelf, please refer to our Whitepaper V2.0.
Stay connected with our community:
Website | X | Telegram | Discord