NFT syntax of names using cardano-cli

Hi guys, I’m minting NFTs by using Daedalus socket node and cardano-cli.
When it comes to build transaction I cannot set spaces or special characters in the asset name, it gives me error
but I see around a lot of NFT minted with a space in the name. How can I solve this problem?

Example:
–mint=“1 03840f1ca7480d2e07f272b954a14c8841e2528545d5d428cfa33569.Assetname”
here and in the --txout out section if I set “Assetname” it is ok, if I try to set “Asset name” or “Asset-name”
it gives me error and I cannot build the transaction!

Thank you!!

Did you use any quote around your asset name ? Could you provide the command line and the corresponding error message please ?

Thank you for the support, for sure: here it is the command and the error message

Cardano-cli complains about the space in between “test " and " test”. I tried writing 1 word
and putting spaces only in the metadata.json but then it is not visualized correctly on pool.pm

OK, so from the inline help of cardano-cli we have :

  --tx-out TX-OUT          The transaction output as Address+Lovelace where
                           Address is the Bech32-encoded address followed by the
                           amount in Lovelace.

It seems like you put the value for --mint= in place of the amount in Lovelace… There is more info on 3. Create a simple transaction — cardano-node Documentation 1.0.0 documentation

If I use just 1 word, for example instead of “test test” I use “test” it works.
Anyway I tried to remove the part from the tx-out command and the problem is also in the --mint command.
Here the command I used and the error I got:

So now the --txout part is ok, we can focus on --mint, if you refer to the doc you shouldn’t use quotes for the whole parameter value, only for the part with the asset name. Eventually you could remove the quotes and escape the space between ...test and test by prefixing it with a backslash, i.e. ...test\ test.

In other words, regarding mint parameter value "1 abc def" and 1 "abc def" are quite different, in first case you have one string parameter, in second case you have two.

Thank you again for the support.
I tried without quotes or putting quotes only to the policyID , assetname or only to the assetname and the result is always this one:
image

I used again the quotes as before and it gives me the error as before:
image

Also using "\ "before the space gives me problems:
image

I manage to build the tranaction only if I use the “old method” and so witohut spaces:

Ok, then I’ll try asking someone more knowledgeable than me.

By the way, have you got any example of such an asset, I mean with spaces in asset name and not in asset metadata ? I didn’t find one on pool.pm

The short answer to your question is that it’s not possible, as @bwbush made me remark, it is a current limitation of cardano-cli as you may see in the source code the parser only accepts sequences of alpha-numeric characters .

However @bwbush was able to use other characters using his own tools ; you’ll find many useful resources on his website. Finally he referred me to a current feature request concerning your current need for cardano-cli : [FR] - Extend CLI syntax for multi-asset names · Issue #2297 · input-output-hk/cardano-node · GitHub

1 Like

Here is the link to the tool I use to mint tokens whose names contain spaces and other non-alphanumeric characters: mantis/ReadMe.md at main · functionally/mantis · GitHub.

Thank you for the outstanding support! I’ll try and let you know in case of troubles.

Thank you again!

Hi folks, I’ve posted a question on github but has anyone else seen the TxMetadataJsonToplevelBadKey error when using the mantis tool to mint?

Cheers,
Rhys

I think this is a problem in the policy script that was provided to the tool. I’m responding on the github issue.

Sorry for my delay responding to the github issue you posted.

This bug is fixed in version 0.2.10.2, which is available on github now. Thanks for your patience.

Cheers Brian. As replied on github - tested and working perfectly. Thanks again for sharing your code with the community and allowing mere mortals to experiment with Cardano and blockchain.

Aroha from Aotearoa
Rhys

1 Like