Multisig wallet
Prerequisites
dYdX CLIEOA WalletsInstantiate a multisig
1. Add wallets locally
To verify your local setup, list all wallets with
dydxprotocold keys showAs an example, letβs imagine we have a generated wallet A with, e.g.:
dydxprotocold keys add walletA And have added offline walletB and walletC
dydxprotocold keys add walletB --pubkey='{"@type":"/cosmos.crypto.secp256k1.PubKey"dydxprotocold keys add walletC --pubkey='{"@type":"/cosmos.crypto.secp256k1.PubKey",2. Instantiate the multisig
You need the names of the wallets, e.g. walletA , walletB and walletC and the threshold. ourMultisig is an arbitrary name, choose one that is meaningful to you
Now let's send some small funds to the multisig address in order to activate the address.
3. EXAMPLE scenario multisig
Letβs say that we have
WalletA ,
dydx18ym0ts7fw40x2qqw73plgg7wgmkljvvd7x8jk0- the one that we controlWalletB ,
dydx1n72zp2myk6qzsec954nd6lap7tn5f6mwtr2qne- an offline wallet of one of our counterparties in the multisigWalletC ,
dydx1h03ny3j2k4yltt767r3tjw92qs0vj3p2g5w6x3- an offline wallet of the other counterparty in the multisigourMultisig ,
dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smh- a 2/3 multisig, instantiated with WalletA , WalletB , and WalletC
Querying the multisig balances:
4. Create send token Tx
dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smhis the address of the multisig from which we send tokens - in case you have instantiated the multisig locally, you can use itβs name, e.g.ourMultisigdydx1h6x6pxkv2fv3jzsx5hc5efaarhue7gpsdmxafkis the recipient address700000000000000000adydxis the amount to send - 0.7 DYDX--fees value 5000000000000000adydxmay need adjustment; the transaction will fail only when broadcasted if this amount is not enough--generate-onlywill prevent the transaction to be submitted
The result will be stored in the file named unsignedTx.json
5. Sign Token Tx
Replace walletName with the respective wallet name ( walletA , walletB , or walletC ).
Each signer must have instantiated the multisig locally - they must see
dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smhwhen listing their know walletsThe value of
--multisigcan also be the multisig name, e.g.ourMultisig
After this step, there should be two separate signed transaction files, e.g., walletASignedTx.json and walletBSignedTx.json.
6. Combine signatures
One needs all the files generated until now: unsignedTx.json , walletASignedTx.json and walletBSignedTx.json . ourMultisig cannot be the multisig address The result is a file called multisignedTx.json
7. Broadcast Send Tokens Tx
You can use the txhash to check MintScan for the transaction status. If nothing is available on MintScan, then the broadcast or signing were unsuccessful.
Last updated