-
Architecture overview
-
Buying and storing offset certificate on IPFS
-
Proposing to mint CO2kens by providing the HASH of the certificate. DAO members can vote. If proposal passes, CO2kens are minted.
-
web3 applications can interact with these primitives through the eth-co2.js npm module to offset their user's carbon emissions
-
Smart contract owners can add a `offset()` modifier to their methods to offset all transactions interacting with the "green" smart contract
-
Overview of all functionalities
-
Overview of all functionalities with examples
Inspiration
Climate change should be treated as a waste management problem. If you produce waste [emissions], you pay somebody to remove it [offset these emissions]. Today, there is no easy way to offset carbon emissions in the crypto space (even though the carbon footprint of blockchain transactions is not negligible). We wanted to change that!
What it does
We have built the necessary primitives to use carbon offsets within the Ethereum ecosystem. These primitives allow:
- crypto nerds like us to offset their emissions (e.g. flights) through our website www.co2ken.io
- all dApps to offer their users the possibility to offset their carbon emissions (e.g. from crypto transactions)
- all 3rd party smart contracts to add our
offset()
modifier into their methods, automatically offsetting all transactions going through that contract—essentially creating green smart contracts
How we built it
- a
CO2ken.sol
contract which holds tokenized carbon offsets calledCO2kens
representing a negative tonne of CO2. This contract has anoffsetCarbon()
method which acceptsDAI
and burns a respective amount ofCO2kens
- These
CO2kens
are minted by a DAO set up on Aragon. A DAO member purchases offsets from traditional offset certificate retailers, uploads proof to IPFS and creates a proposal in Aragon to mint a respective amount ofCO2kens
. Other DAO members verify the uploaded certificate and vote in favor of minting newCO2kens
if the certificate is valid. The DAO also manages the parameters need for computations stored inCO2kenData.sol
(token price & carbon footprint of 1 unit ofgas
) - All web3 applications can now interact with our
CO2ken.sol
contract through aeth-co2.js
npm package. This opens the door to a multitude of use cases:- Integrations into wallets to offset all crypto transactions
- Allows dApps to offer their users an offset functionality
- We also deployed a
Green.sol
contract which is a solidity modifier calledoffset()
. This modifier can be added to all 3rd party smart contract methods to automatically offset all transactions which go through the respective smart contract. In this case, the contract owner pays for the offset essentially making it a green contract - We've built a frontend which allows users to offset their emissions and pay for it with
DAI
: www.co2ken.io. We've used dapphero, webflow and oureth-co2.js
library to offer that functionality
Challenges we ran into
- Setting up a DAO. We've tried both DAOStack and Aragon and couldn't make it happen. Aaron from Aragon finally pointed us toward the "winning solution". After that it was easy
- Setting up
eth-co2.js
in the correct way - Webflow's limited "hackability"
- Minimize the carbon footprint of our own contract executions. Solved it through batching
- Debugging solidity
Accomplishments that we're proud of
- No screaming, no crying, no spitting at each other
- Iterative approach—adding building block after building block
- A simple design which has a powerful impact
- No risk for the users due to full transparency and risk absorbed by the DAO "preloading" the
CO2ken.sol
contract withCO2kens
What we learned
- How to set up a DAO!
- How to hack dAppHero and webflow as best as possible
- Lots of solidity dev skills, especially around multi-contract architectures
- Lots of Javascript / Typescript / npm tricks and pitfalls
- The importance of useful error messages
- git skills
- How awesomely helpful the Ethereum community can be
- Experience of working as a tight-knit team under time pressure
What's next for CO2ken
- We have got lots of positive feedback for the project and will definitely pursue it.
- There is a clear business case behind the project, so if you're an investor, throw your
DAI
at us <3 - We have to fine-tune the DAO's incentive structure. Potentially integrating a bonding curve to incentivize members to maintain a "safe" supply of
CO2kens
- We're thinking about integrating dispute resolution through Aragon Court or Kleros. This would add additional security to the users
- We bought the co2ken.io domain name
- And of course: double and triple-check our code before deploying to mainnet
- Save the planet, one
CO2ken
at a time :P
Built With
- dapphero
- ethers.js
- javascript
- openzeppelin
- remixide
- solidity
- tenderly
- webflow
Log in or sign up for Devpost to join the conversation.