A Traceable Online Will System Based on Blockchain and Smart Contract Technology

: In recent years, with the rapid levels of economic development, there have been more and more problems in property inheritance and distribution. In today’s society, people still have many taboos when writing a will. Writing a will not only involves various laws and regulations but also costs a lot of money and time, which can be daunting. However, with the development of the Internet, blockchain technology has gradually been applied to many applications. Blockchain technology uses consensus algorithms to ensure consistency and records transaction information in blocks to ensure the effectiveness of transactions. In this paper, we use the cryptography mechanism to propose an online will system based on blockchain and smart contract technology. The architecture considers effectiveness and cost reduction. By combining this with blockchain technology, will assets are saved in blocks, which provides comprehensive will security and non-tamperable security protection. In addition, combined with a smart contract, it realizes the method of automatic property distribution. At the same time, this mechanism also proposes an arbitration solution when there are disputes over wills, and ensures the integrity of data, public veriﬁability, unforgeability, nonrepudiation, irreversibility of information, and the ability to resist counterfeiting attacks.


Introduction
Family quarrels on inheritance issues are nothing new, but in recent years they have become the main content of the news. Most people do not adopt the habit of writing a will, mainly because they have scruples about death. This has led to many families fighting for inheritance rights, causing family members to hate each other and damaging the harmony of society. Succession struggles often occur. For example, after the parents hand over a property to their children, the children begin to rebel against the parents, or the siblings fight over the property with each other.
A starker example is Hendrix's USD 80 million real estate dispute [1]. Hendrix's brother, Leon, announced that he was also entitled to inherit the estate and started a real estate lawsuit with Al's adopted daughter. Other notable examples include pop singer Michael Jackson's USD 100 billion asset allocation event [2], and the occasion where Macau gambled king Stanley Ho's USD 100 billion assets [3]. Generally speaking, there are two types of will: the traditional form and the online electronic form. The traditional form of will usually requires a lawyer to write a will. In addition to paying high legal fees, it also nodes in the system. The operation of the entire system and the chain structure of the database is open and transparent. Within the corresponding rules formulated by the system and within a specific time range, nodes cannot be tampered with or deceived.
In this research, we propose a traceable online will system based on blockchain and smart contract technology to solve the current issues of validity, privacy, and security protection that arise when producing a will. We deploy our smart contracts through the Ethereum blockchain and develop and test smart contracts through Web3.js, Solidity, and Ganache. In this research, as far as the integrity of the electronic will is concerned, we use the Elliptic Curve Digital Signature Algorithm (ECDSA) to sign the information transmitted by the parties. By combining blockchain technology, we use the three main characteristics of blockchain decentralization, non-modification, and publicly verifiable chains, allowing data to be decentralized without relying on other regulatory agencies and hardware facilities, with data being stored in a message block. These message blocks are linked together in a similar "chain" manner, which has the characteristics of preventing tampering and being publicly verifiable, thus, ensuring the integrity of the will. Regarding the trust of the electronic will, all messages must be verified before linking, and the user must have the correct encryption key to read or write the message to the block. This research also combines smart contracts to make the process automation lengthy and complicated. The process information is open and transparent, and will not be subject to human intervention or tampering. This not only reduces the process cost but also solves the trust problem.
Therefore, the general requirements for electronic will production can be summarized as follows: (1) The integrity of data [4,6,11,12]: In the process of transmitting and storing information or data, methods such as digital signatures and hash functions are used to ensure data integrity. (2) Public verifiability [6,7]: The data or the data source can be publicly verified.
The remaining sections of this paper are organized as follows: Section 2 introduces the preliminary research, the third section introduces our system architecture and algorithm in detail, the fourth and fifth sections, respectively, discuss the security analysis and performance. Finally, we conclude this article in Section 6.

Elliptic Curve Digital Signature Algorithm (ECDSA)
The Elliptic Curve Digital Signature Algorithm (ECDSA) is an asymmetric key encryption technology used by Bitcoin and Ethereum blockchains. ECDSA [22] is a combination of ECC(Elliptic-Curve Cryptography) [23] and DSA(Digital Signature Algorithm) [24]. Compared with the general elliptic curve encryption algorithm, the required public key bit size is about twice the security level. For the ECDSA algorithm, the signing and verification process is as follows: Suppose Alice wants to send a message to Bob. First, both parties must choose the elliptic curve and the origin G on the curve. Then, Alice must generate a random number d A as Alice's private key in the interval [1, n-1], and generate a public key Q A = d A G. If Alice wants to send a message m, Alice needs to generate a random number k in the interval [1, n−1], calculate z = h(m), (x 1 , y 1 ) = kG, r = x 1 mod n, s = k −1 (z + rd A ) mod n, and then send the message m and the ECDSA signature (r, s) to Bob, and Bob receives it. The correctness of the ECDSA signature will be verified. First, Bob will calculate z = h(m), u 1 = z s −1 mod n, u 2 = rs −1 mod n, (x 1 , y 1 ) = u 1 G + u 2 Q A r = x 1 mod n. If the verification passes, Bob confirms that the signature and message (m) sent by Alice are correct.

Smart Contract
Interdisciplinary legal scholar Nick Szabo proposed the concept of smart contracts in 1995 [25]. The following is a definition of a smart contract: A set of commitments (including contract participants) defined in digital form through smart contracts can achieve collaboration and trust between multiple entities in the blockchain through smart contracts, thereby expanding the scope of mutual cooperation and depth. The execution of smart contracts can be divided into three steps as follows [26]. (1) Develop smart contracts: Contract participants use programming languages to formulate the terms of the agreement, and use private keys to sign them. (2) Connect with the blockchain system: Each node of the blockchain will receive the contract, verify it and reach a consensus mechanism.
(3) Execution of smart contracts: After most nodes are verified, the contract agreement will be successfully executed and contract participants will be notified. Figure 1 below shows the operation flow chart of the smart contract. [24]. Compared with the general elliptic curve encryption algorithm, the required public key bit size is about twice the security level. For the ECDSA algorithm, the signing and verification process is as follows: Suppose Alice wants to send a message to Bob. First, both parties must choose the elliptic curve and the origin G on the curve. Then, Alice must generate a random number dA as Alice's private key in the interval [1, n-1], and generate a public key QA = dAG. If Alice wants to send a message m, Alice needs to generate a random number k in the interval [

Smart Contract
Interdisciplinary legal scholar Nick Szabo proposed the concept of smart contracts in 1995 [25]. The following is a definition of a smart contract: A set of commitments (including contract participants) defined in digital form through smart contracts can achieve collaboration and trust between multiple entities in the blockchain through smart contracts, thereby expanding the scope of mutual cooperation and depth. The execution of smart contracts can be divided into three steps as follows [26]. (1) Develop smart contracts: Contract participants use programming languages to formulate the terms of the agreement, and use private keys to sign them. (2) Connect with the blockchain system: Each node of the blockchain will receive the contract, verify it and reach a consensus mechanism. (3) Execution of smart contracts: After most nodes are verified, the contract agreement will be successfully executed and contract participants will be notified. Figure 1 below shows the operation flow chart of the smart contract. The blockchain combined with smart contract technology can realize the verifiability of data, files, and contract records. By calling the smart contract, the user can use the wallet address (owner account) of the deployed contract, or according to the written smart contract conditions, other wallet addresses can also call the smart contract. The blockchain combined with smart contract technology can realize the verifiability of data, files, and contract records. By calling the smart contract, the user can use the wallet address (owner account) of the deployed contract, or according to the written smart contract conditions, other wallet addresses can also call the smart contract.

ERC-20
ERC(Ethereum Request for Comments)-20 was written by Fabian Vogelsteller and Buterin in 2015 [27]. It is a protocol standard for smart contracts on the Ethereum blockchain. It is written in Ethereum's solidity language and is currently the most widely used Ethereum token in the mainstream. Specifications and standards include virtual currencies in the blockchain, such as Maker, OmiseGO, and Basic Attention tokens.

System Architecture
This research uses blockchain technology to build a new online will system, by building a private Ethereum chain and writing smart contracts through solidity to achieve a privacy-protected and unmodifiable online will system. Figure 2 shows the structure of the will system, which is mainly used for the validity of the will proposed by the applicant and how the testator will execute the will after his death. The will certificate can be verified at any time through the validity of the blockchain to realize the anti-counterfeiting effect of the will certificate. The participating roles of the system include the Blockchain Center (BCC), Applicant (A), Family (F), Court (C), and Hospital (H).
of the will certificate. The participating roles of the system include the Blockchain Center (BCC), Applicant (A), Family (F), Court (C), and Hospital (H).
The system architecture includes five main roles, namely: 1. Applicant (A): Pre-written testator. 2. Court (C): Accepts the registration of applicants for wills and applications for wills arbitration. This represents the review and arbitration department for will applications. 3. Hospital (H): The hospital that issued the death certificate when the person who made the will dies. 4. Testamentary Successor (TS): This is the owner of the inheritance will after the testator dies, for example, the testator's family. 5. Blockchain Center (BCC): According to the instructions of the will, a smart contract is issued and executed. Step1. Each role in the system needs to register with the blockchain center before using the system and fill in relevant information on the registration webpage as needed, such as personal data, passwords, and Ethereum accounts. When making a will, Secure Channel Insecure Figure 2. The structure of the will system.
The system architecture includes five main roles, namely: 1. Applicant (A): Pre-written testator.

2.
Court (C): Accepts the registration of applicants for wills and applications for wills arbitration. This represents the review and arbitration department for will applications. 3.
Hospital (H): The hospital that issued the death certificate when the person who made the will dies. 4.
Testamentary Successor (TS): This is the owner of the inheritance will after the testator dies, for example, the testator's family.

5.
Blockchain Center (BCC): According to the instructions of the will, a smart contract is issued and executed.
Step1. Each role in the system needs to register with the blockchain center before using the system and fill in relevant information on the registration webpage as needed, such as personal data, passwords, and Ethereum accounts. When making a will, the system will also verify whether the user's information is correct. If the format is incorrect, the front platform will return a corresponding error message. Finally, when each role transmits sensitive data to the blockchain center, it will use the Transport Layer Security (TLS) protocol to encrypt the data in transmission. After successful registration, the applicant will obtain the public and private signature key pair for the ECDSA. Step2. Before the applicant makes a will, he/she will first download the will template for the court to fill out. The will template contains the applicant's sensitive personal information and the inheritance and distribution of the property. After the applicant fills in the contents of the will, the will content will be sent to the court for review. After the court receives the applicant's will information, it commences the stage of uploading the will. The court will review the contents of the applicant's will. After the review is passed, the private key of the court will be used to sign the content of the will with the ECDSA and it will be uploaded to the blockchain center. Step3. When the applicant of a will dies, the testamentary heir should provide the hospital with relevant information about the applicant before applying for a death certificate.
When the hospital receives information from the testamentary heir, it will begin to review whether the information provided is correct. If it is correct, the content of the death certificate will be published and uploaded to the blockchain center. At this time, procedures related to the content of the will will be executed accordingly and the process will enter the stage of property distribution of the will. Step4. The testamentary heir brings the death certificate to the court to apply for the contents of the will. When the court receives an application from the family of the testamentary heir, the court will judge whether the information provided by the family of the testamentary heir is correct. If it is correct, the will content will be downloaded from the blockchain center, so the will has a legal effect. If the testamentary successor has questions about the distribution of the property, he/she can also apply to the court for arbitration. The court will review the content of the testamentary heir's application. If the content of the application is correct, the result of the arbitration shall be determined. Table 1 shows the definition of symbols used in this study as follows: Table 1. Notations.

Symbol Description
The elliptic curve defined on finite group q G A generating point based on the elliptic curve E ID X X's identity k X A random value on the elliptic curve (r X , s X ) Elliptic curve signature value of X (x X , y X ) An ECDSA(Elliptic Curve Digital Signature Algorithm) signature message of X ID BCi The index value of blockchain message BC X Blockchain message of X M will The plain text of the will M Arg Arbitration dispute message content M ArgID

Identity information of an applicant for arbitration M Argpay
The message of the arbitrator's estate distribution TS X Timestamp message of X h(.) Hash function C X The ciphertext of role X E pukX (M) Use X's public key Puk X to encrypt message M D prkX (M) Use X's private key Prk X to decrypt message M A ? = B Verify whether A is equal to B

Initialization Phase
In the proposed scheme of the initial phase, this research study uses Ethereum blockchain technology. During the transaction, some key messages will be stored and verified through the blockchain center. The key information of these blockchains will be defined in smart contracts. Algorithm 1 and Algorithm 2 are the blockchain smart contract structure for the proposed scheme. The following key information will be stored in the blockchain: (1) In the structure of the will message, sensitive information about the identity of the testator, a list of heirs and distributions, and other types of information are recorded. (2) In the structure of the death certificate, sensitive information about the identity of the deceased, the department that issued the death certificate, the date of death, and the attributes of the death are recorded.

Registration Phase
At this stage, when the system is used for the first time, all participants (such as the blockchain center, applicants, family members, courts, and hospitals) must be registered in the blockchain center. The roles of all parties on the registration page of the Blockchain Center are specified and the registration information is filled in in the correct format. After completing the registration information, the registration information filled in by the role to the Blockchain Center (BCC) is sent in order to apply for registration through Transport Layer Security (TLS) and the public and private keys of the elliptic curve digital signature algorithm (ECDSA) are obtained. Figure 3 below is a flowchart of the communication protocol during the registration phase.  Step1. Role X generates an identity IDX, and sends it to the blockchain center.
Step2. The blockchain center generates an ECDSA private key dx based on the role X, calculates QX=dX*G. If the identity of the registered role is verified as being correct, the smart contract xIns will be triggered, the content of which is the Algorithm 3 as follows: Algorithm 3. Smart contract xIns of the proposed scheme.
function insert x smart contract xIns ( string x id, string x detail) { count ++; x id.count = id; x detail.count = detail; } string x keypairs; Then the blockchain center will transmit IDX, (dX, QX) to role X.
Step3. The role X will store the key (dX, QX).

Will Editing Phase
In the will editing phase, the applicant must visit the court's website and download the will template to edit the will. After the applicant has filled in the template, the will Step1. Role X generates an identity ID X , and sends it to the blockchain center.

Roles (X) Blockchain Center
Step2. The blockchain center generates an ECDSA private key dx based on the role X, calculates Q X =d X *G. If the identity of the registered role is verified as being correct, the smart contract xIns will be triggered, the content of which is the Algorithm 3 as follows: Algorithm 3. Smart contract xIns of the proposed scheme.
function insert x smart contract xIns ( string x id, string x detail) { count ++; x id.count = id; x detail.count = detail; } string x keypairs; Then the blockchain center will transmit ID X , (d X , Q X ) to role X.
Step3. The role X will store the key (d X , Q X ).

Will Editing Phase
In the will editing phase, the applicant must visit the court's website and download the will template to edit the will. After the applicant has filled in the template, the will content will be sent to the court for review. Since personal wills are sensitive information, the will content will be encrypted before being sent to the court. After the court receives the will, it will first verify the identity to ensure that the source of the will is correct. If it is correct, it will review the contents of the will and upload the applicant's will to the blockchain center. Figure 4 below is a flow chart of the editing will phase.   to the blockchain center.

Death Certificate Issuing Phase
During the death certificate issuing phase, the testamentary successor applies to the hospital for the death certificate, and the testamentary successor provides the hospital with relevant information about the applicant. After the hospital receives the application message and confirms that the relevant information is correct, the hospital will issue a death certificate based on the application information provided by the probate successor. Since the death certificate contains sensitive information, personally sensitive information will be encrypted and sent to the blockchain center. Figure 5 shows a flowchart of the death certificate issuing phase. Step1. The applicant first downloads the will from the court website and then fills in the contents of the will. After the applicant fills in the content of the will, the applicant will generate a random value k A−C and use the court's public key Puk C to encrypt the content of the will. The signature will be calculated C A−C = E PukC (M will ), Step2. The court first uses TS now − TS A−C ≤ ∆T to check whether the timestamp is valid. Then, the correctness of the ECDSA signature is verified and the following is calculated: If the verification is recognized, and the signature obtained by the representative is correct, the court will obtain information related to the will and trigger the smart contract will. the content of which is the Algorithm 4 as follows:  The court calculates BC A−C = h(r A−C , s A−C ) and uploads (ID A , BC A−C ) to the blockchain center.

Death Certificate Issuing Phase
During the death certificate issuing phase, the testamentary successor applies to the hospital for the death certificate, and the testamentary successor provides the hospital with relevant information about the applicant. After the hospital receives the application message and confirms that the relevant information is correct, the hospital will issue a death certificate based on the application information provided by the probate successor. Since the death certificate contains sensitive information, personally sensitive information will be encrypted and sent to the blockchain center. Figure 5 shows a flowchart of the death certificate issuing phase. Step1. The testamentary heir submits an application for a death certificate to the hospital. When the hospital receives the testamentary heir's application, the hospital generates a random value kH-BCC, executes the signature calculation - , ,  = r H−BCC , and if it passes the verification, it means that the obtained signature is correct and triggers the smart contract deaths. the content of which is the Algorithm 5 as follows:

Will Assets Distributing Phase
In the will assets distributing phase, after the hospital issues the death certificate, the smart contract will be triggered at this time, and the will assets distribution action will be executed according to the content of the testator's will. Figure 6 demonstrates a flowchart of the will assets distributing phase.   Figure 6. Flowchart of the will assets distributing phase.

Court (C) Blockchain Center (BCC)
Step1. After the hospital issues the death certificate and uploads it to the blockchain center, it enters the testamentary property distribution process, then, the blockchain center generates a random value k BCC-C , executes the signature to calculate z BCC−C = h(ID BC , TS BCC−C , BC BCC−C ), (x BCC−C , y BCC−C ) = k BCC−C G, r BCC−C = x BCC−C modn, s BCC−C = k BCC−C −1 (z BCC−C + d BCC−C r BCC−C )modn, and then sends ID BC , TS BCC−C , BC BCC−C , (r BCC−C , s BCC−C ) to the court.
Step2. After the court receives the message from the blockchain center, it will first use TS now − TS BCC−C ≤ ∆T to check whether the timestamp is valid, then verify the correctness of the ECDSA signature, and calculate z BCC−C = h(ID BC , TS BCC−C , If the verification is recognized, and the signature is correct, the court will use Dprk C to decrypt the contents of the will. The court generates a random value k C-BCC , executes the signature calculation Step3. When the blockchain center receives a message from the court, it will first use TS now − TS C−BCC ≤ ∆T to check whether the timestamp is valid, then verify the correctness of the ECDSA signature and calculate If the verification is recognized, it is confirmed that the signature is correct. Then, the blockchain center will use the private key to decrypt the encrypted content (M will ) = D prkBCC (BC C−BCC ), read the successor list in the will, refer to the contract content proposed in the initialization phase, find the ts_address and ts_pay data from the contract, and then use the Ethereum ERC20 protocol [23], and Call the transferFrom function to execute the asset transfer process. The Algorithm 6 is the content of transferFrom. This function will first check whether the sender's balance is greater than or equal to the specified amount, and then check that the specified transfer amount does not exceed the previously set transfer limit. If all the conditions are met, the corresponding amount will be transferred from the applicant's wallet. The property amount is transferred to the designated account, and finally, the transaction message will be published and recorded on the block.

Arbitration Phase
During the arbitration phase, when the testamentary heirs object to the distribution of the testamentary property, the testamentary heirs will provide the court with ID TS , ID A , ID BCwill , ID BCdie , M Arg information. The court will use the application information provided by the testamentary heir and compare the blockchain data to confirm the validity of the will, the identity of the testamentary heir, death certificate, and property distribution. The flow of the arbitration phase is shown in Figure 7.

Integrity
In our research, the elliptic curve digital signature algorithm (ECDSA) was used to sign the transmitted message and ensure data integrity. In the will editing phase, when the applicant sends a message to the court, the applicant will generate the ECDSA signature After receiving the message, the court will verify the validity of the applicant's timestamp

Court (C) Blockchain Center (BCC) Testamentary Successor (TS)
Validity of the will signature.
Confirm that IDTS is the successor in the Step1. The testamentary heir applies to the court for arbitration and sends a message ID TS , ID A , ID BCwill , ID BCdie , M Arg to the court. After the court receives it, it enters the arbitration procedure. The court uses ID A to obtain the testator's signature (r A−C , s A−C ) and uses ID BCwill to retrieve the blockchain data BC A−C of the testator's will and verify the blockchain data BC A−C ? = h(r A−C , s A−C ). If the verification fails, the court will reject the arbitration application.
Step2. After the court verifies the validity of the will signature, the court checks the content BC A−C of the will blockchain data and compares ID TS with the ts_address data in the testament succession list to confirm if the identity of the testamentary heir is inherited by the testator ID TS ? = ts_address. If the verification fails, the court will reject the arbitration application.
Step3. After the court verifies the validity of the testamentary successor, the court uses ID A to obtain the testator's signature (r A−C , s A−C ) and uses ID BCwill to retrieve the death certificate blockchain data BB, and verify the death certificate blockchain signature data BC H−BCC ? = h(r H−BCC , s H−BCC ). If it fails, the court will reject the arbitration application.
Step4. If the court verifies the validity of the death certificate, the court will use the will blockchain data BC A−C obtained in the second step, and then compare M Arg these with the information in the inheritance list in the will. The M Arg message contains the address M ArgID of the testamentary heir and property M Argpay currently allocated to the testamentary heir. The court will then check the successor list from the BC A−C . The heir list will refer to the contract content proposed in the initialization phase, and merge the ts_pay and M Arg into the heir list. It will compare the amount of property currently allocated by the probate heir to check whether the property allocation is incorrect M Argpay ? = ts_pay. If the verification fails, the court will reject the arbitration application. If the verification is successful, it means that the blockchain data have been fully verified and the arbitration application of the testamentary heir has also been established.
Step5. When the testamentary heir receives the messages that the arbitration has been established, the testamentary heir can retain the results of the arbitration to execute legal procedures and redistribute the property through administrative procedures.

Integrity
In our research, the elliptic curve digital signature algorithm (ECDSA) was used to sign the transmitted message and ensure data integrity. In the will editing phase, when the applicant sends a message to the court, the applicant will generate the ECDSA signature (x A−C , y A−C ) = k A−C G. After receiving the message, the court will verify the validity of the applicant's timestamp TS now − TS A−C ≤ ∆T and ECDSA signature = r H−BCC modn. Finally, in the assets distributing phase, both the blockchain center and the court will generate its ECDSA signature (x BCC−C , y BCC−C ) = k BCC−C G, (x C−BCC , y C−BCC ) = k C−BCC G. After receiving the ECDSA signature, the hospital will verify the blockchain center's timestamp TS now − TS BCC−C ≤ ∆T, TS now − TS C−BCC ≤ ∆T, and the correctness of the signature x BCC−C ? = r BCC−C modn, x C−BCC ? = r C−BCC modn. Since the attacker does not know the private keys of the applicant, the court, and the hospital, even if the transmission content is tampered with, the correct ECDSA signature (x A−C , y A−C ), (x H−BCC , y H−BCC ), (x BCC−C , y BCC−C ) and (x C−BCC , y C−BCC ) will not be generated.
From the above descriptions, this study uses ECDSA signature technology to ensure the integrity of the transmitted message. If the attacker intercepts the message sent to the court and pretends to be a legitimate applicant who sent an incorrect testament message to the court. The attacker will not be able to successfully attack, because even if the attacker modifies the content of the applicant's will content sent to the court, the attacker cannot use the applicant's private key to sign the ECDSA. After receiving the messages, the court will immediately check the integrity of the received data. The court will find that the message content does not match the signature, and the attacker's attack will fail.

Public Verifiability
This research uses the ECDSA digital signature mechanism, combined with blockchain technology to design an electronic will system with smart contracts based on the blockchain mechanism, which has the characteristics of public verification. All messages must be verified before uploading, and the correctness of the messages will be verified during the process of sending and receiving messages. Next, take the message sent by the applicant and the court as an example. When the applicant sends a message signed with ECDSA to the court, the court will first verify the legality of the time stamp TS now − TS A−C ≤ ∆T and the ECDSA signature x A−C ? = r A−C modn. Then, the court will generate blockchain data BC A−C = h(r A−C , s A−C ), and upload the blockchain data to the blockchain center using ID A as an index. In other words, after verifying the correctness of the timestamp and signature for each role that receives the message, it will also verify the correctness of the ECDSA signature generated by the previous role. Therefore, our proposed solution achieves publicly verifiable features by applying blockchain technology and ECDSA digital signatures.

Unforgeability
This study uses blockchain technology, which has the characteristics of being decentralized, open, anonymous, and tamperproof, and can retain the integrity of the will content. Therefore, when the applicant, heirs, and family members of the applicant have questions about the will, they can verify and compare the signature information of the will at any time to confirm the legality of the information. Since the signature is signed by the applicant using his private key, neither the court nor illegal people can use the applicant's private key to sign the ECDSA. Therefore, when the verifier checks if the signature of the will matches the actual signature of the will, if it does not match, then it can be known that the will has been forged.

Non-Repudiation
In this study, when all roles send the content message, each role uses its private key to sign and transmit the message with ECDSA, and each role has its own private key. Take the applicant and the court as examples, when sending a message signed with ECDSA to the court, the court will use the applicant's public key to verify the message. If the message is successfully verified, the court will not reject the content of the sent message. Therefore, this mechanism has undeniable characteristics. After the receiver receives the message, it will use the sender's public key to verify the message. If the message is successfully verified, the sender cannot reject the content of the sent message. Table 2 is a description of the non-repudiation of each role in this scheme.

Message Irreversibility
In the proposed scheme, the key message content transmitted between each role is first passed through the hash function calculation and the time stamp mechanism before being chained to achieve the characteristic of message irreversibility. The information after the hash function operation is as follows: Because the attacker cannot reverse the content of the original message, the message is irreversible.

Resist Counterfeiting Attacks
Attackers can fake the contents of a will by impersonating a legitimate applicant. To prevent such attacks, the proposed solution in this research uses ECDSA and hash functions to protect sensitive messages. Next, take the editing phase of a will as an example. When the applicant sends a message with an ECDSA signature to the court, the court will first verify the legality of the timestamp TS now − TS A−C ≤ ∆T and the correctness of the ECDSA signature x A−C ? = r A−C modn. The ECDSA signature is signed by the applicant using his/her private key. Neither other legal roles nor illegal personnel can use the applicant's private key to sign on the ECDSA. When the court checks the ECDSA signature of the will does not match the actual signature of the will, the court will know that the will is forged. Therefore, this solution can safely prevent counterfeiting attacks.

Tamperproof
This research uses blockchain technology, which is a chain formed by linear connections of blocks. The transaction records of all parties on our system will be stored in the corresponding blockchain. For example, after confirming the correctness of the time stamp = r A−C , TS now − TS H−BCC ≤ ∆T, the contents of the will and death certificate will be written into this block. Due to the immutability of blockchain technology, once a block record is generated and uploaded to the chain, it cannot be tampered with, because other blockchain verifiers will not recognize the modified information, as long as the block data have been modified, the block hash value will fail to verify. Therefore, the proposed scheme realizes that the will cannot be tampered with.

System Decentralization
Since traditional applications and network platforms have servers and databases dedicated to processing and storing data and defining how the code should be executed, all data records are subjected to the official server and database constraints. However, if the official server is closed due to abnormalities or if a hacker invades and tampers with the data, then the data will be damaged. Therefore, this research adopts blockchain technology with decentralized characteristics. It is a decentralized data storage space on the blockchain. Therefore, no one has the opportunity to tamper with the data in the block. It will avoid stopping operations due to unexpected failures.

Fair Arbitration
As demonstrated in the arbitration process shown in Figure 7, this study designed a set of arbitration mechanisms. If there is a dispute over the distribution of property, the testamentary heirs can apply to the court for arbitration and provide the court with information, such as ID TS , ID A , ID BCwill , ID BCdie , M Arg . The court will use the arbitration information provided by the probate heir to obtain block information from the blockchain center for review. After the review, the testamentary heirs will be notified of the result of the arbitration, and the testamentary heirs can initiate legal proceedings based on the result of the arbitration to redistribute the property. Therefore, the proposed scheme can ensure that the testamentary heirs will not suffer unfair arbitration. Table 3 shows the calculation cost analysis and function of each stage in our proposed plan.  In Table 3, we analyzed the computational cost of the proposed scheme in each stage of the blockchain center, applicant, court, hospital, and testamentary successor. We found the highest computation cost in the will assets distribution phase; for example, the Blockchain Center needs seven multiplication operations, two hash function operations, one comparison operation, and two signature operations. The Court needs seven multiplication operations, two hash function operations, one comparison operation, and two signature operations. Thus, the computation cost is acceptable in our proposed system. Table 4 shows the communication cost analysis of the proposed scheme. In the current 3G environment, the maximum transmission speed is 14 Mbps. In a 4G environment, the maximum transmission speed is 100 Mbps. In a 5G environment, the maximum transmission speed is 20 Gbps [28]. We assume that the ECDSA key and signature are 160 bits, the hash function calculated value is 160 bits, and the remaining message length (such as ID and timestamp) is 80 bits. The cost of communication cost analysis at each phase is shown in Table 4 below: Take the analysis of the highest communication cost in the will assets distributing phase as an example, the effectiveness of this mechanism is higher than that of other phases, and its total communication cost is 1280 bits. It takes 0.091 ms in a 3.5G (14 Mbps) communication environment, 0.128 ms in a 4G (100 Mbps) communication environment, and 0.021 microseconds in a 5G (20 Gbps) communication environment. From the above analysis, we know that these communication costs are very low, so the proposed solution has better communication performance. Table 5 below shows a functional comparison of the proposed solutions. It can be seen from the table that although some documents using blockchain technology in the past, there are still some shortcomings.

Function Comparison
In Table 5, we can see that in the solutions proposed by Chien and Lin [4], Lee et al. [5], and Chen et al. [6], they all use a cryptographic system to encrypt the content of the electronic will, but none of these three references provide this function in terms of security, such as making the message irreversible, resistant to counterfeiting attacks, and tamperproof. In the proposed scheme by Sreehari et al. [7], although people are concerned about the blockchain issue and the concept of storing wills in the blockchain through smart contracts, the content of the document is only in the draft stage. The detailed protocol does not appear in this article. Therefore, all of our proposed schemes overcome the above shortcomings and implement a legacy distribution mechanism.

Limitations
In the proposed scheme, before using the system, all roles need to be registered with the blockchain center and have their respective data filled in. An Ethereum account and other relevant information are also required during the registration process. After successful registration, they need to obtain the public key and private key pair of the elliptic curve signature before they can use this system. Additionally, the legal effect of online wills will depend on the amendment of relevant digital signature legal provisions in various countries.

Conclusions
With the rapid development of the social economy, our society is gradually aging. There is an increasing number of family disputes about inheritance. A will allows the testator to decide how property will be distributed after their death in accordance with his/her wishes. It can also avoid ongoing disputes between children for the distribution of property and even avoid court appeals. Currently, traditional methods are used to produce a will, but privacy and security protection are relatively insecure. Electronic will production has a higher level of privacy and convenience. Users have their accounts and passwords, which can not only reduce costs but also improve efficiency. Through blockchain technology, the shortcomings of the existing architecture and environment can be solved.
In this research, we propose a traceable online will system based on blockchain and smart contract technology. The applicant first goes to the court to download the will document to fill in the content of the will, and then obtains the review of the court. All information about the pre-will process will be uploaded to the blockchain, and the relevant information will be signed by each role. Therefore, attackers cannot tamper with it. The legality of the data can be verified by a third party to achieve the purpose of anti-counterfeiting and to ensure the security of the will content.
The proposed scheme can meet the requirements of information security, including ensuring data integrity, and that information is irreversible, non-reproducible, and tamperproof. Through blockchain technology, not only anti-counterfeiting of the will is achieved, but also the cost is reduced and the efficiency is improved. It also incorporates smart contracts. The deployment of smart contracts needs to be done through blockchain transactions. After the deployment is completed, it cannot be changed. Therefore, the trust problem that cannot be solved by traditional wills has been completely resolved. This research also proposes an achievable arbitration mechanism solution to ensure that testamentary successors will not suffer unfair arbitration.

Institutional Review Board Statement:
This study is based entirely on theoretical basic research. It does not involve humans.

Informed Consent Statement:
This study is based entirely on theoretical basic research. It does not involve humans.

Data Availability Statement:
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest:
The authors declare no conflict of interest.