This blog is now an archive. Find content from Hiro here and Stacks news and announcements here.

Meet The Winners Of HackDeFi

Decentralized Finance has erupted over the last two years and taken the blockchain industry by storm. HODLing is great and all, but cryptocurrency is too powerful to not put it to good use! We’ve seen DeFi platforms emerge from seemingly out of nowhere, redefining what money can do and offering unprecedented financial instruments to unaccredited investors.

The HackDeFi hackathon was aimed at building these innovative cryptographic mechanisms on Stacks 2.0 using Clarity smart contracts. We wanted to see our diehard community truly test the limits of Clarity, and build DeFi products that demonstrate the versatility of the STX token.

Hackers DeFinitely delivered! We were impressed by the robustness of the projects, and how they exemplified the community’s growing familiarity with Clarity. Take a look at the best submissions from the batch, and a huge congratulations to all the winners!

First Place: DualX

Author: Westridge Blockchain

For a long time, all you could really do with crypto is stare at it in your wallet. The first few years of Bitcoin championed it as a “Store of Value”, and Ethereum was pretty useless before dApps and DeFi rolled onto the scene. That’s why the recent DeFi boom is truly spectacular. For the first time, we are seeing truly novel, innovative, and unprecedented financial mechanisms available to consumers. MakerDAO stuck their foot in the door in 2019 with CDPs, but since then hundreds of DeFi products have sprung up offering yield farming, arbitrage, leverage, flash loans, and other mind-boggling economic instruments.

With DualX, we’re starting to see that explosion of complexity on Stacks. This submission is a collection of Clarity smart contracts for the Stacks 2.0 blockchain that implement a DeFi ecosystem of exchanges (DepX and GamX). It provides the opportunity for an investor‘s capital (denominated in BTC) to earn a yield on their funds while passively waiting to buy an investment asset (say STX). This results in a deposit at the Deposit Exchange (DepX). The counterparty who takes this deposit (in return for providing the yield) receives a Deposit Token (dToken) certifying their ownership of the deposit. The Investor and the Yield Provider also agree on the maturity of the deposit, and a conversion rate between BTC and STX. This gives the Yield Provider an option to decide at maturity whether to return the original BTC amount, or an equivalent STX amount converted at the conversion rate. Logically, they will choose whichever is more profitable for them!

This relationship between investors, yield providers, STX, and BTC, is when we really start to see the beauty of blockchain automation. Trying to do these complicated swaps and liquidity events with a bank as an intermediary would be a nightmare with expensive fees and accredited investor requirements. Blockchain was literally created for automated crypto madness such as this! Allowing a user to earn dTokens is a huge incentive to participate in DualX, and will only increase volume through the exchange.

DualX is a robust fleet of interoperable Clarity contracts enabling a decentralized exchange ecosystem. Not only did this hacker build some killer smart contracts, but the accompanying dToken is a foundational incentive for depositors. Now we’re really seeing Clarity pushed to the limit!

View On Github

Second Place: ClarityDAO

Author: Friedger Müffke

One could argue that a DAO is the original dApp. Back in 2017, when there weren’t many tangible use cases for cryptocurrency, an ambitious project emerged called The DAO. A DAO is a Decentralized Autonomous Organization. This is basically a decentralized, virtual company that exists on the blockchain, autonomously performing actions based on the votes of the members who participate in the DAO. Participation in a DAO typically entails contributing capital, with groups of individuals pooling funds in order for disbursement decided by voting.

The DAO in 2017 was one of the first high-profile utilization of smart contracts in a DAO. The Ethereum community flocked around the idea and soon the DAO had an extremely large amount of crypto locked up in it. Unfortunately, hackers used a recursive call exploit to begin draining funds from the DAO treasury to the tune of 3.6 million Ether. The smart contract programming language on Ethereum, Solidity, was nascent and unfamiliar to a lot of developers. This led to numerous attack vectors being overlooked, and massive amounts of funds being lost. Although the original DAO was a catastrophe, the conceptual brilliance of a DAO, and hard lessons learned from the exploit, have never been more recognized by blockchainers.

With the advent of Clarity, it may be time for another DAO! The Clarity smart contract language on Stacks 2.0 prevents a multitude of attack vectors and security vulnerabilities that are seen in other frameworks. The recursive call exploit used in The DAO hack in 2017 would be impossible in Clarity due to it being deliberately Turing incomplete.

Stacks mastermind Friedger Müffke definitely realized the benefit of developing a DAO using Clarity, and submit the showstopping ClarityDAO! Based off the recent MolochDAO on Ethereum, ClarityDAO is an internet community contract that can hold multiple tokens, make investments, give grants, and trade tokens. The Clarity code is very close to the original Solidity code, and the same variables and functions names have been used.

ClarityDAO contains all the functions you would hypothetically need to organize and operate a DAO. Any user can submit or cancel a proposal. Then other participants can sponsor a proposal, or merely submit a vote endorsing a certain grant. Once voting is complete, the proposal is processed, a mechanism in which the DAO counts votes for a certain proposal and confirms a result. One last intriguing aspect of the platform is that a user may ‘ragequit’ the DAO if a proposal is passed that they did not endorse.

DAOs are a glimpse into the future of business and capital raising. Hypothetically, a company could live entirely in the virtual, blockchain world, with its “employees” simply voting on proposals and venture capital disbursements using on-chain transactions. ClarityDAO is an example of how we can make DAOs more secure and trustworthy using Clarity. This could be a critical avenue for burgeoning teams to raise funds in a decentralized manner in the Stacks ecosystem!

View On Github

Third Place: FiStack

Author: Ankit Raj

Managing payroll expenses on a centralized system is always going to be risky. Relying on software such as Quickbooks, Brex, or Xero keeps a small business’s private information in siloed servers controlled by a corporation. A single point of control can also mean a single point of failure. Settling or reconciling accounts can be problematic, as well as audits being time-consuming and frustrating. There’s also so much manual work involved for a human resources manager or accountant.

Meet the solution: FiStack! This submission is a unified, decentralized platform where managers can organize a database of their employees, as well as automate payment for services. FiStack allows you to enter in detailed information for all employees, as well as assign them roles and a manager. Once you have a ledger of employees, a salary can be configured for each person. This payment is then automated on an hourly, daily, weekly, or monthly basis depending on the parameters, and disbursed as tokens on the blockchain.

The ledger.clar clarity smart contract included with the project is a beast! It uses a map to assign payments to each of the employees in the ledger, and then another map to link those payments to BTC addresses. It also makes certain functions only available to the contract creator, ensuring there can always be an administrator.

When you own a small business, the security of your data and your customers information is paramount. Using corporate software, you have no idea the unilateral control or backdoors the developers might have access to. Keeping your books on the blockchain guarantees that the accountants are the only one with access to the data. FiStack leverages blockchain technology to offer a private, decentralized, secure way of doing payroll, without anyone snooping.

View on Github

Fourth Place: PieStack

Author: Terje Norderhaug

PieStack Donation Chart

Philanthropy has never been more important in our society. With wealth inequality only growing in some areas of the world, it’s critical that we have mechanisms for capital redistribution. Charity fraud is also a major obstacle in ensuring that collected funds are actually being dispensed to the correct beneficiary in need. Some donation drives result in massive amounts of money being collected, so it’s integral that the process is legitimate, verifiable, and secure.

PieStack, a hackathon project from hacker extraordinaire Terje Norderhaug, tried to alleviate problems that arise when using centralized philanthropic platforms by using blockchain technology instead of a Web 2.0 solution. PieStack is a decentralized network of gracious donors and deserving beneficiaries that enables STX and BTC donations, graphically displayed on a dynamic pie chart.

Pietron Donation Pie

User-friendly sliders allow for visual rebalancing of the pie that updates in real-time. It also provides functionality for quickly generating a url which would add a person or entity to someone else’s PieStack! Additionally, PieStack charges no fees whatsoever and simply requests that users donate to the project if they enjoy the platform. Finally, logging into the the app with a Blockstack ID prioritizes data portability and privacy, championing the self-sovereign identity component of blockchain.

PieStack is one of those dapps that really helps people wrap their brain around the benefits of blockchain technology. Philanthropy is a perfect use case for decentralized networks, and cryptocurrency keeps it transparent and auditable. Thanks to Terje for building a rockstar app, and thinking about others in the process!

Try Out PieStack

View On Github


→ Check out the project gallery on DevPost

Muneeb Ali

Joe Bender

Joe grew up in Pittsburgh, Pennsylvania, receiving his Masters in Information Science from the University of Pittsburgh. After gaining an interest in blockchain technology and cryptocurrencies in 2016, he moved to New York City and joined ConsenSys to work on Ethereum. Joe joined Blockstack as a Developer Evangelist in April 2020, looking to spread awareness of the technology and empower developers to build powerful decentralized applications. His favorite thing about the blockchain ecosystem is the passionate, thriving community full of eclectic, ambitious thinkers.