Search code examples
modelethereumsoliditychainlink

Chainlink newbie doubts


I'm starting my studies about Chainlink this week and right now I'm trying to fit all together before I continue my exploration of Chainlink docs. May be you could help me in this task.

Could you confirm this understanding?

As I've already read, there are 3 models in Chainlink:

  • Decentralized Data Model with Flux Aggregator where the oracle smart contract receives prices report of crypto assets and aggregate them to offer this information to consumers. However, this model is being deprecated in favor of OCR, right?
  • The Off-Chain Reporting that aggregates the prices of crypto assets off-chain and send a single transaction to the oracle smart contract and this smart contract offer the median of prices to the consumers.
  • Basic Request Model where it is possible to call any Chainlink job. Typically, this job is a API calling with some transformations before the result is sent to the smart contract consumer.

If I'm not misunderstanding this basics concepts, I have some doubts:

  • The first two models, DDM and OCR, are only for assets' prices or they could be used for other kinds of data since exists oracles providing that data? If true, are there real examples of this kind of usage?
  • About the Basic Request Model, I feel like it is a centralized solution, I haven't seen any step of aggregation/conciliation, only one node responds and that is it. Is this understanding right or I'm missing something?
  • Another concept not clear yet: what is a Data Provider? I found out this page https://market.link/search/data-providers and seems like centralized providers of data, is that right?

Solution

  • Some great questions and points asked here. I'll try to address them one by one:

    The first two models, DDM and OCR, are only for assets' prices or they could be used for other kinds of data since exists oracles providing that data? If true, are there real examples of this kind of usage?

    Correct, right now they are mainly used for asset prices because that's where the biggest current need is. But the idea is in the future that they will be used for many other types of data, such as weather data, sports and election results etc. In terms of real world examples, right now only price data feeds are officially supported, but there's nothing stopping someone taking the code and attempting to spin up their own OCR networks for other types of data

    About the Basic Request Model, I feel like it is a centralized solution, I haven't seen any step of aggregation/conciliation, only one node responds and that is it. Is this understanding right or I'm missing something?

    This is correct. The direct API request really opens up smart contract use cases, but is prone to centralisation in its current form. You can alleviate this by manually doing the aggregation and decentralization yourself. Eg call the API 3 times in your smart contract with 3 seperate chainlink nodes/jobs, then doing validation or aggregation on-chain after the third result. In the future, this model may change to automate this process and provide an easier way to get this functionality without centralisation risks, (eg how Chainlink Keepers work today)

    Another concept not clear yet: what is a Data Provider? I found out this page https://market.link/search/data-providers and seems like centralized providers of data, is that right?

    A data provider is any company or business that provides data to smart contracts. They usually run their own Chainlink node as well that has jobs created specifically for smart contracts to call to obtain the data. Eg SportsMonks is a data provider that sells sports data to smart contracts across multiple blockchains. They run Chainlink nodes that have jobs to return this data, so smart contract developers can access it and use it in their dApps. The listing on market.link shows developers how to access the data, ie what job IDs and parameters they need in their smart contracts, how much it costs to do a call etc.