Skip to main content

Create a Digital Twin

M-Trust provides the services for managing your DIDs and therefore Digital Twins of your project.

Prerequisites

You need to have an access token ready.
Learn how to obtain one in the Get Access Token guide.

Create a Digital Twin for an Object

Creating a digital twin from an object establishes a robust connection between a DID and that specific object. For this purpose, the gemini service provides the digital twin endpoint. A detailed description of the endpoint can be found in the API Reference.

The endpoint expects a POST request to create a digital twin.

For authorized access, you need to include the access token in the Authorization header. Also make sure that your App has the necessary permission Create Digital Twin to create a digital twin for the registry. Learn more about Apps and permissions in Create App & API Token guide.

Request

POST /api/gemini/v1/digital-twin

Headers:
Authorization: Bearer <YOUR_ACCESS_TOKEN>

{
"identifier": string,
"objectType": string,
"registryName": string
}

  • identifier - A unique identifier for your object. This can be a serial number, a QR code or any other identifier that is unique for this object. Soon M-Trust will provide our patented scan methods and hash algorithms to generate this identifier for you.
  • objectType - The type of the object. This can be the name of a specific product, a machine, a vehicle or any other type of object.
  • registryName - optional. The Registry you want to use for your DID.
Beta

For the beta, we provide a DID registry based on the Polygon Amoy blockchain. Therefore, please use Polygon Amoy Testnet for registryName. This is a testnet focusing on the development and testing of decentralized applications. We are working on integrating more DID registries in the future.

Response

If the request is successful, you get a response with the created digital twin.

{
"did": string,
"alias": string,
"provider": string,
"controllerKeyId": string,
"keys": [...]
}
  • did - The unique decentralized identifier for your digital twin.
  • alias - The alias of the digital twin.
  • provider - The protocol, method and optional the ledger identifier of the did e.g. did:ethr:polygon:amoy.
  • controllerKeyId - The public ledger address of the controller.
  • keys - A list of key materials used for verification, access and ownership.

Congratulations. You just creeated your first digital twin. In the response you can find the DID of your digital twin. This is the unique identifier for your object in the digital world. You can use this DID to authenticate and identify your object in the future.

In the next step you will learn how to resolve your digital twin. Therefore you need to persist the DID of your digital twin.