With Multisig Auth
Learn how to create an Avalanche L1 with a multisig authorization.
Avalanche L1 creators can control critical Avalanche L1 operations with a N of M multisig. This multisig must be setup at deployment time and can't be edited afterward. Multisigs can are available on both the Fuji Testnet and Mainnet.
To setup your multisig, you need to know the P-Chain address of each key holder and what you want your signing threshold to be.
Note
Avalanche-CLI requires Ledgers for Mainnet deployments. This how-to guide assumes the use of Ledgers for setting up your multisig.
Prerequisites
Avalanche-CLI
installed- Familiarity with process of Deploying an Avalanche L1 on Testnet and Deploying a Permissioned Avalanche L1 on Mainnet
- Multiple Ledger devices configured for Avalanche
- an Avalanche L1 configuration ready to deploy to either Fuji Testnet or Mainnet
Getting Started
When issuing the transactions to create the Avalanche L1, you need to sign the TXs with multiple keys from the multisig.
Specify Network
Start the Avalanche L1 deployment with
First step is to specify Fuji
or Mainnet
as the network:
Ledger is automatically recognized as the signature mechanism on Mainnet
.
After that, the CLI shows the first Mainnet
Ledger address.
Set Control Keys
Next the CLI asks the user to specify the control keys. This is where you setup your multisig.
Select Custom list
and add every address that you'd like to be a key holder on the multisig.
Use the given menu to add each key, and select Done
when finished.
The output at this point should look something like:
Note
When deploying an Avalanche L1 with Ledger, you must include the Ledger's default address determined in Specify Network for the deployment to succeed. You may see an error like
Set Threshold
Next, specify the threshold. In your N of M multisig, your threshold is N, and M is the number of control keys you added in the previous step.
Specify Control Keys to Sign the Chain Creation TX
You now need N of your key holders to sign the Avalanche L1 deployment transaction. You must select which addresses you want to sign the TX.
A successful control key selection looks like:
Potential Errors
If the currently connected Ledger address isn't included in your TX signing group, the operation fails with:
This can happen either because the original specified control keys -previous step- don't contain the Ledger address, or because the Ledger address control key wasn't selected in the current step.
If the user has the correct address but doesn't have sufficient balance to pay for the TX, the operation fails with:
Sign Avalanche L1 Deployment TX with the First Address
The Avalanche L1 Deployment TX is ready for signing.
This activates a Please review
window on the Ledger. Navigate to the Ledger's APPROVE
window by using the Ledger's right button, and then authorize the request by pressing both left and right buttons.
After successful Avalanche L1 creation, the CLI asks the user to sign the blockchain creation TX.
This activates a Please review
window on the Ledger. Navigate to the Ledger's APPROVE
window by using the Ledger's right button, and then authorize the request by pressing both left and right buttons.
On success, the CLI provides Avalanche L1 deploy details. As only one address signed the chain creation TX, the CLI writes a file to disk to save the TX to continue the signing process with another command.
Enter the name of file to write to disk, such as partiallySigned.txt
. This file shouldn't exist already.
Gather Remaining Signatures and Issue the Avalanche L1 Deployment TX
So far, one address has signed the Avalanche L1 deployment TX, but you need N signatures. Your Avalanche L1 has not been fully deployed yet. To get the remaining signatures, you may connect a different Ledger to the same computer you've been working on. Alternatively, you may send the partiallySigned.txt
file to other users to sign themselves.
The remainder of this section assumes that you are working on a machine with access to both the remaining keys and the partiallySigned.txt
file.
Issue the Command to Sign the Chain Creation TX
Avalanche-CLI can detect the deployment network automatically. For Mainnet
TXs, it uses your Ledger automatically. For Fuji Testnet
, the CLI prompts the user to choose the signing mechanism.
You can start the signing process with the transaction sign
command:
Next, the CLI starts a new signing process for the Avalanche L1 deployment TX. If the Ledger isn't the correct one, the following error should appear instead:
This activates a Please review
window on the Ledger. Navigate to the Ledger's APPROVE
window by using the Ledger's right button, and then authorize the request by pressing both left and right buttons.
Repeat this processes until all required parties have signed the TX. You should see a message like this:
Now, partiallySigned.txt
contains a fully signed TX.
Commit the Avalanche L1 Deployment TX
To run submit the fully signed TX, run:
The CLI recognizes the deployment network automatically and submits the TX appropriately.
Your Avalanche L1 successfully deployed with a multisig.
Add Validators Using the Multisig
The addValidator
command also requires use of the multisig. Before starting, make sure to connect, unlock, and run the Avalanche Ledger app.
Select Network
First specify the network. Select either Fuji
or Mainnet
:
Choose Signing Keys
Then, similar to the deploy
command, the command asks the user to select the N control keys needed to sign the TX.
Finish Assembling the TX
Take a look at Add a Validator for additional help issuing this transaction.
Note
If setting up a multisig, don't select your validator start time to be in one minute. Finishing the signing process takes significantly longer when using a multisig.
After that, the command shows the connected Ledger's address, and asks the user to sign the TX with the Ledger.
Because you've setup a multisig, TX isn't fully signed, and the commands asks a file to write into. Use something like partialAddValidatorTx.txt
.
Sign and Commit the Add Validator TX
The process is very similar to signing of Avalanche L1 Deployment TX. So far, one address has signed the TX, but you need N signatures. To get the remaining signatures, you may connect a different Ledger to the same computer you've been working on. Alternatively, you may send the partialAddValidatorTx.txt
file to other users to sign themselves.
The remainder of this section assumes that you are working on a machine with access to both the remaining keys and the partialAddValidatorTx.txt
file.
Issue the Command to Sign the Add Validator TX
Avalanche-CLI can detect the deployment network automatically. For Mainnet
TXs, it uses your Ledger automatically. For Fuji Testnet
, the CLI prompts the user to choose the signing mechanism.
Next, the command is going to start a new signing process for the Add Validator TX.
This activates a Please review
window on the Ledger. Navigate to the Ledger's APPROVE
window by using the Ledger's right button, and then authorize the request by pressing both left and right buttons.
Repeat this processes until all required parties have signed the TX. You should see a message like this:
Now, partialAddValidatorTx.txt
contains a fully signed TX.
Issue the Command to Commit the add validator TX
To run submit the fully signed TX, run:
The CLI recognizes the deployment network automatically and submits the TX appropriately.
You've successfully added the validator to the Avalanche L1.