I am running through the Plutus Pioneer Program and I have reached week 5. Also as a reference, I will use the LobsterChallenge repository. I am a bit confused about how NFTs work for the Cardano blockchain.
From what I understood and me asking in the discord channel when making the policy we accept a TxOutRef as a parameter to the policy. That's all fine, but let's say I want to have 10000 users to mint my collection. Then I need to provide users a way to build, sign, and submit a transaction (To my knowledge I build the off-chain code, and with PAB I provide endpoints the construct everything? Please do correct me If I am wrong as it's still fuzzy for me).
So the off-chain code chooses a TxOutRef from the user's wallet and generates the policy (currency Symbol) by passing the UTXO when compiling the policy
curSymbol :: TxOutRef -> TokenName -> CurrencySymbol
curSymbol oref tn = scriptCurrencySymbol $ policy oref tn
So hopefully I gave some info about what I am talking about and will start with the questions:
- Doesn't the
curSymbol
function return a different currency symbol every time? When that is the case, how do I know that a wallet has been minted from my collection? Do I store this currency symbol in my databases as a reference to the wallet? - What stops a user from getting my code in a public repository and initiating a transaction with a different UTXO
- How do I limit mints? Do I mint all 10000 NFTs to a script I create and allow only for the script to mint more (so nobody can try and initiate the policy). And minting 10000 NFTS, wouldn't that require 10000 UTXOs? From what I understand in a UTXO there must be at least
1.25 ADA
- I tried understanding the horrorcubes scripts . But got more confused from the:
data CounterDatum = CounterDatum {
cdValue :: !Integer, -- ^ The current counter value.
cdLimit :: !Integer -- ^ The value limit, after this limit is reached, this eUTXO can not be spent again.
} deriving (Show, Generic, FromJSON, ToJSON)
What do they mean by "The value limit, after this limit is reached, this eUTXO can not be spent again.".
Isn't the purpose of a UTXO to never be spent again? I think these are my questions for now. Thanks a lot to the people who will respond!