Chainlink Oracles – How Oracles (Chainlink) Are Deterministic Despite Changing Values with Each Call?

chainlinkoracles

I've been playing with the chainlink getRandom call which returns a random number every time it's called. What I'm confused by though is the blockchain should be deterministic so if we were to rebuild this entire network from node 0 wouldn't that same call to getRandom be a different number and this not be deterministic? Same for external api calls, what if that node goes away and when you rebuild that data is no longer available, wouldn't that change the entire chain going forward?

Best Answer

You're correct in saying that blockchains are deterministic, oracles however, operate outside of blockchains. Oracles deliver data the same way that people make transactions.

When you replay a blockchain that uses oracle data, your replay what the oracle returned. In the same way when you replay a blockchain that has human transactions, you replay the result of those transactions.

An oracle works by delivering data in a transaction. So the oracle only delivers the data once, and that becomes a part of the historical transaction data of the blockchain.

Does that make sense?

Related Topic