2

If there are multiple --tx-in-script-file for the same plutus script file only with different utxos is that means that multiple times will be sent plutus script and that will affect the size of a transaction? For example:

SCRIPT=AlwaysSucceeds.plutus
...
  --tx-in 941a7f0159053338f4ee97c19b2d3fcf802f137a4d6bdac301871a37da72e97a#1 \
  --tx-in-script-file $SCRIPT \
  --tx-in-datum-value 20 \
  --tx-in-redeemer-value 1 \
  --tx-out addr_test1qqp6z9xneafqp0ndrxgyjd3qecs4tf6ktqhvj2hyc5efg2gzq5lqcm6rfuv6yp0mtsgc2qxvwlwr938qk2nue0rqg6rqxewe52+11900000 \
  \
  --tx-in c5692c4242bfd6a52b1eb33ada17fe65a7291644baeec08644b3df8bfdb0267a#1 \
  --tx-in-script-file $SCRIPT \
  --tx-in-datum-value 30 \
  --tx-in-redeemer-value 100 \
  --tx-out addr_test1qz270xngvhp50nvc5cxktsuh6tf7s3sanh5gyqr4dphx6qzdvmtrj9qmssswlxaty64q9xukz3z3xecqch6hvfcn8tqq0g3wej+1400000+"60 29856eae5151337853ffbd8fd80df78dab8c7f09c37c95799328abb8.RTOK" \
...

Does this mean that size of the transaction will be increased for the size of the script 2 times, or just once independent of how many times is added?

2
  • 1
    I think the script is only included once in the final transaction, even if you supply it twice. The best way to check though would be to build the transaction both ways and check if the transaction.raw files differ in size.
    – Thom
    Commented Nov 23, 2021 at 11:15
  • In the transaction, I have 3 utxos that are consuming from the script and when I remove one of them, the transaction file size from 2059B comes to 1563B. I have datum and redeemer also removed but it looks like it is sending a copy of the script for every utxo.
    – zarej
    Commented Nov 23, 2021 at 23:21

1 Answer 1

3

No it won't. The script needs to only be provided once. This is generally true for any witness in transactions. For example, if two or more inputs require a signature from a same signing key, only one signature is needed to validate all inputs.

Your Answer

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

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