<p>Looks like you are using the CLI correctly, and the question was really about the NFT metadata standard. The usage of &quot;721&quot; as the top level key is to be compatible with Etherium token metadata and 3rd party sites that showcase ETH NFTs.</p>
<p>Alessandro of BERRY/SpaceBudz is the one who proposed this as a <a href="https://forum.cardano.org/t/cip-nft-metadata-standard/45687" rel="nofollow noreferrer">CIP on the Cardano forums</a> and it seems to have been widely adopted at this point.</p>
<p>Edit: See also <a href="https://cardano.stackexchange.com/questions/351/is-there-a-metadata-standard-for-native-assets-talking-about-fungible-tokens-fi">Is there a metadata standard for native assets (talking about fungible tokens first) in Cardano?</a></p>

CC BY-SA 4.0
2021-05-05T14:53:26.207Z
2021-05-05T17:47:52.040Z
2021-05-05T17:47:52.040Z
Ben NOBLE
<p>I still do not know the meaning of the values given to top-level integer keys, but I was able to get <code>cardano-cli transaction build-raw</code> to work by putting my original JSON as a value of a top-level integer key of 721. On <a href="https://cardanoscan.io/transaction/ff126032aeccf0079a02168f9810a81d9632a8ac34e50cad278771be2423aa86?tab=metadata" rel="nofollow noreferrer">cardanoscan.io</a>, I noticed that the metadata has a 'label', which explorer.cardano.org lacks. I surmised that the label is the top-level integer key, but I don't know of a way to confirm that.</p>
<p>So the short answer is that the JSON given to cardano-cli must be an object with integer keys.</p>

CC BY-SA 4.0
2021-05-05T11:30:49.130Z
2021-05-06T12:08:21.607Z
2021-05-06T12:08:21.607Z
Joshua Chia
<p>What command-line options and input file content can I provide to <code>cardano-cli transaction build-raw</code> to specify a transaction with metadata similar to the one in this transaction? <a href="https://explorer.cardano.org/en/transaction?id=ff126032aeccf0079a02168f9810a81d9632a8ac34e50cad278771be2423aa86" rel="noreferrer">https://explorer.cardano.org/en/transaction?id=ff126032aeccf0079a02168f9810a81d9632a8ac34e50cad278771be2423aa86</a></p>
<p>I initially thought that I just needed to give <code>--metadata-json-file</code> a JSON file with the corresponding desired JSON content (like the JSON show under 'metadata' on the webpage), but that just gives an error message about integer keys. In the <a href="https://github.com/input-output-hk/cardano-node/blob/b82e6c780937a8e9570915248c3d825e8211ab3d/doc/reference/tx-metadata.md" rel="noreferrer">Transaction Metadata</a> reference for cardano-node, it says that the top-level keys must be integers, but I don't understand the significance or meaning of the values of the top-level integer keys or how the whole thing relates to an actual JSON I want to appear in the explorer.cardano.org transaction webpage.</p>

<cardano-cli><metadata>
Providing metadata to `cardano-cli transaction build-raw`
# Providing metadata to `cardano-cli transaction build-raw`

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

What command-line options and input file content can I provide to `cardano-cli transaction build-raw` to specify a transaction with metadata similar to the one in this transaction? <https://explorer.cardano.org/en/transaction?id=ff126032aeccf0079a02168f9810a81d9632a8ac34e50cad278771be2423aa86>

I initially thought that I just needed to give `--metadata-json-file` a JSON file with the corresponding desired JSON content (like the JSON show under 'metadata' on the webpage), but that just gives an error message about integer keys. In the [Transaction Metadata](https://github.com/input-output-hk/cardano-node/blob/b82e6c780937a8e9570915248c3d825e8211ab3d/doc/reference/tx-metadata.md) reference for cardano-node, it says that the top-level keys must be integers, but I don't understand the significance or meaning of the values of the top-level integer keys or how the whole thing relates to an actual JSON I want to appear in the explorer.cardano.org transaction webpage.

**Tags:** cardano-cli, metadata

---

## 2 answers

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

Looks like you are using the CLI correctly, and the question was really about the NFT metadata standard. The usage of "721" as the top level key is to be compatible with Etherium token metadata and 3rd party sites that showcase ETH NFTs.

Alessandro of BERRY/SpaceBudz is the one who proposed this as a [CIP on the Cardano forums](https://forum.cardano.org/t/cip-nft-metadata-standard/45687) and it seems to have been widely adopted at this point.

Edit: See also [Is there a metadata standard for native assets (talking about fungible tokens first) in Cardano?](https://cardano.stackexchange.com/questions/351/is-there-a-metadata-standard-for-native-assets-talking-about-fungible-tokens-fi)


---

### Answer by username_0 on 2021-05-05. Score: 2

I still do not know the meaning of the values given to top-level integer keys, but I was able to get `cardano-cli transaction build-raw` to work by putting my original JSON as a value of a top-level integer key of 721. On [cardanoscan.io](https://cardanoscan.io/transaction/ff126032aeccf0079a02168f9810a81d9632a8ac34e50cad278771be2423aa86?tab=metadata), I noticed that the metadata has a 'label', which explorer.cardano.org lacks. I surmised that the label is the top-level integer key, but I don't know of a way to confirm that.

So the short answer is that the JSON given to cardano-cli must be an object with integer keys.


---

