Infrastructure Overview

Summarizes the infrastructure DApp builders must set up in order to effectively use the Creditcoin Oracle.

Infrastructure Components

The Creditcoin Oracle is intended for use by DApp builders. However, in order to use the oracle effectively those teams will need to set up some infrastructure of their own.

Source Chain Smart Contract

This can be on a network such as Ethereum.

This contract supports DApp-specific logic on the source chain and emits events which can be converted into Creditcoin oracle queries. For example, to support a token bridge DApp the source chain smart contract might be an ERC20 contract which emits transfer events.

Universal Smart Contract

Deployed to the execution chain, Creditcoin

This contract is responsible for interpreting and acting upon oracle results specific to the DApp team's use case by forwarding its request to the DApp Business logic Smart Contracts. In the example of a token bridge DApp the USC would interpret oracle provided data corresponding to a transfer event on Sepolia.

DApp Business Logic Smart Contracts

Deployed to the execution chain, Creditcoin

One or more DApp business logic smart contracts on Creditcoin. This is where the state and logic of your DApp will live. The universal smart contract (USC) for your DApp can be given a special administrator role within your business logic contracts so that the USC can seamlessly trigger actions across your DApp based on oracle results.

Oracle Worker

Deployed 💻 offchain

This offchain worker follows events on a DApp's source chain contract and automatically submits queries to the Creditcoin oracle. The worker also detects when oracle query processing is complete and submits a USC call to make use of oracle results. This reduces the number of transactions an end user has to sign from 3 to 1, greatly improving UX.

With these contracts and worker in place a transaction on a source chain can automatically trigger DApp logic on Creditcoin, allowing for entirely seamless interoperability!

Next Steps

Source Chain Smart Contracts

Check out this tutorial for an example of how to use the Creditcoin stack to set up a decentralized trustless bridge.

Last updated