whoabuddy

Oct 116 min read

Defining DeFi on BTC with Clarity and Stacks 2.0

Follow the money

Decentralized finance, or DeFi, is a big topic in cryptocurrency communities. Right now, DeFi Pulse shows there is just over $11 billion dollars of "Total Value Locked" (TVL) across 43 projects spanning 5 categories. This is up from $700 million dollars in December 2019 and only passed the $1 billion mark in early February 2020.

Below are the categories as well as the top three projects in each. If you are into crypto, you've likely heard these names before.

The full list of ranked projects can be found on the main DeFi Pulse website, which includes additional information about each. DeFi Pulse also maintains the DeFi List with additional projects, resources, and publications.

What do all of these projects have in common aside from fancy websites, fleeting forecasts, and further reading? Except for the Lightning Network, everything listed exists on the Ethereum blockchain, where smart contracts are programmed using Solidity.

Solidity is not without its security considerations, and there have been quite a few big-dollar mistakes made by abusing smart contract logic. If you search for the words "solidity", "smart contract", or "defi" + the word "hack" in your favorite search engine, there are a ton of examples of where things went wrong, what happened, and how much was lost.

The one challenge with a decentralized system and the immutable nature of blockchains is that once lost, these funds are often unrecoverable, magnifying the warnings set forth in the fine print, terms of service, and other areas people don't typically enjoy reading. Investment does not come without risk!

An example of how it works

The (extremely simplified) summary below is based on the DeFi Pulse article "Zero to DeFi – A beginner’s guide to earning passive income via Compound Finance", written on September 18, 2019.

Note: I am not affiliated with any of the services below, there are always other options, and I'm not saying you should follow these steps. This is simply an example of one path you could take and should be in no way construed as financial advice.

1. Learn the basics

  • read basics of cryptocurrency
  • read basics of crypto wallets
  • read security best practices

2. Setup Coinbase account

  • verify identity
  • link bank account
  • enable 2FA

3. Setup Metamask

  • install extension
  • create account
  • save seed phrase
  • save seed phrase
  • save seed phrase (yes, it's that important!)

4. Log into Coinbase Pro

5. Deposit funds into Coinbase Pro

  • using USD as an example moving forward

6. Trade funds (USD) for Ether (ETH)

7. Withdraw ETH from Coinbase to Metamask wallet

  • copy, paste, and verify address
  • enter 2FA code to complete transfer

8. Swap ETH for DAI using a decentralized exchange

  • they use DEX.AG in the article to get the best rate (and don't forget about gas prices!)
  • connect site with Metamask
  • send an approval transaction (first time)
  • send a transaction for the trade

9. Swap DAI for cDAI via Compound Finance

  • connect site with Metamask
  • supply DAI in exchange for cDAI
  • receive passive interest every 12 seconds

Simple, right?

While the process has quite a few steps, the allure of locking up cryptocurrency to return passive income is definitively on the rise. However, I think it would be much more exciting if this could be done within the realm of Bitcoin.

Shake up the game

Enter Clarity and Stacks 2.0 - commonly touted as "Web 3.0 on Bitcoin".

Clarity programming language

Clarity is a programming language for smart contracts, initially supported by Blockstack and Algorand, aiming to make smart contracts more safe, secure, and predictable. There are two key elements to how this is done:

  • Clarity is a decidable language, meaning you can know what it's doing from reading the code.
  • Clarity is interpreted, not compiled, so that the source code is published and executed by blockchain nodes.

This design helps eliminate common smart contract vulnerabilities to create a safer environment for programmatically locking up money. If we are to rely on code as a financial steward with no "undo" button, then this is a very important set of qualities!

Stacks 2.0

In late September, the Stacks 2.0 Testnet entered Phase 3: Krypton. This represents the first functional implementation of the Proof-of-Transfer (PoX) consensus mechanism, and a major milestone for Blockstack as it approaches mainnet.

The stacks blockchain is anchored to the security of the bitcoin blockchain, and unlocks some new possibilities as a result. With PoX, miners submit bitcoin (BTC) to mint new stacks (STX) tokens, and stackers can lock-up (or pool) their STX tokens to receive BTC rewards.

This can even be taken a level further, where a project can use PoX to create the same mechanism for their own blockchain and token. In that case, miners would submit stacks (STX) to mint new app (ABC) tokens, and stackers can lock-up (or pool) their ABC tokens to receive STX rewards.

The two concepts combined

Looking back at the winners of the recent hackathons hosted around Clarity and Stacks 2.0, we can see some early implementations that could form the building blocks of DeFi on BTC.

  • Pascal's swapr, wrapr, and flexr represent methods for creating an automated token exchange modeled after Uniswap, wrapping tokens, and implementing a token with elastic supply.
  • Friedger's profit sharing token represents dividable value into a number of given parts, which paves the way for options and futures.

Plus, the next two hackathons will continue expanding that feature set, first focusing on leveraging the power of PoX with #HackStacks, followed by developing DeFi projects with #HackDeFi.

What's coming next

While I don't ever claim to be able to predict the future, I do see potential for explosive growth. As someone who's been a part of Blockstack's ecosystem since the beginning of this year, I am excited and honored to be a part of the community, and overwhelmed by how welcoming, collaborative, and encouraging everyone is.

While DeFi only represents one small portion of what's possible with the technology, and while I am more called toward the concepts of privacy, sovereign identity, and user-owned data, I do have to acknowledge that DeFi is an interesting and rapidly-developing concept that could quickly drive mass adoption.

If you feel called to get involved, there are several resources available to interact with the testnet, a long list of events to learn more, and an excellent community ready to help with answering questions, sharing ideas, and building camaraderie. I hope to see you there!

Share this story