The Aptos blockchain offers a powerful, developer-friendly environment for building decentralized applications, especially in the realm of non-fungible tokens (NFTs). Built on the Move programming language, Aptos provides native support for digital assets through its aptos_token.move module—enabling developers to create, manage, and transfer NFTs with ease. This guide walks you through a hands-on tutorial to create and transfer an NFT using the Aptos TypeScript SDK, highlighting key concepts, common pitfalls, and best practices.
Whether you're new to blockchain development or expanding your expertise into Move-based ecosystems, this step-by-step walkthrough will help you understand how NFTs function within Aptos' architecture.
Understanding the Aptos NFT Ecosystem
Aptos simplifies NFT creation with built-in functionality via the aptos_token.move module. Unlike traditional blockchains that require custom smart contracts for every collection, Aptos supports no-code NFT implementations through standardized transaction builders and SDK helpers. This makes it ideal for developers looking to prototype quickly or deploy scalable digital asset solutions.
Key features include:
- Native digital asset standard (
DigitalAsset) - Collection-based token organization
- On-chain metadata storage
- Immutable ownership tracking via indexer queries
This foundation allows seamless integration of NFTs into dApps, marketplaces, and identity systems—all while leveraging Move’s safety-first design principles.
👉 Discover how to build your first Move-based NFT project today.
Step 1: Choose and Install the SDK
To interact with the Aptos blockchain programmatically, you'll need an SDK. The two primary options are TypeScript and Python. In this tutorial, we use the TypeScript SDK, known for its robust tooling and active ecosystem.
Install dependencies using your preferred package manager. While npm or yarn work fine, we’ll use pnpm for efficiency:
pnpm add @aptos-labs/aptos-sdkEnsure Node.js is installed (v18+ recommended), and enable ES modules if working in an ESM environment.
Step 2: Run the Sample Code
Begin by cloning the official Aptos TypeScript SDK repository:
git clone https://github.com/aptos-labs/aptos-ts-sdk.git
cd aptos-ts-sdkInstall dependencies and build the project:
pnpm install
pnpm build⚠️ Troubleshooting Tip: You may encounter a memory allocation error during the DTS (TypeScript definition) build phase:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memoryIf this occurs, increase Node.js memory limits:
node --max-old-space-size=8192 ./node_modules/.bin/tsupAfter successful compilation, navigate to the examples directory:
cd examples/typescript-esm
pnpm install
pnpm build
pnpm run simple_digital_assetUpon success, you’ll see output confirming:
- Alice and Bob accounts created
- A collection minted by Alice
- One NFT minted and transferred from Alice to Bob
This simulation demonstrates end-to-end NFT lifecycle management on Aptos.
Step 3: Interpreting the Output
The sample script performs several core operations:
- Account Generation: Creates two local accounts (Alice and Bob)
- Funding Accounts: Uses the Devnet Faucet API to fund both accounts with test APT
- Collection Creation: Establishes a named collection with metadata (name, description, URI)
- NFT Minting: Mints a single digital asset under the collection
- Asset Transfer: Transfers ownership of the NFT from Alice to Bob
Each operation returns structured JSON data containing blockchain identifiers like:
collection_idtoken_data_idowner_address- Timestamps and version numbers reflecting ledger state
These values confirm successful execution and can be used for further inspection via explorers or indexer APIs.
Step 4: Exploring the Underlying Code
Let’s dive into how each step works under the hood.
4.1 Initialize the Aptos Client
The client connects your app to the Aptos network:
const APTOS_NETWORK: Network = NetworkToNetworkName[process.env.APTOS_NETWORK] || Network.DEVNET;
const config = new AptosConfig({ network: APTOS_NETWORK });
const aptos = new Aptos(config);By default, it targets Aptos Devnet, perfect for testing without cost.
4.2 Generate Local Accounts
Accounts are generated offline using cryptographic key pairs:
const alice = Account.generate();
const bob = Account.generate();They exist locally until funded and registered on-chain.
4.3 Fund Accounts via Faucet
Use the faucet to get test tokens:
await aptos.fundAccount({
accountAddress: alice.accountAddress,
amount: 100_000_000,
});This registers the account on-chain and enables transaction submission.
4.4 Create a Collection
Collections group related NFTs:
const createCollectionTransaction = await aptos.createCollectionTransaction({
creator: alice,
description: "Example description.",
name: "Example Collection",
uri: "aptos.dev",
});
await aptos.signAndSubmitTransaction({ signer: alice, transaction: createCollectionTransaction });This stores collection metadata on-chain and assigns a unique collection_id.
4.5 Mint a Digital Asset (NFT)
Minting creates a token within a collection:
const mintTokenTransaction = await aptos.mintTokenTransaction({
creator: alice,
collection: "Example Collection",
description: "Example asset description.",
name: "Example Asset",
uri: "aptos.dev/asset",
});
await aptos.signAndSubmitTransaction({ signer: alice, transaction: mintTokenTransaction });The resulting NFT has a unique token_data_id and is owned by the creator.
4.6 Read Metadata from Chain
Retrieve on-chain data using helper functions:
const collectionData = await aptos.getCollectionData({
creatorAddress: alice.accountAddress,
collectionName: "Example Collection",
});
console.log("Alice's collection:", JSON.stringify(collectionData, null, 2));Similarly, check owned assets:
const assets = await aptos.getOwnedDigitalAssets({ ownerAddress: alice.accountAddress });These queries use Aptos Indexer (GraphQL) for fast retrieval.
4.7 Check Object Ownership
Ownership is tracked separately from accounts. Use:
const ownerships = await aptos.getOwnedDigitalAssets({ ownerAddress: alice.accountAddress });Only records where amount > 0 are returned—ensuring accurate balance tracking.
4.8 Transfer NFT Between Users
Transfer ownership securely:
const transferTransaction = await aptos.transferDigitalAsset({
sender: alice,
digitalAssetAddress: assets[0].token_data_id,
recipient: bob.accountAddress,
});
await aptos.signAndSubmitTransaction({ signer: alice, transaction: transferTransaction });After confirmation, Bob becomes the new owner.
👉 Start experimenting with real-time NFT transfers on a secure blockchain platform.
Frequently Asked Questions (FAQ)
Q: Can I deploy this on Mainnet?
A: Yes. Replace Network.DEVNET with Network.MAINNET and ensure your account holds sufficient APT for gas fees.
Q: Are these NFTs compatible with wallets and marketplaces?
A: Absolutely. Aptos NFTs follow the v2 digital asset standard, supported by major wallets like Petra and Martian.
Q: How do I add royalties or mutable properties?
A: Currently, royalties aren’t natively enforced but can be implemented at the application level. Mutable URIs/descriptions are supported if enabled during creation.
Q: What’s the difference between token ID and token data ID?
A: token_data_id refers to the unique metadata record; multiple fungible copies can share it. For NFTs, there’s typically one non-fungible instance per token_data_id.
Q: Is Move required to create NFTs?
A: Not necessarily. The SDK abstracts Move logic, allowing no-code minting. However, custom logic (e.g., dynamic minting rules) requires writing Move modules.
Q: How scalable is Aptos for high-volume NFT drops?
A: Very. Aptos uses parallel execution and block-STM for high throughput—capable of handling thousands of TPS during large mints.
Conclusion
Creating and transferring NFTs on Aptos is streamlined thanks to its modern Move-based architecture and intuitive SDKs. From generating accounts and funding them via faucet to minting and transferring digital assets, each step is designed for developer efficiency without sacrificing security or decentralization.
With native support for collections, metadata, and ownership tracking, Aptos lowers the barrier to entry for Web3 creators and developers alike. Whether you're building game items, digital collectibles, or verifiable credentials, Aptos offers a reliable foundation.
👉 Unlock advanced tools and resources to accelerate your blockchain journey.