<p>Basically, they're the same:</p>
<ul>
<li><p><code>AssetId</code>: Actually, it's not part of Plutus Library. It's part of <a href="https://github.com/input-output-hk/cardano-node" rel="nofollow noreferrer">cardano-node</a> and used mainly in native tokens, for example, when you run the following command, it displays your native tokens:</p>
<p><code>cardano-cli query utxo --address &lt;address&gt; --testnet-magic 1097911063</code></p>
</li>
<li><p><code>AssetClass</code>: this is part of <a href="https://github.com/input-output-hk/plutus" rel="nofollow noreferrer">Plutus</a> Library and you can use it in your plutus scripts.</p>
</li>
</ul>
<p>The reason to have two definitions, it's because they're used in different tools.</p>

CC BY-SA 4.0
2021-11-17T17:14:56.823Z
2021-11-17T17:14:56.823Z
georgeos
<p>In the Plutus library, <code>AssetId</code> is defined in <code>module Cardano.Api.Value</code> as</p>
<p><code>data AssetId = AdaAssetId | AssetId !PolicyId !AssetName </code></p>
<p>while <code>AssetClass</code> is defined in <code>module Plutus.V1.Ledger.Value</code> as</p>
<p><code>newtype AssetClass = AssetClass { unAssetClass :: (CurrencySymbol, TokenName) }</code></p>
<p>, as of the time of writing this question.</p>
<p>Does <code>AssetId</code> and <code>AssetClass</code> have any difference in its meaning. What is the purpose of having two definitions?</p>

<plutus>
Does `AssetId` and `AssetClass` mean the same?
# Does `AssetId` and `AssetClass` mean the same?

(Asked by: username_0 on 2021-11-17)

In the Plutus library, `AssetId` is defined in `module Cardano.Api.Value` as

`data AssetId = AdaAssetId | AssetId !PolicyId !AssetName`

while `AssetClass` is defined in `module Plutus.V1.Ledger.Value` as

`newtype AssetClass = AssetClass { unAssetClass :: (CurrencySymbol, TokenName) }`

, as of the time of writing this question.

Does `AssetId` and `AssetClass` have any difference in its meaning. What is the purpose of having two definitions?

**Tags:** plutus

---

## 1 answers

### Answer by username_1 on 2021-11-17. Score: 1

Basically, they're the same:

* `AssetId`: Actually, it's not part of Plutus Library. It's part of [cardano-node](https://github.com/input-output-hk/cardano-node) and used mainly in native tokens, for example, when you run the following command, it displays your native tokens:

  `cardano-cli query utxo --address  --testnet-magic 1097911063`
* `AssetClass`: this is part of [Plutus](https://github.com/input-output-hk/plutus) Library and you can use it in your plutus scripts.

The reason to have two definitions, it's because they're used in different tools.


---

