-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design options and use cases for Oracles #967
Comments
@lock9 if you prefer to group here all decisions for oracles, I'll help you. This last issue I opened has nearly a complete proposal for oracles, in two different execution modes (trusted and non-trusted), and hiding CN IP address, which must be a requirement in my opinion. The proposal for two different operation types on oracles is here (I'll close that one, to work here): #798 Proposal for TransactionAttributeUsage.Url: #769 (this one was independently proposed by Erik and Shargon in Native NEP-5 big PR). This is already implemented. I couldn't find the original proposal of oracles, which was by Shargon and Erik, some time ago. @doubiliu is very active there and has given priceless contributions for the design as well, so let's summon here as well ;) |
I'll quote my last comment there: (from #932) @doubiliu interesting analysis.
|
As far as I know, we are docking some oracle third-party organizations (such as Chain.Link), and then these third-party organizations perhaps will provide oracle data services to Neo in the future. So is there any relation or difference between the oracle design we discussed here and the docking? |
@eryeer I'm not aware of the docking you mention, can you clarify? WIll it require an extra attribute transaction field I'll present my "mental challenge" on the Oracle feature. Suppose we want to build a lottery system on Neo, that depends on random.org website, and will give millions of dollars in prize. Can we build it using the third-party provided? This is what I'm trying to (I wanted to) achieve here. |
Of-course we can use the third-party oracle service. There are no conflicts whether NEO has its own oracle service or there are third-parties. |
@igormcoelho FYI, we are working with ChainLink to build Oracle service on NEO so that projects can use, and Chainlink are working with a lot of big data providers . So do we still need to put so much effort to provide Oracle in NEO by ourselves. |
@eryeer @lock9 @doubiliu @igormcoelho @erikzhang |
@igormcoelho We can discuss the relevant issues in face-to-face meetings in September. |
@wanglongfei88 @steven1227 I don't think we should be dependent on third party solutions and tokens to offer this functionality. Chainlink support should expand the options for NEO developers, not replace them. NEO should still offer its own Oracle solution. |
I agree with @EdgeDLT on this one. NEO should offer a full solution for developers without relying on the existence of a third party. Having Chainlink support to supplement the built in NEO oracle service would be ideal for developers. |
My point is just if ChainLink can provide such a guarantee that I mentioned. If it can, we can adopt it, I'm not against third party solutions. Let me clarify the challenges I see:
If that works, or solution is even better, that's good for us,I'm just raising dome concerns on oracle design that werent raised before,and I think they're important. |
We need incentives and the features needed for these providers to work with neo. The ability of them being paid using smart contracts. Like people already mentioned before, we need some kind of delegation, because CN won't access the internet, it will probably count on some sort of proxy to make these requests. We need some sort of 'oracle fees'. Maybe, for these fees, we can even allow them to be paid using nep-5 contracts, like @vncoelho mentioned in #978. We need to allow Neo to support different providers and make this "profitable" for them (allow Neo users to pay them fees). |
Sure @eryeer , we want the best of the best for Neo ;) |
Consider the example set by NeoFS. There is an outer ring of storage nodes paid in GAS (creating incentives for NeoFS network participants and NEO holders), and an inner ring of nodes that handle auditing/accounting. The same model should work for an oracle network, except network participants would be offering "trustworthy" request data for review instead of providing storage space. The inner ring would be responsible for handling payments/punishment, validating request data, and somehow making the validated information available to CNs. |
In fact, I didnt know NeoFS work like that 😂 interesting.. when I say "outer ring", for me is just an "external ring" of nodes, so we wouldnt need internal ones (btw, NeoFS is even more complex than this proposal, congratulations to NSPCC). |
Yep, in this case I guess CNs or contracts act as the 'inner ring' seen in NeoFS. I just think it is important that NEO provides its own infrastructure to handle transaction routing or to let people participate by running nodes (ideally with incentives powered by GAS). I don't want to see a situation where important features like oracles for contracts are unavailable to NEO developers that do not want to trust a third party project and its network or token. The way I see third parties like Chainlink fitting into the picture is by connecting as a part of the NEO oracle "external ring." It's up to them to build a product that will convince developers to use those nodes over the native NEO infrastructure. This is what I mean by avoiding dependency; NEO should provide an implementation that these projects can then extend on their own terms. |
The only thing I'm afraid is thirdparty not providing Oracle service with one block finality (by third party externally reading and writing on the chain).. block finality is not common, other chains dont have it, so it might be ok for them, but Neo has it and we need to take advantage of it. We need to better discuss it, I dont know the details. |
The concept of a 'baked in' Oracle into the protocol is a great (and ground breaking) idea, and in my opinion if it can be pulled off properly, is an important feature to have for a number of reasons (which Edge touched on). Here's some of my thoughts: Most platforms aren't suited to have this in the protocol due to their architecture. NEO is suitable for this due to the lower number of consensus nodes coupled with the dBFT consensus mechanism. However as stated above, there are some careful considerations that need to be taken into account re: internet access, block times, security and effect on consensus etc. If it's done, it should be relatively easy for a developer to make use of this Oracle for simple requests, and be able to pay for the request with GAS. Chainlink has built a great decentralized Oracle network which is quickly becoming the standard for getting off-chain data to all blockchain Smart Contracts. However not all use cases require this level security, decentralization and complexity required to implement. ie lets say a Smart Contract on NEO pays millions of $ out insurance to farmers based off weather events, then you'll likely want to use multiple sources of data for weather rather than just 1, and have the results aggregated off chain and passed to the Smart Contract. This is where something like Chainlink shines, it gives you confidence in the data due to its ability to pull data from multiple sources & oracles, have it aggregated and with nodes staking tokens and having penalties for if they are found out to be acting bad. However if you are a simple small startup or developer building a game dApp that needs to connect to a custom web service you've built and deployed on AWS, then it would be better if you could simply call the service from within your Smart Contract without needing to go through an external network, obtain & consume LINK tokens etc. If NEO can offer both options to developers, I believe it will greatly help adoption from developers, individuals, startups all the way to big enterprises, because it covers all bases from the quick, simple & easy, through to high value scenarios where a very high level of security and decentralization is required |
I like the idea that @pappas999 proposed. Let Chainlink team to handle the complex Oracle service which takes decentralization, security and efficiency into account, Because that will require lots of effort, expertise and partnerships. Then NEO could just provide Simple Internet Access to developers or projects without worrying decentralization , Byzantine nodes or malicious users, etc. It is just a simple web access service or resource developers want to use and access. I thought this is also the original propose. |
That's what this proposal is about @wanglongfei88 😂 it's challenging to offer such a simple service. My proposal tries to made this as simple as possible, to be honest. |
A use case that I (us from Novem) would implement right away when we have oracles. Autoconversion of tokens. At Novem we give 2% discount on purchase of our NNN token if its paid with the NVM token. Both prices fluctuate, NNN tokens relate to the Gold price, NVM is market price on exchanges. There are a few more use cases like a savings plan, auto portfolio allocations (like having a BTC / Gold portfolio, that auto adjusts to keep a certain exposure to both assets), that comes to my mind, if we can get external pricing. |
Plan A: |
Work Flow |
On-chain component Off-chain component Work flow: The first stage:
|
Advantages: 1) Synchronization |
We also design a traditional plan |
Plan B: |
Work Flow |
It is a asynchronous model |
And we also need to design a Incentive model |
My proposal is only a draft, and there are still many details to discuss. |
Maybe we can discuss them on face-to-face meeting next week |
I like the two approaches @doubiliu, let's discuss them soon, and make a fine report for the community ;) |
@igormcoelho I am looking forward😄 |
Both are good concepts to discuss. I think we should also discuss penalties in addition to incentives; it is important to have a way to keep nodes honest. Perhaps a quantity of NEO that should be staked by Oracle nodes or something. |
We will present our proposal soon, completely different to the proposal neo-project/proposals#78 |
Maybe the Oracle is honest but the server is cheating... Very hard to decide this... everytime you should think in random.org |
@shargon yeah, it is very important.We collect some key trust problems of designing a distributed Oracle system. And we have design a incentives proposal.We need discuss carefully |
@shargon the text you made on proposals is still very good, perhaps this should be re-proposed on specification repo... as soon as we agree on basic oracle features. |
The problem with this text is that was proposed for delegate all the work to the current CN and we thought now that we need other nodes, Oracle nodes. without touch the current consensus mechanism. |
It was great discussions yesterday. Thanks to @shargon and @belane and @neo-project/ngd-shanghai for teaching the options. Congratulations for the great job and all the design. I agree with the comment of @igormcoelho here #967 (comment) (OPTION A), which is also the proposal @shargon and @belane are supporting, as well as a need of the guys from NEO-FS. The incentives are still not clear but sure some good direction will soon appear. As emphasized, the block finality is a good thing we have and should be used in our favor, providing a one-step on-chain solution with off-chain information sharing. |
Following this line of reasoning, I think that 2 consensus are not necessary for the Oracles to work properly. Perhaps, the following flow could be considered:
|
What you guys are proposing sounds great, but it is extremely similar to what Chainlink have been developing for the past 2 years: Decentralized Oracle network, consisting of on and off chain parts, staking, penalties, threshold signatures, consensus/aggregation on results etc. If this is the case, wouldn't it make more sense to just integrate to that, and develop some form of atomic swap (GAS for LINK) for NEO Smart Contracts to be able to use and directly pay for data requests with GAS? Only suggesting this because their team has been in development on all this stuff for 2 years, so it requires great effort to achieve. Having said that, if you do want to replicate that sort of functionality and have it baked into the NEO protocol that's also great, it may pay to have a read of the chainlink white paper for some ideas (or check out their github) I have a question though. From the description of option A), it sounds like any Oracle Node can take a request from the Oracle pool and request data from the API and generate the response back? Or will it be like Chainlink where specific Oracle nodes are setup to obtain data from specific APIs? eg Alice has a node that obtains weather data from weather.com, Bob has an Oracle Node that gets data from accuweather.com. If this is a more 'general' Oracle implementation where any Oracle can obtain the results from the APIs due to them all being public and open etc, then how do we determine which Oracle Node in the available pool gets to make the request (and get the reward)? |
@pappas999 Our design is the former one, every Oracle node will request the same public API. The API url is specified by transaction. Any oracle node that requests the API and get the consistent result approved by consensus should be considered to contribute to the result of the request, and they should be rewarded equally. |
Thanks, that makes sense now. So the use case for the NEO Oracle network will be publicly accessible static or dynamic web services and URLs that return JSON data etc which can then be parsed and aggregated into a result that will be hashed and stored in the block. I have some thoughts to add for incentives/penalties and considerations: Incentives: Also, seeing as the URLs being accessed are public, there should be good incentive for NEO holders to be Oracle nodes if they wish. This plays in well to the token economics of the NEO ecosystem, and would allow them to collect more GAS from Oracle transaction fees. The only potential downside to this, is you don't want NEO holders with poor servers/internet connections being critical Oracle nodes in the network. Chainlink is implementing a 'marketplace' to combat this, where nodes will have reputations, and to be verified as a high quality data provider, you need to show solid uptime and response times for a certain length of time. Perhaps Consensus Nodes or NEO holders can vote in/out Oracle nodes somehow based on their performance. Penalties: data points/URLs: Need to be careful how many Oracle nodes will be accessing these URLs at a given time. Eg Will the URL be able to handle getting 100 GET requests within a couple seconds? I'm not an expert on web servers and requests/scaling so this point may be not applicable. |
@pappas999 I like point2 in Incentives.So I want to add concept of group. |
And Penalties is very difficult.Since there is not any evidence can be trusted to judge a node's behavior |
Would you be interested to see how this approach can help? Only 1 node needs to make an oracle call. The rest can verify it, if the oracle has signed it's response. In our work above we show that external calls from Blockchain systems are possible, contrary to widespread misconception. |
According to the accepted proposal neo-project/proposals#78
List use cases
Discuss what is the best way to implement it (best design)
Discuss the scenarios we should cover
Discuss security issues we should be concerned
Implementation design
Edit: Implementation design proposals without images will be punished with a thumbsdown (👎 )
The text was updated successfully, but these errors were encountered: