  Blockchains with smart contracts are distributed ledger systems that achieve
block-state consistency among distributed nodes by only allowing deterministic
operations of smart contracts. However, the power of smart contracts is enabled
by interacting with stochastic off-chain data, which in turn opens the
possibility to undermine the block-state consistency. To address this issue, an
oracle smart contract is used to provide a single consistent source of external
data; but, simultaneously, this introduces a single point of failure, which is
called the oracle problem. To address the oracle problem, we propose an
adaptive conformal consensus (ACon$^2$) algorithm that derives a consensus set
of data from multiple oracle contracts via the recent advance in online
uncertainty quantification learning. Interesting, the consensus set provides a
desired correctness guarantee under distribution shift and Byzantine
adversaries. We demonstrate the efficacy of the proposed algorithm on two price
datasets and an Ethereum case study. In particular, the Solidity implementation
of the proposed algorithm shows the potential practicality of the proposed
algorithm, implying that online machine learning algorithms are applicable to
address security issues in blockchains.
