Blockchain Framework for Certification of Organic Agriculture Production

: Organic production, as a sustainable food production system, is designed to implement all agroecological principles that enable the preservation of human and animal health, environmental protection, and positive impact on society and the ecosystem while achieving significant economic benefits. Demand for organic food products is constantly growing, and the land area under organic production is continuously increasing. The problem in this sector is that producers of organic products face many administrative and systemic obstacles that prevent the faster development of this sector. On the other hand, consumers do not have complete confidence in the current mechanisms of control of organic production, so in the sale on the food markets and in the rest of the market, fake and unverified organic products can be found. Based on sensor data from the production field, this paper presents the SAFE platform as a solution for the described problem. The data necessary for producers to carry out the certification process are harmonized with the current legislation for organic food production. The SAFE platform uses blockchain technology to secure data consistency and history since it makes it impossible to change data history. The results of a survey about the SAFE platform are presented. The proposed solution stimulates the development and improvement of agricultural production by organic production methods, accompanied by increasing capacity in organic production.


Introduction
Food is one of the basic human needs. By ingesting food, the human body is supplied with the necessary nutrients. The ingested nutrients participate in various metabolic processes that enable the construction of new cells and regeneration, and thus the growth and development of tissues, organs, and the whole organism. Nutrients are converted to energy in metabolic processes, which are necessary for all life activities [1,2]. Foods used in human nutrition can be of plant and animal origin. Both fresh food products and their processed products are used in human nutrition.
The human population is increasing every day and producing a sufficient amount of food products has become a global problem [3,4]. Solving this problem has influenced the emergence of some negative trends. First, more and more land is being converted into agricultural land. This land is used to produce plant food products for human consumption or for the nutrition of animals, whose products are used in human nutrition [5][6][7][8][9][10][11]. This increase in agricultural areas usually influences decreased areas under forests, either by using machines or burning forests. Decreasing areas under forests effect the rise in carbon dioxide concentration in the atmosphere, negatively affecting the greenhouse effect and the global rise in temperature. Furthermore, deforestation destroys the habitats of various plant and animal species. The consequence of habitat destruction is that many plant and animal species become endangered or extinct. Destruction of forests also leads to soil erosion due to external influences. Winds can also influence the decreasing of land. Due to the occurrence of heavy rains or earthquakes, landslides occur. Landslides can cause tragic consequences and significant economic damage.
There is a trend of increasing usage of chemicals to ensure yields in agricultural production. In plant production, chemicals (fertilizers) are used to nourish plants, while other chemicals protect plants from diseases and pests during the growing season and reduce weeds in orchards [12]. However, using chemicals in plant production leads to the contamination of plant products. It can lead to soil and water pollution, thus negatively affecting flora and fauna because it can cause the endangerment and extinction of many species (e.g., bees) [13]. After harvest, the products are treated with various chemical preparations to keep the freshness and healthy appearance of products during storage for as long as possible. Herbal products produced in this way can be used for animal nutrition, whose products are used in human nutrition. In the production of food of animal origin, the use of drugs, antibiotics, and special hormones is increasing to produce as many products as possible (milk, eggs, meat, etc.).
This paper presents the SAFE platform based on sensor data from the production field (soil, fertilization, pesticides, treatment, etc.) The data necessary for producers to carry out the certification process are harmonized with the current legislation for organic food production. The SAFE platform uses blockchain technology to secure data consistency and history since it makes it impossible to change data history. This relevant data is used for the certification process, which is conducted according to organic farming methods.
Only a few applications can be found on the market that could be used to support the certification process of organic farming. Still, there are no similar solutions to the SAFE platform. Companies offering applications with blockchain technologies (for example, AgriChain [36], AgriDigital [37], GrainChain [38], ZhongAn [39], and others) mainly focus on agricultural transactions and processing without intermediaries, transactions through smart contracts, etc. Other systems use blockchain technology to trace organic products during production, storage, and transportation [40][41][42][43]. In the agricultural service market, only the SAFE platform is specialized in supporting the implementation of the process certification in organic production.
The novelty of the SAFE platform concerning existing solutions is reducing the time necessary for activities related to the organic certification process, as well as the application of blockchain technology, which enables the recording of all changes made during the certification process and thus guarantees the validity of the issued certificate. This is achieved by giving clear step-by-step instructions to the farmers as to which documents they should provide, after which these documents are checked in the shortest possible time. In detecting errors in the certification process activity, farmers are informed in a very short time on how they should correct the defined errors. Farmers do not need to know the standards and regulations essential for a specific certification procedure, since the platform enables them to access only those steps in the certification process that are necessary for a particular certification procedure. The usual manner implies that farmers have to wait for the availability of validators who give advice only in direct contact with farmers. This is repeated for each step of the certification procedure. Suppose a large number of farmers are waiting for the availability of validators. In that case, this can significantly prolong the certification procedure, which is often the case in the usual manner of monitoring. Suppose the farmer wants to certify several types of organic productions with the SAFE platform. In that case, it is possible to further speed up the certification process by using part of the already obtained and validated documentation used in another certification procedure. An example can be documentation about a registered farm, the amount of land owned by the farmer, etc. Every step in the interaction between the farmer and a validator is recorded with additional usage of blockchain technology. In this way, the SAFE platform enables the traceability of the organic production certification process, which is also a novelty in organic production certification procedures.
The SAFE platform proposed in this paper creates a custom environment based on each individual-specific process of organic certification of food producers. Therefore, it represents an expert system that primarily assists producers in preparatory work to implement a complete plan of the certification process.
The SAFE platform stimulates the development and improvement of agricultural production under agri-environmental principles. As a result, reducing the use of fertilizers, antibiotics, pharmacological agents, pesticides, GMOs (Genetically Modified Organisms), and aggressive hygiene products will be achieved. The overall effect will reduce adverse environmental impacts (land, water, and air).
This paper is organized as follows. Section 2 describes organic production as well as the obstacles producers face in organic production. Section 3 describes blockchain technology as well as the application of blockchain technology in the agri-food industry. Section 4 describes the developed SAFE platform. Section 5 provides a discussion of the developed SAFE platform. Finally, in Section 6, conclusions and directions for future development of the SAFE platform are given.

Organic Production
Organic production (OP), as a sustainable food production system, is designed to implement all agroecological principles that enable the preservation of human and animal health, environmental protection, and positive impact on society and the ecosystem while achieving significant economic impact benefits. Demand for organic food products (plant and animal) is constantly growing in domestic and foreign markets. Land area under the OP is continuously increasing. The number of certified producers is growing, the organic food processing sector is developing, new markets are opening up, and exports are growing. However, the existing potential and resources available in the Republic of Serbia are 16 to 20 times less used than in EU (European Union) countries.
OP producers face many administrative and systemic obstacles preventing faster development of this sector (a certification organization losing a license when the certification process is already underway, inconsistent list of plant protection products with EU practice, etc.) On the other hand, consumers do not have complete confidence in the current mechanisms of control of organic production; thus, in the sale on the food markets and in the rest of the market, fake and unverified organic products can be found. Such a situation endangers the survival and position of certified organic food producers and misleads consumers in their perception of the quality of these products. Undermined consumer confidence reduces market demand, which is reflected through reduced production, increased storage of products, and economic losses of producers.
From signing a contract with one of the certification organizations, most food producers do not have sufficient technological knowledge, face high financial costs, and often encounter inconsistencies in methodological approaches and interpretations (control/implementation) of prescribed legislation by a certification organization. Due to this situation, it is difficult for producers to decide to start their organic production, that is, to switch from the existing conventional production to organic, so the process is extremely slow and complicated. All this prevents faster and stronger sector growth in the domestic market, especially exports, whose current value is 30 million euros. Therefore, the potential for profits on the domestic market and foreign exchange inflows from exports to increase several times remains unutilized. Accordingly, to solve this extremely complex situation, efficiently manage it, and satisfy the needs of all stakeholders in the integrated chain (state government, producers, consumers), it is necessary to improve the verification of the plan for the certification process of organic production.

Blockchain
One of the current propulsive research topics in industry and academia is blockchain. Although it represents a broader image, blockchain is often identified with Bitcoin, a public blockchain for transferring money. The idea behind Bitcoin was to send money quickly from one end of the world to another without commission and control from a central organization. This idea resembles DigiCash, which David Chaum created in 1989 [44]. Digi-Cash was based on anonymous transactions and used cryptographic protocols, such as public and private keys, to preserve anonymity. Unlike DigiCash, which broke down in 1998, Bitcoin has a decentralized system, which excludes the need to confirm a specific tranche and allows everyone to have a copy of the entire blockchain. Blockchain, defined as a shared and distributed ledger, uses a set of nodes to maintain the data structure, organized in blocks. Although blockchain is not a new technology per se, it is a combination of three technologies used for quite some time. First, blockchain mimics a simple database that is decentralized and stored in the network's nodes by using peer-to-peer networking, asymmetric cryptography, and cryptographic hashing [45]. Motivation in this paper stands in perceiving the benefits and flaws of the Ethereum and Hyperledger platforms as leading private blockchain platforms and their applicability in various industry and academia fields. Benefits and drawbacks will be represented in scalability, performance, and security.
Many industries have demonstrated interest in blockchain technologies, including health departments, economics, and gambling [46]. Moreover, Dubai has an ongoing process for introducing blockchain into government, thus reducing paperwork [47]. In the paper [48], the authors discuss architectural types of blockchain that can be implemented in Internet-of-Things (IoT) services. Another example of using blockchain in the IoT industry is presented in [49], where authors use smart contracts, which are part of the Ethereum network, to create the Turing-complete code. Another example of industrybased blockchain technologies is presented in [50], where the authors describe how this technology can be used in blockchain-based electricity trading systems. Extensive research was conducted by authors [51] using their BLOCKBENCH, an open-source tool for quantitative analysis of the blockchain, which compares Ethereum, Parity, and Hyperledger. As Ethereum and Hyperledger represent a novelty in industry and science, whether their performance can justify expectations regarding scalability, speed, and reliability remains a question. Authors in [52] have concluded that, in terms of the average execution time, average latency, and average throughput, Hyperledger Fabric outperforms Ethereum across all scenarios.
Blockchain represents a growing technology in the field of agri-foods. It can help improve the safety and quality of agri-foods and change many parts of the agricultural industry. The cooperation model between agri-foods and blockchain is based on the food company responsible for providing information related to agri-foods, and the blockchain company is responsible for providing technical knowledge. Table 1 provides examples of current collaboration models using blockchain to bring transparency and traceability to agri-foods. IBM is widely recognized as the leading company for enterprise blockchain. IBM Food Trust program has been exploring routes to utilize blockchain technology to create shared, secured, and permissioned digital records of agri-food data. That will enable participants on the network to access tools and data to improve food safety [53].

Data Transparency
The food supply management and interactions are unidirectional in traditional systems. Most of the participants in the supply chain can only connect with downward entities. For example, the manufacturer can communicate with a restaurant, but the restaurant cannot communicate with the manufacturer because it is above the supply chain. Using blockchain for agri-foods supply chain management can be more reliable and efficient because blockchain can link all parts of the food supply chain with a traceable and immutable data system.
If consumer purchases an item from a retailer, and the expiration date of the food product is still safe to consume, but after consuming the food consumer gets sick, the first reaction that the consumer might take would be to contact the retailer. After that, the retailer might ask a local regulator to check the case because the local regulator is a central controller. The central controller needs to trace the origin of an issue, which can be difficult and time-consuming because of many participants and because there is no single entity with all of the information. Therefore, tracing the origin of an issue in current supply chains may be time-consuming, complex, inefficient, and sometimes inconclusive. Because of this, many food safety issues are usually ignored. Blockchain technology can help address the problems by leveraging decentralized communication. All participants are connected in the blockchain system, and the communication is interactive and bidirectional. Every participant can be considered as a node, and every node has access to all information on the blockchain. Using blockchain, the consumer does not need a middleman (regulator) to find the source of an issue, and he can track all the information on the purchased item through the entire supply chain. The advantage of agri-food supply chain management is the reliability of the data maintained on the blockchain. The advantage is in the data-sharing system that the regulators can utilize to access information for regulators.

Data Traceability
Blockchain can track digital data for food items passed through different food supply chain participants-farmers, food processors, packers, and distributors. Supply chain managers can easily track everything remotely in a ledger using blockchain. Traditional methods rely on information supervision centers to transfer and share information, unlike blockchain, where all the information stored is provided by first-hand sources such as farms, markets, warehouses, etc. Data acquisition is the first step in creating data traceability. Several approaches can be used for data acquisition-sensors, cameras, etc. For example, the farm location, soil, and fertilizer information can be recorded and stored on the blockchain. The data during packing can be added to the blockchain. For manufacturing facilities, cameras can be used to monitor the process, and data such as temperature, time, and humidity recorded by sensors can be used and stored on the blockchain. Food products can be tracked throughout each supply chain step using smart tags or QR (Quick Response) codes. Each item can have a unique ID (Identification) stored in the QR code, which will be recognized on the blockchain. The devices can scan the QR code and get all the information about the product.

Food Safety and Quality Monitoring
Blockchain technology provides an information platform for real-time food tracing systems to enable all the supply chain members to access the same information for a particular product, providing openness, transparency, neutrality, reliability, and security to food supply chains. Furthermore, the data stored on the blockchain can be monitored for food safety and quality. Food safety is essential to prevent contamination and food pathogen outbreaks, which may have a global impact. Other safety issues are sanitation procedures, pathogen processing, storage conditions, etc. Suppose all the information about the origin and handling of the products can be tracked and monitored by the blockchain. In that case, food safety risks can be significantly reduced, improving the safety of agrifoods.

Walmart Example
In 2016, Walmart established Food Safety Center in Beijing and used IBM's blockchain solution. As a result, two pilots have been established: mango slices and fresh-cut pork products. The system for pork traceability implemented in China has been validated using fresh-cut pork products, summarized as: 1. Tracking factor identification-the first step is identifying factors for traceability, which is the critical point for the HACCP (Hazard Analysis Critical Control Points) system. 2. Training-a special training program for employees in the pork pilot plant, used to teach employees how to use the app or portable devices for data uploading, scanning, collecting, etc. 3. Pork processing-when pigs are processed, inspection information is collected. Then, pigs are cut into different parts and pre-packed into various products. 4. ID creation-For each item, ID (Identification) is created. ID is linked with product information such as production date and time, location, source, inspection data, etc. Each item has a different ID and QR code. 5. First blockchain connection-when products are processed and ready to be shipped, ID and QR code is recorded and linked with a vehicle of transportation. In this case, the origin of the source of the product is registered. 6. Second blockchain connection-when a product is delivered to a grocery store, the location of the receiving store will be recorded automatically by GPS (Global Positioning System), which will store data to blockchain such as the number of items delivered, and delivery time, etc. 7. Selling and storage: delivered products are put in the storage rooms and labeled for price. QR code is attached to every item, so consumers can scan and access all data for that product stored on the blockchain.

SAFE Platform
The SAFE platform is a knowledge-based system that guides the user through the certification process according to the specifications of each user. The platform enables all the necessary data to be ready for checking, validation, and verification by an accredited control certification organization. The relevant Ministry gives accreditations and authorizes certification organizations to work. In most cases, the control organization will not need to guide the client, and the field inspection or related activities will be minimized.
The SAFE platform consists of the SAFE service, the Sensor layer, the Database (DB) layer, and the User Interface (UI) layer. The SAFE platform architecture is shown in Figure  1. Communication between layers is based on a special interface-Service. Service has methods exposed to sensors and the external world with RESTful API. The Service methods exchange data between the SAFE service, the DB layer, and the Sensor layer.

Sensor Layer
The Sensor layer represents smart meters located on the ground or anywhere where the procedure for organic certifications is required. Smart meters send data to the SAFE platform. What kind of data will be collected depends on the organic certification process. The SAFE platform supports many different IoT sensors used in agricultural production. Air quality sensors measure air parameters such as air temperature and humidity, the concentration of particles and gases in the air that can affect the quality of cultivated plants, and the health of farm animals. Soil quality sensors measure soil temperature, moisture, and concentrations of chemical elements and can detect excessive use of chemical agents. Water quality sensors can determine water quality so that water of sufficient quality is used for irrigating land and feeding livestock. Light sensors measure whether plants and farm animals are getting enough light. GPS sensors are combined with other sensors to provide insight into the exact location of parameter measurements or to monitor the movement of animals during breeding on farms. For example, they check whether livestock moved through certified organic pastures during grazing. The measured values of the parameters are sent by the sensors directly to the SAFE platform. These sensors can be placed in the fields and buildings on farms (greenhouses, pens, barns). Sensors deployed in the fields require their own power sources, such as battery power or power through solar panels. Sensors installed in farm facilities can have their own power supply or use existing farm infrastructure. Only authorized people from the SAFE platform will install new sensors on the field at the client location and register them on the SAFE platform. The administrator UI side has an option for getting sensor settings and editing them, sending new settings to the sensor in the field. The SAFE platform tests received values from sensors with the prescribed norms for organic production. In addition, the platform is expected to communicate with document management systems where records of purchases, forms of applied technology, grazing, harvesting, storage, transportation, etc., are used. All records are permanent and cannot be deleted or edited, which is made possible by using blockchain technology. Multiple verification points enable entirely provable trust among all stakeholders (participants in the certification process).
Sensor APIs (Application Programming Interface) is responsible for sensor communication. Sensor APIs send control data for sensors and receive data that sensors measure. Communication between SAFE service and the Sensor layer is shown in Figure 2. The Sensor APIs are responsible for storing sensor data in the off-chain database. For example, when new data is received, the Organic Validation Process (OVP) will be notified to check whether new data meet validation criteria and should be stored in the blockchain. Sensor APIs use three methods:  Figure 3 shows a block diagram of changing sensor settings. Parameters for changing sensor settings are: • AdminToken (String)-Authentication for admin; • SensorID (String)-ID of the sensor; • SensorSettings (Map < String, String >)-New sensor settings. 3. ReceiveSensorData-This endpoint is used to receive data from a sensor. After receiving data from the sensor, OVP stores the data in the off-chain database and decides on storing the data in the blockchain. Figure 4 shows a block diagram of the receiving data from the sensor. Parameters for receiving sensor data are:

SAFE Service
The SAFE service represents the core of the infrastructure of the SAFE platform. This layer is the central part of the SAFE platform that handles all the requests and communicates with the database and the blockchain to store data. The database and the blockchain are part of the Database layer (DB layer). Moreover, the SAFE service communicates with the User Interface layer (UI layer) and the Sensor layers. From the Sensor layer, the SAFE service gathers sensor data for storage. Finally, the SAFE service obtains requests and sends data to end-users via the UI layer.
The SAFE service does the following operations: The main goal for the SAFE service is to handle many requests that will come from sensors and users' external sources and communicate those requests with the DB layer. The SAFE service is designed to be scalable, replicable, fault-resistant, and optimized with high availability and high performance to handle all the requests. The architecture of the SAFE service is service-based, meaning that it consists of APIs used for communication with the Sensors, the UI, and the DB layers. The SAFE service handles security and authentication for the Sensor and UI layers. The UI and the sensors send each request which must be secured with HTTPS/SSL (HyperText Transfer Protocol/Secure Sockets Layer) and authenticated. The communication between sensors and The SAFE service will transform all data that come and check whether data need to be stored in the blockchain or offchain database. SAFE service uses TCP/IP and UDP protocols for communication with databases. The design of the SAFE service is generic so that it can accept connections from any platform/device/database. The SAFE service's hardware is located and executed in a container in the cloud. The App Service Container on the MS Azure platform was used.
The Organic Validation Process (OVP) is a core logic part of the organic certification procedure and represents a very important segment of the SAFE service. OVP handles all actions for tasks and the validation of data that needs to be stored on the blockchain. The main functions of OVP are: 1. Validation Data from Sensor-Data collected from the sensor need to be validated before storing on the blockchain. A predefined set of values for each process task and each type of sensor must be met to validate the process. Each data collection from sensor data will be compared to predefined values to check if it is valid for the process task, and then data can be stored on the blockchain. Figure 5 shows a block diagram of the validation of sensor data. 2. Validation Data from Manual Entry-Data from the user that is updated manually will be validated by SAFE platform-certified professionals. Professionals will have their user interface with process tasks that they can analyze and validate. When they validate the process task, OVP will prepare and transform data for blockchain, store it on the blockchain and update the process task in the database. Figure 6 shows a block diagram of the validation data from manual entry. 3. Creation of Process Tasks for a New Process-When the user creates a new process, OVP will prepare and attach process tasks for that process depending on the process type. Moreover, OVP will initially store a new process on the blockchain to create a new entry for validating tasks in the next steps. Figure 7 shows a block diagram of the creation of a process task for a new process. For blockchain implementation, the Semantic Ledger enabler is used [54]. Within the SAFE platform, there are administrator functions to create a set of rules for the Semantic Ledger, which will be used for validating data that are being stored. Storing data on Semantic Ledger is shown in Figure 8. When accessing the data from the Semantic Ledger, data are being validated by the Semantic Ledger Validator, and users can verify compliance with the specified rules, which is the main goal. Getting data from Semantic Ledger is shown in Figure 9.

DB Layer
The DB layer is the storage layer of the platform. It consists of the Semantic Ledger blockchain and the Off-chain database-MongoDB. The DB layer can have many databases. However, all databases are linked to the SAFE service. Therefore, databases are not communicating directly, only through the SAFE service. Communication between the SAFE service and the DB layer is shown in Figure 10. The workflow of data in the SAFE platform is shown in Figure 11. This data workflow is designed to fulfill all demands from the SAFE platform architecture. Short descriptions of the workflow states are the following.
"Users"-this contains all necessary data about registered users. The basic functionalities for each user have been implemented: registration of the user on the SAFE platform, login of the user to the SAFE platform, log out of the user from the SAFE platform, and deletion of the user from the SAFE platform.
"Roles"-contains information about users' roles within the platform. Depending on the role within the SAFE platform, users are provided with additional functionalities. The SAFE platform has three user roles: Company, Validator, and Administrator. The Company uses the SAFE platform to track the progress in obtaining a certificate for organic food production. Additional functionalities for this role are adding new processes, adding new process flows, adding the answers to tasks for process flows, adding attachments for tasks on process flow, viewing all its processes, and viewing all of its processes' flows. The Validator gives their expert opinion on the validity of the data submitted by the Company over the SAFE platform. Additional functionalities for this role are viewing assigned process flows, viewing assigned processes, adding a comment on a task for process flow, and verifying a task for a process flow. Finally, the Administrator enables maintenance of the SAFE platform by changing functional parameters. Additional functionalities for this role are adding a new Validator, assigning the Validator for processes, adding a new process type, editing process type, adding a new task, editing task, adding a new sensor, editing sensor, adding sensor tasks, editing sensor tasks, viewing all registered Companies, viewing all sensors, viewing all sensor tasks, viewing all Validators, viewing all process flows, viewing all processes, and viewing all process types.
"UserRoles"-contains information on the roles assigned to each user. One user can have multiple roles.
"Companies"-represents all registered companies on the SAFE platform.
"UserCompanies"-contains information about the connections between the users and the companies.
"Tasks"-contains all the questions and tasks for all certification processes in one table and flags to describe if it needs only an answer or needs a comment and/or attachment as proof.
"WorkFlows"-contains workflow Id, Name, and Status for specific certification processes.
"WorkFlowTasks"-represents which questions need to be answered in a workflow to be certified. If the workflow needs to change, tasks are added or deleted from the workflow, but there is a constraint for WorkFlowId and TaskId combination to be unique in the table.
"Processes"-contains individual processes that represent a workflow. There can be more processes for the same company when each represents a different workflow. There can also be more processes with the same workflow for various companies, but the Work-FlowId and CompanyId combination must be unique. For example, when a company selects a workflow to be certified, a new process will be created. The process may need to be certified periodically, so there can be more process flows for the same process.
"ProcessFlows"-are generated when a user creates a new flow to be certified by selecting a specific process. ProcessFlows contains information about process/workflow, status, and verification date.
"ProcessFlowTasks"-contains all the questions related to process/workflow generated with the default (negative) answers on a new flow creation. Then, the user starts the certification process by changing the answers and giving proof.
"ProcessAttachments"-contains all the documents attached as proof for each answer in the process flow. "ProcessStatuses"-contains possible states of the process flow tasks and the whole Process flow, e.g., there are four possible states of the process flow tasks. State "Created" means that the user is still making changes, and the process flow task has not yet been sent for verification. State "NotConfirmed" means waiting for process flow task verification. State "Verified" means that all data are validated. Finally, the state "Denied" means proofs and improvements for process flow task verification are needed.
All tables contain columns CreatedBy, CreatedTime, LastModifiedBy, LastModified-Time, and Log tables, and triggers should be created for each of them for tracking changes. Figure 11. Data workflow of SAFE platform.

UI Layer
UI layer with APIs is responsible for communicating with end-users and serving enduser requests. Figure 12 shows communication between the SAFE service and the UI layer.

Figure 12. Communication between SAFE service and UI layer.
UI APIs use eight following methods: 1. UserLogin-this method is used for authentication and authorization for users. 2. CreateUser (only for Administrator)-this endpoint is for the Administrator to create a new user on the SAFE platform. The administrator assigns a role to the new user who can be the Company (a role for clients) and the Validator (a role for professionals). The administrator will input basic details about the user, and the user will receive an email with information about his profile and login info. 3. MyProcesses-this method is used for fetching all processes for certification created by the user during the Organic Validation Process (OVP). 4. MyProcessById-this method is used to fetch the user-process by ID. The user calls this endpoint to view details about his process and take action. The process can be in one of four states. State "Created" means that the user is still making changes, and the process has not yet been sent for verification. State "NotConfirmed" means waiting for process verification. State "Verified" means that all data are validated. Finally, state "Denied" means proofs and process verification improvements are needed. 5. CreateNewProcess is used for the user to create a new process for organic certification. The user will enter basic information about the process when making it. When the user creates a new process, OVP will assign process tasks for that process depending on the process type. Tasks are to be completed and validated systematically, meaning the user needs to complete the previous task before starting the next one. Some process tasks are automatized, and data are fetched from sensors. For those processes' tasks, the user does not need to update info. The info will be updated from sensors when criteria are met and data are validated. Figure 13 shows a block diagram for creating a new organic certification process. 1. ProcessTaskById is used to fetch the same process task by id so the user can take action on that task and submit information. 2. UpdateProcessTask is used for the user to update process tasks and complete them.
The user cannot update some tasks. Those tasks are updated when sensors send data to the SAFE platform. The user will provide information from the UI side for the process task. The process task can be in one of four states. State "Created" means that the user is still making changes and processing tasks that have not yet been sent for verification. State "NotConfirmed" means waiting for process task verification. State "Verified" means that all data are validated. State "Denied" means proofs and necessary improvements for process task verification. Figure 14 shows a block diagram of updating process task for organic certification. 3. ValidateProcessTask is used by certified validators who analyze data submitted by users to validate them before the user can receive certification. The Validator will manually validate data that the user submitted manually. Automated data from sensors is validated automatically when criteria are met. The Validator has its UI with a list of pending process tasks for validation. Figure 15 shows a block diagram of process task validation for organic certification. The Model View Controller (MVC) design pattern was used to implement the user interface. The interface is implemented in the ASP.NET framework within the Microsoft Visual Studio development environment. The hardware on which the UI interface is located and executed is a container in the cloud. The App Service Container on the MS Azure platform was used. The SAFE platform is designed to be scalable, and there is no limit on the number of system users. Depending on the current number of users accessing the SAFE platform and the required speed of data flow, it is possible to automatically occupy additional resources on the cloud to meet all users' demands.

Experimental System
The experimental system was implemented to test the proposed SAFE platform architecture concept. As part of the experimental system, users of the SAFE platform have access to the SAFE Web and mobile applications. These applications enable users to interact with the platform, providing easy access to all relevant data in the certification process. For example, online users can view data from installed sensors or access the history of collected data. Moreover, users can access all saved documents that enable and confirm the completion of the certification process. Knowing that each user can create an environment adapted to the certification process's specifics is essential. Every user must register on the platform and go through validation to use the SAFE platform. After registration, users can use only assigned services for a specific role of users (Company, Validator, or Administrator). Therefore, every type of user has its user interface on the SAFE platform. The example of the first page of the Company user interface is shown in Figure 16. The Company uses the SAFE platform to track the progress in obtaining a certificate for organic food production. The first step in using the SAFE platform for the Company is to select a certification process type. This action is performed by pressing the command Processes on the toolbar for this kind of user (see Figure 17). The Company can select several certification processes simultaneously, such as verifying the process for the certification of organic milk production, organic meat production, organic fruit production, etc. After choosing the certification process type, the Company is guided step by step on fulfilling the requirements of the selected certification process. The Company needs to give answers or/and upload documents in each stage. These actions are performed through the toolbar command "Process flows" (see Figure 17).
The Validator's main objective is to give their expert opinions on the validity of the data submitted by the company over the SAFE platform. The Validator user interface is similar to the Company interface. These actions are performed through the commands on the toolbar "Process flows," where the Validator can access all assigned certification processes. By pressing the command "Processes" on the toolbar, the Validator can see which certification process types are assigned according to its expert knowledge. For each certification process, it is necessary to gather competent expert knowledge of top experts (agronomists) on at least three sides from a specific scientific and professional field within organic production. A knowledge base will be formed based on the collected and integrated expertise for each certification process. Knowledge bases are set up within the database layer to be used by the inference mechanism. Together with the data collected within the Sensor layer, and based on the knowledge base thus formed, its validation will be performed. The main objective for the administrator is to enable maintenance of the SAFE platform. These actions are performed by changing functional parameters through the commands on the toolbar: Process flows, Processes, Process Types, Tasks, Sensors, Sensor tasks, Companies, and Validators (see Figure 18). By pressing the command Process Types on the toolbar, the Administrator can add/remove/edit data about Process Types on the SAFE platform. Through commands, Process flows, Processes, and Tasks, the Administrator can see currently active processes and process flows and assign Validators to currently active organic production verification processes. By pressing the command Validators on the toolbar, the Administrator can add/remove/edit data about Validators on the SAFE platform. By pressing the command Companies on the toolbar, the Administrator can add/remove/edit data about Companies on the SAFE platform. By pressing the command Sensors task on the toolbar, the Administrator can add/remove/edit data about tasks (temperature, humidity, % of soil nitrogen, etc.) assigned to the sensor on the SAFE platform.

Discussion
The SAFE platform's target market is customers oriented toward organic production. The SAFE platform customers are divided into four segments, as shown in Table 2. holdings in the EU, two-thirds less than 5 ha in size. Around 4.2% of the agricultural holdings in the EU are entirely organic. The total area under organic farming in the EU continues to increase, and in 2019 covered almost 13.8 million hectares of agricultural land, corresponding to 8.5% of the total utilized agricultural area (Source: Eurostat). This trend will continue in the future, so at least 1 million agricultural holdings can be expected to be the overall market potential for the EU market. Our competitors do not have a similar platform, but some applications can also be useful in organic certification. Some of our competitors' ICT (Information and Communications Technology) solutions are applications such as: 1. AgriChain-A blockchain company focusing on enabling peer-to-peer agricultural transactions and processing while cutting out the mediators; 2. AgriDigital-The platform helps to process complex agricultural transactions through smart contracts; 3. GrainChain-provides a blockchain software platform to enable more fluid transactions for grain. In addition, the platform connects suppliers and farmers, reducing inventory management friction; 4. ZhongAn-A blockchain-based system that tracks individual chickens from farm to consumer using IoT.
Only SAFE platform specializes in organic certification compared to these competitors. Besides competitors with ICT solutions, our competitors are certifying agencies that, in most cases, use a face-to-face approach. In this situation, farmers must wait until validators from the agency contact them to acquire documents for each step-in certification. This is a time-consuming process that can last several months, even years. Moreover, farmers do not know the status of fulfilled requirements for organic certification. The SAFE platform solves these problems because it speeds up the organic production certification process and enables the traceability of the organic production certification process.
After realizing the software, we paid special attention to testing and surveying the users of the SAFE platform. We interviewed 18 representative samples of a farmer (Company-type client) and three experts (Validator-type client). Farmers were divided into three groups, depending on the size of income in the previous year. In the first group, were farmers with incomes up to € 70,000 per year. The second group was farmers with an income of up to € 200,000 per year. Finally, in the third group were farmers with an income of over € 200,000 per year. The most important survey questions for farmers and validators were: 1. Is the user interface of the SAFE platform sufficiently understandable and intuitive? 2. Were the Validators' answers clear enough, thus enabling continuing certification process over the SAFE platform? 3. Are you satisfied with the response time for which the validator gives a commentresponse to the entered data and/or uploaded document? 4. Are the instructions for each step in the verification process for organic production clear enough? 5. On a scale from 0-10, how likely are you to recommend the SAFE platform to a friend?
Based on the obtained data and analysis, we obtained the following conclusions and did the following: 1. The user interface of the SAFE platform is satisfactory, and there was no need to change anything in the interface. 2. Validators' answers were clear enough in most cases. However, it was recommended that the validator asks for confirmation that their answer was clear enough in more complex steps. 3. The validator's response time was satisfactory for most farmers. However, a time limit was afterward defined; thus, it was specified that the validator must respond within 48 h.
4. The instructions for most of the steps in the process were clear enough. However, minor changes have been made according to farmers' and validators' suggestions. 5. A total of 89% of answers were scored 9-10 (promoters), while 11% of answers were scored 7-8 (passive).
The validators' most crucial question was whether all the certification process steps were appropriate for the certification process and whether any changes should be made. The answers were that all questions were relevant and in the correct order. Therefore, based on the feedback received from the surveyed clients and the changes made, it can be concluded that improvement of the quality of the SAFE platform was accomplished. Figure 19 shows statistical data of the survey in the form of histograms. Figure 19. Statistical data of the survey.

Conclusions
This paper presents the SAFE platform based on sensory and realistically collected field data necessary for producers to implement organic production certification and harmonize with current legislation for organic agricultural production. The SAFE platform significantly impacts the scientific community, development of organic agriculture and processing industry, export promotion, creation of new markets, preservation of the environment and biodiversity, and consumer society.
The novelty of the SAFE platform is the reduction of the time necessary for activities related to the organic certification process, as well as the application of blockchain technology, which enables the recording of all changes made during the certification process and thus guarantees the validity of the issued certificate. The time needed for the organic certification process differs depending on the certification type. The organic certification process can last for several months, even years. With the SAFE platform, farmers can reduce the time needed for fulfilling all requirements in each step during the certification procedure. In the case of issuing a certificate for organic milk production, the average time saving was determined to be 18%. Suppose the farmer wants to certify several types of organic productions with the SAFE platform. These savings could be even greater. For example, besides organic milk production, farmers can certify organic production of cheese, meat, etc. In that case, further speed up certification processes will be achieved using part of the already obtained and validated documentation used in organic milk production certification. Every document related to the certification procedure is uploaded to the SAFE platform and a validator is recorded with the additional usage of blockchain technology. In this way, the SAFE platform enables the traceability of the organic production certification process, which is also a novelty in organic production certification procedures.
Potential beneficiaries of this innovative solution are primarily agricultural producers (theoretically around 500,000), control certification companies whose number fluctuates (many lose their licenses and accreditation), insurance companies and banks in the field of agriculture, investors, suppliers of equipment and services in agriculture, consulting companies, producers and suppliers of raw materials, export companies and others. All of the above will cause an increase in the number of producers, an increase in land area under the OP, and all other stakeholders in the field of organic agriculture.
Increasing market demand will increase the number of producers who will more easily and quickly decide to start organic production, i.e., increasing the current production capacity. The consequence of this development trend is reflected in the rapid opening of new domestic and foreign markets. Furthermore, such applied technology and platform will influence foreign markets with complicated and demanding import procedures (special quality standards). Therefore, the offered solution would greatly facilitate export procedures.
Given that the proposed solution stimulates the development and improvement of agricultural production by organic production methods and following agri-environmental principles, the accompanying effect of increasing capacity in the OP will result in reducing the use of fertilizers, antibiotics, pharmacological agents, pesticides, GMOs, aggressive hygiene products, equipment, animals, etc. The overall effect will reduce adverse environmental impacts (land, water, and air). The accompanying consequences of all cumulative will improve human and animal health, partly through OP and partly through products of organic origin.
Today, many plant and animal species face a high percentage of extinction due to unwanted climate change, environmental pollution, habitat loss, etc. Therefore, improving and increasing the capacity for dealing with organic production will balance the processes of circulation of matter and energy in agriculture in the biological sense in terms of acceptable and long-term sustainable development.
We have developed, tested, and made some corrections to fine-tune the SAFE platform. Moreover, we generated the first sales after the demo period. Our plans for the SAFE platform are divided into three phases in the forthcoming period. The first phase focuses on the technical improvements of the SAFE platform. The first step in this phase is to expand the SAFE platform so that there is a possibility to select the country where the organic certification process will be conducted. Currently, multilingualism is built-in, but it does not mean that the chosen language is related to the county where the organic certification process should be performed. Although the standards for organic production have been harmonized at the EU level, there are specific differences for each EU member country. The second phase aims to increase the number of validators to have a sufficient number for each type of organic certification process and for each country where the SAFE platform is used. The third phase aims to increase the number of certification process types that can be used on the SAFE platform, and continuous modification of existing certification processes will be conducted in accordance with changes in the standards.
After the third phase, we expect an increase in the number of "Company" type users, which will lead to an increased number of certified organic production processes, and thus directly affect the reduction of usage of pesticides, fertilizers, and other chemical products, and indirectly affect reducing adverse environmental impacts.