gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
839 stars 342 forks source link

Oracle VRF #2364

Open DIGIX666 opened 1 week ago

DIGIX666 commented 1 week ago

based from this https://github.com/gnolang/gno/issues/265

Hello everyone, after repeatedly needing to randomize values, @kazai777 and I are looking into how to create an Oracle VRF.

Following our research, we wanted to validate our thinking on the creation steps and also get answers to some pending questions:

Off-chain ->

In Gno ->

Questions:

Feel free to provide any additional suggestions if you have any :)

deelawn commented 1 week ago

Hey @DIGIX666. I did some work earlier this year to build a generic package to enable various types of oracle implementations. It's called gnorkle. It is currently used in a realm meant to enable off-chain verification of gno addresses linked to github users. This example establishes a single trusted off-chain agent that can query the oracle realm for tasks. The agent complete the tasks and publishes the results back to the oracle realm.

gnorkle is built to be extended by implementing the Feed, Ingester, and Storage interfaces.

As for implementing a VRF specifically, I imagine this would be classified as a continuous data feed -- a feed that produces a "random" value on demand by doing some type of aggregation of the data sent to the oracle by multiple off-chain agents.

Writing a gno realm that acts as an oracle will always require a certain amount of trust unless the agent publishing to the realm is some external oracle like ChainLink. Even then, users must trust that it is actually ChainLink publishing the data.

I'm not sure what the exact use case or scope of your VRF proposal is, but have a look at some of the things I've linked here. I'd be happy to jump on a call with you to discuss in more detail.

DIGIX666 commented 6 days ago

Hey @deelawn, thanks for your comment. I will dig into your links with @kazai777 , and we'll get back to you as soon as possible to organize a call. That would be great! :)

Hey @DIGIX666. I did some work earlier this year to build a generic package to enable various types of oracle implementations. It's called gnorkle. It is currently used in a realm meant to enable off-chain verification of gno addresses linked to github users. This example establishes a single trusted off-chain agent that can query the oracle realm for tasks. The agent complete the tasks and publishes the results back to the oracle realm.

gnorkle is built to be extended by implementing the Feed, Ingester, and Storage interfaces.

As for implementing a VRF specifically, I imagine this would be classified as a continuous data feed -- a feed that produces a "random" value on demand by doing some type of aggregation of the data sent to the oracle by multiple off-chain agents.

Writing a gno realm that acts as an oracle will always require a certain amount of trust unless the agent publishing to the realm is some external oracle like ChainLink. Even then, users must trust that it is actually ChainLink publishing the data.

I'm not sure what the exact use case or scope of your VRF proposal is, but have a look at some of the things I've linked here. I'd be happy to jump on a call with you to discuss in more detail.

Hey @deelawn, thanks for your comment. I will dig into your links with @kazai777 , and we'll get back to you as soon as possible to organize a call. That would be great! :)