<p>This should work. I don't see any obvious ways of tampering with it. As long as you are checking against the token name, not the currency symbol, these tokens would be non-fungible and unique.</p>
<hr />
<p>To build this minting smart contract, I would write 2 scripts (and include a 3rd): a minting policy and a validator to hold the counter datum (and use <code>Plutus.Contracts.Currency</code> to build your &quot;dummy&quot; NFT).</p>
<p>The validator holds the &quot;dummy&quot; + datum and does all the logic you mentioned above:</p>
<ul>
<li>Check that 1 token is minted of designated currency symbol</li>
<li>Check that the token name is the datum value + 1</li>
<li>Check that the dummy NFT is returned to the validator with the datum counter bumped</li>
</ul>
<p>The minting policy just checks that the dummy NFT is included in the transaction.</p>
<p>It's organized this way because Minting Policies don't have datums for storing state (like your counter). It's a fairly common pattern in the Plutus examples. I've been calling it the &quot;Access Control Token&quot; pattern or variations on that. But &quot;dummy NFT&quot; works fine too :). I don't know what the core devs refer to it as.</p>

CC BY-SA 4.0
2021-12-06T12:05:36.693Z
Thanks, this answer was very helpful!
Montario
CC BY-SA 4.0
2021-12-06T00:36:48.463Z
2021-12-06T00:36:48.463Z
Mitchell Turner
<p>I would like to be able to mint a collection of NFTs across different transactions that fall under the same policy id.</p>
<p>A method I would like to try is making a 'dummy' nft that holds a counter as its datum. Every time a new nft is minted, the policy checks that the asset name is the current_count + 1 and that the counter output is created again with the same dummy nft and incremented value. Would there be any ways of tampering with this and would it still be considered a valid NFT?</p>
<p>Thanks!</p>

<plutus><nft><datum>
Ensuring NFT collection uniqueness using counter as asset name?
# Ensuring NFT collection uniqueness using counter as asset name?

(Asked by: username_0 on 2021-12-05)

I would like to be able to mint a collection of NFTs across different transactions that fall under the same policy id.

A method I would like to try is making a 'dummy' nft that holds a counter as its datum. Every time a new nft is minted, the policy checks that the asset name is the current\_count + 1 and that the counter output is created again with the same dummy nft and incremented value. Would there be any ways of tampering with this and would it still be considered a valid NFT?

Thanks!

**Tags:** plutus, nft, datum

---

## 1 answers

### Answer by username_1 on 2021-12-06. Score: 2 | Accepted answer

This should work. I don't see any obvious ways of tampering with it. As long as you are checking against the token name, not the currency symbol, these tokens would be non-fungible and unique.

---

To build this minting smart contract, I would write 2 scripts (and include a 3rd): a minting policy and a validator to hold the counter datum (and use `Plutus.Contracts.Currency` to build your "dummy" NFT).

The validator holds the "dummy" + datum and does all the logic you mentioned above:

* Check that 1 token is minted of designated currency symbol
* Check that the token name is the datum value + 1
* Check that the dummy NFT is returned to the validator with the datum counter bumped

The minting policy just checks that the dummy NFT is included in the transaction.

It's organized this way because Minting Policies don't have datums for storing state (like your counter). It's a fairly common pattern in the Plutus examples. I've been calling it the "Access Control Token" pattern or variations on that. But "dummy NFT" works fine too :). I don't know what the core devs refer to it as.

> **Comments:**
> **username_0**: Thanks, this answer was very helpful!  

---

