Qwoyn Studios

Authz and Multi-Sig

This tutorial is meant for committee members or anyone using multi-sig in conjunction with authz.

Tutorial: Creating and Broadcasting a Multi-Signature Transaction

In this example, we will be creating a transaction using the granter as the --from address. Then, we will have the multi-sig holders sign the auth exec transaction.

Step 1: Generate the Original Transaction

qwoynd tx staking delegate qwoynvaloper1srqkgpnkstcmhap39yuavs0jl9mkqp79slgdlx 33333000000uqwoyn --from qwoyn1stfhre33shlwkp0ma2yhyqkscg886w085pul8j --fees 12500uqwoyn --gas 400000 --generate-only >> unsigned_delegation.json
  • This command delegates 33,333 Qwoyn tokens (in the form of micro-qwoyn) to the validator with valoper address ending in gdlx.
  • We use the generate-only flag to create the transaction without broadcasting it.
  • The output is saved to a file called unsigned_delegation.json.
Note: Authz granter is the person who gave authorization to the wallet that will eventually sign this transaction. In our case, that wallet is qwoyn1efftazlsv6lejspj436knsv2fjzrn8jxcwxwx7.

Step 2: Generate Another Transaction for Multi-Sig Holders to Sign

qwoynd tx authz exec unsigned_delegation.json --from qwoyn1efftazlsv6lejspj436knsv2fjzrn8jxcwxwx7 --fees 12500uqwoyn --gas 400000 --generate-only >> step2_unsigned_delegation.json
  • This command creates another transaction using the unsigned_delegation.json file as input.
  • The generate-only flag is used to create the transaction without broadcasting it.
  • The output is saved to a file called step2_unsigned_delegation.json.

Step 3: Multi-Sig Holders Sign the Transaction

qwoynd tx sign step2_unsigned_delegation.json --multisig qwoyn1efftazlsv6lejspj436knsv2fjzrn8jxcwxwx7 --from qwoyn1tdeyh5v6qvquws6e7c282s2ld4lz93xmnxxgq7 --output-document qwoyn_signed_step2.json
qwoynd tx sign step2_unsigned_delegation.json --multisig qwoyn1efftazlsv6lejspj436knsv2fjzrn8jxcwxwx7 --from qwoyn1hsafk3cfrdcn2qjar7awz68qhmlj6tz27j4ah4 --output-document badgerBite_signed_step2.json
  • The multi-sig holders sign the step2_unsigned_delegation.json file to approve the transaction.
  • Replace qwoyn1tdeyh5v6qvquws6e7c282s2ld4lz93xmnxxgq7 and qwoyn1hsafk3cfrdcn2qjar7awz68qhmlj6tz27j4ah4 with the addresses of the multi-sig holders.
  • The signed transaction outputs are saved to files: qwoyn_signed_step2.json and badgerBite_signed_step2.json.

Step 4: Combine the Signed Transaction Files

qwoynd tx multisign step2_unsigned_delegation.json qwoynd-aquifer-multi qwoyn_signed_step2.json badgerBite_signed_step2.json --output-document final_signed_delegation.json
  • This command combines the signed transaction files (qwoyn_signed_step2.json and badgerBite_signed_step2.json) with the original unsigned transaction (step2_unsigned_delegation.json).
  • The output is saved to a file called final_signed_delegation.json.

Step 5: Broadcast the Transaction

qwoynd tx broadcast final_signed_delegation.json
  • This command broadcasts the final signed transaction stored in final_signed_delegation.json.
  • The transaction will now be executed on the Qwoyn network.
Remember to replace the addresses and values with your specific data when following the tutorial.