Skip to main content

Tokenization

Overview

The tokenization feature enables the creation of Digital Product Passports (DPP), represented as NFTs on compatible blockchains (e.g., Starknet). These DPPs ensure product traceability, authenticity, and post-sale engagement.

Management of these DPPs relies on:

  • an API for bulk minting via JSON Lines,
  • mechanisms to track status and progress,
  • a JavaScript/React SDK for integration into client-facing interfaces (e.g., user wallet).

Creating DPPs (minting)

API Endpoint

POST /v1/organizations/:orgId/applications/:appId/tpp/mint

This endpoint launches a minting job using a JSON Lines file. Each line represents a TppMintData object with an identifier (tppId) and product metadata.

Example JSONL payload

{
"tppId": "b7cd08...",
"metadata": {
"name": "XYZ Mobile 12",
"description": "Discover the XYZ Mobile 12...",
"image": "https://dummyimage.com/...",
"attributes": [
{ "trait_type": "Ean", "value": "9783161484100" },
{ "trait_type": "Serial number", "value": "SN123" }
],
"external_url": "https://www.example.com/product",
"creator": "IntegratorID",
"blockchain": "Starknet"
}
}

⚠️ The tppId field must be unique and stable. We recommend calculating it using a hash (e.g., SHA-256 of a product identifier).

See the API documentation for more details.


Tracking minting jobs

1. Single status check

GET /v1/organizations/:orgId/applications/:appId/tpp/mint/:jobId/status

Returns the current status of the job as JSON.

{
"total": 10,
"completed": 7,
"errors": [],
"results": [...]
}

2. Live progress updates (SSE)

GET /v1/organizations/:orgId/applications/:appId/tpp/mint/:jobId/status/sse

Returns a Server-Sent Events (SSE) stream that delivers continuous job progress events. Ideal for real-time UI feedback.

See the API documentation for more details.


SDK Integration

The JavaScript SDK (Core and React) allows:

  • interacting with the user's wallet,
  • claiming a DPP linked to a minted NFT,
  • verifying and displaying metadata.

Example using React

import React from "react";
import { useKeybanAccount } from "@keyban/sdk-react";

function DppClaimButton() {
const [account, accountError] = useKeybanAccount();

if (accountError) {
return <div>Error: {accountError.message}</div>;
}
if (!account) {
return <div>Loading account...</div>;
}

const handleClaim = async () => {
try {
const { transactionHash } = await account.tppClaim("b7cd08dc66...");
console.log("Claim successful, tx hash:", transactionHash);
} catch (error) {
console.error("Claim failed:", error);
}
};

return <button onClick={handleClaim}>Claim DPP</button>;
}

See the React SDK documentation for more details.


Learn more