<p>Technically you cannot change the metadata for a token once its minted. Thats the whole point of putting something on the blockchain-its immutable. On Cardano, token metadata is just metadata in the minting transaction. What you are doing is just adding new metadata to a new transaction with the token. This is not changing the minting metadata. You should just burn the token and start fresh.</p>

CC BY-SA 4.0
2021-05-13T14:31:05.450Z
2021-05-13T14:31:05.450Z
nalyd88
<p>This seems to work:</p>
<pre><code>export address=&quot;address the token was created on&quot;
export txhash=&quot;transaction hash the token was create don&quot;
export txix=&quot;index of txhash above&quot;
export funds=&quot;funds at the txhash&quot;
export policyid=&quot;the token policy id&quot;
export fee=&quot;0&quot;
export output=&quot;0&quot;
export tokenamount=&quot;the countof the token at the txhash&quot;

cardano-cli transaction build-raw \
        --fee $fee \
        --tx-in $txhash#$txix \
        --tx-out $address+$output+&quot;$tokenamount $tokenpolicy.$tokenname&quot; \
        --metadata-json-file metadata.json  \
        --out-file matx.raw

fee=`cardano-cli transaction calculate-min-fee --tx-body-file matx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 1 --mainnet --protocol-params-file=protocol.json | cut -d &quot; &quot; -f1`
echo &quot;Funds? $funds&quot;
echo &quot;Fee? $fee&quot;
output=$(expr $funds - $fee)
echo &quot;Output? $output&quot;
echo &quot;Addr? $address&quot;
echo &quot;txhash: $txhash#$txix&quot;

# redo the transaction aboev w/correct fee
cardano-cli transaction build-raw \
        --fee $fee  \
        --tx-in $txhash#$txix \
        --tx-out $address+$output+&quot;$tokenamount $tokenpolicy.$tokenname&quot; \
        --metadata-json-file metadata.json  \
        --out-file matx.raw \

# sign the transaction
cardano-cli transaction sign \
            --signing-key-file test.skey \
            --signing-key-file policy/policy.skey \
            --tx-body-file matx.raw \
             --mainnet \
            --out-file matx.signed

# submit the transaction
cardano-cli transaction submit --tx-file  matx.signed --mainnet
</code></pre>

CC BY-SA 4.0
2021-05-13T05:58:10.830Z
2021-05-13T05:58:10.830Z
mpr
<p>I've minted a token but some of the metadata.jsosn properties don't look so great. Is there a way to update them?</p>
<p>The general form I've tried is:</p>
<pre><code>cardano-cli transaction build-raw \
        --fee $fee \
        --tx-in $txhash#$txix \
        --tx-out $address+$output \
        --metadata-json-file metadata.json  \
        --out-file matx.raw
</code></pre>

<transaction><cardano-cli><mint><metadata.json>
How can metadata.json properties be changed after a token is minted?
# How can metadata.json properties be changed after a token is minted?

(Asked by: username_0 on 2021-05-13)

I've minted a token but some of the metadata.jsosn properties don't look so great. Is there a way to update them?
The general form I've tried is:
cardano-cli transaction build-raw \
        --fee $fee \
        --tx-in $txhash#$txix \
        --tx-out $address+$output \
        --metadata-json-file metadata.json  \
        --out-file matx.raw

**Tags:** transaction, cardano-cli, mint, metadata.json

---

## 2 answers

### Answer by username_1 on 2021-05-13. Score: 3 | Accepted answer

Technically you cannot change the metadata for a token once its minted. Thats the whole point of putting something on the blockchain-its immutable. On Cardano, token metadata is just metadata in the minting transaction. What you are doing is just adding new metadata to a new transaction with the token. This is not changing the minting metadata. You should just burn the token and start fresh.


---

### Answer by username_0 on 2021-05-13. Score: 0

This seems to work:
export address="address the token was created on"
export txhash="transaction hash the token was create don"
export txix="index of txhash above"
export funds="funds at the txhash"
export policyid="the token policy id"
export fee="0"
export output="0"
export tokenamount="the countof the token at the txhash"

cardano-cli transaction build-raw \
        --fee $fee \
        --tx-in $txhash#$txix \
        --tx-out $address+$output+"$tokenamount $tokenpolicy.$tokenname" \
        --metadata-json-file metadata.json  \
        --out-file matx.raw

fee=`cardano-cli transaction calculate-min-fee --tx-body-file matx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 1 --mainnet --protocol-params-file=protocol.json | cut -d " " -f1`
echo "Funds? $funds"
echo "Fee? $fee"
output=$(expr $funds - $fee)
echo "Output? $output"
echo "Addr? $address"
echo "txhash: $txhash#$txix"

# redo the transaction aboev w/correct fee
cardano-cli transaction build-raw \
        --fee $fee  \
        --tx-in $txhash#$txix \
        --tx-out $address+$output+"$tokenamount $tokenpolicy.$tokenname" \
        --metadata-json-file metadata.json  \
        --out-file matx.raw \

# sign the transaction
cardano-cli transaction sign \
            --signing-key-file test.skey \
            --signing-key-file policy/policy.skey \
            --tx-body-file matx.raw \
             --mainnet \
            --out-file matx.signed

# submit the transaction
cardano-cli transaction submit --tx-file  matx.signed --mainnet


---

