That is something that can not be enforced by the Cardano chain.
Without Plutus, it was done by NFT projects promising to only mint one and using policies that are locked at some point in time, so that nobody can mint or burn after that point. But that would not be suitable here, since other names should still be mintable.
With Plutus, you have some more possibilities than just requiring some signatures and before and after slots, but it is still restricted to information given to the contract in UTxOs of the execution transaction.
That is possible, but it still doesnât solve the âonly oneâ problem. The contract would still need the information about all previously minted names and that is too much to be held in the datum of one UTxO, but if it is distributed in many UTxOs the contract cannot verify that all of them were given to it, and it would still be too much data for the size limit of one transaction.
Requiring that an address has no UTxOs is something that a contract cannot do. It only works on UTxOs given to and coming out of a transaction. And it only restricts the spending of UTxOs on its own address (which is the hash of its code, so only known after the fact) or the minting/burning of tokens for its own policy (which is the hash of its code) depending on the type of contract.
A smart contract cannot read external data. A smart contract is just a very small piece of code executed by every single node that verifies the transaction and it just says âYes, this transaction is okay.â or âNo, this transaction is not okay.â.
The off-chain part of a contract could read external resources from IPFS or somewhere else, but it would then have to prove to the on-chain part that that external resource really contained (or did not contain) the information that the off-chain code claims it does.
Otherwise, in a truly decentralised application, anybody could write their own off-chain code and get the contract to do what they want.
If it is not truly decentralised and the on-chain code requires some special permission and we trust the holders to do âthe right thingâ, we could just throw away the âsmart contractâ marketing, be honest, and say that that centralised entity is in control of the thing and their signature is enough.
Hard thing to do for the reasons stated above.
Instances of tokens are not distinguishable. If just the nickname is the asset name, it could not be told who of the holders of two tokens with the same name holds the first.
There could be a rather complicated construction: Encode the timestamp in the asset name and allow minting only by a smart contract that ensures that the timestamp is correct (this is a local property that can be checked by a contract). Then whoever wants to build the index can take the one with the oldest timestamp and ignore all others with the same name.
There, in fact, has been a CIP for off-chain metadata for over a year:
https://github.com/cardano-foundation/CIPs/tree/master/CIP-0026
It does work without any on-chain shenanigans and just honestly keeps the metadata off-chain, but it does not call for a centralised service either. There could be many different services according to that standard â one by IOG, one by ADA Handle, one by me, one by you, âŠ