Knowledge Base
Last updated
Last updated
Blockchain oracles are entities that connect blockchains to external systems, thereby enabling smart contracts to execute based upon inputs and outputs from the real world.
Oracles provide a way for the decentralized Web3 ecosystem to access existing data sources, legacy systems, and advanced computations. Decentralized oracle networks (DONs) enable the creation of hybrid smart contracts, where on-chain code and off-chain infrastructure are combined to support advanced decentralized applications (dApps) that react to real-world events and interoperate with traditional systems.
Blockchain oracles connect blockchains to inputs and outputs in the real world.
For example, let’s assume Frank and Lucy want to set up a escrow bet on the outcome of a friendly football match. Alice bets $200 on the BLUE team, and Bob bets $200 on the RED team, with the $400 total held in escrow by a smart contract. When the game ends, how does the smart contract know whether to release the funds to Frank or Lucy? The answer is to link an oracle to fetch the data off-chain and validate the score on-chain, therefore validating who the winner is.
A smart contract is an automated digital agreement, written in code, that tracks, verifies, and executes the binding transactions of a contract between various parties. The contract transactions are automatically executed by the smart contract code when predetermined conditions are met. Essentially, a smart contract is a short program whose inputs and outputs are transactions on a blockchain.
Smart contracts are self-executing and reliable and do not require the actions or presence of third parties. The smart contract code is stored on, and distributed across, a decentralized blockchain network, making it transparent and irreversible.
In summary, smart contracts are immutable as a contract cannot be changed, they are distributable and tamper-proof, fast and cost effective, as there is no middle man which saves money and time, and is safe due to encryption.
Cardano was introducing Smart Contract support in 2021. As a multi-functional environment, Cardano will support the development and deployment of smart contracts using such programming languages as:
Plutus — a purpose-built smart contract development and execution platform. Plutus contracts consist of parts that run on the blockchain (on-chain code) and features that run on a user’s machine (off-chain or client code). Plutus draws from modern language research to provide a safe, full-stack programming environment based on Haskell, the leading functional programming language.
Marlowe — a domain-specific language (DSL) for writing and executing financial contracts that allows building contracts visually as well as in more traditional code. For example, financial institutions can use it to develop and deploy custom instruments for their customers and clients. The Marlowe language itself is now embedded in both JavaScript and Haskell, offering a choice of editors depending on developers’ preference and skillset.
Related Topics
Source: Cardano Docs
A cross-chain bridge enables exchanging information, cryptocurrency, or NFTs from one blockchain network to another. It allows the flow of data and tokens across what would otherwise be siloed sets of data on different blockchains.
With fiat currency, there are many established ways for individuals and businesses to exchange money, creating a globally available and interoperable system of financial payments. Those systems include financial institutions, banks, and credit cards that handle foreign exchange. In the world of blockchains, a cross-chain bridge serves a somewhat analogous purpose.
Exchange across different blockchains for cryptocurrency is possible without a cross-chain bridge, but it is expensive and more time-consuming. Without the use of a cross-chain bridge, users have to first convert a cryptocurrency token into a fiat currency, which often involves fees. In a cross-chain bridge, users must use the currency to get the other desired type of cryptocurrency, incurring more fees and taking time.
One characteristic of a cross-chain bridge is that it enables users to exchange one cryptocurrency for another without first changing it to fiat currency. Cross-chain bridges aren't limited to just cryptocurrency value transfer either. An effective cross-chain bridge can also enable the transfer of smart contracts and NFTs from one blockchain environment to another.
There are several approaches to enabling transfers with a cross-chain bridge. One common method is using a wrapped token issued by the cross-chain bridge provider platform. With a wrapped token, the value of one token from a specific blockchain network can be encapsulated inside another token. Wrapped tokens are typically based on the ERC-20 technical specification for an Ethereum network. For example, WADA is an ADA token wrapped with an ERC-20 Ethereum smart contract.