1

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?

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.