Hello Humans! On this post I want to give a quick update on the status of UBIv2, and the last piece that needs to be solved in order to move forward to testing and auditing the contract.
As some of you may (or may not know) the last couple of months have been a bit crazy on the development of UBIv2. The streaming features turned out to be a very interesting use case for some developers, and I have received many comments, questions and even proposals, on how it works or how it should work.
A couple of iterations occurred and different ideas for implementations occurred. This lead to a constant refactor of the contract Streaming features.
- First, there were Sreaming features on the UBI contract
- Then, a refactor to turn Streaming features into NFTs, on a separate contract
- Then, a new proposal by the 0xdelyver team to create Flows instead of streams. This last proposal basically changed how Streams worked, allowing to make cheaper delegations, but with different features.
- Given the previous proposal I came up with the Idea of turning UBI delegations into a modular thing, allowing delegations to be basically Plugins to the UBI smart contract.
UBI Delegator Plugins
The last iteration basically allows for any arbitrary contract that implements specific code, to be used as a Delegator mechanism for UBI. In order to plug in a new delegator implementation, a UIP would have to be voted and accepted by the DAO. This would allow to have specific implementations for bridges or other not yet known use-cases.
The last piece to be solved
The last piece to be solved is not tied to the Plugin mechanism, but its an inherent issue that UBI delegation brings.
Whenever a human is removed from the registry (by expiration or challenge), a function called reportRemoval has to be executed on the UBI contract to make that account stop receiving the UBI. The accrued UBI is then given to the caller of the function. (Accrued is the “virtual accumulated value” that is not yet part of th account’s balance) This is currently implemented on the UBIv1 contract.
The problem that we need to solve as a community, is that the implementation of UBI flow delegation, needs to have a defined mechanism about how to deal with the reportRemoval, when UBI has been delegated. The following are possible scenarios, with their pros and cons:
A word of advice: Keep in mind that in order to understand this scenarios, it’s required to understand how accruance, and reportRemoval work on the current version of UBI. If you need to better understand this, please, ask in the community. There are many who already know how this works.
On reportRemoval, delegated UBI is given to the caller of the reportRemoval function
This is basically the way that the current version works. Giving the accrued UBI to the function caller, is a basic incentive to make someone who whould not be receiving UBI, stop receiving it.
Pros: The incentive to execute the reportRemoval function is intact
- Protocols implementing UBI delegation as collateral might not be very motivated to use it, since they risk losing their funds, even when the UBI is delegated.
On reportRemoval, delegated UBI remains on the delegated account
The main idea here is that the implementor of the protocol can keep some guarantees about the accrued UBI.
Pros: The protocol implementing UBI delegations is guaranteed to keep the accrued UBI, if the profile is removed.
- A malicious actor could register and immediatelly delegate their UBI to another account, skipping the risk of losing their funds if the profile is challenged. (Think of farmers)
- There is no incentive for anyone to execute the reportRemoval function.
It’s also worth mentioning that whatever needs to happen on the reportRemoval function call, can be implemented on the delegator contract, so it could be different for each implementation, but the multiple scenario should be taken into account.
The Arbitration Option
The is also a 3rd option, which seems to be the most viable. As @santisiri put it in simple words: “Just use Kleros” . This would basically mean: The delegator implementation would do whatver they think is best: Either give it to the reportRemoval callr, or keep it on the delegated account, but both cases should allow for a challengeable window in which, if someone challenges the expected result, it ould go to a Kleros court to be resolved.
After solving the last piece, the UBI update would include:
- UBI contract Update with the Pugins system
- Streams Delegation (by Me) implementation, which allow for scheduleable delegations, and accrues UBI on the NFT
- Flow Delegations (by 0xDelyver), which allows for instant delegations, straight to the wallet of the Flow NFT holder, No schedule, but cheaper gas fees.
All of this would be detailed on the UIP-1 Phase-3 vote, but before going there, we need to go through a few more steps:
- Solve reportRemoval mechanics
- Contracts auditing
Feel free to leave your comments, questions, or feedback.