Migration from v1
Welcome to the home of your new documentation
v1 of TrustOS API is going to be deprecated and its use is not recommended. If you are using v1 of APIs, we recommend that you update to v2 as soon as possible.
This section is designed to facilitate the migration from v1 to v2.
Below, we detail the most important changes that have been made in v2 of TrustOS, which may affect the migration of your systems.
Blockchain network
As part of the migration to v2, we have updated the core blockchain network within TrustOS. Previously, our systems were deployed by default on a private Hyperledger Fabric network. With v2, we have migrated to a private Hyperledger Besu network, based on the Ethereum Virtual Machine (EVM).
This allows us to interact with any Ethereum-based network, expanding TrustOS capabilities and taking advantage of the latest implementations and improvements from the Ethereum community, such as ERC-4337 (Account Abstraction).
Therefore, we recommend using this network for registering any asset or certificate within TrustOS. If you consult the available networks through the /providers endpoint, you will be able to see all the networks available to interact with TrustOS.
Please use the networkId 10004 (Telefónica Tech’s Hyperledger Besu). If you need to register on public networks, please contact us.
API Authentication
In order to achieve proper modularization of functionalities within TrustOS, we have removed the authentication endpoints from the certificates and traceability module.
To interact with TrustOS APIs, it is necessary to authenticate previously in the identity module. To do this, you must use the /login endpoint to obtain an authentication token (jwt). This token must be included in the header of all requests to TrustOS APIs, under the name Authorization
.
Data Persistence
The information stored in the lab environment, such as certificates and assets, as well as users, will be deleted and cannot be recovered.
In the case of the production environment, since we have migrated to a new blockchain network, all data stored in the private Hyperledger Fabric network has been transferred within TrustOS systems, enabled only in read-only mode. That is, the information will still be accessible through the APIs, but write operations cannot be performed.
Identifiers
The identifiers for new users and certificates have been updated:
- Users: User identifiers have changed from
did:vtn:trustid:<userId>
todid:user:<userId>
. - Certificates: Certificate identifiers have changed from
did:vtn:c1:certid:<certId>
todid:<environment>:certid:<certId>
.
New Formats
Response Format
In order to obtain more clarity in responses from TrustOS, we have updated the response format of TrustOS APIs. We have moved from the format:
to the format:
Certificate Format
The certificate format has evolved, modifying and adding new fields and structures. Moving from:
to the following format:
Asset Format
Like the certificates module, the asset format has evolved, modifying and adding new fields and structures. Moving from:
to the following format:
Other changes
- The functionality to make a certificate private has been added
- Token API is discontinued
- The expiration time of the Login jwt, as well as the refresh token, have been updated.
If after reading this guide you still have questions, don’t hesitate to contact us.