Assets
Asset Units
Understanding policy IDs, asset names, and units
Asset Units
Every native asset on Cardano is identified by two components: a policy ID (28-byte hash of the minting policy script) and an asset name (0-32 bytes chosen by the minter). Together, these form the asset's unique identifier or "unit."
Structure
| Component | Size | Format | Example |
|---|---|---|---|
| Policy ID | 28 bytes | Hex (56 chars) | 7edb7a2d...c9d8e7f6 |
| Asset Name | 0-32 bytes | Hex-encoded | 4d79546f6b656e ("MyToken") |
| Unit | Combined | policyId + assetName | 7edb7a2d...4d79546f6b656e |
Working with Assets
import { } from "@evolution-sdk/evolution"
const = "7edb7a2d9fbc4d2a68e4c9e9d3d7a5c8f2d1e9f8a7b6c5d4e3f2a1b0c9d8e7f6"
const = "4d79546f6b656e" // "MyToken" in hex
// Add native token to an asset bundle
let = .(2_000_000n) // Min ADA for UTxO
= .(, , , 1000n)Lovelace
ADA's smallest unit is lovelace. 1 ADA = 1,000,000 lovelace. Lovelace is always represented separately from native tokens in asset bundles:
import { } from "@evolution-sdk/evolution"
const = .(5_000_000n)
// Common amounts
const = 1_000_000n
const = 500_000n
const = 10_000_000nMinimum ADA
Every UTxO must contain a minimum amount of ADA (determined by coinsPerUtxoByte protocol parameter). UTxOs with native tokens require more ADA because they're larger. The transaction builder calculates this automatically.
Next Steps
- Assets Overview — Creating and merging asset bundles
- Metadata — Attach metadata to transactions
- Simple Payment — Send native tokens