I followed the NFT minting docs on https://developers.cardano.org/docs/native-tokens/minting-nfts which works very well for the first transaction.

I'm currently stuck trying to mint a second NFT. It's not clear to me, what kind of data has to be regenerated and what needs to be kept for the cli commands their parameters.

for the second transaction I've tried with and without regenerating policy keys and policyID. I adjusted the txhash and funds values, as those have changed after the first transaction. nothing really works.

here is the error I'm getting:

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 999813423 (fromList [(PolicyID {policyID = ScriptHash "b5c707bc10063ae8ab04c2f7b99c3ed1f0bdd82266369367a7bef050"},fromList [("NFT1",1)]),(PolicyID {policyID = ScriptHash "fcd60019e5c25602201d5a28f73b7749e85efab6a31dbb7aa461132b"},fromList [("NFT1",1)])])) (Value 999813423 (fromList [(PolicyID {policyID = ScriptHash "b5c707bc10063ae8ab04c2f7b99c3ed1f0bdd82266369367a7bef050"},fromList [("NFT1",1)])])))))])

I hope someone can give me advice what kind of parameters need to change after the first transaction is done.



Sorry for not providing more context and code / scripts in the original question. however, I found the solution to my problem and want to share it in case anyone else has a similar issue.

for the very first transaction from/to a given address, the --tx-out param looked something like this:

--tx-out addr_test1vqjf8aak5fn3u2la4dgwyda98s2py3f9pqcmnhfq93ugq0qkctw7v+0+1 "90fa8ff2fb851f92fd239574334a37762bc22dcdf0595a269ad300c8.NFT1"

which is basically $address+$fees+"$tokenamount $policyID.$tokenname"

for the second transaction I just tried to replace $fees, $tokenamount, $policyID and $tokennamewith values from another NFT. what I didn't know is that $tokenamount, $policyID and $tokenname of the first transaction (or from all previous transactions) also have to be appended to the new value for the --tx-out param. so it would look like this:

--tx-out addr_test1vqjf8aak5fn3u2la4dgwyda98s2py3f9pqcmnhfq93ugq0qkctw7v+0+1 "90fa8ff2fb851f92fd239574334a37762bc22dcdf0595a269ad300c8+NFT1" "1 9bb49c25ea28964c96d119ecb3a9425d39a390e6c34974f2637c750e.NFT2



You should wait until transaction is finished and UTxO's are updated in your wallet.

A way to do it is to create a script that will query UTxO's for your wallet and once UTxO's are changed you run next transaction.

You can query it either directly from CLI and parse the results, or you can query it via cardano-graphql or Blockfrost.io API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.