HAKKA Governance

The OFF-CHAIN Voting System (Phase 2: Enlightened Despotism)

Hakka Finance
HakkaFinance
7 min readAug 21, 2020

--

Hakka Finance

Hakka Finance is a decentralized financial ecosystem with remarkable DeFi products administered by governance token: HAKKA. By distributing HAKKA directly into the hands of users and community, an increasingly huge ecosystem will be incentivized to upgrade the protocol and collectively steward it into the future with excellent governance.

We proudly present the governance system of Hakka Finance:

https://gov.hakka.finance/

Anyone who possess HAKKA token can express their opinion regarding the ecosystem issues (HAKKA Improvement Proposal, HIP) of Hakka Finance via our OFF-CHAIN voting system, which will introduce as below.

Governance of Existing DeFi Protocols

DeFi protocols such as Compound and yearn.finance are governed by their governance token (COMP / YFI). Token holders are given the right to determine the protocol’s issues and policies via an on-chain voting system. However, the rising gas price makes token holders hesitate to vote and express their opinions. Therefore, the on-chain voting system suffers from the potential risk of high costs and the community’s low wills for voting.

Off-Chain Voting Model

Concerning the high costs of voting on-chain, Hakka Finance dedicated to resolving the issue of lacking willingness for paying ethers to vote and, afterward, we developed an “Off-Chain” voting system. There will be no more requirement to pay high gas fees to vote and express their opinions. A Hakka Finance governed by the entire community, regardless of rich or poor, is realizing.

To ensure the validation of each vote and that the voting process is transparent and open, we decided to use “Git” as our backend database. In the following paragraphs, we will elaborate on the mechanisms of how this off-chain voting system works.

Let’s walk through the process of off-chain voting in Hakka Finance:

Step 1. Create a Topic

Parameters: (Topic / Description / Vote Options / Duration)

Any Hakka token holders can be the proposer in the Governance Platform of Hakka Finance. A proposed topic should fit the template HIP form of the vote in Git, including the information of “Topic,” “Description,” “Vote Options,” and “Duration.”

Proposed topics are required to be transmitted to GitHub via the formation of “PR(Pull Request).” Received PR would be stored in the format of “Markdown” at the GitHub Repo in Hakka Finance. After proposing, the topic will be displayed on GitHub and the Governance Platform for community members to browse and discuss. There will be no way to adjust the content of the topic once proposed.

Step 2. Vote

After full awareness of the topic, token holders can vote in the Governance Platform. When the token holder decided to vote for an option after full awareness of the topic, the backend would generate a string of specific format for the token holder to sign (type sign) with their private key in the wallet. The particular format includes the “HIP Number,” “Vote Option,” the “hash” of the HIP’s content, and the “Timestamp” of the voting moment. By signing to the above strings, there comes a “Signature Data,” which will be stored in the Markdown file at GitHub Repo along with the address of the voter, vote option, and timestamp.

Step 3. Progress

An accumulator connected with the API of GitHub would be built in the frontend of the Governance Platform. After retrieving the voting data from GitHub and requesting the ethereum nodes for Hakka’s balance in the addresses, the immediate progress of the voting will be displayed in the front end for anyone to review.

Step 4. Result

When the topic’s duration is over, the voting system will shut down, and no one will be able to vote anymore. The accumulator will generate the final result of the topic with the status at the very moment when the duration is over.

With the above information, we construct the following diagram of system architecture:

Complementary

<1> How to Avoid Double Count

The current voting system allows anyone to vote again with a different option in the duration. However, the accumulator in the frontend only takes the latest vote as a legitimate one. Therefore, ballots with previous timestamps will be dropped, so there will be no double counting.

On the other hand, to avoid the system being paralyzed by maliciously continuous voting, we will set a timelock in the config file at GitHub Repo. There will be a cooling time to vote again after one vote.

<2> How to Verify the Vote

The “Signature Data” is signed by the token holder with their private key in the voting process. We can easily verify whether the “Signature Data” is signed by the wallet owner or not by the public key of the wallet.

<3> How Result Affected by Transferring Hakka

The progress of the vote is determined by the real-time Hakka balance of each address, which means the final result of the vote is the status at the moment of duration ends.

For example, suppose address A with 100 Hakka voted for option (1), but he transferred the whole 100 Hakka to address B who voted for option (2) before the duration ended. Then, by the end of the period, there will be no balance for address A, and the balance of 100 Hakka will be added to option (2).

The accumulator would request the ethereum nodes for the information of the latest balance via the below code:

Pros and Cons

We can conclude the pros and cons of the “off-chain” voting compared to “on-chain” voting as below:

Pros

A. Costless

The process of off-chain voting required only a “type sign” as a proof, regardless of the on-chain action. Hence, there will be no gas fees included in the process. Due to no gas enrolled in voting, we expect an ideal governance system with a high vote rate that all token holders can vote without further ado rather than only a few people willing to pay high gas fees to vote.

B. Needless of Delegation

Gas fees, which are expensive for community members who hold only small amounts of the governance token, are required in each on-chain vote. Therefore, on-chain voting is usually implemented along with a delegation system, allowing users who hold small amounts of the governance token to delegate their rights to holders with a huge amount who are definitely willing to pay the gas fees to vote. By operating with a representative democracy system, there are, in fact, few people actually enrolled in the governance.

Off-chain voting, needless of gas fees, allows any users to vote via their crypto wallet simply with an act of signing with their private key. We expect a direct democracy system that anyone, no matter how many tokens they own, can express their opinion without further ado.

Cons

A. Uncertainty

In the on-chain voting mechanism, votes are sent directly to the smart contract in the format of the transaction, which will be stored in the block history forever, making each vote “certain.” The off-chain voting system, however, relies on the signature, which can be limitlessly generated by the wallet. Therefore, we count on the accumulator in the front-end to discard the duplicates and keep only the latest one as leverage.

B. Weak Anti-censorship

On-chain votes are sent to the nodes in the distributed network. Off-chain votes, however, are sent to a single server, which makes the distinct difference of anti-censorship.

To conclude the pros and cons of the on-chain/off-chain comparison, we present the table below:

Future Work

Although the voting system of Hakka Finance is generally developed, some technical details are still underway:

Solution for Voting via Contract Wallet

The second task would be solving the issue of users who vote via contract wallets. Because the contract’s result of verifying is changeable, proofs that pass isValidSignature() might be invalid after admin changes. The voting system’s current structure would drop the invalid signature, which means the contract wallet must sign again after admin changes.

The introduction of the off-chain voting system proposed by Hakka Finance is as mentioned above. Advice is always welcome from every community members. Thanks to all the HAKKA fans for building a much ideal ecosystem of Hakka Finance together.

--

--

Hakka Finance
HakkaFinance

A DeFi ecosystem with remarkable products administered by the HAKKA token.