# On Blockchain-Based Cross-Service Communication and Resource Orchestration on Edge Clouds
## 4 Network Service Marketplace Operations
### Service Data Store-Blockchain Functionality  
As above mentioned, we leverage Blockchain technology and smart contracts to support the network service lifecycle of the NSM and use the distributed ledger as the NSM data store, while ensuring trust, security, authenticity, integrity and immutability. In this subsection, we focus on the data stored in the data store. The data store is one of the most important components of the marketplace as it facilitates the service advertisement, leasing and orchestration functions of the marketplace. The stored information on the distributed ledger contains data both for service advertisement and discovery, and cross-service orchestration. The data required for the orchestration operations are fully aligned with the ETSI-NFV standard and refer to information about Network Slices and Services linking to information also stored in OSM database. Delving into more details, Listing 2 illustrates the structure and format of the stored data. Initially, the **Network Slice** object refers to the set of virtualized computing and network resources required to deploy an application. The _ID_ and _Name_ attributes refer to the Network Slice Template descriptor of the slice as described by ETSI-NFV, and the _Tenant_ attribute points to the object stored in the ledger that contains all information about the slice owner. Figure 2: Register Lease Smart Contract Function. The **Service** object refers to the advertised network services for lease in the marketplace. As it is shown in Listing 2, it contains the following attributes; _ID, Name, Shortname, Description, NsdName and Provider_. The attributes of _Name, Shortname_ and _Description_ are used solely for advertisement and discovery purposes and contain information and functionality description of the service for lease. The attributes of _ID, NsdName_ and _Provider_ are used for orchestration, management and billing operations. In particular, the _NsdName_ argument indicates the name of the service's Network Slice descriptor that contains all information and descriptions for the slice deployment. The _ID_ attribute indicates the unique identifier of the service's Network Slice instance. The _Provider_ attribute points to a Network Slice object in the ledger that contains the information of the Network Slice of the provider and the tenant to which it belongs. ```
//NetworkSlicedatastructdef typeNetworkSlicestruct { ObjectTypestring'json:\"docType\" IDstring'json:\"id\" Namestring'json:\"name\"  TenantTenant'json:\"tenant\" } //Servicedatastructdef typeServicestruct { ObjectTypestring'json:\"docType\" IDstring'json:\"id\" Namestring'json:\"name\" ShortNamestring'json:\"short_name\" Descriptionstring'json:\"description\" NsdNamestring'json:\"nsd_name\" Providerstring'json:\"provider\" } //Leasedatastructdef typeLeasestruct { ObjectTypestring'json:\"docType\" Gramtorstring'json:\"gramtor\" Recipientstring'json:\"recipient\" Servicestring'json:\"service\" Issueint32'json:\"issue\" Expiryint32'json:\"epripy\" Revokers[]string'json:\"revokers\" }
```  
Listing 2: Data store formats. Finally, the **Lease** object contains the stored information in the distributed ledger whenever a lease is granted. The _Grantor_ and _Recipient_ attributes refer to the Network Slice descriptors of the Provider and the Consumer respectively for orchestration purposes. The _Service_ argument contains the ID of the service to be leased as described above, while the _Issue_ and _Expiry_ attributes indicate the duration of the granted lease. Lastly, the _Revokers_ attribute is an array containing the identities of the users or entities that can revoke the lease. Regarding the **Network Slice** and **Service** objects, we aim at maintaining only the essential information for orchestration in the ledger for the following two reasons. Initially, preserving the users' data privacy is one of the top priorities of the NSM.