Generalized Governance – Becoming Future – Medium
A framework for scalable, interoperable governance, coded in Vyper.
by Kenny Peluso
What is Generalized Governance?
What’s the difference between government and governance? Government is the tangible apparatus that legitimizes and executes laws. Governance is the means through which a government distributes its legitimization and execution across laws. Generalized governance (GG) is the set of rules all types of governance mechanisms follow. In other words, GG is all that can be abstracted from all forms of governance. In programming lingo, GG is a class, and things like democracy, republic, TCRs, etc. are instances of that class.
Why do we want GG?
GG is useful for the same reason every Ethereum Request for Comment (e.g. ERC-20, ERC-721) is useful: Ease of interoperability is directly proportional with achieved network effects. When aspects of commonly used notions (e.g. what constitutes a token, what constitutes packets of information sent across the internet, what constitutes governance) are standardized and agreed upon, developers can concentrate on the core competencies of their products and thus augment the network’s cumulative value (e.g. the nuances of TCP/IP minimally distract the front-end developer from providing their users with the best UX).
What makes my GG so special?
Past GG designs have assumed tokenomics-based solutions to governance (e.g. this GG paradigm is tokenomics-specific and this other GG paradigm, by Level K, is again tokenomics-specific but opinionated to easily accommodate TCRs), but clearly there are many instances of governance that don’t need any tokenomics (e.g. despotism, direct democracy, and systems that cannot be implemented with tokenomics). Therefore, past solutions do not fully encapsulate the set of all governance solutions and thus are not truly GG solutions.
I have formulated an alternative interface that I now propose as a true GG solution. This solution allows for data type-agnostic decisions and captures the governance instances born from tokenomics as well as the traditional solutions pictured above. I have also made and tested a basic, exemplary implementation of said interface. In this post, I’ll be diving deep into how my interface operates through examining my basic implementation.
How does my GG work?
To explain how my GG works, I’ll first list excerpts from the relevant code that can be referenced as the “legal workflow” is outlined. Then, I’ll actually walk through said outline.
addPreferences(_dud: address, _type: uint256, _prefs: address) -> bool
addIssue(_dud: address, _type: uint256) -> uint256
propose(_dud: address, _type: uint256, _issue: uint256) -> uint256
debate(_dud: address, _bill: uint256) -> uint256
vote(_dud: address, _debate: uint256, _votes: uint256, _ye: bool) -> uint256
resolve(_debate: uint256) -> bool
numIssues() -> uint256
numBills() -> uint256
numDebates() -> uint256
These excerpts allude to the general workflow for “how a bill becomes a law” in my GG.
Additionally, here is an excerpt from
contracts/preferences_basic_address.vy, a necessary feature of the governance process:
opinions: map(uint256, address) # HERE
def __init__(_owner: address):
self.owner = _owner
def isInDebate(_status: bool) -> bool:
assert msg.sender == self.delegation
self.inDebate = _status
def setDelegation(_gov: address) -> bool:
assert self.owner == msg.sender
assert not self.inDebate
self.delegation = _gov
def setOpinion(_issue: uint256, _opinion: address) -> bool: # HERE
assert self.owner == msg.sender
assert not self.inDebate
self.opinions[_issue] = _opinion
def getOpinion(_issue: uint256) -> address: # HERE
preferences contracts, user can input their opinion for various issues. Those opinions may become law. The excerpt above is taken from the
preferences contract handling the
address data type. Only 3 lines of code need to be altered to build
preferences contracts listing opinions for different data types, and within those lines, only one word needs to be changed. The lines that need to be altered have been commented with
# HERE in the excerpt above. If the governance system is to reach decisions regarding
string variables instead of
address variables, then, within those 3 lines, simply replace
string. That’s it. My repo provides examples of
preferences contracts for
timedelta data types, so check it out if examples can explain this point better than I.
With the necessary infrastructure in place, we can now dive into the “legal workflow.” The workflow that follows is how I thought about the GG process, but the governance interface, I think, accommodates a plethora of alternative and valid workflows. Those other workflows may not even include
preferences contracts! That being said, here is my envisioned workflow:
- Future members deploy
preferencescontracts for every data type of decision.
- Future members set their preferences i.e. their opinions are recorded and
- The GG contract is deployed
- Members are “added” i.e. Members must call
setDelegation()to assign the GG contract as their
addPreferences()is called to link their
preferenceswith their address the GG contract, and some other operation may be invoked within GG (e.g. reputation points may be assigned to the member’s address or some access token may be assigned to them).
5. Members call
propose() to propose that their opinion on an issue becomes law.
6. Debates on proposed bills are initiated by calling
7. Votes follow via calling
8. A debate is resolved by calling
9. The governing body’s legitimization of an opinion is asserted; A bill becomes a law. The actual read operation of laws involves reading the approved bill’s sponsor’s
preferences and then reading the sponsor’s opinion.
A locking operation can be applied to the preferences contract such that when one’s opinion becomes law, then they cannot change their opinion on an issue. The basic implementation on my repo works differently in that it allows those whose opinions have been deemed as law to change their opinions and thus the law. This is akin to selecting “an expert” per issue governed, where the governing body defaults to the expertise of a subset of members. I say “subset” because a
preferences contract’s opinions can easily be governed by another governing body of individuals, another GG contract, or even the same GG contract with opinionated functionality for whitelisted committees.
The contract in my repo has a basic implementations of both the
preferences and GG contracts. Feel free to fork, contribute, and leave your feedback!