DEV Community

Cover image for Ethereum Diamonds for On-Chain Decentralized Governance
Nick Mudge
Nick Mudge

Posted on • Edited on

Ethereum Diamonds for On-Chain Decentralized Governance

A great use-case for Ethereum diamonds is decentralized on-chain governance.

People vote on-chain on executable proposals (proposals that can be executed on a blockchain). If a proposal passes then it is executed to add/replace/remove functions on a diamond in order to remove, change or add functionality to a protocol or system.

Any industry or DAO or protocol or system of contracts can use diamonds to do this.

New DeFi projects are adopting diamonds to implement their on-chain decentralized governance.

BarnBridge

BarnBridge is a new DeFi project utilizing diamonds for governance. From their whitepaper:

The BarnBridge DAO will have full control over the protocol and the features that are built into it. We are doing this through the use of the the Diamond Standard (EIP-2535), which allows us to upgrade the protocol without having all the members remove their tokens and switch to a version 2 of the protocol when that time arises.

The BarnBridge DAO will have full control over the Diamond which provides amazing flexibility in the WEB3 space.


Because we want to have a completely decentralized system, our whole infrastructure is based around a community driven DAO. The DAO will be the owner of the core contracts of the system and will be able to define what the contracts are able to do.

The architecture is using the Diamond Standard (EIP-2535) which allows for smart contracts to add, upgrade or remove functionality. The Ethereum smart contracts are limited to 24KB of maximum contract size, however implementing this standard allows us to bypass this limitation.

It also allows the BarnBridge DAO to choose what functionality to be changed and how. If we promise that a specific functionality will be later disabled from the contract system, we can remove the bytecode which was specifically describing that functionality. That means that there’s no risk of that part of the contract to be re-enabled in the future. Because we can remove specific parts of the contract, we remove the bloat from our contract system, making them easily auditable by the community, while having greater flexibility.

This will not only be an amazing addition to the tech stack but also would help push forward the Ethereum ecospace. This EIP brings many advantages, not only to our protocol, but the Ethereum ecosystem at the aggregate level.

DerivaDEX

DerivaDEX is another new DeFi project using a diamond for their governance. From their blog:

A “diamond” is a contract that gets its external functions from other contracts (called “facets” in the standard). Any number of facets can be added to a diamond.

After deployment, the DerivaDEX Diamond contract will have ownership of the DDX token contract, and the governance contract will be added to the diamond as a facet. Thus, additional facets can be added, removed, and modified in the future only via governance.

DerivaDEX goes into detail in their blog post about how they use EIP-2535 Diamond Standard to implement their system.

In addition DerivaDEX sponsored a smart contract security audit of the diamond contracts:

Want more? Follow me on twitter.

Top comments (0)