{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Mathematically Formalizing the Conviction Voting Algorithm\n", "\n", "## Background\n", "---\n", "Conviction Voting is an approach to organizing a community's preferences into discrete decisions in the management of that community's resources. Strictly speaking conviction voting is less like voting and more like signal processing. Framing the approach and the initial algorithm design was done by Michael Zargham and published in a short research proposal [Social Sensor Fusion](https://github.com/BlockScience/conviction/blob/master/social-sensorfusion.pdf). This work is based on a dynamic resource allocation algorithm presented in Dr. Zargham's PhD Thesis.\n", "\n", "The work proceeded in collaboration with the Commons Stack, including expanding on the python implementation to makeup part of the Commons Simulator game. An implemention of Conviction Voting as a smart contract within the Aragon Framework was developed by [1Hive](https://1hive.org/) and is currently being used for community decision making around allocations of their community currency, Honey.\n", "\n", "## Defining the Word Problem\n", "___\n", "\n", "Suppose a group of people want to coordinate to make a collective decision. Social dynamics such as discussions, signaling, and even changing ones mind based on feedback from other's input play an important role in these processes. While the actual decision making process involves a lot of informal processes, in order to be fair the ultimate decision making process still requires a set of formal rules that the community collecively agrees to, which serves to functionally channel a plurality of preferences into discrete outcomes. In our case we are interested in a procedure which supports asynchronous interactions, and provides visibility into likely outcomes prior to their resolution to serve as a driver of good faith, debate, and healthy forms of coalition building. Furthermore, participations should be able to show support for multiple initiatives, and to vary the level of support shown. Participants have a quantity of signaling power which may be fixed or variable, homogenous or heterogenous. For the purpose of this document, we'll focus on the case where the discrete decisions to be made are decisions to allocate funds from a shared funding pool towards projects of interest to the community.\n", "\n", "## Converting to a Math Problem\n", "___\n", "\n", "Let's start taking these words and constructing a mathematical representation that supports a design that meets the description above. To start we need to define participants.\n", "\n", "### Defining the Participants\n", "\n", "___\n", "\n", "Let $\\mathcal{A}$ be the set of participants. Consider a participant $a\\in \\mathcal{A}$. Any participant $a$ has some capacity to participate in the voting process $h[a]$. In a fixed quantity, homogenous system $h[a] = h$ for all $a\\in \\mathcal{A}$ where $h$ is a constant. The access control process managing how one becomes a participant determines the total supply of \"votes\" $S = \\sum_{a\\in \\mathcal{A}} = n\\cdot h$ where the number of participants is $n = |\\mathcal{A}|$. In a smart contract setting, the set $\\mathcal{A}$ is a set of addresses, and $h[a]$ is a quantity of tokens held by each address $a\\in \\mathcal{A}$.\n", "\n", "### Defining Proposals & Shared Resources\n", "\n", "___\n", "\n", "Next, we introduce the idea of proposals. Consider a proposal $i\\in \\mathcal{C}$. Any proposal $i$ is associated with a request for resources $r[i]$. Those requested resources would be allocated from a constrained pool of communal resources currently totaling $R$. The pool of resources may become depleted because when a proposal $i$ passes $R^+= R-r[i]$. Therefore it makes sense for us to consider what fraction of the shared resources are being requested $\\mu_i = \\frac{r[i]}{R}$, which means that the resource depletion from passing proposals can be bounded by requiring $\\mu_i < \\mu$ where $\\mu$ is a constant representing the maximum fraction of the shared resources which can be dispersed by any one proposal. In order for the system to be sustainable a source of new resources is required. In the case where $R$ is funding, new funding can come from revenues, donations, or in some DAO use cases minting tokens.\n", "\n", "### Defining Participants Preferences for Proposals\n", "\n", "___\n", "\n", "Most of the interesting information in this system is distributed amongst the participants and it manifests as preferences over the proposals. This can be thought of as a matrix $W\\in \\mathbb{R}^{n \\times m}$.\n", "![image of participant/proposal affinity matrix](https://i.imgur.com/vERr8Zv.png)\n", "\n", "These private hidden signals drive discussions and voting actions. Each participant individually decides how to allocate their votes across the available proposals. Participant $a$ supports proposal $i$ by setting $x[a,i]>0$ but they are limited by their capacity $\\sum_{k\\in \\mathcal{C}} x[a,k] \\le h[a]$. Assuming each participant chooses a subset of the proposals to support, a support graph is formed.\n", "![pic](https://i.imgur.com/KRh8tKn.png)\n", "\n", "## Aggregating Information\n", "\n", "___\n", "\n", "In order to break out of the synchronous ad-hoc voting model, a dynamical systems model of this system is introduced that fuses collective community preferences into a single signal. The mathematical derivation of this process can be found below.\n", "\n", "### Participants Allocate Voting Power\n", "\n", "___\n", "\n", "![pic](https://i.imgur.com/DZRDwk6.png)\n", "In the above diagram, we examine the participant view. Participant $a$ with holdings $h$ at time $t$ supports proposals $i$ and $j$ with $x$ conviction. The sum of all conviction asserted by participant $a$ is between 0 and the total holdings of participant $a$.\n", "\n", "### System Accounting of Proposal Conviction\n", "\n", "___\n", "\n", "![pic](https://i.imgur.com/euAei5R.png)\n", "\n", "In the above diagram, we examine the proposal view. Proposal $j$ with total conviction $y$ at time $t$ is supported by participants $a$, $b$ and $c$ with $x$ conviction. The total conviction $y$ at time $t+1$ is equal to the total conviction at time $t$ decremented by an exponential decay $\\\\alpha$ plus the sum of all conviction from $k$ agents in time step $t$.\n", "\n", "### Understanding the Alpha Parameter\n", "___\n", "For a deeper exploration of the $alpha$ parameter, please read more in the [Deriving Alpha notebook](https://nbviewer.jupyter.org/github/BlockScience/Aragon_Conviction_Voting/blob/master/models/v3/Deriving_Alpha.ipynb)\n", "\n", "\n", "## Converting Signals to Discrete Decisions\n", "___\n", "\n", "Conviction can be considered like a fluctuating kinetic energy, with the Trigger function acting as a required activation energy for proposals to pass. This is the mechanism by which a continuous community preference turns into a discrete action event: passing a proposal. \n", "\n", "### The Trigger Function\n", "___\n", "For a deeper exploration of the trigger function, please read more in the [Trigger Function Explainer notebook](https://nbviewer.jupyter.org/github/BlockScience/Aragon_Conviction_Voting/blob/master/models/v3/Trigger_Function_Explanation.ipynb)\n", "\n", "\n", "### Resolving Passed Proposals\n", "___\n", "\n", "![pic](https://i.imgur.com/lmOl9HE.png)\n", "\n", "## Social Systems Modeling\n", "___\n", "\n", "In the conviction voting model, multiple graph structures are used to represent participants and proposals to represent a subjective, exploratory modeling of the social system interacting.\n", "\n", "### Sentiment:\n", "\n", "* Global Sentiment denotes the outside world appreciating the output of the community. \n", "* Local Sentiment denotes the agents within the system feeling good about output of the community. \n", "* Sentiment increases when proposals pass and work is completed in the community, and decreases when proposals fail and community progress stalls.\n", "\n", "### Relationships between Participants:\n", "\n", "* Edges from participant to participant denote influence (to represent subjective social influence) and are assigned randomly via mixing processes.\n", "\n", "![Participant Influence Graph](https://i.imgur.com/zQziRA7.png)\n", "\n", "### Relationships between Proposals\n", "\n", "* Edges from proposal to proposal represent conflict, which can be positive or negative. \n", "* Some proposals are synergistic (passing one makes the other more desirable). \n", "* Some proposals are (partially) substitutable (passing one makes the other less desirable).\n", "\n", "![Proposal Conflict Graph](https://i.imgur.com/CNjLhmr.png)\n", "\n", "## Glossary of Notation\n", "___\n", "### Summary of State Variables\n", "\n", "| Notation | Definition|\n", "|--- | --- |\n", "|$\\mathcal{A}_t$ | The set of all governance agents/participants at time t |\n", "|$\\mathcal{C}_t$ | The set of all candidate proposals at time t |\n", "|$n_t$ | The number of agents/participants at time t |\n", "|$m_t$ | The number of candidate proposals at time t |\n", "|$W_t$ | The matrix private preferences of n agents over m proposals |\n", "|$h_t$ | The active token holdings of an agent at time t (Note: the sum of h over all agents is equivalent to the effective supply) |\n", "|$x_t$ | The sum of tokens supporting a proposal at time t |\n", "|$X_t$ | The matrix of tokens from n agents supporting m proposals at time t |\n", "|$y_t$ | Total community conviction for a proposal at time t|\n", "|$y^*_t$ | Trigger function threshold for a proposal at time t |\n", "|$R_t$ | Total available resources in the proposal funding pool|\n", "|$S_t$ | Effective supply of tokens available for community governance|\n", "\n", "
\n", "
\n", "\n", "## Summary Laws of Motion / State Transition\n", "\n", "* A new address $a$ joins the community of participants:\n", "$\\mathcal{A}_{t+1} = \\mathcal{A}_t \\cup \\{a\\}$\n", "$h_{t+1}[a]= \\Delta h >0$\n", "\n", "* An address $a$ leaves the community of participants:\n", "$\\mathcal{A}_{t+1} = \\mathcal{A}_t \\backslash \\{a\\}$\n", "$h_{t+1}[a]= 0$\n", "\n", "* A proposal $i$ is added to the set of candidates\n", "$\\mathcal{C}_{t+1} = \\mathcal{C}_t \\cup \\{i\\}$\n", "\n", "* A proposal $i$ is removed from the set of candidates\n", "$\\mathcal{C}_{t+1} = \\mathcal{C}_t \\backslash\\{i\\}$\n", "\n", "* Resources are added to the shared resource pool\n", "$R_{t+1}= R_t+ \\Delta r$\n", "\n", "* Update Conviction Required to pass proposals\n", "$y^*_{t+1} = [\\cdots ,f(\\mu_i), \\cdots]$\n", "where $\\mu_i = \\frac{r[i]}{R_t}$\n", "\n", "* A participant allocates their support\n", "$X_{t+1}[a,: ] = [\\cdots,x[a,i],\\cdots]$\n", "s.t. $\\sum_{i\\in \\mathcal{C}_t}x[a,i]\\le h[a]$\n", "\n", "* A proposal is passed given $y_t[i] \\ge y^*_t[i]$\n", "$\\mathcal{C}_{t+1} = \\mathcal{C}_t \\backslash\\{i\\}$\n", "$R_{t+1}= R_t- r[i]$\n", "\n", "* Update Conviction\n", "$y_{t+1}[i] =\\alpha\\cdot y_t[i] + \\sum_{a\\in \\mathcal{A}_t} x[a, i]$\n", "\n", "
\n", "\n", "## Parameters\n", "\n", "\n", "| Notation | Definition|\n", "|--- | --- |\n", "|$\\alpha$ | The decay rate for previously accumulated conviction |\n", "|$\\beta$ | Upper bound on share of funds dispersed in the example Trigger Function|\n", "|$f(z)$| Trigger function that determines when a proposal has sufficient conviction to pass|\n", "|$\\rho$ | Scale Parameter for the example Trigger Function |\n", "\n", "Recall that the Trigger Function, $f(z)$ satisfies $f:[0,1]\\rightarrow \\mathbb{R}_+$\n", "e.g. $f(z) = \\frac{\\rho S }{(1-\\alpha)(z-\\beta)^2}$\n", "\n", "
\n", "\n", "## Additional Considerations when Deploying CV\n", "\n", "* Timescales\n", " * whether your system is operating in block times, or more human understandable timescales like hours, days, or weeks, these considerations need to be factored into your model\n", "* Minimum candidacy times\n", " * proposals should be active for a minimum period to ensure appropriate dialog occurs within the community, regardless of level of support\n", "* Minimum conviction required for small proposals\n", " * to prevent small proposal spamming from draining the communal funding pool, all proposals should have some minimum conviction required to pass\n", "* Effective supply\n", " * to avoid slow conviction aggregation due to \"inactive\" tokens (e.g. locked up in cold storage or liquidity pool, without active participation in governance), effective supply is the portion of tokens that are active in community governance\n", "* Proposal Approval & Feedback Process\n", " * the proposal process could make use of additional mechanisms like fund escrow, proposal backlog processes, reviews/validation & disputability/contestation to ensure that the incentive to game the system is kept to a minimum through responsible community oversight\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.3" } }, "nbformat": 4, "nbformat_minor": 4 }