Product Tagging Tutorial
A complete guide to tagging your first product with TAG IT Network.
Tutorial Overview
In this tutorial, you will learn how to tag a physical product with an NFC chip and register it on the blockchain. By the end, you will have a fully authenticated product ready for verification.
What You'll Build
- A physical product with an encoded NFC tag attached
- A blockchain registration linking the tag to product metadata
- A verifiable digital identity for your product
Prerequisites
- A TAG IT Network developer account with API keys
- NFC-enabled smartphone or NFC writer device
- Compatible NFC tags (NTAG 424 DNA recommended)
- The product you want to tag
- TAG IT SDK installed (see Quick Start Guide)
This tutorial takes approximately 30-45 minutes to complete, depending on your familiarity with NFC technology.
Step 1: Prepare Your Product
Before attaching an NFC tag, you need to identify the optimal placement location and prepare the surface.
Tag Placement Considerations
Consider placing tags in accessible but protected areas. For luxury goods, common locations include inside packaging, on product labels, or embedded within the product itself.
Choose a location that is:
- Accessible: Users should be able to tap the tag easily with their phone
- Protected: The tag should be shielded from damage and tampering
- Away from metal: Metal surfaces can interfere with NFC signals
- Flat: Curved surfaces may reduce read range
Surface Preparation
- Clean the surface with isopropyl alcohol to remove dust, oil, and debris
- Allow the surface to dry completely (2-3 minutes)
- For porous materials, apply a thin primer coat if necessary
- Mark the exact placement location with a light pencil mark
Never place NFC tags directly on or within 1cm of metal surfaces. Use ferrite shielding if metal placement is unavoidable.
Step 2: Select NFC Tag
Choosing the right NFC tag is crucial for security and durability. TAG IT Network supports various tag types, but we recommend using tags with cryptographic authentication.
Recommended Tags
| Tag Type | Security Level | Best For |
|---|---|---|
| NTAG 424 DNA | High (AES-128) | Luxury goods, high-value items |
| NTAG 213/215/216 | Medium | Consumer products, general use |
| ICODE SLIX2 | Medium | Industrial applications |
For detailed tag specifications and purchasing options, see our Chip Selection Guide.
Step 3: Encode the Tag
Before attaching the tag, you need to encode it with a unique identifier and configure its security settings.
Using the TAG IT Mobile App
- Download the TAG IT Encoder app from the App Store or Google Play
- Log in with your developer credentials
- Select "Encode New Tag" from the menu
- Hold your phone near the blank NFC tag
- The app will write a unique identifier and security keys to the tag
Using the SDK (Programmatic Encoding)
For automated encoding workflows, use the SDK with an NFC writer device:
import { TagIt } from '@tagit/sdk';
import { NFCWriter } from '@tagit/nfc-tools';
const tagit = new TagIt({
apiKey: process.env.TAGIT_API_KEY,
network: 'mainnet'
});
// Initialize NFC writer
const writer = new NFCWriter({
device: 'ACR122U' // Supported NFC reader/writer
});
async function encodeTag(productInfo) {
// Generate unique tag ID
const tagId = await tagit.tags.generateId();
// Prepare tag payload
const payload = {
tagId: tagId,
productSku: productInfo.sku,
manufacturerId: productInfo.manufacturerId,
timestamp: Date.now()
};
// Generate security keys
const keys = await tagit.tags.generateKeys(tagId);
// Write to NFC tag
await writer.write({
ndef: [{
type: 'url',
value: `https://verify.tagit.network/${tagId}`
}],
securityKeys: keys,
lockTag: true // Prevent overwriting
});
console.log('Tag encoded successfully:', tagId);
return tagId;
}
// Example usage
const tagId = await encodeTag({
sku: 'WATCH-LUX-001',
manufacturerId: 'MFR-12345'
});
Always test the encoded tag with a smartphone before attaching it to the product. Once attached, re-encoding may not be possible.
Step 4: Register on Blockchain
After encoding the tag, register the product on the blockchain to create an immutable record of authenticity.
Registration API Call
import { TagIt } from '@tagit/sdk';
const tagit = new TagIt({
apiKey: process.env.TAGIT_API_KEY,
network: 'mainnet'
});
async function registerProduct(tagId, productData) {
const registration = await tagit.products.register({
tagId: tagId,
metadata: {
name: productData.name,
brand: productData.brand,
category: productData.category,
serialNumber: productData.serialNumber,
manufactureDate: productData.manufactureDate,
origin: productData.origin,
description: productData.description,
images: productData.imageUrls
},
owner: productData.initialOwnerAddress,
options: {
mintNFT: true, // Create NFT certificate
storeOnIPFS: true // Store metadata on IPFS
}
});
console.log('Product registered!');
console.log('Transaction hash:', registration.txHash);
console.log('Token ID:', registration.tokenId);
console.log('IPFS hash:', registration.ipfsHash);
return registration;
}
// Example usage
const result = await registerProduct('NFC-TAG-001-ABC', {
name: 'Luxury Watch Model X',
brand: 'Premium Timepieces',
category: 'Watches',
serialNumber: 'SN-2024-001234',
manufactureDate: '2024-01-15',
origin: 'Switzerland',
description: 'Limited edition automatic watch with sapphire crystal',
imageUrls: ['https://example.com/product-image.jpg'],
initialOwnerAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f5c9E8'
});
Registration Response
{
"success": true,
"tagId": "NFC-TAG-001-ABC",
"tokenId": "12345",
"txHash": "0xabc123def456...",
"ipfsHash": "QmXyz789...",
"contractAddress": "0x1234567890abcdef...",
"blockNumber": 45678901,
"timestamp": "2024-01-15T10:30:00Z",
"verificationUrl": "https://verify.tagit.network/NFC-TAG-001-ABC"
}
TAG IT Network uses Polygon for low-cost transactions. Registration typically costs less than $0.01 in gas fees.
Step 5: Attach the Tag
With the tag encoded and registered, it's time to physically attach it to your product.
Application Methods
Visual guide showing adhesive application, heat sealing, sewing into labels, and embedded placement techniques.
Adhesive Application (Most Common)
- Peel the backing from the adhesive NFC tag
- Align the tag with your marked placement location
- Press firmly from the center outward to remove air bubbles
- Apply pressure for 30 seconds for optimal adhesion
- For added security, apply a tamper-evident overlay sticker
Heat-Sealed Tags
For textile and apparel applications:
- Position the heat-seal tag on the fabric
- Apply heat press at 150-170°C for 10-15 seconds
- Allow to cool before handling
Sewn-In Labels
For garments and accessories:
- Use woven labels with embedded NFC inlays
- Sew into seams or care label areas
- Ensure the antenna is not folded or crimped
Embedded Tags
For products with internal cavities:
- Place the tag inside the product during manufacturing
- Use protective housing if necessary
- Ensure read range is adequate through the product material
Step 6: Verify Installation
After attaching the tag, perform a verification test to ensure everything works correctly.
Verification Checklist
- Read Test: Use your smartphone to tap the tag. The verification page should load.
- Data Verification: Confirm all product information displays correctly.
- Range Test: Test reading from various angles and distances (should work within 2-4cm).
- Security Test: Verify the cryptographic signature validates successfully.
Verification Script
import { TagIt } from '@tagit/sdk';
const tagit = new TagIt({
apiKey: process.env.TAGIT_API_KEY,
network: 'mainnet'
});
async function verifyInstallation(tagId) {
console.log('Starting verification tests...\n');
// Test 1: Tag exists in database
const tagExists = await tagit.tags.exists(tagId);
console.log('1. Tag registered:', tagExists ? 'PASS' : 'FAIL');
// Test 2: Product data retrieval
const product = await tagit.products.get(tagId);
console.log('2. Product data:', product ? 'PASS' : 'FAIL');
// Test 3: Blockchain verification
const verification = await tagit.products.verify(tagId);
console.log('3. Blockchain verified:', verification.verified ? 'PASS' : 'FAIL');
// Test 4: Signature validation
const sigValid = await tagit.security.validateSignature(tagId);
console.log('4. Signature valid:', sigValid ? 'PASS' : 'FAIL');
// Test 5: IPFS data availability
const ipfsData = await tagit.storage.getIPFS(product.ipfsHash);
console.log('5. IPFS available:', ipfsData ? 'PASS' : 'FAIL');
const allPassed = tagExists && product && verification.verified && sigValid && ipfsData;
console.log('\n' + (allPassed ? 'All tests passed!' : 'Some tests failed. Review above.'));
return allPassed;
}
// Run verification
verifyInstallation('NFC-TAG-001-ABC');
Expected Output
Starting verification tests...
1. Tag registered: PASS
2. Product data: PASS
3. Blockchain verified: PASS
4. Signature valid: PASS
5. IPFS available: PASS
All tests passed!
Best Practices
Follow these best practices to ensure long-term success with your product tagging implementation.
Durability
- Environmental Protection: Use waterproof encapsulated tags for products exposed to moisture
- UV Resistance: Choose UV-resistant tag materials for outdoor products
- Temperature Range: Standard tags operate -25°C to +85°C; use industrial tags for extreme conditions
- Physical Protection: Apply protective overlays or embed tags in protective housings
Placement
- Consistency: Place tags in the same location across product lines for predictable user experience
- Documentation: Include tag location in user manuals and packaging
- Visual Indicators: Use "NFC Enabled" or "Tap to Verify" icons near the tag location
- Accessibility: Ensure the tag is reachable without disassembling the product
Security
- Use Cryptographic Tags: Always prefer NTAG 424 DNA or equivalent for high-value items
- Tamper Evidence: Apply tamper-evident seals over tags to detect removal attempts
- Key Management: Store encryption keys securely; never expose them in client-side code
- Regular Audits: Periodically verify registered products haven't been tampered with
Never share your API secret keys or tag encryption keys. Compromised keys can allow counterfeiters to create fraudulent products.
Batch Operations
For high-volume tagging operations:
import { TagIt } from '@tagit/sdk';
const tagit = new TagIt({
apiKey: process.env.TAGIT_API_KEY,
network: 'mainnet'
});
async function batchRegister(products) {
const results = await tagit.products.batchRegister(products, {
batchSize: 100, // Process 100 at a time
retryOnFailure: true,
webhookUrl: 'https://your-server.com/webhook/batch-complete'
});
console.log(`Registered ${results.successful} of ${products.length} products`);
console.log(`Failed: ${results.failed}`);
return results;
}
// Register 1000 products
const productBatch = generateProductBatch(1000);
await batchRegister(productBatch);
You have successfully tagged and registered your first product on the TAG IT Network. Your product now has a verifiable digital identity on the blockchain.
Next Steps
- Ownership Transfer Tutorial - Learn how to transfer product ownership
- Dispute Resolution - Handle authenticity disputes
- REST API Reference - Explore all available API endpoints
- Advanced Encoding Guide - Deep dive into NFC encoding options