user871: 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?

user1231: Basically, they're the same:

AssetId: Actually, it's not part of Plutus Library. It's part of 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 <address> --testnet-magic 1097911063

AssetClass: this is part of 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.

871: <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>
 1231: <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>
