Smarter and resilient smart contracts applications for smart cities environment using blockchain technology

Our daily activities revolve around various technologies, the smart city technologies and the services they offer have all influenced modern living conditions. The purpose of a smart city is to enhance people's quality of life and provide possibilities to address social and environmental issues. As a developing technology, blockchain is beneficial for enhancing smart city services including food tracking, supply-demand matching, the security of connected cars, and regulatory compliance. We propose a new framework for describing how blockchain technology is used in smart contracts to improve security, dependability, and many other positive outcomes in a smart city environment. We propose smarter and resilient smart contracts using blockchain technology to manage real estate information. We propose a framework with tamperproof functionality to store the data and retrieve the data. Smart contract mathematical computations like overhead rate, execution time, mean computational cost, standard deviation, throughput, and resource utilization are evaluated and the results are compared. This paper focuses on real-world rental file management scenarios to demonstrate the benefits of blockchain technology and how it is used to address the issues that currently exist in developing smart contracts and services while exchanging real land and other properties in a smart city environment.


Introduction
We all are now experiencing an atmosphere of pure technology in which everything around us has emerged as future application using Industry4.0started to change and increasingly transform into a technological trend [1].Urbanization, public administration and other sectors of life are based on technological environments with different characteristics and applications.Due to urbanization and modernization people are accepting new technologies that have gone through different stages in our life from using remote controls to control various smart home appliances to handle all events.Recent technologies like Internet of Things and Virtual Reality and the have gained thrust over the last decade and are now being added to blockchain technology to provide security over the network [2].
Smart Contracts [3] are used for verifying, digitally facilitating or negotiating legal contracts to avoid intermediates over a decentralized platform, smart contracts is a computerized protocol.Blockchain uses powerful smart contracts to negotiate different people over the decentralized platforms this technology can be used for more safe financial transactions.Advantages of smart contracts are immutable and distributed, with this feature no one able to modify the fixed contract and the contract is added to the public ledger, all the participating party are able to validate the contracts, participating party cannot claim later that the contract has not been activated and not verified.
A smart contract has the time restrictions that could impose deadlines on the contract and it has blockchain security coding.It maintains the data and permissions expressed in code which requires to occur in a specific order to result in the agreement of the terms specified therein.Smart contracts are embedded in blockchain [4], each smart contract on the blockchain has a unique specification as the smart contract in question uses basic criteria such as verifying that the transferred value actually exists in the sender's account.A shared agreement between two or more parties is known as a smart contract.Information is stored, processed, and outputs are written to the function which is predefined one.Smart contract uses constructor to enable the contract, constructor function is enabled to host a new contract, self-destructor function is also defined to destruct the smart contract, the user who own a contract can only allowed to destruct the function.A Smart contract its similar to class consist of instance variable to refer state of the related fields through the events and operations to be performed.Methods in smart contracts will change the state variables, there are two different types of constant and writable states like the state functions are two types read only and write functions [5].
Several platforms provide exceptional features for creating smart contracts like contract code execution.These have allowed the creation of smart contracts through particular programming languages.The Bitcoin is used to lever transactions involving cryptocurrencies with a relatively limited capacity for computation.Bitcoin [6] platforms employ a bytecode scripting language that uses stacks.The capacity for Utilizing Bitcoin to design a smart contract with high complex logic, Major alterations would be finished to the mining processes with the incentive programmes to propose intelligent proper contracts on the blockchain.The open-source blockchain platform NXT [7] uses a proof-of-stake consensus mechanism.These platforms support templates for creating smart contracts and doesn't allow new contracts to deploy.The main objectives of the paper are The decentralized procedure is used to reduce the overheads and minimizing the expensive intermediaries through the proposed Blockchain-based land register system.The proposed framework has provided the distributed environment of land record which are stored in the network while the updated data has been connected with the Blockchain technology.The smarter and resilient smart contracts for land registry record in smart cities environment through the Blockchain technique has provided the solution for a critical problem of land registry.

Literature survey
The smart contracts which are subjected to the current traceability rules and processes which is intended for agro-food supply chains which has the blockchain technology for managing the F2F framework that has been utilized by the European Union [8].The smart contracts with the multi-agent system to model Supply chain in blockchain which manages to track and coordinate the food supply chain model [9].The study delves into the enablers of blockchain implementation, considering perspectives from technology, organization, supply chain, and the external environment.The smart containers [10] in a blockchain for efficient supply chain management, the proposed smart contracts to manage payment automation, recipient verification, verifying user and refund initiation for violations of predefined terms [11].QuarkChain framework [12] has been utilized the blockchain-based interoperability model with reputation-enabled Proof-of Authority framework to address the issues related with the supply chain management.A blockchain-enabled traceability framework [13] has been enabled with highly clear, and tamper-proof traceability information as well as automatic regulatory compliance verification and adaptation for traceability situations involving imported products.CAIPY [14] is a smart contractenabled bionetwork that enables considerable cost savings for insurance claims while maintaining the simplicity and transparency of current processes.DAPP [15] is a decentralized daily information sharing app based on smart contracts, users can register and be involvement without revealing of personal data.The Data trading approach [16] which uses smart contract provides solution using Machine Learning enabled Blockchain framework.The Mobile payment structure has been framed using smart contract based on sturdy certificate-less signatures [17].Ethereum [18] is a public platform of blockchain which manages the users for deploying the smart contracts while the computational resource utilization of every execution has been evaluated through the Ether crypto currency.Hyperledger [19] a product of Linux foundation and it's an open source blockchain for managing the crypto currency.NEM [20] enables asset definition which maps realistic industrial instruments.It's an enterprise blockchain platform.R3 Corda [21] designed for the industrial integration, it has privacy features and it is a scalable blockchain platform.Stellar [22] is a platform for multicurrency payments that is effective in terms of how much processing power it uses.Waves [23] enables the users of bitcoin wallets to top up their balances in US dollars, a platform for dollar payments has been created.Fork of Ethereum called Ethereum Classic [24] allows for cheaper transactions.It is an enhanced form of Ethereum.Tezos [25] is a self-updating crypto ledger that uses two different sorts of accounts -implicit and originated -as well as native cryptocurrency.The originated accounts are linked to the smart contracts.NEO [26] is used for digitize the assets intended to create smart economy.Plutus is a new programming language used in Cardano [27] to develop new smart contract.EOS [28] was built primarily with the goal of creating decentralized apps that are both horizontally and vertically scalable.EOS has addressed a number of issues, such as governance, parallel processing, and enhanced usability.The decentralized data availability in a common position could be managed for providing the users to avail the specific services.The Blockchain data of the land registry system will make the workflow framework of the registration system as the verification purpose for the people, it will help the property chain right from the people.While implementing the selling and buying properties, the Blockchain enabled smart contracts provide the events having tracked in a sequential way and an online procedure has been followed [29].

Proposed work
The decentralized Blockchain-based land register system is proposed in this paper as the architecture enables the overall network security through the decentralization process to reduce the overheads and minimizing the expensive intermediaries.By assuring suitable authentication and validating transactions, the privacy of the stored information is guaranteed.Blockchain has the data immutability as it is very hard to modify data while it has been connected with the blockchain framework.The proposed framework suggested tamperproof functionally to store the data.The blockchainbased land registry methodology has away from the distributed databases of land records that are shared within the network.We propose Smarter and resilient smart contracts for land registry record in smart cities environment using blockchain technology, which is effectively solves a critical problem with the previous system, important three units of land registers are Objects, right and subject Objects is the property, right is associated with the property, subject is the person or property holder.When the property gets changes from one hand to another all-legal documents should be changes from one to another, legal records can always change from one to another and it can be tampered or altered at any time to avoid this we propose smart contract for land registration.In today's scenario of real estate, if a person wants to sell or buy a property he will contact the real estate agent, they will check with land registry records and confirms that the person is the real owner or not. Figure 1 illustrates classical land registration method used nowadays, we propose 3 smart contracts for land registration as follows, using blockchain buyer and seller get connected directly through blockchain platform, property owner can check and verify ownership whether they are eligible to sell property, the bank can check the status of the ownership over the blockchain.The process will remove the third party like brokers involvement, when the seller transforms the ownership to buyer payment automatically transforms from buyers account to sellers account, buyer, seller, bank can verify the contract over the block chain smart contract platform.
The smart contract for Land Registration has been designed with the following parameters: 1. "smart contracts": It holds contracts of varying levels of complexity, indicated by a number prefix in the filename.2. "scripts": scripts used to deploy a contract.3. "tests": file name called "Ballot" contains contract to test contract with unit tests in Solidity.
The "scripts" contains scripts for deploying the "Hold" contract.Any number of contracts can be added by passing Name, arguments in contract arguments, program can be implemented using web3.jsor ethers.jslibraries or any recent blockchain network, contracts can be developed through Solidity file, solidity files should be compiled first after that Script can to run by file explorer by right click on top of the file.The keccak256 standards are followed to complete Registration task in the XDC network.Every transaction is referred by the unique number and this will be used completely different transactions, which has been illustrated in Figure 2.
Contract 1: Property: The property contract has the values of Admin, Status, and Role to indicate that the land registration maintained the Approval and the buyer details as follows: pragma solidity > = 0.7.0 < 0.9.0; /// @title Property /// @dev Store & retrieve value of a property contract Property { address public Admin; enum Status {Not available, Awaiting, Approved, Excluded} enum Role {Visitor, owner, Admin, Buyer } Contract 2: Transfer property: The transfer property has the list of completed transfer details as the property owner can deliver the sender message and the Access control is maintained while the updated completion list is developed through the access control.The Add address functionality with the help of access control has the total list of completed address of transfer property with authentication.pragma solidity > = 0.7.0 < 0.  The method set () has the parameter "uint.""public" is a key that decides who can process this function.The variable "sendermsg" which is invoked when the transaction is initiated by the owner and stores the information about the address, amount of the person of ether XDC tokens.The modifier function is used to modify the values, changing state value of the transaction, view or pure function is used to view or not to change the state of the transaction property related details are stored in Structure here Struct is used to store the details.
struct LandDetail { Status Statenumber; uint256 propertyvalue; address Owner; } The block node can be used to store PropertyId, ownerID, userrole, userid after user verification so that the named can be mapped to land details, below listed functionalities used to track the user details // Stores all properties propertyId (Mapping to Landdetils) public properties; // Keeps track of property owner (Mapping to address) public propertyOwnerChange; // Keeps track of user and their privileges Mapping to user Role) public userpriviledge; // Keeps track of user verification (true / false) (Mapping to Boolean value) public verifiedUsers; Contract 3: Register Contract Land registration contract is generated by the owner using DApp, the Land Registration smart contract handles this process very excellently, it demonstrates the pseudocode representation and functional execution of the register () function, which is used to register Lands in DAPP.It takes input arguments such as current block difficulty, current time, lot number, city, country, state, etc.The current block difficulty is calculated based on the time it takes to process the actual transaction, select or detach a block, or delete a block, it is an integer value.SHA3 algorithm taken all details as inputs, and it produce a spitted large size hexadecimal number.Entire process of generation of hexadecimal number is represented as the unique hexadecimal number is further used to register land and considered as unique id for registered land, it gives the details of pseudocode implementation of the computer Node() function to that implements the contract to add node on the blockchain.
Input: address of the owner (sender message pnumber(plotNo),l(location),district(district), state(state),lmark(landmark),price(sellingprice), AccessList(AL)) 1. AL is the XDC address of all authorized user access list in the contract If PlotNo, Location combination does not exist in the blockchain then 3.
Register the following information to the blockchain: 4.
Revert contract and show an error (PlotNo, Location combination already exists) 7. End If 8. Else 9.
Revert contract and show an error (Sender-Message not authorized) The land registration contract has involved the authentication process as the node list in the specific address of the authorized nodes in the contract while the delivered details is in the list of nodes then calculates the hash value with keccak-256 and saves it into the blockchain otherwise the error message is displayed.
ComputeNode() Input: siteNumber(Pno),location(l), Listofnode(AL),state(s),district(d) 1. AL in the XDC address of authorized nodes in the contract 2. If (sendermessage e AL) then 3. Compute hashvalue using Keccak-256 and store it to the blockchain; 4. else 5. Revert contract state and display error message 6. End The above contract details the process of computing and adding valid node on the block chainSmart contracts reside in XDC blockchain, after compilation Solidity generates bytecode that will be executed by EVM."Gas-Cost."Costsrequired to perform mathematical calculations for smart contracts, each smart contract is processed with.sol.fileextension, Atom, VSCode are Editors that have the high level language.The bytecode and ABI are two objects were generated after the compilation of smart contracts, the smart contract is deployed to the XDC network, this address will consider as the smart contract address.ABI is vital meanwhile it is very difficult to understand the functionality of a smart contract based on bytecode alone.Each account can communicate with the organized smart contract requires this address.The specific account which needs to process a smart contract involves the ABI to hash function and generate EVM bytecode for it.The Sequence diagram for the proposed methodology is demonstrated in Figure 3.
The proposed model is best suitable to buy or sell land details with land registry DApp, it is an alternate to the current land register method.The landowner enters the specifics of the property and the asking price for it in the DApp.The registration process is only validated by the official identified as the validator.Although a government official is involved in the registration process, the complete procedure is tamper-proof and boosts system trust by offering demonstrable audit trails.Every person is identified uniquely by referring the address of smart contract call made by the processor and execute the authenticated access to contract.
The proposed technique has the interaction with the smart contract while the system delivers the transaction with the evaluated value.The throughput and RTT within the several nodes in the system as the link nodes have the link within the sender and the receiver nodes.The higher throughput within the nodes is nearer to 7.0 Mbps, the smallest RTT is about 0.50 ms and the comparison result is demonstrated in Figure 4.
The comparison for RTT for the proposed technique within the value of 0-1 ms for the links 1-10 is demonstrated in Figure 5 as it holds the highest values for Link 1 and Link 10.
The proposed framework has the topology and dynamic routing of the entire network, the issue within the relay node of the sender to forward the data.The sender requires to identify the connection point into the adjacent node for managing the latest node for connection.The recovery time is computed in Equation (1).
where Reco T is the recovery time, Lost T is the lost time, AN T denotes the time for communicating the adjacent node, BC T demonstrates the time for the Blockchain.
The experimental results proved that the blockchain    connection has the sender which broadcasts the packets to its adjacent node.The Recovery time comparison for the proposed technique with the existing techniques is illustrated in Figure 6.
The resource utilization of the proposed technique has the classification based on the CPU and memory which is performed in different level of iterations.The mean utilization of the resources is computed through the system in terms of performances of the CPU and memory and it is illustrated in Figure 7.
The proposed technique has various security related functionalities which is utilized to produce the block that makes 0.89 ms.The proposed technique has managed the cryptographic Blockchain transactions that utilizes the smart contracts with the security and it can be analysed through the standard deviation of 0.04 ms which is demonstrated in Figure 8, the standard deviation comparison for the proposed technique with the relevant techniques is illustrated in Figure 9.
The proposed methodology has been measured the execution time of every stage according to the current situation.In the performance evaluation, the virtual clients parallelly delivered the access request into the main smart contract while the total clients are in constant.Additionally, the smart contracts have the delegation policy to the specific resources and save it into the Blockchain, where it enhances the total delegation policy through the evaluation procedure of every stage into the restricted scalability and the mean authentication period which has some values while the policy revocation period is determined through the smart contracts and it is illustrated in Figure 10.
The overhead rate for the proposed methodology has the subsequent amount of client requests and the delegation policy.The experimental results proved that the overhead rate is minimum for the proposed technique compared to the relevant techniques.Hence, the proposed technique has produced the better scalability in   terms of delegation policy and the client requests, the overhead rate is shown in Figure 11.
The total cost of the proposed method is O(|X| + |Y|), where |X|&|Y| are the parameter values for cost computation.

Conclusion
The predominant purpose of our proposed work is to analyse the blockchain platform and the way it is able to be implemented to resolve the troubles with inside the current land registry structure.This research work provides a brief overview about the blockchain and its usage for land registration and the solution have been given clearly.Further, itsemphases on the secure land registry system based on blockchain-based model and emulates on the XDC platform for the design and development of DApp.The paper then effectively addresses the challenge of integrating the XDC token into the XDC platform and deliberates the whole process of method creation, implementation, and interaction.These blockchain implementations can be used in a variety of industries like healthcare, supply chain management, trading, e-commerce, and others, to address current problems and find a technical solution to security vulnerabilities in the current blockchain model.The research focuses on security, trustworthiness and the privacy of the network is ensured and results were discussed.The future enhancement of the blockchain framework is to provide the complete opportunities in many research aspects to observe and incorporate with Artificial Intelligence which may resolve the most common troubles in economic system and trade in extra powerful manner.

Figure 2 .
Figure 2. Unique number generation for node.

Figure 3 .
Figure 3. Sequence diagram for land registration.

Table 2 .
Comparison with required parameters.