Need help understanding Bitcoin DeFi?
→ START HERE
Need help understanding Bitcoin DeFi?
→ START HERE
Need help understanding Bitcoin DeFi?
→ START HERE
Need help understanding Bitcoin DeFi?
→ START HERE
Need help understanding Bitcoin DeFi?
→ START HERE

How to Use MultiSafe, a Treasury for Bitcoin DAOs

Hey, this is Chris Castig, co-founder of Console.xyz and GM at Trust Machines. Console is a chat platform designed specifically for decentralized organizations (think Web3 Discord), and as part of that work, my team is releasing a number of open-source tools designed to empower Web3 communities. Today, I’m going to talk about one of those tools, MultiSafe, and how it empowers communities to collectively own and secure their Bitcoin, STX, NFTs and other digital assets.

Type
Deep dive
Topic(s)
Published
November 29, 2022
Author(s)
Co-Founder of Console.xyz & GM at Trust Machines
Contents

I’ve been fascinated by online communities for a long time. I studied distributed network culture at the University of Amsterdam where I earned my masters researching peer-to-peer online groups, how they interact and are incentivized to behave. Turns out, a lot of that research was relevant for Web3. 

I think for me the power of Web3 clicked when I read Muneeb’s “Can’t Be Evil” blog post from 2017, where he wrote: “no single company should be able to enforce its version of morality on the entire internet or to track users. That’s not how freedom works. The users themselves can choose what should and what should not be censored for them. Instead of relying on promises made by the ‘good guys’, the ‘can’t be evil’ internet protects this right through code and mathematics.”

Web3 presented an opportunity to reimagine how online communities coordinate and behave.

I first met Muneeb and Ryan (the founders of Blockstack, which eventually became Stacks) back in 2012. I was immediately fascinated by their mission to create a user-owned internet.

Web3 presents an opportunity to reimagine how online communities form and behave. As soon as I left my previous  “Web2 company,” I knew I wanted to work on the next generation of digital communities.

A Revolution Starts With Funding

The idea behind a DAO is that people can come together to form a community, pool funds together and then go out and take some action. It’s a fascinating evolution of online communities.

In the world of Ethereum, there are all sorts of DAO tooling such as Gnosis Safe, Snapshot, Juicebox, and many many more. These tools help communities collect funds and make decisions.  

The first step for a community to achieve something meaningful is to raise funds.

These types of DAO tools on Ethereum don't yet exist on Bitcoin nor on the Stacks layer, which makes sense because Stacks is so young. But this means that there is a big opportunity in Stacks and Bitcoin to take some of the lessons on how communities and DAOs are being built and apply them to Stacks and secure them with Bitcoin.

We are now working on a number of tools to empower communities, including MultiSafe (a multisig wallet) and BallotBox (community voting). In this post, I’m focusing on MultiSafe because I believe the first step for a community to achieve something meaningful is to raise funds. 

The problem with web wallets today is they’re not secure enough for communities. For example, if a community or organization raises one million dollars, you don’t want to put the control of all those funds in the hands of just one person. 

A multisig (or multiparty) wallet like MultiSafe allows you to have multiple signers. Therefore, in order to remove money from the treasury you’d need more than one person to approve the transaction. 

We heard from numerous people in the Stacks ecosystem that there was a need to more securely handle community funds, so that’s exactly what we built.

Meet MultiSafe

MultiSafe enables communities to secure funds via shared ownership. 

It’s a customizable smart contract where you can store digital assets (BTC, STX, NFTs, etc), add any number of owners to that contract, as well as set a threshold for how many owners must sign a transaction before it can be finalized.

MultiSafe is useful for:

  • Communities that want to coordinate money and hold shared assets. By having multiple owners of the community account, you get more security and decentralize the control of those funds.
  • Web3 projects that want to leverage our multi-party signing feature in order to execute Clarity smart contracts.
  • Individuals that want greater security. For example, let’s say you own a bunch of NFTs and hold a lot of value in your wallet. You could add a friend or even a second personal wallet as an additional layer of security. 

MultiSafe is an open-source project, and any developer can build on it. MultiSafe successfully passed security audits from both Coinfabrik and Least Authority — two of the leading security firms on crypto-security. 

If you have a need for it, reach out to us on Twitter (@multisafexyz) and contribute to it. Or fork it! It’s a building block for Stacks communities, and we want people to build on it.

We are starting to see some traction since we announced the tool. MultiSafe will be available in the Xverse wallet soon, and DeFi protocol Zest is leveraging MultiSafe to facilitate multi-party signing to execute smart contracts. 

How MultiSafe Works

Each MulitSafe is a unique smart contract address on the Stacks blockchain. When you come to MultiSafe.xyz, all you’re doing is using our user interface (UI) to launch a smart contract. Any assets that you store in a MultiSafe are just between you and the blockchain.

You can go to the Stacks Explorer at any time to view the transactions in a MultiSafe. For example, here’s the MultiSafe contract for Art DAO being deployed on Stacks mainnet:

Source

MultiSafe can do all on-chain operations like a standard user can do (such as swapping tokens, buying/selling NFTs, etc), and MultiSafe is creating add-ons to allow safe owners to more easily interact with various Stacks DeFi products and applications.

Each operation handled by MultiSafe is controlled by separate executor smart contracts that the MultiSafe contract can call. As you can see in our GitHub, we have created several executor smart contracts handling basic functions like adding/removing owners and transferring assets. Once deployed, an executor contract can be used by any live MultiSafe, so any new integration only needs to be built once. For example, here is the executor contract for adding a MultiSafe owner:


;; Title: MultiSafe add owner executor
;; Author: Talha Bugra Bulut & Trust Machines

(impl-trait 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.traits.executor-trait)
(use-trait safe-trait 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.traits.safe-trait)
(use-trait nft-trait 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.traits.sip-009-trait)
(use-trait ft-trait 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.traits.sip-010-trait)

(define-public (execute (safe ) (param-ft ) (param-nft ) (param-p (optional principal)) (param-u (optional uint)) (param-b (optional (buff 20))))
	(contract-call? safe add-owner (unwrap! param-p (err u9999)))
)

The safe contract can call an executor contract through the <code-rich-text>execute<code-rich-text> function. This model is inspired by ExecutorDAO, a DAO structure created by Marvin Janssen at the Stacks Foundation.

An important use case for MultiSafe for developers is contract ownership. When building, it can be important to restrict important smart contract functions to specific admins. For example, those restricted functions could be setting token emissions or updating fee addresses to redirect an app’s fees somewhere else. 

As a matter of security, you don’t necessarily want those controls in the hands of just one person. Instead, you can put those controls in a MultiSafe and require multiple admins to sign-off before making critical changes to your smart contract, improving security.

Another use case is to manage project funds on a MultiSafe wallet. For example, let’s say you are releasing an NFT collection with multiple project owners and would like to move minting revenue to a safer place instead of a standard wallet. You can embed/configure your MultiSafe address onto your NFT contract, and once a user mints your NFT, the minting fee goes directly to your MultiSafe wallet. This way you can manage project funds in a safer place with other owners of your project.

To take advantage of MultiSafe for your project, you can use MultiSafe’s UI or build your own UI using the Stacks Blockchain API to query and submit new safe transactions.

How to Create a MultiSafe 

You can create a new MultiSafe in just a few minutes. 

Go to MultiSafe.xyz. Once you fill out a few fields, your safe will be deployed to the Stacks blockchain. We don’t store any of your data in a centralized database — our website is simply a view for your account as all your assets (tokens, NFTs, BTC) will be kept on-chain. 

Once you create a MultiSafe you, or your community, can easily deposit assets into the safe. 

Transferring assets away from your MultiSafe will require a set number of confirmations from each of the shared owners. In this case you can see “3 of 3” owners signed to send a MegaPont NFT to jake.btc, while only “1 of 3” confirmations have been made to transfer 5000 STX to castig.btc. 

How Can You Get Started

To launch a MultiSafe, learn more by reading our MultiSafe documentation. You can also view the source code on GitHub. If you have any questions about MultiSafe, reach out to us on Twitter @multisafexyz

Copy link
Mailbox
Hiro news & product updates straight to your inbox
Only relevant communications. We promise we won’t spam.

Related stories