OP codes and messages

Knowledge Base

OP codes and messages

Every ObjectID include a TEXT field called OP_code.

The content of this field can be set by the Producer or by the Owner of the ObjectID and can be used tto trigger specific application features.

Code must be made of 4 numeric digits and can be set in sequenze separated by a comma (in example “0001, 0010”)

Codes from 0000 to 0999 are reseved for ObjectID applications.

This is the currently used codes:

CodeMeaning – effect
0000Indicate that the product represented by the ObjectID has been stolen. It instructs the smart contract to accept calls to the message function and send one of the predefined messages, plus the geolocation code provided by the user, to the product owner (onwer_did).
0001Indicate that the product represented by the ObjectID has been lost. It instructs the smart contract to accept calls to the message function and send one of the predefined messages, plus the geolocation code provided by the user, to the product owner (onwer_did)
0002This code allows an identified user to send predefined messages to the agent. It instructs the smart contract to accept calls to the message function only when the destination DID matches the agent_did field of the ObjectID.
0003This code allows an identified user to send predefined messages to the onwer. It instructs the smart contract to accept calls to the message function only when the destination DID matches the owner_did field of the ObjectID.
0010In normal operation Agent can set a new ObjectID onwer. This code indicate to the smartcontract to accept calls for update_owner function only coming from a DID matching the ObjectID owner_did field.
0020In normal operation any identity with sufficient credit can call the smart contract function add_event to add an event to an ObjectID . This code indicate to the smartcontract to accept calls for add_event function only coming from a DID matching the ObjectID owner_did field.
0021In normal operation any identity with sufficient credit can call the smart contract function add_event to add an event to an ObjectID . This code indicate to the smartcontract to accept calls for add_event function only coming from a DID matching the ObjectID owner_did field or agent_did field.
0030In normal operation Owner and Agent can update the product geolocation. This code indicate to the smartcontract to accept calls for update_geolocation function only coming from a DID matching the ObjectID owner_did field.

Messages

ObjectID allows subjects identified by a DID, who have scanned a QR code representing an object, to send messages. These messages can be generated either through the ObjectID dApp or by third-party applications.

A message is an object created by the ObjectID smart contract under specific conditions. It may contain the following fields:

Field nameMeaning
from_didRepresents the identity of the subject invoking the message function of the smart contract. This field is automatically determined by the smart contract using the provided Identity Capability Token.
dest_didRepresents the identity of the subject designated to receive the alert indicating the presence of a message to read. It can only be the owner, the agent, or the object_did associated with the specified object.
objectRepresents the unique identifier of the object to which the message refers.
message_codeRepresents the identifier of a predefined message. This code enables applications to send messages over the blockchain without exposing sensitive data, ensuring compliance with GDPR. See the table below for reference.
messageRepresents the body of the message. It can typically be filled only when the from_did matches the creator_did, meaning the message source must be clearly identifiable for this field to be used.
geolocationRepresents a geolocation reference, used to provide contextual information related to the message.
linkMay contain a URL linking to additional resources.

Message codes

Messages are objects created by the smartcontract that remain in the blockchain for a limited period of time. The message code is a u16 number. Values from 0 to 40 are reserved for ObjectID applications. The following are the predefined messages generated by the ObjectID dApp based on these codes:

CodeMessage sent and rules
0When this code is used to call the message function of the smart contract, the dApp displays the message: ‘Someone found your object ID‘ to the object’s owner. This message is generated by the smart contract only if the object’s op_code is set to 0000 (object_stolen). Geolocation data assists the owner in locating and retrieving the object.
Note: the ObjectID dApp silently call the smart contract alert function keeping anonymous the identity of the user.
1When this code is used to call the message function of the smart contract, the dApp displays the message: ‘Hello, I’ve found your object ID‘ to the object’s owner. This message is generated by the smart contract only if the object’s op_code is set to 0001 (object_lost). Geolocation data assists the owner in locating and retrieving the object.
2When this code is used to invoke the message function of the smart contract, the dApp displays the message: ‘Hello, I’ve found your object ID. I’m reporting and delivering it to the police.’ to the object’s owner. This message is generated by the smart contract only if the object’s op_code is set to 0001 (object_lost). Geolocation data assists the owner in locating and retrieving the object.
3When this code is used to call the message function of the smart contract, the dApp displays the message: ‘Hello, I’ve found your object with ID … I’m keeping it safe until you collect it.’ to the object’s owner. This message is generated by the smart contract only if the object’s op_code is set to 0001 (object_lost). Geolocation data helps the owner locate and retrieve the object.
11When this code is used to invoke the message function of the smart contract, the dApp displays the message: ‘I need support for the Object ID‘ to the object’s owner or agent, depending on the op_code. This message is generated by the smart contract only if the object’s op_code is set to 0002 (message_to_agent) or 0003 (message_to_owner). Geolocation data assists the owner/agent in locating the object.
12When this code is used to invoke the message function of the smart contract, the dApp displays the message: ‘I want to report an improper use of object ID‘ to the object’s owner or agent, depending on the op_code. This message is generated by the smart contract only if the object’s op_code is set to 0002 (message_to_agent) or 0003 (message_to_owner). Geolocation data assists the owner/agent in locating the object.
13When this code is used to invoke the message function of the smart contract, the dApp displays the message: ‘This object requires maintenance: ID‘ to the object’s owner or agent, depending on the op_code. This message is generated by the smart contract only if the object’s op_code is set to 0002 (message_to_agent) or 0003 (message_to_owner). Geolocation data assists the owner/agent in locating the object.
14When this code is used to invoke the message function of the smart contract, the dApp displays the message: ‘This object has been damaged …’ to the object’s owner or agent, depending on the op_code. This message is generated by the smart contract only if the object’s op_code is set to 0002 (message_to_agent) or 0003 (message_to_owner). Geolocation data assists the owner/agent in locating the object.
15Code reserved.
Terms & Conditions Privacy - ObjectID is a service provided by SDV Consulting SRLS, VAT: IT 13168650961
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners. View more
Cookies settings
Accept
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active
Save settings
Cookies settings