Secure Smart Contract Based on Blockchain to Prevent the Non-Repudiation Phenomenon

: Blockchain is an innovative technology that has gained interest in all sectors in the era of digital transformation where it manages transactions and saves them in a database. With the increasing financial transactions and the rapidly developed society with growing businesses many people looking for the dream of a better financially independent life, stray from large corporations and organizations to form startups and small businesses. Recently, the increasing demand for employees or institutes to prepare and manage contracts, papers


Introduction:
On peer-to-peer networks, blockchain is considered one of the distributed ledger technologies controlled via multiple peers.This system works with no requirement for data storage management or a centralized administrator.Data is dispersed among multiple nodes, with encryption and replication ensuring data quality.The notion of blockchain was introduced on October 31, 2008, when Nakamoto published a white paper 1 .Because data is saved on each one of the nodes operating in each of the different networks, such a network is commonly indicated as a distributed registry.The hash regarding the previous block's record is used for combining a transaction group into blocks of transactions connected in the chain in blockchain networks 2 .As a result, the primary security aspect of blockchain networks is enforced as a property of immutability.The further along the chain a block is (the older it is), the more data it contains is protected against alterations 3,4 .Since it allows databases and peers in a trustworthy environment to be maintained (publicly) in a safe manner, the relevance of smart contract integration regarding blockchain technology will become a focus.Intelligent and permanent contracts are trackable.Every financial detail is used in a smart contract and implemented immediately.
The cryptography's hash function is used for encrypting transactions, which are checked with the nodes.The transaction's hash value is connected to its preceding hash value.No one may change or adjust it after the transaction has been inserted into the Blockchain; furthermore, the transaction can be publicly accessed, giving network accountability 5,6 .
Technological transformations and digital features in the legal field have cast a shadow over various transactions, especially modern contracting methods such as the smart contract 7 .Currently, the security of smart contract administration is considered one of the major pressing challenges 8,9 .Blockchain technology has also emerged as the most innovative application to support smart contracts 10 .The smart contract technology aids in the management of real estate transactions by ensuring transaction reliability, transparency, and accuracy, as well as overcoming the present mechanism's pivotal capability in executing transactions via a real estate broker 11 .A secure environment for organizing, storing, exchanging, and retrieving information is provided by an efficient information management process 12,13 .Also, a robust security level and a decentralized ledger are two properties of the blockchain, whereas non-repudiation is a key information security feature 14,15 .Achieving non-repudiation through the use of a digital signature, as well as improving it, is also a possible approach.Most governmental document systems continue to rely on physical records, while others have transitioned to digital recording via a centralized manner 16 .
The main contribution of this paper is to suggest a secure smart contract that depends on Blockchain with decentralized management and to prevent a non-repudiation scheme.The present work aims at providing a secure model with a more confident decentralized contract in addition to providing more effective smart contract protection through several security requirements, for instance, confidentiality, authorization, accountability, integrity, and authenticity.The essence idea focused on the used of blockchain technology with the smart contract and how to apply it in a real-estate.The real-estate scenario includes the establishment of a distributed ledger, which eliminates the need for centralization and (TTP).Where the proposed model has the ability to achieve a substantial change in the way international trade and business are performed by accelerating the transactions, finishing paperwork, and reducing cost-efficiency.
This proposed is organized into four sections in addition to the current section and the rest are outlined as follows: Section two: entitled Related Work covers the theoretical background of smart contracts and blockchain and blockchain challenges, as well as smart contract security issues.Section three entitled System Design: This section attempts to show the details of the design and applied of the proposed solutions assisted by flow charts.Section four entitled Results and Discussion involves the experimental results and the analytical discussion about the cost and security aspects of blockchain and smart contracts.Section five: entitled Conclusion and Future Works presents the conclusion of this proposed and suggestions for future works.

Related Work:
Zyskind et al. 1 presented a lightweight decentralized blockchain data management architecture to protect personal data and ensure users' ownership and control their data.Off-chain data storage was used in the proposed strategy to boost efficiency.In addition, using the protocol that transforms a blockchain into an autonomous accesscontrol manager that does not rely on third-party trust.
Clack et al. 3 studied four fundamental topics of smart contracts: terminology, automation, enforceability, and semantics.They concluded that legal contracts are a simple framework based on two main aspects: operational and non-operative, as well as smart contract templates that can be implemented as electronic representations.This approach resulted in the creation of three separate contracts between Ricardian and Design.In this context, they also discovered the design scene to increase the parameterization of complex firstgrader types and long-term work that would contribute to the acceptance of official languages in the courts.
McCorry et al. 5 a decentralized implementation and a self-voting protocol were suggested that can be implemented over the internet.The implementation was performed with a high degree of voting privacy using blockchain because it was suitable for council elections and was written as a smart Ethereum contract and was not dependent on a stable electoral privacy authority, as it was a self-adhesive protocol that makes it was possible to protect voting privacy.As for their further research, they will conduct national blockchain elections and will need a special blockchain where large numbers of transactions are stored on the chain and managed in a manner similar to the central RS-coin and examined the smart contract limitation used by Ethereum.
Karamitsos et al. 17 investigated the impact of smart contracts and their various components on implementation in the real estate market.The benefits of using smart contracts and blockchain technology for real estate are as follows: Various parties have the ability to edit the database.Untrustworthy among entities and groups.Disintermediation has the advantage of allowing transactions to be independently reviewed and automatically authenticated, and transactions have the advantage of separating transactions between parties in order to increase the efficiency of the invoicing process.
Daniel et al. 18 investigated the implementation of smart contracts utilizing cuttingedge blockchain technology, which can serve as a component technology for a computing paradigm known as service-oriented computing (SOC) on the blockchain to encourage reuse and increase costeffectiveness.It showed how the conceptual underpinnings of this new environment were more interconnected than one might assume, and how smart contracts, to some extent, may be read as basic components, that is, services, of a blockchainbased, SOC paradigm.
Terzi et al. 19 described an application of BC technology in two real-world supply chain scenarios.The first was designed to log and trace items by employing smart contracts to identify the constituents of food products and how to uniquely identify the food product throughout their transportation from the plant to the client who purchases it.The transparency of the procedure and transportation verification are critical components of this method.The second explanation is meant to address the authentication process for users having BC IDs.A user's identity is critical for network security, enabling only authorized parties to access and process data.
Sookhak et al. 20 investigated the implementation of smart contracts using cuttingedge blockchain technology, which can serve as a component technology for a computing paradigm known as service-oriented computing (SOC) in the blockchain to promote reuse and increase costeffectiveness and describes how the conceptual underpinnings of this new landscape are more integrated than one might expect, and how smart contracts, to some extent, can be interpreted as basic components, i.e. services, of a blockchain-based, service-oriented computing paradigm.The researchers focused on studying ways to ensure the security of patients' information and privacy when Electronic Health Records (EHRs) are used in healthcare settings, particularly during data breaches.The introduction of blockchain technology and smart contracts cleared the path for the creation of a reliable EHR access control system that supports secure client authentication, identification, and authorization.Also, researchers will look into cutting-edge blockchain-based access control approaches in healthcare.A thematic taxonomy regarding blockchain-based access control techniques is offered to emphasize the essential security needs for designing a granular access control approach and recognizing the security concerns of current approaches.They tested and investigated the contrasts and similarities of conventional access control techniques, as well as several significant and unresolved contemporary concerns as potential future directions.
For managing vaccine registration, distribution, and storage, Rotbi et al. 21used a Blockchain-based system.They provided a compact system depending on blockchain technology and the Internet of Things (IoT) to service the Covid-19 vaccination.This study proposed a secure smart contract that depends on Blockchain with decentralized management to prevent a nonrepudiation scheme.The present work aims at providing a secure model with a more confident decentralized contract in addition to providing more effective smart contract protection through several security requirements, for instance, confidentiality, authorization, accountability, integrity, and authenticity.

Research Methodology: The Proposed System Infrastructure
The system infrastructure is divided into three parts, the client, the server, and the database as a system that is supposedly more than one client and more than one server.The client part includes many interfaces and for server contains events.The requirement of the system is consisting of: 1. Server (nodes): that contains two types of servers, the first one for major processing.
While the second server is used for saving the database.

2.
Client: needs to interface, may be web application or client application.3. Database: connects with the server directly and must be safe.
Thus, the requirements of the user to establish the connection can be listed and illustrated in the following Fig 1 .A. Bank account.B.
Real estate account.C.
Key pair (public key and private key) used for the sign.
D. Wallet with the username and password for storing all the required information in addition to: 1) Approved Contract.
2) Pending Contract.The server application is applied on the trusted party, and contains the following: 1) Wallet database.
2) The blockchain that contains the contract.
3) Connection to the bank.5-Pending contract.However, each of the block databases.Wallet, and pending contracts have to be placed in the trusted party.
The contract management stage takes place after creating a smart contract by both parties filling in the contract's information for both parties and adding the required signatures from each party all information will be included in the signature.Suppose a person wants to sell a property, the first step requires building a contract and signing the information, adding the required price, the property offered for sale, and the other party is the buyer.
Then the contract is signed by the seller.The stage of completing the contract by the seller is complete.Now comes the role of the buyer.Then the contract is received as stated in Fig 4 where the system of smart contracts that sent to the server.
The most important step is to verify the information included in the contract verifying whether the information is intact or has been manipulated by the other party.After making sure that the information is correct and adding the signature of the seller and the buyer, the next step is to verify the information by the server.The role of the server at this stage is to verify the signatures of the two parties, the property information, and the bank account of both parties.After the verification is done, the transaction is considered completed.The information is saved and added to the Previous Block ID after which it is saved to the Blockchain network.

The Proposed Prototype System Overview
The proposed system was designed and implemented with a set of compact programs that include virtual real estate and virtual banks.This means that non-repudiation has been required on the SSL layer's top, which is often utilized for securing communications between seller and buyer as well as the server.Entity authentication, confidentiality, and data authentication are all provided by SSL.Transactions must, on the other hand, be timebound to the parties involved in order to be legally validnon-repudiation is required.It is impossible to implement this on a layer underneath the application layer, like the SSL layer since involved parties must beware of legal binding and procedures of non-repudiation.As a result, it must be presented in the application layer itself.Hence, the main goal was to design and implement a program that simulates real estate and banks by using blockchain technology.

The Construction of the Smart Contracts with Blockchain
The proposed system will discuss a virtual prototype scenario using a real-estate department between a buyer and seller as stated in Fig 5 .Where the proposed smart contract gives us the following more distinguished smart compared with traditional systems:  The proposed system adopts a distribution scheme that allows the data to be dispersed over several nodes, allowing any fraudulent, forged, or corrupted records to be recognized and swiftly rejected by comparing the data across nodes. The proposed system would reduce reliance on external parties for the purposes of information verification and authentication requirements, and it will make asset exchange as easy as possible.Through the interaction of the smart contract with other smart contracts or accounts during a transaction, a property can be sold or transferred.In this approach, building management might be automated and carried out more quickly, saving cost and time 22 .
As shown in Fig 6 the proposed system has four primary levels: software system level, container level, component level, and contract level.Nodes are constructed at a variety of trustworthy sites, such as government buildings, banks, or huge corporations.A trusted node is assigned to a party that directly or indirectly benefits from maintaining safe and speedy transactions, such as banks and real estate businesses.Because they cooperate to make the system safe, all nodes will suffer and be affected if a record is damaged or fabricated.To create and sign contracts, users must communicate with nodes; everything else is handled by the node, which verifies the information provided and takes other necessary actions to ensure the accuracy of the information.In order to expedite the exchange of assets, banks and real estate offices connect with nodes.

The Proposed System Scheme
The proposed system consists of four main correlated parts that show the architecture of the proposed system with its main ingredients: Bank Application Programming Interface (API); Realestate Ledger; Server; and Client.The system scenario consists of several sides and parties that can be illustrated in the following phases: The following description involves several phases for the construction scenario of smart contract transactions from client to server and their permissions: 1. User Side Permissions: This aspect is concerned about the login information of the user to the system, as well as the execution regarding a few actions or processes linked to entity operations: o The user can create a bank account to deposit money and ensure that the amount is preserved and can be used for different types of online payments.o The user can create a real estate account with his money.The real estate account can give the seller a gateway entry to the platform to sell any real estate.At the same time, it gives the buyer the opportunity to browse thousands of classified ads daily and discover the best properties offered.o The user can get a pair of keys generated using his own content algorithms.The first is public and is accessible to everyone, and the second is a secret that is only for the user.o The wallet consists of (a username and password).The user must have a wallet that includes the user's name and password.The benefit of the wallet lies in the storage facilities and gives the user convenience as well as ease of payment.• Consist of the ID of each user registered in the system.• Account name: it involves the user account name to log in to the system.• Balance the amount of the user's amount that is added to the bank account to complete the transaction between the two parties.

The Design Paradigms of User API
The user design style involves registration steps which also known as the wallet procedure that can be seen in Fig 7 which explains how the user registers to the system: a) The user chooses an ID and password to enable him to enter the system at any time, and the nickname must be unique that can be recognized by network subscribers.b) Filling in the bank account information that is required by the system when entering any user into the user interface.
c) Filling real estate account information is required also by the system when entering any user.d) Creating public or private key pairs utilizing Elliptic Curve cryptographic protocols.The key generation process took the responsibility of the server.
e) Encrypts information with Advanced Encryption Standard (AES-256) to encrypt data and provide a high security and protection level against brute force and other attacks.f) Sending information to be saved in Blockchain nodes with hashed data, so that the user might access the file hashes through smart contacts after worker node authentication.

Advanced Encryption Standard
Scrambled data using the intriguing technique of encryption, making it unintelligible to unauthorized parties.A specification for the encryption of electronic data is called the Advanced Encryption Standard (AES), sometimes known as Rijndael (its original name).The practice of encrypting communications or important information so that only authorized parties may read, it is known as encryption.Although encryption does not stop interceptions by itself, it does prevent the interceptor from getting the information.
Simply put, encryption is the process of creating encrypted text that can only be decoded by a certain person.Advanced Encryption Standard is one such encryption method used to safeguard online data from AES.In most cases, symmetric key encryption techniques or public key encryption schemes are used for encryption 23 .

The Design Paradigms of Client API
In this section, starting the process of client connection with the server using TCP connection protocol.Where the contract creation process will start after the process of creating a contract.Then adding the contents of the contract which involve the information of the seller and buyer.After that, the signature is verified between the buyer and the seller and then the details will be sent to the server for checking and verification.The process of verifying, signing, and saving them in the Blockchain will occur immediately.
The following steps will prepare the information to be added to the contract by the seller and buyer as shown in

The Design Paradigms of Server API
The local server has been addressed that is responsible for receiving the queries and requests.After completing the contract information, the verification process will start between the seller and the buyer to ensure that the information is not tampered with.The signing process is carried out by both parties and sent to the trusted node so that the verification process is done later on.During this process, the transaction data is signed and kept in the Block-chain as a signature creation and verification process as stated in  The process of verifying the contents of the contract between the seller and buyer ensures the information has not been tampered with.Concerning a communications scenario, such as a contract, one of the users may subsequently deny the contents of the agreement or even that the communication occurred at all.Thus, the signing stage comes to prove the authentication for a specific transaction.1. Contract Singing The seller or buyer signs a contract.

Contract Verification:
To confirm the Seller's or Buyer's signature on the contract.3. Contracts should be signed in the trusted node.4. Timestamping is used to confirm that a contract was signed in a trusted node. 5. Contracting the Blockchain: The following connected steps must be completed in order to add a contract to the block-chain in the trusted node: I.
Checking the contract's assets.II.
Exchanging resources.III.Declaring the Contract to be authorized.
IV. Adding the contract's ID and signature from the previous block's blockchain record.V.
In the Trusted Node (_), sign a contract.VI.Including the contract in the blockchain.VII.The blockchain is synced with other nodes.6. Trusted Node Block-Chain Verification: The process of checking the contract is shown in Fig 10.

Elliptic Curve
Similar to RSA the ECC is a type of publickey cryptosystem.But it differs from RSA in that it can evolve more quickly and offers researchers working on cryptographic algorithms an appealing and different approach.Even with smaller ECC keys, the level of security offered by RSA can be achieved.As an example, the 163-bit security strength of an ECC.But could provide the 1024-bit security strength of an RSA.Other than this, ECC is particularly well suited for wireless communications, such as mobile phones and smart cards 24 .
Elliptic Curve Cryptography is a relatively new type of cryptography that Koblitz independently proposed in the latter half of the 19th century.Due to the same level of security, they offer with significantly smaller key sizes than traditional public-key cryptosystems, it has since attracted a lot of attention and grown immensely popular.The ECC includes key exchange, the Elliptic Curve Digital Signature Algorithm(ECDSA), and all pertinent asymmetric cryptographic primitives.
Elliptic Curve Cryptography is a relatively new type of cryptography that Koblitz et al. 25 independently proposed in the latter half of the 19th century.Due to the same level of security they offer with significantly smaller key sizes than traditional public-key cryptosystems, it has since attracted a lot of attention and grown immensely popular 26,27 .The ECC includes key exchange, the Elliptic Curve Digital Signature Algorithm(ECDSA), and all pertinent asymmetric cryptographic primitives 28,29 .

Elliptic Curve Digital Signature Algorithm
The EC Digital Signature Algorithm is the elliptic curve equivalent of the DSA; this protocol requires not only elliptic curve operations, such as integer multiplication, inverse operation, and modular operation, but also scalar multiplication, field multiplication, and field inverse operation.The EC Digital Signature Algorithm is the elliptic curve equivalent of the DSA; this protocol requires not only elliptic curve operations, such as integer multiplication, inverse operation, and modular operation, but also scalar multiplication, field multiplication, and field inverse operation 30 .

Results and Discussion
The main aim of any smart contract design must be performance, security, implementation costs, and other factors.The performance test approach determines the time required to perform implementation smart contracts operations.The design of a smart contract depends on several programming languages and several important libraries with different environments.Several tests were implemented on many platforms and in several languages in addition to the different hardware.
This chapter describes the implementation and testing for a real estate transaction using smart contracts and blockchain technology.The proposed system utilized a smart contract which is utilized on a blockchain that stores a description of a rent item or a purchase and regulates transactions between the two entities.And how the smart contract code executed on the blockchain is integrated into the C# language and the implementation of the actual components.The simulation software package for the proposed models is implemented in C# and the complete environment was built in Visual Studio 2017.The ECC algorithm is selected because it gave the best results in implementation compared with RSA.Furthermore, a new additional layer of the secure web via SSL has been dedicated.

The Proposed Graphical User Interface
To implement the real estate transaction, the user has to obey the following steps: registration process, create a Real-estate account, and create a bank account initially.The Graphical User Interface (GUIs) of the prototype can be explained with some of the captured snapshots below:   1. Adding funds to the user and the amount of balance.2. This step represents the user registration for the system and creates the contract.The next step is the forming of the final contract with the information of the seller and buyer and the price required to sell the property and adding the seller's signature to the information and adding in the pending smart contract.The incoming step is the process of defining the contract by the buyer, by double clicking to start the process of adding the buyer's signature and agreeing to the information sent by the seller.
The last step involves adding the signature and approval by the buyer as shown in the following Fig 15.Confidentiality is a key aspect of security, and it ensures that sensitive information is protected from unauthorized access.In the blockchain, confidentiality is achieved through the use of encryption.Data is encrypted before it is added to the blockchain, and only authorized parties with the proper decryption keys can access the data.This ensures that even if the data is intercepted by an unauthorized party, they will not be able to read it.
While authorization is another important aspect of security, as it ensures that only authorized parties are able to access and modify data.In the blockchain, authorization is achieved through the use of digital signatures.Digital signatures are a cryptographic technique that is used to confirm the identity of the parties involved in a transaction.Each party involved in a transaction will have a unique digital signature, and these signatures are used to confirm their identity.This ensures that only authorized parties are able to access and modify data on the blockchain.Where the transaction is signed by the persons present in the contract and the signature is made using the high-security (ECC) algorithm, which in turn is difficult and complex.
Data integrity refers to the reliability and trustworthiness of data.It involves the maintenance of, and the assurance of the accuracy and consistency of, data over its entire life cycle.Blockchain just might be the solution to improve data integrity to the highest standards .Blockchain ledgers are immutable meaning that data addition or transaction cannot be edited or deleted.One aspect of blockchain technology which particularly important for improved data integrity is the Merkle tree, it ensures the integrity of data in the blockchain.Merkle tree is a fundamental component of blockchain that uses a cryptographic hash function.Every block stores transaction data in the form of a tree, hashes of child nodes are combined into the parent nodes header and this technique continues iteratively until a final, or root, node is reached, this node will contain all the information contract, so it is used hash and Merkel tree in verifying the integrity of the data in the blockchain.
Non-repudiation is the concept that parties involved in a transaction cannot deny their involvement in it.
In the blockchain, nonrepudiation is achieved through the use of digital signatures.Digital signatures are used to confirm the identity of the parties involved in a transaction and ensure that they cannot deny their involvement.This is because digital signatures are unique to each party, and they cannot be forged or duplicated.This ensures that parties cannot deny their involvement in a transaction, even if they try to.
All these elements work together to provide a secure and tamper-proof environment for conducting transactions and storing data on the blockchain.
The use of encryption, digital signatures, cryptographic hash functions, and nonrepudiation ensures that data stored on the blockchain is protected from unauthorized access, tampering, and criminal involvement.

Analysis and Evaluation
This study, evaluates the prototype implementation of the present proposal and provides short security and cost analysis of the suggested blockchain-based solution to provide proof of the authenticity of the digital content.

Security Analysis
This section focus on security analysis that comprises the cryptographic algorithm and protocols like SSL encryption, RSA, and ECC.
While buying an SSL certificate, you should have a clear understanding of both of these terms.It may be utilized for the creation of smaller, more efficient, and much faster cryptography keys.Instead of using the traditional method to generate a product of very large prime numbers, it uses an elliptic curve equation to generate keys.ECC is used in the well-known cryptocurrency (i.e.Bitcoin etc).For hackers, it is really hard to crack the ECC algorithm that operates upon the Elliptic Curve Discrete Logarithm Problem (ECDLP).The ECC certificate has often smaller size because the information that is needed for exchanging for validation is less.For organizations having longterm security solutions as a primary concern, ECC may be an ideal choice.
Also, hybrid SSLs can be utilized to use ECC instead of RSA-trusted root keys.A simple comparison can be shown in terms of the length of ciphering key between the RSA and the ECC can be stated in Table 1  Here is a quick comparison between RSA and ECC according to the NIST publication.It will help us to decide which is better in terms of security.From the above Table 1, this research concludes that the ratio of a key in size and its strength for the ECC compared with RSA is as follows: No.1 (1:7), No.2 (1:10), No.3 (1:12), No.4 (1:20), No.5 (1:30).

Cost Analysis
This section involves the evaluation and analysis of cost in terms of the creation of contracts and interaction activities.It is important to note that the transaction sender in the blockchain should avoid paying gas fees in reverse contracts using Etherume.However, concerning transaction cost economics, the proposed solution has been argued that, though smart contracts reduce transaction costs related to contracting parties as shown in Table 2.
This section includes a discussion of the costs of deployment and interaction that are related to the purchase and sales contracts that have been explained in the section Analysis and Evaluation.From the standpoint of transaction cost economics, though smart contracts reduce transaction costs related to contracting parties' holdups, they can also create or increase other costs related to it.As a result, the execution time for transaction validity according to the Proof-of-stake consensus can be calculated as a function of elapsed time as shown below: A simple comparison of the cost of key generation between the RSA and ECC can be shown in Fig 17 and

The Finding of the Study
It has been in regard to ECC, has three features that give the ECC the privilege over RSA, which are more security algorithms, smaller key size, and faster key generation processes.These features give ECC a higher level of security.

Privacy of the Transaction
This section presents a discussion of the most significant aspects of privacy, which include the security of smart contract accounts as well as transaction security.Accounts might be locally managed.The second approach should only be utilized for the purposes of testing, due to the fact that it includes unlocking the account and then sending the wallet password via a network in plaintext.
In the case of utilizing WalletAccountService, a local wallet can be decrypted with the use of the password that is given by the user for signing each one of the transactions with the secret key that belongs to the account.Utilizing WalletAccountService presents protection from eavesdropping due to the fact that the wallet password is never given to the client.In addition to that, it provides protection from the Man-in-the-Middle (MITM) attack, due to the fact that there is no ability for altering a transaction cannot once it was signed with a secret key.There are only 2 cases left, where the attacker might get or utilize the secret key of the account: • An attacker has root access to OS and is capable of intercepting the password from a user with the use of a key logger.

•
An attacker gains physical access to a device and the account remains unlocked, where the attacker has the ability of using the account for signing the sale contract or purchasing the contracts and transmitting money to their own accounts.The transaction backend needs to solve the blockchain computation for the chain of digests.Thus, regardless of the various computations of multiple hash functions, it can be deduced the average time for the several hashing as shown in The privacy issues arising from the storing and exchanging of personal user data have been discussed in the application.It should be stated that potential issues related to privacy, may happen in the case of storing the details of the contract on blockchain and the way they may be evaded.The storing of the contract details in plaintext on the smart contract may lead to privacy problems, due to the fact that the seller and buyer addresses are stored as well on the contract, which is why they are accessible publicly.A party that is aware of an individual belonging to a certain address (for example, in the case where it exchanged the user or the contract data with that individual in the past) might look up the details of other contracts which have been signed by the individuals.For the purpose of preventing this, the option of light deployment may be utilized.In the case of utilizing the light deployment, only the hash of the details of the contract which don't have to be stored on a blockchain is stored on smart contracts.From the result, the finding of this study was competitive with state-of-the-art studies.

Conclusion:
This study focused on achieving a trusted smart contract exploiting the features of Blockchain technology.A simulated scenario of a prototype system has been designed and implemented.The implemented scenario supposed the existence of Blockchain infrastructure that integrated with designed smart contracts effectively.The blockchain includes a set of blocks in which a block includes several transactions, in which the transaction can be described as a record or data that has been written to block-chain.Blockchains are replicated on all nodes in a network and every one of the nodes validates the content of the block, as a result, maintaining the consistency of the database by a mechanism of consensus.In this study, the investigation is directed towards using the blockchain and smart contracts in real estate property and concluded.The integration of the blockchain with smart contracts gives a decentralized system with less time implementation and with less expense.The smart contracts eliminated any necessity for intermediaries as well as contract enforcement.Which results in greatly reducing costs and simplifying the process of contract negotiation.The Blockchain technology provides a secure and tamper-proof environment for conducting transactions and storing data.The use of encryption, digital signatures, cryptographic hash functions, and non-repudiation ensures that data stored on the blockchain is protected from unauthorized access, tampering, and criminal involvement.

Figure 1 .
Figure 1.The requirements of the user.

Figure 2 .
Figure 2. The implementation of client and server applications.

4 )
Connection to real estate.5) Execution the contract.The server application can apply the following functions: a. Receiving the contract, in case the contract is not signed, then sent it to the parties to sign.b.Contract signiture c.Verifying the signatures d.Verifying information (bank, ledger) e. Transfering f.Adding bank ID g.Signing with a trusted key.h.Saving in the chain.Therefore, the server application connects with a set of databases as seen in Fig 3.

Figure 4 .
Figure 4.The smart contracts management steps.

Figure 5 .
Figure 5. Virtual scenario between buyer and seller 22 .

Figure 6 .
Figure 6.Overview of the proposed system.

Figure 8 .
Figure 8. Contract creation for the seller and buyer.
logs in to the system, he will need to create add bank account and real estate account as explained inFig 11 and Fig 12.

Figure 11 .
Figure 11.Create a bank account.

3 .
The next step after the registration process involves adding the bank account and the real estate account, the contract is created as shown in the following Fig 13 and Fig 14.

Figure 13 .
Figure 13.Illustrates the add funds and amount balance process.

Figure 5 .
Figure 5.The process of adding seller and buyer information to the contract.

Figure 6 .
Figure 6.Adding the signature and approved by the buyer.The next step includes transferring the property from the first person to the second person and transferring the balance from the first person to the second person and saving in blockchain and taking a number(16) in the list of approved contracts.Another step shows the generation of the keys for the seller and the buyer, which are public,

Figure 7 .
Figure 7. Date and time of the creation of the contracts for the seller and buyer.

FunctionFigure 17 .
Figure 17.The time cost of RSA key generation in seconds.

Figure 18 .
Figure 18.The time cost of ECC key generation in seconds.

Figure 19 .
Figure 19.The time cost of digital signature (signing).

Figure 20 .
Figure 20.The time cost of digital signature (verification).

FigFigure 21 .
Figure 21.Time cost for the number of chained hash.
2. Client API-Side Permissions: The user will register to a new wallet or log in to an existing wallet through a user interface that is called Client API, with the following steps.o At first login to a wallet which allows the user to access the wallet by entering the username and password o Then register to a new wallet the login stage includes entering the user's name, real estate account, and bank account so that the user can enter the system.o A new contract is generated for the user and takes place after the registration process in the system.o View old contracts where the user can view the list of old contracts by date and time.o View pending contracts, where the user can view the contracts that are not signed by others and that are in pending status.o Check and verify the bank account where the user can check the balance in the bank account of the other party.o Check real estate the user can verify the property in the real estate concerning the

Table 1 . Comparison between RSA and ECC key strength 32 .
31cording to the NIST (i.e. the National Institute of Standards and Technology)31.