Creating an address in Cardano to require multiple signatures

Nicolás Tillet
3 min readMar 16, 2021

Every company should start by requiring it’s founders several signatures to move the company funds, and that’s why we implemented a multi signature script address, that will require 3 or more founders to sign with their private keys (actually, with their witnesses) to enable the spending of the tokens (or company shares).
How do we do this on Cardano? It’s fairly simple (all was done in Linux).
If you need to do it on mainnet, just change the testnet-magic for mainnet.

First, we create our regular addresses that will be used to sign (not staking) using cardano-cli, or cardano-address, whatever suits you best. Ideally these addresses needs to be created by each member, and not just delegate to the developer (won’t add this here as you need to learn that before aiming to do this)

Second, using our public verification key (vkey) we’ll be getting the hashes used on our script later.

Third, we create the file with the script itself

Lastly, we will create the script address itself

That’s all! There you have your own script address that requires 2 signers to execute a transaction.

But, how do we do a transaction now?
Of course, we wont be needing the private keys to sign this, but we will need to generate a witness from each one of our signers (actually, they will have to do it, I will send them the instructions and the scripts to do it easily until Yoroi or Daedalus implements this)

Someone will create the main transaction, giving enough time on the ttl parameters (100000 is around 1 day) to collect all the required witnesses. tx-in-count will be how many incoming transactions we’re using. tx-out-count will be how many we’re needing on the output, for example if we’re using all the funds, we’ll need just 1, otherwise some will “return” to our address, meaning that we’ll have 2 out-count.

We’ll build the transaction now, amount is expressed in Lovelaces, where 1000000 Lovelaces = 1 ADA. In our case we’re sending 10 ADA (remember that you’ll need those 10 ADA + Fees calculated in previous step). Tx-in will be the previous transaction hash from where we’re getting the funds.

First command is the script witness, second is the witness needed to create with each private key. WARNING: Those should be done offline and by each signer, never give your private key to anyone.

When every signer sent you his witness (or the amount needed by the atLeast script), and if the ttl time set previously didn’t already passed, then you’ll be able to continue with the transaction assemble, and later, with its submit.

I highly recommend you to try with less than the required witnesses to check the error, and start understanding how the errors are presented. If one of more errors are present, you’ll see them all (I’ve set lower than the required fee amount for testing the transaction entirely aswell).

That’s all! You should have an address that has more security than a regular address and you’ll have more control on your multi signature accounts. You could set the atLeast on 1, and for example you’ll get a multi signature account that will require any sign to process (however the witness creation will be required still).
As another useful link, I’ll attach a repository of scripts that can be helpful to understand a little more how to interact with the cardano-cli.
https://github.com/gitmachtl/scripts

Good luck!

--

--