Skip to content
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

a response from the [anti-collusion infrastructure RFP](https://grants.web3.foundation/docs/RFPs/anti-collusion_infrastructure). #2445

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
268 changes: 268 additions & 0 deletions applications/MACI-CDao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
# Minimal anti-collusion infrastructure

- **Team Name:** CDao
- **Payment Details:**
- **DOT**: 12ukKnLvKCbrS31TmaeGPHZSVoP4rsiaXbN9D6x4CJtspShD
- **Payment**: 12ukKnLvKCbrS31TmaeGPHZSVoP4rsiaXbN9D6x4CJtspShD
- **[Level](https://github.com/w3f/Grants-Program/tree/master#level_slider-levels):** 2

## Project Overview :

### Overview

- This application is a response from the [anti-collusion infrastructure RFP](https://grants.web3.foundation/docs/RFPs/anti-collusion_infrastructure).

- Decentralized decision-making aims to be an  ACI(anti-collusion infrastructure) implementation for the Polkadot ecosystem.

- In certain situations where collective decision-making is required, it is essential to design a mechanism that effectively prevents any on-chain collusion. However, as explained in the RFP, existing voting systems, such as on-chain secondary funds, are likely to pass Collusion, and bribery was exploited (see Vitalico's post on Collusion). This proposal is intended to serve as a proof of concept that can help enable true anti-collusion infrastructure in the Substrate ecosystem.

- This regular pallet can be incorporated into any substrate-based blockchain.

- Our team's goal is to develop a super fair governance chain and realize that all applications on the chain meet the requirements of decentralized decision-making (e.g., DDapp). A fundamental property of decentralized decision-making is anti-collusion and avoidance of bribery.

### Project Details

- MACI use case

![usecase][def]

- An overview of the technology stack to be used

pallet_cdao_decentralized_desion\\
pallet_cdao_collective

- The functions related are as follows:

For organizational managers: \\
Organizational management:\\
1.1 register_collective: Register a collective organization,\\
1.2 remove_collective: Delete collective organizations,\\
1.3 reset_collective: Modify collective organization,

Member Management:\\
2.1 add_member: Add a member; \\
2.2 remove_member: Delete a member; \\
2.3 reset_member: To modify a member;

Topic management:\\
3.1 add_issue: Add voting topic; \\
3.2 remove_issue: Delete voting topic; \\
3.3 reset_issue: Modify the voting topic; \\
3.4 set_schedule: Voting time planning, including start time, disclosure time, decision time, feedback time, etc; \\
3.5 set_share_snapshot: Snapshot of equity shares during the voting period;

Proposal management:\\
4.2 exec_motion: Execute the proposal; \\
4.3 record_misconduct: Records improper behavior; \\

For organizational members, the relevant functional functions are as follows:\\
5.1 transfer_to: Transfer of Shares; \\
5.2 commit: To submit a commitment vote; \\
5.3 reveal: Reveal the voting value; \\
5.4 confirm_decision: confirms whether the decision result is fair; \\
5.5 report_misconduct: Report misconduct Behavior of Selected Nodes; \\


- PoC/MVP or other relevant prior work or research on the topic:

A specific case of implementing MACI is as follows:\\
Assuming that five nodes A, B, C, D, and E have the right to create a new block (and therefore have the right to share the gas cost brought by the new block);\\
Assuming that the five nodes have voting shares of 5, 40, 40, 5, and 10, respectively, \\
Question: How do they produce blocks, and how do they allocate gas costs?

The solution for super fair governance is as follows:\\
Firstly, each node provides its block production plan and the total gas that can be obtained from that plan (using the bit commitment model, following the step of first committing and then revealing to provide its plan);\\
Secondly, the decentralized decision system provides a solution.\\
Assuming that A, B, C, D, and E have expected gas returns of 9, 7, 6, 5, and 4 tokens for the new block, respectively.\\  
The decentralized decision result is as follows:\\
A is responsible for generating a new block and paying 8.415 tokens to the other four nodes;\\
B received a profit of 3.88 tokens,\\
C received a profit of 3.48 tokens,\\
D received a profit of 0.385 tokens,\\
E received a profit of 0.67 tokens.

The analysis of super fairness is as follows:\\
E believes that the new block can generate 4 tokens and holds 10% of the shares,\\
Therefore, in a fair state, 0.4 tokens should be distributed; \\
Also, because E received 0.67 tokens, Therefore, in E, the share of income per ticket that exceeds the fair value is (0.67-0.4)/10=0.027.\\

Similarly, It can be analyzed that in B, C, and D, the income per ticket also exceeds the fair value by 0.027 tokens:\\
for B: the fair gain is 7*40%=2.8; the real gain is 3.88, excess gain per ticket is (3.88-2.8)/40=0.027;\\
for C: the fair gain is 6*40%=2.4; the real gain is 3.48, excess gain per ticket is (3.48-2.4)/40=0.027;\\
for D: the fair gain is 5*5%=0.25; the real gain is 0.385, excess gain per ticket is (0.385-0.25)/5s=0.027;\\

Finally, analyze A:
A believes that the new block can generate 9 tokens, with others holding 95% of the shares,
Therefore, in a fair state, 8.55 tokens should be paid to others;
Also, due to A's actual payment of 8.415 tokens, the share of income per ticket that exceeds the fair value is (8.55-8.415)/5=0.027.

Overall, \\
Decentralized decision-making systems allocate block allocation rights for new blocks, and Each token holder can earn 0.027 more than their fair state earnings.

Conclusion: \\
In the above distribution plan, regardless of how other participants collude, as long as the participants ensure their votes are honest, the final benefit will exceed their fair share.    \\
So, we have established a minimal anti-collusion infrastructure and implemented a mechanism to prevent bribery and collusion.


- What your project is *not* or will *not* provide or implement

It has yet to be a universal anti-collusion system, and the next expansion step can be used for voting governance on general and controversial issues. \\
MACI now can only be applied to simple consensus mechanism processing, such as service providers, providing NFT equity division services for the collective co-creation of NFTs, determining which node is responsible for creating blocks and how to allocate gas fees for consensus nodes, etc.

### Ecosystem Fit

- Where and how does your project fit into the ecosystem?

Provide services for parachain or dapp in the form of pallets;

- Who is your target audience (parachain/dapp/wallet/UI developers, designers, your own user base, some dapp's userbase, yourself)?

Any collective organization that requires decentralized decision-making services, including DAO, Parachain, etc.

- What need(s) does your project meet?

Provide a decentralized decision-making and voting service interface. The decision result meets the following requirements:\\
1 Anti-collusion, prohibiting the infringement of the rights and interests of minority opinion holders;\\
2 Eliminate governance attacks;\\
3 Avoiding the tyranny of the majority;\\
4 Enhance members' enthusiasm for participating in governance.

- How did you identify these needs? Please provide evidence in the form of (scientific) articles, forum discussions, case studies, or raw data.

The implementation of anti-collusion is based on super-fair governance. The concept of super fair governance comes from super fair distribution. Super fair distribution is a mathematical model for solving cake-cutting problems.Typical cake-cutting solutions are envy-free division and super-fair distribution, two decentralized decision-making techniques based on unanimous consent. These techniques aim to make everyone believe that their cake is bigger than that of others or that their cake is bigger than that of the average.

Related papers can be referred to:
1 Arnsperger C. Envy-Freeness and Distributive Justice[J]. Journal of Economic Surveys , 1994 , 8(2):155-186.
2 Brams S J, Taylor AD. Fair Division: From Cake-Cutting to Dispute Resolution[J] Social Justice Research,1999,12(2).
3 Liu Chao, Wang WenJie,Super Fair Distribution Based on Individual Preference[C],International Conference on Management Science And Intelligent Control(ICMSIC 2011), 2011-8:368-372.
4 Chen Y , Lai J K , Parkes D C ,et al. Truth, justice, and cake cutting[J].Games & Economic Behavior, 2013, 77(1):284-297.

The papers mentioned above are aimed at divisible resources, but by introducing economic compensation measures, they can be applied to indivisible resources. More importantly, we can extract several key points of decentralized decision-making from it:\\
1 All participants have decision-making power;\\
2 The final decision reflects the preferences of all participants.\\
Obviously, the second feature has already achieved the anti-collusion mechanism we expected to achieve.


- Are there any other projects similar to yours in the Substrate / Polkadot / Kusama ecosystem?

There is no such pallet that supports Minimal anti-collusion infrastructure. The reasons for the failure of these projects are as follows:  \\
The existing voting system, especially based on the principle of majority, will inevitably damage the rights of minority opinion holders and cannot avoid collusion among voters to obtain improper benefits. \\
Encryption methods to assist in voting decisions can only ensure that participants accurately do what they want but cannot guarantee that the system does the right thing.  \\  
The solution to the problem lies in changing the principle of majority voting to the principle of unanimous consent. In other words, all voters must unanimously agree upon any final decision.

- Are there any projects similar to yours in related ecosystems?

There is no such projects in related ecosystems.


## Team :

### Team members

- Name of team leader: LIU Chao
- Names of team members: Sam

### Contact

- **Contact Name:** LIU Chao
- **Contact Email:** [email protected]

### Legal Structure

- **Registered Address:** NA
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a legal entity then please also list the address here. Otherwise you can apply as an individual.

- **Registered Legal Entity:** CDAO

### Team's experience

LIU Chao, Senior software engineer, More than 20 years of control software development experience in traditional fields, the proponent of the super fair distribution theory, and master's degree in computer application from the Graduate School of the Chinese Academy of Sciences,and the initiator of the CDao.

Sam, MBA, Senior Project Manager, Data Analyst, with over 20 years of cross disciplinary experience Project experience, CDao initiator.

### Team Code Repos

- [ SuperFairGovernance ](https://github.com/SuperFairGovernance)

## Development Status :

The application is in response to the [anti-collusion infrastructure RFP](https://grants.web3.foundation/docs/RFPs/anti-collusion_infrastructure).

Development status will be found over at [super-fair-chain](https://github.com/iunknow588/super-fair-chain). The anti-collusion infrastructure will be implemented by several pallets components of the super fair chain.

## Development Roadmap :

### Overview

- **Total Estimated Duration:** 3 months
- **Full-Time Equivalent (FTE):** 1.5 FTE
- **Total Costs:** 28,000 USD
- **DOT %:** 50%

### Milestone 1 : Pallet logic — Basic functionality

- **Estimated duration:** 1 month
- **FTE:** 1
- **Costs:** 8,000 USD

- Description: Pallet written in Rust for Substrate 2.0 based blockchains. The Pallet will use decentralized decision algorithms to implement the Minimum Anti-Collusion Infrastructure (MACI) mechanism.

| Number | Deliverable | Specification |
| ------ | ----------- | ------------- |
| 0a. | License | Apache 2.0 |
| 0b. | Documentation | Code documentation, API reference |
| 0c. | Tests | The code will have unit-test coverage (min. 70%) to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
| 1. | Usage example | Example of how to use the pallet inside code |


### Milestone 2 Pallet logic — Auxiliary functions features

- **Estimated Duration:** 1 month
- **FTE:** 1.5
- **Costs:** 10,000 USD
- Description: Pallet written in Rust for Substrate 2.0 based blockchains. The Pallet will implement member management and bit commitment voting process,together with decentralized decision pallets, it forms the Minimum anti-collusion Infrastructure (MACI).

| Number | Deliverable | Specification |
| ------ | ----------- | ------------- |
| 0a. | License | Apache 2.0 |
| 0b. | Documentation | Code documentation, API reference |
| 0c. | test | The code will have unit-test coverage (min.70%) to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
| 1. | Usage example | Example of how to use the pallet inside code.|
| 2. | anti-collusion | Implement a mechanism to prevent bribery and collusion, leveraging encrypting votes potentially via Minimum anti-collusion Infrastructure (MACI) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds very vague. It would be nice if you could commit harder in the specification of the deliverables to what you want to implement.


### Milestone 3 Demo case —— Extended functionality features

- **Estimated Duration:** 1 month
- **FTE:** 2
- **Costs:** 10,000 USD

- Description: Develop a simple ddapp, demonstrate the minimum anti-collusion mechanism, and publish an article that explains the work done as part of the grant

| Number | Deliverable | Specification |
| ------ | ----------- | ------------- |
| **0a.**| License | Apache 2.0 |
| **0b.**| Documentation | Code documentation, API reference. |
| **0c.**| test | The code will have unit-test coverage (min. 70%) to ensure functionality and robustness.|
| **0d.**| Article | We will publish an article that explains the work done as part of the grant. |
| 1. | Anti-collusion | Implement Minimum Anti-Collusion Infrastructure (MACI). |
| 2. | Voting Example | Integrate a basic voting example that test the mechanism. |



## Future Plans

First, we hope to extend the minimum anti-collusion infrastructure into a new consensus mechanism and build a super fair governance chain;\\
Second, we will construct a general, super fair solution to the general dispute problem, i.e., a sufficient anti-collusion infrastructure;\\
Finally, we look forward to the emergence of more and more decentralized decision-making applications (ddapps) on the super fair governance chain, which requires the joint efforts of community members.

## Additional Information :

**How did you hear about the Grants Program?**

Announcement by OneBlock.

**other additional information**

- The paper about super fair governance is still under review.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is the only source available for this cake cutting model then please forward it to us at [email protected] already so we can take a look :)

- In polkadot-hackathon-2024, We plan to build a super fair governance chain, but we are just planning. The workload exceeded expectations, so we need to redo the development plan.


[def]: https://github.com/iunknow588/super-fair-chain/blob/a645a872f0e967b0cec23405cac5e70cbdfd852b/docs/maci.png
Loading