# Leveraging Blockchain Technology for Secure 5G Offloading Processes +
## 3 Blockchain-Based Secure 5G Offloading Mechanism
### Blockchain for a Secure Marketplace
#### 3.1.2 Data Models and Operations
The marketplace emits a Blockchain event confirming that the process has been successfully completed and indicating the following information:
* The identifier of the consumption request the answer refers to;
* The identifier of the primary operator making the request;
* The identifiers of the selected secondary operator and service;
* The identifier of the UE whose required resources will be offloaded;
* A list with the minimum requirements specified in the request by the primary operator;
* A list of the actual values provided by the selected secondary operator and service for the defined requirements;
* The price of the offloading process for the selected secondary operator and service. This event will be received by the primary and secondary selected operators to indicate that they should proceed with the offloading process according to Figure 2.  
As mentioned before, this process could be extended at any point with external services. In these cases, as already explained, events must be emitted in order for the oracles to get the required external information. In addition, new methods need to be defined in the marketplace smart contracts in order for the oracles to share the external information with the marketplace smart contract. Each external service consideration requires a different event definition and a new method in the smart contract. For example, let us consider the case in which some external feedback or ratings about the different operators is considered for the most suitable service selection instead of the minimum price. For this example, step 4 should be updated as follows:  
* The marketplace sends a new Blockchain event with the information (identifier) about the operators of the suitable identified services after the three previous steps. * The oracle receives the event, processes it and extracts the list of operators identifiers whose rating values are needed. It also makes a request to the external service with the list of operators. * The external service operation happens and, as a result, the rating value for each operator in the list is obtained and sent back to the oracle as response. * The oracle processes the received information and creates and signs the suitable transaction to invoke the new method to update the rating internal information to be considered by the marketplace most suitable service selection. * The new method in the marketplace smart contract will be executed providing as a result the most suitable service in terms of associated operator rating values. * Step 5 is then executed in the same way as explained, resulting in a Blockchain event to notify the primary and secondary selected operators. The process needs to be repeated for each external service, creating a new Blockchain event and a new associated method in the marketplace smart contract. This event-driven approach ensures flexibility, allowing service consumption to continue asynchronously even if certain oracle components experience temporary unavailability.