Closed srenault-meeds closed 7 months ago
@bourasom could you please take a look at Deployment Architecture so that I can continue on designing the Software Architecture. Thanks in advance for your collaboration.
- Update gamification events removed (out of scope)
e. from the reward page in the hub, reward admin can review achievement from the rewards list with way to reject f. from the reward page in the hub, reward admin can list rewards per program with ability to define a program budget and the rules (program owner can manage its budget and send rewards OR program owner can only review achievement) removed (out of scope)
d. removed mention of merke tree (non functional)
- If not claimed, then the reward can be claimed after and once a period (to identify) is passed with unclaimed rewards, then it goes back to the meeds dao. Indeed, claim has not been done so it is expired dropped the requirement. Replace by : "Rewards accumulate and can be claimed at any time"
added new requirements
- any community member should be able to verify the full score and rewards for any UEM period
- UEM index and rewards should be inalterable
added requirement
UEM weekly budget can be changed by an onchain param.
Reviewed the scope accordingly to internal discussions
to check please @margondicco
user who has reached a minimum of points - threshold to adjust if needed
We don't have a way to verify this information on blockchain, thus no need to add this requirement
Provide a way for WoM Manager to review current and past user engagement data for each hub and globally of course
Not only for WoM Manager
. IMO, we should provide this way for everyone who should anonymously access those information so that all other Hubs can audit and identify cheaters. We should even think of a way to let other Hubs declare a Hub Rewarding Report as fraudulent. In fact, the UEM engine has to be as much autonomous as possible and as much as decentralized as possible, so that it's governed by hubs participating to the UEM and not centralized by any party. This to make sure that we continue to be transparent about the sent Rewards and guarantee fairness as much as possible.
Suggest to generate random data based on a budget to study upcoming rewards before sending
This need should not be expressed here IMO since it's an internal method for testing the Formula. I would rather say that we should just describe the expected outcome as a product feature.
Provide a way to send rewards
The rewards will not be sent, it will be claimable. In fact, the UEM Rewards have to be, like for LP Tokens Staking, autonomous and without needing a centralized ~DAO member who has to be the validator~.
Rewards can only claimed by the Hub's admin wallet
In fact, the Deed Owner and Tenant can claim their shares and the Hub's wallet isn't the target of rewards. The Deed Manager can claim its rewards knowing that we can suggest to send those rewards to the Hub Wallet in order to redistribute those earnigs with the Hub community if needed... to be discussed more if needed (I think this will need further ideation to know how to design the flow)
Thanks.
We don't have a way to verify this information on blockchain, thus no need to add this requirement
Indeed, it is only a definition of what an engaged user is. I will update this.
Not only for WoM Manager.
Indeed, this is why I propose a summary of such informations for anyone who wants to know more about the score's details, etc. This is described above Check this >
Each hub card will suggest an option to access detail of engagement informations.
Regarding this:
The rewards will not be sent, it will be claimable.
Ok, claimable I know. But for me, it had to be "approved". As I understand, you suggest that no for more decentralization. Thus, I have a question. How does the DAO check if cheating have been done during the period? Do we have a way to "give" a malus to cheater for next rewards? cc @plamarque
How does the DAO check if cheating have been done during the period? Do we have a way to "give" a malus to cheater for next rewards?
Very good question! But ~DAO check~, rather to replace with WoM Hub Owners (participants on the WoM only). We can use the voting rights of the Deed so that during the current UEM period, any WoM Hub can submit a fraud report
on Blockchain so that autonomously the WoM members decides if the submitted reports of others are fraudulent.
Go fonc of course
Ready for technical specification review by DAO members (eXo : @rdenarie , DAO secretary @plamarque )
go tech
ACC & PRs ready to review ( eXo : @rdenarie )
Hello, You can proceed to the merge.
Hello, You can proceed to the merge.
Thanks, merged to develop
Rationale
The Meeds DAO's Whitepaper explains it well: we aim to reward user engagement of each Hub running in the WoM. Cf. Whitepaper - https://mirror.xyz/meedsdao.eth/EDh9QfsuuIDNS0yKcQDtGdXc25vfkpnnKpc3RYUTJgc
1. Functional Requirements
To accomplish this, 4 major use cases will be adressed:
Collect data regarding user engagement
Display UEM informations of each hub
Review user engagement and reward for UEM
Inform owners and hosts about the reward to claim
2. Terminology
3. Technical Requirements
Expected Volume & Performance
Security
The security requirements of the UEM technical design are:
Extensibility
The
wallet
addon has to allow through extensions adding informations about UEM from thedeeds-tenant
addon. In fact, both administration UIs (Wallet administration and rewards Administration) has to allow such an extension to display:Configurability
No configuration requirement.
Upgradability
The UEM & WoM contracts has to be upgradable so that the association can vote to change the UEM formula computing.
Existing Features
Existing Features of Meeds Packages shouldn't being altered by the introduction of
deeds-tenant
addon.Feature Flags
No feature flag is needed.
4. Software Architecture
Data and persistence
The Data Model that will be used un UEM Blockchain Contract will define the following entities:
This data structure will be used to store informations sent by Hubs about their periodic rewards. Those information will be stored as it was sent without alteration nor computing.
This data structure will be copied from the WoM Contract (see MIP #106 ). It's a snapshot of the associated Deed to the Hub at the time of report sending. The Deed information, as described in the whitepaper, will be used to compute the Hub score.
This data structure will be computed once the report is received and will be unaltered but the
fraud
flag. This flag can be set totrue
by another contract that can adopt a dedicated business logic to mark a contract asfraud
or not. This will allow to decentralize the governance of Hub reports denunciations and slashing.This data structure aggregates information about the reports included in the current Reward period including the
fixedGlobalIndex
which is the sum of all Hubs scores and which will be used in Claimable amount computing.This data structure is the result of all UEM engine computing which will allow Deed Owner/Tenant to receive UEM rewards through a
claim
method in the blockchain.Services & processing
Considering that we aim to have thousands of Hubs hosted in the WoM and rewarded by the UEM, the big concern is to scale the UEM so that it doesn't require any action to weekly send rewards. In addition, we aim to decentralize the Hub reports data sending so that all actions are transparent and secure on the blockchain. To do this, the Choice of using
Polygon
instead ofEthereum
was obvious to reduce Gas Fees in favor of the decentralization of the UEM.Hub Report Sending
The above diagram describes the sequence diagram of Hub Report sending Transaction. It demonstrates as well how the different Blockchain Contract Data structures are altered by this kind of transaction.
When transaction sending fails (or the transaction local estimation/simulation fails), the error is stored in the Hub so that it gives the detail to the Hub Manager/Owner to fix the error. (by sending Matic to the Admin Wallet per exemple when no funds are remaining in the admin wallet to send transactions to the blockchain)
Access
The Hubs Reports and UEM rewards should be accessible from blockchain and publically available from https://wom.meeds.io.
The Hub listing, reports and rewards should be accessible through URLs:
On the UEM contract in the Blockchain, those list of operations will be available to retrieve information:
hubReports(uint256 reportId)
: returns the Hub Report data structure (see above in Data Model section)hubDeeds(uint256 reportId)
: returns the associated Deed of the Hub Report data (see above in Data Model section)hubRewards(uint256 reportId)
: returns the computed Reward of the Hub Report data (see above in Data Model section)hubReportIds(address hub)
: returns the list of reportIds sent by the HublastReportId
: Last sent report Identifier (Auto incremented)periodicRewardAmount
: the amount of Meeds with decimals (10^18) that is used periodically by UEM to reward Hubsrewards(uint256 rewardPeriodId)
: retrieves the Data structure of the UEM Period Reward details (see above in Data Model section)recipients(address recipient)
: retrieves the Data structure of the UEM rewards for a given deed manager/tenant/owner (see above in Data Model section)reportsByRecipient(address recipient)
: returns therecipient.reportIds
as described in the data structure ofRecipient
. (see above in Data Model section)pendingRewardBalanceOf(address recipient)
: returns the pending claimable rewards for a given recipient. This doesn't consider the Hub Reports in the current period.5. Annexes
Reasoning that explain the technical choices
This is the third version (V3) of UEM technical design
The first technical design (v1) proposed a full centralization of UEM rewards and which includes that:
The disadvantage of this first solution was that Hub reports are aggregated in a centralized server inside a database which is alterable and which, due to a bug, can compute a bad score for a giving report. In addition, centralizing such an information will reduce the credibility of the project and will give the governance of UEM rewarding administration, in an opaque way, to a unique organization. (anti DAO)
The second technical design (v2) proposed to make the Hub reports sending decentralized and made from the Hub itself to a Blockchain contract in order to allow the traceability of reports sent by each Hub. To allow sending report to this contract, we needed to have a contract which describes the list of Hub addresses who are allowed to send reports to the UEM which will be considered valid by default. This new contract is considered as the WoM and already detailed in MIP #106 (Created after this one for the V2 of Technical Design).
The disadvantage of this second solution, which was the same as the first version, is that rewards are sent and not claimed, thus the Hubs has to wait for Rewards sending operation, in addition to the fact that the rewards sending will require multiple transactions to send by a Wallet managed by the DAO (anti decentralization as well).
For those both concerns, the V3 was designed in order to decentralize the Reports sending and rewards claiming. Thus the DAO will just have to send Meeds to the UEM contract and configure the periodic Meeds to share between Hubs.
Some other concerns aren't addressed yet by this third version, which is the
Fraud Detection
mechanism and how it should be decentralized and follows a voting system instead of a centralization of Fraud decision. Should the Fraud detection follow a voting system or should it be automatically made through some business rules that could be determined after UEM rewarding experimentation ? Is the UEM formula fair enough to measure the Hubs engagement and to recognize Hubs engagements ? How the UEM total amount has to be computed and retrieved fromTokenFactory
contract from Etheruem Blockchain to receive the 30% ofUsers
Mintium share of automatic and periodic minted Tokens ?Contracts Deployment
The WoM and UEM contracts has been made
upgradable
to allow the DAO voting on formula changes to make the Mintium fair enough for all participating Hubs. Thus theERC1967Proxy
will be used. You can use the following steps in order to deploy the contracts (using Remix IDE):solidity 0.8.20
(limitation in Java Web3J Maven Plugin, thus added using0.8.9
in source code only)0x8129fc1c
(Abi encoding of emptyinitialize
method, use https://abi.hashex.org/ by example)setPeriodicRewardAmount
to set the periodic amount of Meeds that will be sent by the UEM to participating Hubs (LoadUserEngagementMinting.sol
using address of newly deployed proxy to access UEM functions through the proxy address)WoM Manager
Address on WoMProxy address throughaddManager
which will make the automatic bridging of Deeds from Ethereum Blockchain to Polygon (see MIP #106 for more details)WoM Manager
Address to allow bridging automatically the deed between blockchains.