Nested Multisigs

Or Turtles All The Way Down

Dekan Brown
Odyssy
5 min readMar 18, 2019

--

At Odyssy, we have been using the Gnosis multisig as a shared account for operating expenses. It works great for our small team and allows a little bit of on-chain governance on how we send these funds around.

Our use case:

Every time we get a client payment we put a small percentage into our shared multisig fund. When we want to pay for something as a team, one of us simply requests to withdraw some funds which creates a transaction in the multisig that requires at least 3 out of the 5 of us to approve the withdrawal. This streamlines the process of doing basic expenses and allows funds to be transferred instantly to the person that needs them.

For example our designer made a cool new t-shirt design. He needs $500 to print a run of the t-shirts. He makes a withdraw request from the multisig, and needs at least a majority to agree we need t-shirts. When 3 of the 5 owners approve he gets the money and everyone has new cool t-shirts on the way.

Another time, one of us wanted to go to SF for a hackathon. She can make a request for the trip expenses from the multisig. As long as a few others agree it would be a good use of time and approve the withdraw, she can easily get the required funds to pay for the trip.

How does it work?

The Gnosis multisig has been around for a while, well for a few years, which is a long time in blockchain world. It has been well audited and is used by some major companies in a production setting. You can access the contract through a nifty web3 front end here or deploy and access the contract directly.
The initial deployment of the contract will cost less than a dollar at current gas prices. The contract allows you to add signatories (owners), change the number of approvals, and approve transaction requests. It supports ETH and all Erc20-compatible tokens. It can also be used to run any other contract function. That last bit is a really cool part and we found lots of interesting ways to use it.

ERC721 Vault

At one point we decided to buy some Erc721 tokens as a group, we wanted to use our shared funds to buy them and have group ownership of these non fungible tokens. The multisig handles this as well, (although the current web3 interface does not show Erc721s). You can send any Erc721 to the multisig contract address and now this address is the owner. This may raise some red flags to you because a contract does not have a private key. So how can you sign a transaction to transfer the token again? Seems it would be stuck and lost in the multisig contract forever.

Business loan from a CDP

We also, as a group, wanted to stake some ETH into a CDP to get a DAI loan. But to draw DAI, add more collateral or payoff the loan we have to call some functions in the CDP contracts. How could we do that, except by having only one person owning and interacting with the CDP?

SubmitTransaction to the rescue

Because the contract is now the owner of the Erc721, this address has to be able to call the safeTransferFrom function of the token. submitTransaction allows just that. All you need is the Erc721 contract address and the contracts ABI. This way you can call a function of another contract and still have the same approval requirements from the multisig before that function can be executed. This can be done super easy from the multisig’s ‘Add’ button in the interface.

You can get the ABI of a contract from either etherscan (the code tab of the contract address), or from Remix by clicking the ABI button after compiling the contract code. It’s a little more involved to run this directly on the contract because you have to pass the hex data of the function you are calling into the data parameter of submitTransaction. You can get this from MEW (MyEtherWallet) ‘contracts’ page.

Nested Multisigs

So now that we know that we can call a function on another contract from inside the multisig contract how about calling a function on another multisig? Yep that works too!

What’s cool about this? One interesting use case is a boil-up kind of governance between multiple groups. So imagine there are three groups using a multisig similar to how we are at Odyssy, for approval of operation expenses. Those three groups decide they would also like to join up and share some funds to do some shared projects. Each of the three multisigs would be a signatory on a parent multisig. To approve a withdraw on the parent multisig, first each group would have to meet the quorum to approve sending the new approve transaction to the parent contract. The parent contract would then have to meet it’s required quorum of multisig approvals before the withdraw was able to be executed. You could do this nesting as far as you want and from there it’s just turtles all the way down. Pretty neat huh?

Follow or join our progress here on Medium and at Odyssy.io.

Editor’s Note:
We’d love to hear your feedback. What are some other interesting ways these nested multisigs can be used to further collaboration and share value across autonomous organizations?

We have a few ideas that we’ll get into in a follow-up article, so follow on!

--

--