I’m working on workflow for collecting money from NFT sale.
Our idea is to generate for each participant unique address for collecting ADA.
Once unique address is funded, using funds from this address we would generate mint transaction and sign it using policy skey and unique address skey. Once it is submitted user would get back back NFT to address from which he/she sent funds…
Once sales is over we would like to send all remaining lovelaces from all unique addresses back to one address.
Wanted to ask if there is a maximal number of inputs that we can have in transaction
The metadata does count towards the transaction size. My guess is that the script doesn’t count because only its hash is stored on the chain.
The documentation isn’t clear about exactly what counts towards the limit. I’d have to study the Haskell source code to be definitive. Scripts, signatures, certificates, etc. take space in the submitted transaction, but they aren’t stored in toto on the chain, just used for validation.
P.S. I did some experiments on testnet and here is what I found:
For simple transactions (i.e., no metadata, tokens, scripts, etc.), one can create valid transactions with up to 434 --tx-ins!
Items in cardando-cli transaction build-raw count against the size limit. This includes metadata, certificates, auxillary scripts, etc.
Items in cardano-cli transaction sign also count against the size limit. This includes signatures, minting scripts and other simple scripts.
For metadata and scripts, it’s the size in CBOR that counts, not the JSON size.
The size of the tx.raw and tx.signed files are about twice as large as the actual CBOR size of the transaction they contain.
Each --tx-in generally uses about 38 bytes.
If the transaction involves NFTs, a considerable size is consumed by the policy IDs, asset names, and metadata. Recently, when I minted 80 tokens with heavy metadata, I split it into batches of ~14 tokens.