# Mint 2 NFTs per transaction

**URL:** <https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001>\
**Category:** Cardano Integration\
**Tags:** cardano, transactions, nft, cnft\
**Created:** [5 February 2023 00:30 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001 "2023-02-05T00:30:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralph\_L\_Aurage](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ralph_l_aurage/32/61441_2.png) [@Ralph\_L\_Aurage](https://forum.cardano.org/u/Ralph_L_Aurage)\
**Post date:** [5 February 2023 00:30 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/1 "2023-02-05T00:30:30Z")

</div>

I am trying to mint 2 NFT per transaction and the transaction build code looks like this:

```auto
cmd.runSync([
    `${CARDANO_CLI} transaction build`,
    CARDANO_NETWORK_TYPE,
    CARDANO_ERA,
    `--tx-in ${utxo}#${txid}`,
    `--tx-out ${sender_address}+${minimum_lovelace}+"1 ${policy_id}.${hashed_token_name}"`,
    `--change-address ${SEND_CHANGE_TO_ADDRESS}`,
    `--mint="1 ${policy_id}.${hashed_token_name}"`,
    `--minting-script-file ${_account}/policy/policy.script`,
    `--metadata-json-file ./_nft/metadata/${metadata_pathname}`,
    `--invalid-hereafter ${slot_number}`,
    `--witness-override 2`,
    `--out-file ${_account}/tx/matx.raw`
  ].join(" "));

```

My question is about this line here `--metadata-json-file ./_nft/metadata/${metadata_pathname}`  
Is it possible to include this line more than once and have more than one metadata file attached to the build query or how would go about combining 2 metadata files to be able to send 2 nfts in one transaction?

---

<div class="post-metadata">

**Author:** ![georgem1976](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/georgem1976/32/38471_2.png) [@georgem1976](https://forum.cardano.org/u/georgem1976)\
**Post date:** [5 February 2023 20:29 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/2 "2023-02-05T20:29:12Z")

</div>

Yes, you can mint as many NFTs in one transaction, as long as you don’t go over the transaction limit (16 KB). You can take a look on a cardano blockchain explorer at some NFTs from known series and see how the metadata looks like when you mint multiple NFTs in one transaction.

---

<div class="post-metadata">

**Author:** ![Ralph\_L\_Aurage](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ralph_l_aurage/32/61441_2.png) [@Ralph\_L\_Aurage](https://forum.cardano.org/u/Ralph_L_Aurage)\
**Post date:** [5 February 2023 20:43 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/3 "2023-02-05T20:43:48Z")

</div>

Thank you, do you know of any known NFT series that have multiple mints as an example?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [5 February 2023 22:55 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/4 "2023-02-05T22:55:54Z")

</div>

> [@Ralph\_L\_Aurage](#):
>
> do you know of any known NFT series that have multiple mints as an example?

We had an example in an eatlier discussion:

> [@Automatically Link IPFS CID To Each NFT in Collection](https://forum.cardano.org/t/automatically-link-ipfs-cid-to-each-nft-in-collection/113661/2):
>
> Look for example at one of the minting transactions of SpaceBudz:  
> [https://cardanoscan.io/transaction/12792e4952f5178938967fd6455d10014dcb53772a3c2f8c2fdaaa7eeb2cbe93?tab=metadata](https://cardanoscan.io/transaction/12792e4952f5178938967fd6455d10014dcb53772a3c2f8c2fdaaa7eeb2cbe93?tab=metadata)
> 
> There are a lot of metadata blocks for each of the NFTs minted in that transactions in there and each has a different IPFS link to the specific image for that specific NFT.

---

<div class="post-metadata">

**Author:** ![Ralph\_L\_Aurage](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ralph_l_aurage/32/61441_2.png) [@Ralph\_L\_Aurage](https://forum.cardano.org/u/Ralph_L_Aurage)\
**Post date:** [6 February 2023 00:13 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/5 "2023-02-06T00:13:23Z")

</div>

Oh thank you very much and doing it like this won’t mess up the metadata of the individual NFT? Like how does that look on pool.pm or on JPG Store? Are all the traits correct on each NFT?

---

<div class="post-metadata">

**Author:** ![georgem1976](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/georgem1976/32/38471_2.png) [@georgem1976](https://forum.cardano.org/u/georgem1976)\
**Post date:** [6 February 2023 05:48 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/6 "2023-02-06T05:48:50Z")

</div>

No, it won’t, each NFT has its own unique name.

---

<div class="post-metadata">

**Author:** ![Ralph\_L\_Aurage](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ralph_l_aurage/32/61441_2.png) [@Ralph\_L\_Aurage](https://forum.cardano.org/u/Ralph_L_Aurage)\
**Post date:** [6 February 2023 06:49 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/7 "2023-02-06T06:49:02Z")

</div>

So would the following query work for minting 2 nfts in one transaction or would I get an error?

```auto
cmd.runSync([
    `${CARDANO_CLI} transaction build`,
    CARDANO_NETWORK_TYPE,
    CARDANO_ERA,
    `--tx-in ${utxo}#${txid}`,
    `--tx-out ${sender_address}+${minimum_lovelace}+"1 ${policy_id}.${first_hashed_token_name}"+"1 ${policy_id}.${second_hashed_token_name}"${batched_tokens}`,
    `--change-address ${SEND_CHANGE_TO_ADDRESS}`,
    `--mint="1 ${policy_id}.${first_hashed_token_name}"`,
    `--mint="1 ${policy_id}.${second_hashed_token_name}"`,
    `--minting-script-file ${_account}/policy/policy.script`,
    `--metadata-json-file ./_nft/metadata/tempMetadat.json`,
    `--invalid-hereafter ${slot_number}`,
    `--witness-override 2`,
    `--out-file ${_account}/tx/matx.raw`
  ].join(" "));

```

---

<div class="post-metadata">

**Author:** ![georgem1976](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/georgem1976/32/38471_2.png) [@georgem1976](https://forum.cardano.org/u/georgem1976)\
**Post date:** [6 February 2023 06:51 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/8 "2023-02-06T06:51:52Z")

</div>

It should be something like this, but this one will fail. On the `--tx-out` line you included the ${batched\_tokens} 2 times.

---

<div class="post-metadata">

**Author:** ![Ralph\_L\_Aurage](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ralph_l_aurage/32/61441_2.png) [@Ralph\_L\_Aurage](https://forum.cardano.org/u/Ralph_L_Aurage)\
**Post date:** [6 February 2023 07:02 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/9 "2023-02-06T07:02:15Z")

</div>

So if I have batched tokens in there just once it should work? I’ve edited it above, please take a look.

---

<div class="post-metadata">

**Author:** ![georgem1976](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/georgem1976/32/38471_2.png) [@georgem1976](https://forum.cardano.org/u/georgem1976)\
**Post date:** [6 February 2023 08:14 UTC](https://forum.cardano.org/t/mint-2-nfts-per-transaction/114001/10 "2023-02-06T08:14:55Z")

</div>

I cannot tell if it will work or not, you need to test it. I never used the library you seem to use.  
Ideally you should test on Preview or Preprod, and when you are satisfied with the result, then do it on mainnet.
