0

I built a transaction with cardano-cli shelley transaction build-raw command that has multiple inputs. I have the private keys and .skey files of these addresses but I don't know how to sign the transaction with the cardano-cli. How can I do this?

2 Answers 2

1

A single transaction in Cardano can contain many inputs and outputs. As long as the transaction is signed by all the private keys associated with each address, it will be valid. In other words, the number of inputs doesn't effect the number of signatures needed, only the number of unique addresses does, where each unique address requires a signature.

For example, if I have constructed an transaction with an arbitrary number of inputs, but those inputs all come from N-number of unique addresses, the command would be:

cardano-cli transaction sign \
--tx-body-file <RAW_TX_FILE> \
--signing-key-file <SKEY_1_FILE> \
--signing-key-file <SKEY_2_FILE> \
--signing-key-file <SKEY_N_FILE> \
--mainnet \
--out-file <SIGNED_TX_FILE>
3
  • Does it automatically find which file belongs to which address or I should specify that?
    – Foad
    Jan 4, 2022 at 7:12
  • it will automatically find them, There is no need, nor an option, to specify.
    – zhekson
    Jan 4, 2022 at 14:01
  • Got it, Thanks!
    – Foad
    Jan 4, 2022 at 16:16
0

Here's an example of a signing command - just add/remove --signing-key-file parameters as necessary!

cardano-cli transaction sign --signing-key-file payment.skey --signing-key-file policy.skey --mainnet --tx-body-file matx.raw --out-file matx.signed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.