# RedStone: The Modular Oracle

By [Arya](https://paragraph.com/@aryaethn) · 2023-12-06

---

Introduction
------------

Blockchain oracles have become an increasingly important component of decentralized finance (DeFi) protocols, allowing smart contracts to interact with data and external systems beyond the blockchain. Oracles act as intermediaries between off-chain data sources and on-chain smart contracts, providing reliable and timely data to inform smart contract execution. However, the existing oracle systems have limitations, such as the requirement for continuous on-chain data delivery, limited scalability, and lack of trusted sources and data update conditions.

RedStone is a new oracle system that aims to address these limitations by offering a radically different design of oracles that caters to the needs of modern DeFi protocols. RedStone provides frequently updated, reliable, and diverse data feeds for dApps and smart contracts on multiple L1s and L2s. The modular architecture of RedStone maintains data integrity from source to smart contracts, and there are three different ways to integrate their service tailored to the needs of users.

RedStone
--------

RedStone is a decentralized oracle network that provides reliable and secure data feeds for DeFi protocols. The platform uses a modular design that allows data to be first put into a data availability layer before being fetched on-chain, enabling the broadcast of a large number of assets at high frequency to a cheaper layer and putting it on chain only when required by the protocol. RedStone offers three ways to integrate data depending on the smart contract architecture and business demands, including RedStone Core, RedStone Classic, and RedStone X.

The price feeds come from multiple sources such as off-chain DEX'ed, on-chain DEX'es and aggregators. The data is aggregated in independent nodes operated by data providers using various methodologies and safety measures like outliers detection. The feeds are broadcasted both on the Streamr and directly to open-source gateways. The data could be pushed on-chain either by a dedicated relayer operating under predefined conditions, by a bot, or even by end users interacting with the protocol.

RedStone supports two types of data to be received in a contract: Numeric 256-bit values and bytes arrays with dynamic size. The platform also provides an on-chain aggregation mechanism, which adds an additional requirement of passing at least X signatures from different authorized data providers for a given data feed. This mechanism increases the security of the RedStone oracle system and ensures that even if some small subset of providers corrupt, it should not significantly affect the aggregated value.

To ensure the security of the RedStone oracle system, it is recommended that users do not override the getUniqueSignersThreshold function, pay attention to the timestamp validation logic, enable a secure upgradability mechanism for their contract, and monitor the RedStone data services registry. Additionally, users should design their contracts in a way where they do not need to request many data feeds in the same transaction and use around 10 required unique signers for a good balance between security and gas cost efficiency.

RedStone has been benchmarked for gas efficiency, and reports indicate that the platform is highly efficient for a variety of use cases. Overall, RedStone provides a reliable and secure oracle network for DeFi protocols, enabling them to access the data they need to operate effectively and efficiently.

### Supported Chains

RedStone Oracles are available on all EVM-compatible Layer 1 and Layer 2 networks, as well as on StarkNet and Fuel Network. The platform supports a wide range of EVM chains, including Ethereum, Polygon, Avalanche, and Binance Smart Chain, among others. Additionally, RedStone supports a few non-EVM-compatible chains such as TRON, Stacks, StarkNet, and Near. Users can check the integration with the showroom app for EVM chains and StarkNet. Custom development is required to use RedStone on other chains.

### Data Feed

One of the unique features of RedStone is that it can provide over 1,000 price feeds for various types of data. This is made possible by RedStone's unique design, which allows it to collect data from multiple sources and provide it in a standardized format. Users can check all the available data provided by RedStone in its web app, which is easy to use and provides real-time updates.

RedStone also offers custom URL oracles, which allow users to configure custom data feeds based on custom URLs and JSONPath expressions using the custom URL registry app. This feature is particularly useful for developers who need to access specific data that is not available through traditional data sources. Users can access historical data for custom URL data feeds and learn more about custom URL oracles in RedStone's detailed blog post.

In addition to price feeds and custom URL oracles, RedStone delivers floor price data for 20 popular NFT collections from OpenSea. Users can check the NFT tab in the RedStone web app to see the historical data and corresponding data feed ids. This feature is particularly useful for NFT collectors and traders who need to stay up-to-date with the latest market trends.

Finally, RedStone delivers entropy proxied from [**https://drand.love/**](https://drand.love/) for pseudo-random number generation in smart contracts. This feature is essential for developers who need to generate random numbers in a secure and reliable way. Users can see an example of how to use RedStone's randomness in a smart contract and JS code in its web app.

Overall, RedStone is a reliable and comprehensive platform that provides a wide range of data for various types of assets. Its unique features, such as custom URL oracles and NFT data feeds, make it a valuable tool for developers, traders, and investors. Users can access all the data provided by RedStone in its web app, which is easy to use and provides real-time updates.

### Tokenomics

RedStone's tokenomics is designed to facilitate the provision of reliable and accurate information from the outside world to blockchain networks. The RedStone token has not been launched yet, and users should be wary of scammers and anyone trying to sell RedStone tokens.

The RedStone token will be used to incentivize participants to produce, publish, and validate data in a continuous and diligent way. Participants will use tokens to reward providers that publish valuable information, and the exact fee and subscription terms will be at the discretion of the provider and depend on their effort, demand for data, and potential competition.

To ensure the reliability of the data provided, providers will need to publish a Service Level Agreement describing the scope of data being served, the source of information, and the frequency of updates. If a provider breaches the terms of service, a penalty denominated in tokens will be applied. Providers must also set aside a certain number of tokens and lock them for a set period of time to reassure users that any future claims will be fully covered.

Dispute resolution will be facilitated by tokens, where juries will be rewarded for voting with the majority and punished for supporting the losing side. This process will be necessary because of the diverse nature of the provided information, and it will not always be possible to decide if data was corrupted.

At the early stage of development, the token could be distributed to providers to reward their availability and bootstrap the market before there is enough demand from data users. RedStone's tokenomics is designed to create a data-sharing ecosystem that incentivizes reliable and accurate data provision.

---

*Originally published on [Arya](https://paragraph.com/@aryaethn/redstone-the-modular-oracle)*
