I’m building out a protocol called Open Value Sharing (previously called Cycle Compensation or Cycle Sharing).
You can read more about the foundations of the idea here: Cycle Compensation
To get an MVP working, the idea is for Azle to set a timer off on init/post_upgrade of a canister. Keep in mind that this needs to be a general-purpose solution. Azle will be providing this functionality automatically for all Azle canisters.
The timer will go off on some period, like every day. When the timer callback executes, it will loop through the dependencies of the canister (obtained during a build step from node_modules/package(lock).json) and send some cycles to the registered principal of those dependencies.
I think this will work okay as an MVP without protocol changes, at first…but one major limitation is measuring cycle consumption. I really think it would be great to have the payouts be based on the amount of cycles burned between timer callback executions. But there is no way to accurately get this in a general manner, as top ups can’t be easily accounted for as far as I know.
I propose that the IC APIs be extended to allow a canister to query its own cycle consumption over a period of time. This would allow the payout amounts to be easily calculated based on actual cycle usage of the canister.