Charli3 Technical Documentation: Infrastructure

Charli3
3 min readMar 13, 2023

Gitbook Documentation: https://charli3-oracles.gitbook.io/charli3-documentation/

Continuing past the Swap Contract documentation the Charli3 base infrastructure is a necessity for understanding the process the oracle uses to aggregate and validate a set of data.

A High-level overview of our V2 upgrade that uses all Vasil features, to how the node operations are run, and the process of the smart contracts. Below is the documentation, that can also be read on the gitbook link above ^^^

Cardano smart contracts as Oracles

Charli3’s Oracle smart contracts

connects trusted information from the external world through decentralized Charli3 nodes. The nodes periodically gather information from various trusted sources, referred to as data providers. The input from these nodes is then processed through a consensus algorithm, where the value of the feed is calculated.

Figure 1 provides a visual representation of the UTXOs that a Charli3 Plutus V2 Contract holds at a specific contract address

Charli3’s Oracles utilize the Plutus V2 Validator, taking advantage of features introduced in the Vasil Hard Fork, such as:

  • Inline Datums
  • Reference Scripts
  • and Reference UTXOs.

Figure 1 shows the UTXOs that a Charli3 Plutus V2 Contract creates to initiate operations.

*A Plutus V1 version is also available for use, which was developed prior to the Hard Fork. *

Node operator backend

Charli3’s Node Operator Backend software automates transactions with Oracles. It allows node owners, who are responsible for updating UTXO information and providing contract data, to operate through third-party services. The Backend also optimizes transactions by communicating with the Contract’s Node Pool. It’s written in Python and uses the Pycardano library for contract interaction.

Charli3’s Node Operator Backend software automates transactions with Oracles, enabling node owners to update UTXO information and provide contract data through third-party services or their data. The Backend optimizes transactions by communicating with the Contract’s Node Pool and is written in Python, utilizing the Pycardano library for contract interaction.

Charli3’s Network

Charli3’s network consists of two components:

  • Oracle Smart Contract
  • Node Operator Backend

The Smart Contract authorizes transactions on the Cardano blockchain using data from the Node Operator, which creates and uses UTXOs at a designated address. Refer to Figure 2.

Figure 2. Depiction of Charli3’s Network composed of Node Pool Operators and their Interaction with the Oracle Smart Contract on the Cardano Blockchain.

Data consumers

Clients who consume data can access the oracle feed through two methods. The method to use depends on the version of the contract that generated the oracle. For Plutus V2, the Feed UTXO can be accessed by reading the Feed UTXO.

Figure 3. Representation of a third-party contract accessing the information of an oracle feed (PV2).

Figure 3 provides a high-level illustration of a third-party contract accessing information from an oracle. The dotted UTXO represents read-only use of the UTXO.

In the following section, we will review a third-party Python contract called Swap-contract, which utilizes an oracle feed to store the exchange rate of USDT and ADA. The contract facilitates the sale of assets to third-party users based on the oracle feed.

— — -

If you missed the Swap Contract doucmentation. please read it here: https://charli3-oracles.gitbook.io/charli3-documentation/

--

--