Cardano-cli error during NFT minting

cardano-cli is saying “option --tx-out: unexpected end of input expecting hexadecimal digit AssetName deserisalisation failed”

I’m running cardano-cli 1.31 on a synced up node.

This was the command:
cardano-cli transaction build
–mainnet
–alonzo-era
–tx-in $txhash#$txix
–tx-out $address+$output+"$tokenamount $policyid.$tokenname"
–change-address $address
–mint="$tokenamount $policyid.$tokenname"
–minting-script-file $script
–metadata-json-file metadata.json
–invalid-hereafter $slotnumber
–witness-override 2
–out-file matx.raw

I followed these instructions.

The deviation from the doc I made was to convert the text of the AssetName to base16. It’s not base16 in the metadata.json file, but the input parameter validation is stopping before getting to --metadata-json-file so…

Anyway, not finding much out there on what could be wrong. Is there more to tack on to --tx-out that’s not being explained in the dev document perhaps?

Ok…I think I figured it out…maybe. I don’t see this documented anywhere. Since I’m running cardano-cli 1.31 the AssetName text must be converted to base16 (Hexadecimal). Not documented by the developers on the how to mint NFT page. Also, it appears to be required to add a delimiter character at the end of the AssetName value. So slap a hex code of 20 on the end of that string. Seems like it’s needed on the --mint parameter as well…wheeee…not having adequate documentation makes me want to use other protocols.

Hi,

my mint code looks like this and works well (after upgrading 1.31).
I used the same guide but it has been changed since I used it.

funds=cardano-cli query utxo --address $(cat /opt/cardano/cnode/priv/wallet/payment.addr) --mainnet | tail -n +3 |head -1 | awk {'print $3 '}
tx_in="–tx-in ${tx_hash}#${idx}"
amountToSendUser=1700000

((maradek = funds - amountToSendUser))

            currentSlot=$(cardano-cli query tip --mainnet | jq -r '.slot')
            cardano-cli transaction build-raw \
                --fee 0 \
                ${tx_in} \
                --tx-out ${in_addr}+${amountToSendUser}+"1 $POLICYID.${tokenname}" \
                --tx-out ${paymentAddr}+${maradek} \
	    --mint="1 $POLICYID.${tokenname}" \
	    --minting-script-file $scriptPath \
	    --metadata-json-file ${metadatajson} \
                --invalid-hereafter $(( ${currentSlot} + 10000)) \
                --out-file tx.tmp >> $log
            fee=$(cardano-cli transaction calculate-min-fee \
                --tx-body-file tx.tmp \
                --tx-in-count 1 \
                --tx-out-count 2 \
                --mainnet \
                --witness-count 2 \
                --byron-witness-count 0 \
                --protocol-params-file protocol.json | awk '{ print $1 }') >> $log
        fee=${fee%" Lovelace"}
            amountToSendUser=$((${amountToSendUser}-${fee}))
            cardano-cli transaction build-raw \
                --fee ${fee} \
                ${tx_in} \
                --tx-out ${in_addr}+${amountToSendUser}+"1 $POLICYID.${tokenname}" \
                --tx-out ${paymentAddr}+${maradek} \
	    --mint="1 $POLICYID.${tokenname}" \
                --minting-script-file $scriptPath \
	    --metadata-json-file ${metadatajson} \
                --invalid-hereafter $(( ${currentSlot} + 10000)) \
                --out-file tx.raw

Thanks for the example, think I’ll try again. Would you happen to have an example of what your metadata json looks like?

https://pool.pm/test/metadata?metadata=%7B%22721%22%3A%7B%2210f6cf6f5ba163ae6bc0fea30bca1050b201e8b1d011ba6e9865a134%22%3A%7B%22JerryFragiskatos1%22%3A%7B%22creator%22%3A%22R%C3%A9ka%20Saj%C3%B3%22%2C%22description%22%3A%22CARDANO%20POSTAL%20SERVICE%20STAMP%22%2C%22id%22%3A%221%2F128%22%2C%22image%22%3A%22ipfs%3A%2F%2FQmSbWQVYgbKeQTuAk36DAurPFS15EW3n9cyweidxXWZvF4%22%2C%22name%22%3A%22JerryFragiskatos1%20stamp%20%22%2C%22series%22%3A%22Keynote%20Speakers%22%2C%22url%22%3A%22https%3A%2F%2Fcardanopostalservice.io%22%7D%7D%7D%7D

1 Like

Hi, it seems that I have similar problem. Did you manage to resolve it?

I haven’t had a chance to try macracanta’s example yet, maybe try that.