-
Notifications
You must be signed in to change notification settings - Fork 420
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
[Proposal] Waves trigger #2758
Comments
I like the idea to have trigger separately from the blockchain and use economic incentive to run it. |
I'm not really sure if we should add it as an extension to the node. Why not publish it open source and let the community run it, independently of nodes: first come, first serve. :) |
@PyWaves, makes sense. But, this tool needs to check every SetScript transaction: this is what the Node actually does. So, connecting Trigger to the Node application would be a significant optimization. |
I could think of several use cases for this blockchain trigger. However, it would require re-evaluation of the conditions at trigger time. For example, if a script has the following form:
At the time the script is set, it is added to the “to-do-list” to be executed at a certain time. When the script is triggered the conditions are re-evaluated as the lastTx + someInterval value may have shifted due to newer transactions. The trigger is then rescheduled. To avoid abuse/overloading, the someInterval value can be translated to script complexity. A higher value leads to a lower complexity, while a lower value leads to a high complexity. The minimum time interval between triggers can be limited in this way. |
it s been a while, any outcome? |
Blockchain trigger proposal
There are many requests for adding a functionality of auto-running callable functions in Ride. An example would be a simple DeFi application that takes X WAVES from you and payouts Y WAVES back at time T automatically. Now it's only possible to allow user call
payout()
after T by himself. How could we design the functionality of runningpayout
automatically?My proposal is not to try change something in Node. Easier would be creating a Smart Contracts standard and an independent Waves Trigger tool.
SC standard
Assume there is a script containing simple payout function that decides if Alice could withdraw her balance from dApp:
To complete the payout Alice needs to wait till the time comes and call the function by herself. Better and more user-friendly would be to make the smart contract send money to her automatically at 1575515393 (Unix-time). Assume there is a trigging standard presenting function like this:
There are 3 main standard properties:
CALLAT
containing UNIX-time: when to call function?TRIGGING REWARD
transfer - reward for calling a function being payed by dApp<CALLAT>_<function name>_WAS_CALLED
- dApp state value equals totrue
after the function call that prevents re-calling and double spending of trigging rewardTrigger tool
The trigging standard for SC makes it possible to create a tool that finds and calls functions that are expected to be automatically called.
The trigger tool is an open source app that:
The key point is that anyone can run trigger tool and earn trigger reward by calling functions faster than competitors. Moreover, this tool could be designed to be run together with the main node and add new profit to the miners.
Do you find the idea of implementing triggers to the blockchain interesting? Would like to hear any additions, remarks or hates to this Waves trigger proposal. Thank you!
The text was updated successfully, but these errors were encountered: