Stake-Commit-Push-Reward — dit is the new git for Ethereum Developers
Code is the fuel to advance blockchain technologies and paves the ground for the next generation of the Web following the key principals of decrentralization, incentivization and democratization. In fact, code is the backbone of decrentralization and deserves the highest dedication, attention, scrutiny. Surprisingly, blockchain and more generally open-source software development is often controlled by a project owner (or a small group thereof) in order to prevent anyone to perform harmful changes to the code. But the project owner tends to — often unintentionally — drive the development into a direction he alone believes is the best. In many cases, project owners have ignored the interests, concerns and critics of the community. Their selfish control has led to disputes and tensions between developers and project owners, hampering the project continuation or hindering the integration of meaningful features. There have also been a vast amount of cases where bugs have been overseen because project owners failed to scrutinize the code in a sufficiently thorough way. Prominent examples include
- the Linux kernel 4.8 bug and Linus Torvald’s heated discussion regarding messing up “his” kernel,
- the disastrous Heartbleed attack in OpenSSL where a new feature was insufficiently validated by the project owner, or
- the DAO attack where lack of smart contract programming knowledge led to the greatest heist in blockchain history
2. Dit is the new git
dit — a decentralized version of the prominent git client — introduces community governance, vetting and reward mechanisms to software development.
New commits to a repository always initiate a ballot asking the community to approve/reject the code. No central project owner can stop the ballot and bias the outcome. Rather the community democratically decides to merge the proposal into the branch or drop the committed code. The tool to implement the democratic choice is knowledge-extractable voting, a new scheme for blockchain elections based on the very notion of tokenized knowledge rather than wealth, and thus resistant against Sybil and Rich-get-Richer attacks.
2.1 Knowledge over Wealth
dit is different to git in that it uses crypto-economic incentives to create an equilibrium for code proposers and validators. The code proposer and the validator stake some ETH in order to participate in the voting. This way they indicate the code has been crafted with sincerity and diligence. If a proposer commits to code that doesn’t live up to the expectations of the community or a validator does not scrutinize the code properly, the odds are high either party ends up losing the stake. On the other hand diligent proposers and validators will be rewarded with the slashed stake of the losers. In addition to this staking-based consensus mechanism, however, knowledge extractable voting introduces another token dimension, the so-called knowledge (KNW) token.
In contrast to Ether, knowledge tokens are non-purchasable and non-transferable. They are entangled with the identity. Tokenized knowledge is attainable only through the continuous engagement in software development and demonstration of meaningful code crafting expertise to the community (proof-of-contribution).
Only through continuous contribution to software projects, developers mint KNW tokens and gain the community-vetted credibility and trust. Exploitation of expertise to game a ballot or lack of the right programming expertise results in drastically burning KNW tokens and thus decreases the governance power in future elections. A large amount of KNW tokens in a particular software engineering field (label) is a means to quantify a developer’s programming skill set and experience, making her an ideal candidate to be a thought leader in her field of expertise.
Suppose Alice pushes her solidity code to the repository. Bob, Christine, and Dave feel to vet the proposal, as they already have some solidity knowledge.
The code contribution and vetting runs in four phases.
Phase #1: Proposing a push
- Alice proposes a new code contribution. To stress she produced good code for the project, she deposits 30 ETH tokens. (The token amount is chosen for ease of presentation. It is left to the proposer to choose the amount of tokens she believes is sufficient.)
Phase #2: Validating a push
- Bob, Christine and Dave get informed about the new code proposal. Being experts in solidity they scrutinize the contribution.
- To participate in the ballot, they stake 10 ETH each. (Validators stake ETH tokens proportional to the number of voters.)
- They vote. Each validator casts a secret ballot to accept or reject the code.
Phase #3: Merging to a branch/Rejecting push
- After the voting period ended, each voter opens the vote it committed to and all votes are counted publicly.
- Bob and Christine accepted the push while Dave rejected it. Knowledge-extractable voting is designed with the premise to emphasize knowledge over wealth. That’s why votes are weighted with KNW tokens.
- Bob and Dave both have 2 KNW. Hence their voting power amounts to 10+√2*10=24 tokens. Christine has been contributing by far more to solidity projects. Her solidity KNW tokens amount to 16. Hence her voting power amounts to 10+√16*10=50 tokens.
- The outcome of the ballot is 74 tokens in favor of accepting the code contribution and 24 tokens against the acceptance. Hence approximately we have 75% voted for the code acceptance and 25% against.
- A thumb rule of knowledge-extractable voting is that a 100% decision yields the maximum amount of 1 KNW, while a 50,1% decision yields the minimum amount of 0.1 KNW. The rationality is that in the latter case, it is unclear if the outcome is really in the interest of the community despite a close majority decision. Vice versa, a clear indication of voter consensus confirms the community spirit and results in the maximal emission of 1 KNW.
Phase #4: Rewarding the proposer and validators for community contributions
- The quorum is in favor of accepting the code contribution. Applying the stake-and-slash principal of PoS-consensus, Dave’s ETH deposit is divided between Alice, Bob and Christine. They obtain 3.3 ETH.
- For their positive contribution to the community, Alice, Bob and Christine mint solidity 0.5 KNW tokens. Apparently they have shown what a good solidity project is.
- Dave has rather shown that his expertise deviates from that of the solidity community. His knowledge tokens are burnt and reduce to the square root of 2, i.e. √2=1.4 KNW.
For a detailed explanation of knowledge-extractable voting and the crypto-economic incentives behind the scheme, we refer the reader to the full article.
2.3. Why using dit?
Software development becomes truly decentralized, more community friendly and secure. The drive to contribute to a blockchain project with quality of code will be increased as coders and peer reviewers are rewarded with tokens — be it ETH or be it KNW. Through the reward mechanism more programers shall be attracted to participate in exciting blockchain projects, offer their valuable and necessary experience to increase and accelerate the production of comprehensive blockchain applications while at the same time reducing the number of bugs and flaws leading to a strong basis of Ethereum smart contracts.
3. dit alpha v0.1 available on Rinkeby Testnet
A command line version of dit is available for download here. Currently the dit client supports
- GitHub, GitLab und Bitbucket repositories
- import of own Ethereum key pair
- generation of Ethereum key pair
- commit/push initiating a ballot
- cast a vote
- a test mode to immediately obtain ETH and simulate the validation with three dummy validators
dit is a tool for the blockchain community and following the codex of decentralization solicits any form of feedback, critics and contribution. Please get in touch via Twitter.