# APTM: A Model for Pervasive Traceability of Agrochemicals
## 4 Proposed Model
### Tier 3--Blockchain Consortium and Gamification  
The private blockchain tier comprises companies with the \"same commercial interest\" or a single company with an economic interest in this reverse supply chain that autonomously and independently maintains the private blockchain. The goal of private blockchain is to maintain data that begins in the development, production, storage, sale, and return of defective products and/or packages. Mainly it deals with the transit of goods between \"trading partners\" of the same chain. The private blockchain exchanges data via a representational state transfer (REST) API using JSON. This tier has a class library to operate on its objects. It considers features of controlled objects that must return to their origin. This class library allows data to be written from correctly identified objects. These objects are tokens on the blockchains that follow the ERC721 token contract standard (It is a pattern used for tokenized product exchanges. Objects can be represented and uniquely identified by using ERC721 tokens. This standard is used by the Ethereum blockchain in its smart contracts and provides functionality for transfers, approvals, and quantification of token transactions between accounts). The farm also sends data to a web service maintained by the government. Behind this web service, there is a blockchain in which public supervisory bodies interconnect and monitor the movement of agrochemicals. Data is sent in XML format. The data format model used is briefly presented in the listing example  
Figure 8: Functionalities of tier 2 in APTM. Figure 9: Relationship among tier 2 functionalities in APTM. in Figure 10. Data is stored outside the blockchain. Therefore what is forwarded is an extract hash code with a pointer to the complete data. Data stored outside the blockchain uses a protection scheme similar to that used in tier 2. This approach is adopted due to the intrinsic slowness of processing intelligent contracts while recording large volumes of data. The fields that make up this data are: EAN13 refers to the barcode and product identification; GS1_128 refers to the GS1 standard; RFID, code used in radio frequency tags; Storage_Site: storage location; Source: product source; Destination: The product's next destination location; Timestamp: date and time of the event; MovedBy: an employee who made the product movement; AuthorizedBy: an employee who authorized the movement of the product; Observation: Miscellaneous comments; ExpirationDate: final product expiration date; InvoiceNumber: invoice number. Both blockchains in this work have been developed in Ethereum. Figure 11 shows the decentralized application architecture used in both blockchain consortiums in tier 3 of APTM. One of the incentives to participate in this reverse supply chain is engagement via gamification. Participants who submit product transit data score points. This score can be divided into a scale: participation, amount of data sent, amount of information disclosed, etc. These data can be public and consulted via tier 4 in blockchains or made available via a third-party portal ([[https://etherscan.io/](https://etherscan.io/)]([https://etherscan.io/](https://etherscan.io/)), accessed on 26 July 2021). The system that computes the score can be located in tier 2 or 3. The minimum score system can add points and medals using Table 3. The gamification and display of the score in tier 4 can lead to \"green certificates\" and entries into the carbon credit market. The farm becomes transparent in processes involving agrochemicals. This \"green\" recognition can come from the reverse private supply chain, government agencies, or displayed by the farmer himself via tier 4. Points are totaled and displayed on a panel along with the transactions issued. A gamification process can support the routine treatment of agrochemicals within well-defined processes.