Verifiable randomness for Astar and Shiden

Hi Astar and Shiden community, on behalf of DIA, I would like to propose integrating DIA verifiable randomness oracle as a public good and request gas funding for the contract updates.

SUMMARY:

DIA is a multi-chain oracle that provides asset prices for fungible and non-fungible assets as well as verifiable randomness across different ecosystems including Astar and Shiden.

Randomness can be used to empower new utility and is instrumental for on-chain applications such as games, lotteries, prediction markets, and NFT launches. Here is a short case study of a project using DIAs randomness oracle on Evmos, which was also funded as a public good after receiving a community vote.

We value randomness as a public good and would like in partnership with Astar and Shiden to provide builders with a high-frequency and low-cost solution. For this reason, we would like to request treasury funding to support the operational expenses of DIAs randomness oracle as a public good available to all developers in the Astar and Shiden ecosystem for one year.

REQUEST:

Provide gas for the randomness oracles on Astar and Shiden based on actual gas consumption. The cost would be gas for an update every 30 seconds. This would be at the current gas cost approx 0.0005 ASTR and 0.00004 SDN per update and around 525 ASTR and 42 SDN per year. The cost will be the actual cost (525 ASTR and 42 SDN are just an estimation based on current fees).

BENEFIT:

A pre-funded and live verifiable randomness oracle reduces friction to build new applications for dApps that require randomness, targeting use cases within but mostly beyond DeFi including games, lotteries, prediction markets, or NFT launches.

As such, a randomness oracle as a public good will allow for more innovative and new types of applications to be built on Astar and Shiden. Currently, there are no options available for randomness on-chain on Astar and Shiden.

NEXT STEPS:

We would like to collect any possible feedback and questions from the community over the next 7 days prior to having a vote on the proposal. If this proposal gets approved we would start with the integration (approx 14 days lead time, possibly impacted by Christmas break).

Following the integration, we would align on marketing activation introducing randomness on Astar and Shiden, publish specific content, documentation, AMA, etc.

ADDITIONAL INFORMATION:

What is DIA:

DIA (Decentralised Information Asset) is a multi-chain, end-to-end, open-source data and oracle platform for Web3.

The DIA platform enables the sourcing, validation, and sharing of transparent and verified data feeds for traditional and digital financial applications. DIA’s institutional-grade data feeds cover asset prices, metaverse data, lending rates, and more.

DIA’s data is directly sourced from a broad array of on-chain and off-chain sources at individual trade-level. This allows DIA feeds to be fully customized with regards to the mix of sources and methodologies, resulting in tailor-made, high-resilience feeds and thereby setting a new paradigm for oracles.

You can find more details in our documentation:

What is Drand?

Drand is a distributed randomness beacon daemon written in Golang. Servers running Drand can be linked with each other to produce collective, publicly verifiable, unbiased, unpredictable random values at fixed intervals using bilinear pairings and threshold cryptography. DIA uses the drand’s public randomness beacon, and updates its oracle with round number, randomness, and signature.

As Drand has gained maturity, an increasing number of organizations (including NIST, Cloudflare, Kudelski Security, the University of Chile, and Protocol Labs) started taking interest and decided to collectively work on setting up a Drand network spanning these organizations. As Drand has gained maturity, an increasing number of organizations (including NIST, Cloudflare, Kudelski Security, the University of Chile, and Protocol Labs) started taking interest and decided to collectively work on setting up a Drand network spanning these organizations.

What is randomness?

Randomness is the property of lacking any sensible predictability. It is very difficult to create random events on-chain due to the deterministic nature of any EVM or EVM-like environment.

Centralized randomness is susceptible to attacks by the randomness source, as a single non-random outcome cannot be distinguished from a random one. Thus, having a single RNG source provide randomness via an oracle is not enough.

Who needs randomness?

Random numbers can be very relevant for on-chain applications such as games, lotteries, prediction markets, or NFT launches.

Relying on pseudo-random values like the last blockhash can be manipulated by miners and is not advisable.

Drand runs distributed nodes to produce their randomness beacon. Drand uses Pedersen’s DKG (Distributed Key Generation) protocol to create collective private/public key. Participants in their League of Entropy then generate randomness in rounds and broadcast it together with its signature.

How does the randomness oracle work?

The oracle writes results from the distributed random beacon provided by Drand.love on-chain. These results are written about every 30 seconds by the oracle. Here is DIAs documentation, as well as a guide, on how to exactly use the oracle.

Why is funding required and how much ASTR and SDN are needed?

Funding is required because the randomness oracle incurs gas costs to push new verifiable random outputs on-chain. Gas costs are estimated for an update every 30 seconds. At current gas costs, this equates to approx 0.0005 ASTR per update and around 525 ASTR per year and 0.00004 SDN per update, and 42 SDN per year respectively on Shiden.

Astar treasury will provide 500 ASTR and 40 SDN as initial funding to designated addresses which are solely used to fund the Astar and Shiden randomness oracle.

DIA will update the community on actual gas usage for the oracle in case it deviates strongly over a longer time frame from expected gas costs, which might be the case if gas cost fluctuates from expectations. DIA will inform Astar to add funds need-based.

After 12 months of using the oracle, total expenses will be shared in an update and future actions and or developments will be requested and based on community feedback.

Gas costs are solely used for updating the oracle. DIA does not charge or use any of the ASTR/ SDN but for contract updates. Any remaining unused gas will be sent back to the treasury if the community does not wish to prolong the randomness oracles.

Are Astar/ Shiden and DIA already working together?

DIA has been the first Oracle to deploy on Astar. DIA values the Astar team and community as well as builders tremendously. We have been fortunate to partner and integrate with projects such as Starlay, SIO2, Astrid DAO, Orcus Finance, and Starfish Finance. DIA also uses the Arthswap DEX as a price source, and has the first and only WASM oracle on the Shiden Network.

6 Likes

Thanks for coming to Astar and Shiden.

The amount requested is not a big deal and can also be done through dApp staking. Get DIA listed on the dApp store and use the developer rewards to fund the gas.

I am confident that DIA will earn the community support.

1 Like

What math was used here? It gives me aprox 5270.4 ASTR per years. Using the info you supplied.

@paulclaudius

Please kindly, how can we verify that you are part of DIA Oracle team?
Thank you

We will share the proposal on DIA twitter account. Will share a link here later.

1 Like

Thank you for pointing this out. Funding request of 500 ASTR is correct as initially requested.
The cost per transaction is estimated to be 0.0005 ASTR per update (the previous version stated 0.005).
This would amount to ASTR of:
0.06 per hour
1.44 per day
525.6 per year
Having said that we have seen also much higher costs for transactions and this needs to be considered a rough estimate. We are happy to update on actual gas usage.

Ok, I just saw DIA post on Twitter with the proposal right now. Thank you.

And

Thank you for clarifying this.

1 Like

Saying this I would like to hear @Maarten opinion about funding this proposal & also consider @moonme suggestion

Thank you

DIA is already listed on Shiden dApp staking. Can you use the rewards?

1 Like

Thank you for the suggestion. From an operational perspective, we prefer the suggested proposal but are open to adjusting if this is preferred by the community.

1 Like

Hi @paulclaudius
I am currently building a dApp with a raffle and I use the ink_env::random function
Do you expect to provide an Oracle for wasm smart contracts as well?

Hi @GuiGou

DIA already has oracle support for WASM smart contracts on Shiden.
Happy to make any intro if needed.

2 Likes
Approve Treasury Funds
  • Yes
  • No

0 voters

1 Like

Thanks for the proposal, could you explain how are you going to deliver the proposal? Could you say what “integration” mean? Do you have some example of DIA integration? I am curious because randomness is on-chain part and it is difficult to imagine something what is on-chain. Appreciate any helpful link.

1 Like

Integration means that randomness will be provided on Astar and Shiden by updating a dedicated contract DIA will deploy providing approx every 30 seconds a new random number, different dApps can utilize the randomness.
Here is an example of a case study of how the oracle is used by a project called Orbital Apes on Evmos.
Here is also a developer tutorial explaining the randomness oracle and how it can be called.

4 Likes

According to the doc of Dia,

Please note: These demo oracles are NOT intended to be used in live production.
DIA’s Demo Oracles are for testing purposes only. Demo oracles are upgraded and exchanged continuously.
For production oracles, you can request them to be oraclised with custom parameters to best suit your specific use case by contacting the team on Discord.

can we use now this oracle 0x13Cc53aE477eb3E80886fec74E7519E7B50a963D as a production? Is this the public good which you mean here right?

Yes, you can use the Astar randomness oracle in production. The documentation is misleading, we will adjust this.
Feel free to reach out and discuss any possible integration questions.
Link to our developer discord channel: DIA DAO | Open-Source Oracles for Web3

Perfect and thank you!