A cross-chain transaction method combining hash time locks and a notary mechanism
By combining hash time locks with a notary mechanism, the cross-chain transaction method solves the problems of centralization and inequality in blockchain cross-chain transactions, achieving decentralized and flexible transaction processes and asset security, ensuring equal status for both parties and smooth transaction execution.
Patent Information
- Application Number
- CN202411349328.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Existing blockchain cross-chain transactions suffer from issues such as centralization, strong reliance on notaries, inequality in the transaction process, and lack of flexibility in transaction cancellation, leading to risks of transaction failure or asset loss.
By combining hash time locks with a notary mechanism, a transaction process is designed to establish the equal status of both parties by creating hash time lock contracts and notary contracts on the blockchain, and a notary is introduced to intervene in the transaction process when necessary to ensure the atomicity and security of the transaction.
It achieves a decentralized transaction process, reduces reliance on notaries, prevents unilateral cancellation by the transaction initiator, protects the rights and interests of transaction participants, and ensures the smooth progress of transactions and asset security.
Smart Images

Figure CN119398917B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and in particular to a cross-chain transaction method that combines hash time locks and a notary mechanism. Background Technology
[0002] Blockchain technology originated from Satoshi Nakamoto's published paper. Through continuous development and improvement, it has been applied across various industries. Due to its characteristics of transparency, decentralization, and immutability, blockchain possesses vast application potential and prospects. However, different blockchains face interoperability issues. The independence of blockchains hinders asset circulation and value transfer, making the resolution of the "value silo" problem imperative. Information barriers between different blockchains not only restrict the development of blockchain technology but also impede its application in various industries, leading to the emergence of cross-chain blockchain technology.
[0003] Currently, cross-chain technologies mainly include notary mechanisms, sidechain / relay mechanisms, hash locking mechanisms, and distributed private key control. Among these, the notary mechanism is simple in principle and easy to implement compared to other cross-chain mechanisms; however, it is extremely dependent on the notary, resulting in a centralized problem: if the notary goes offline, the transaction risks failure. Hash time locks achieve decentralization but lack flexibility; transaction cancellation can only passively wait for the time lock to unlock, lacking flexibility. Furthermore, the initiator of the transaction can unilaterally decide whether to proceed, dominating the transaction process and creating an unequal relationship between the two parties. Summary of the Invention
[0004] To address the shortcomings of the existing technologies mentioned above, this invention combines hash time locks with a notary mechanism to design a cross-chain transaction method that integrates hash time locks and a notary mechanism. This combination ensures transaction atomicity while resolving the issues of centralization and over-reliance on notaries in the notary mechanism. It also guarantees equal status for both parties during the transaction, preventing the initiator from unilaterally canceling the transaction. Furthermore, it avoids assets entering the notary's account, reducing the risk of user asset loss.
[0005] The technical solution of the present invention is described in detail below.
[0006] This invention provides a cross-chain transaction method that combines hash time locks and a notary mechanism, specifically including the following steps:
[0007] Step S1: Deployment of the hash time lock contract and determination of the notary group management strategy;
[0008] Step S2: Initiating cross-chain transactions and withdrawing or canceling them;
[0009] Furthermore, step S1 specifically includes the following steps:
[0010] S11: Create a notary association contract on the two chains of the blockchain: Chain1 and Chain2 for the management and election of notaries. At the same time, create a hash time lock contract on these two chains for the initiation, withdrawal and cancellation of transactions.
[0011] S12: Rules for the joining and election of notaries: Ordinary nodes on the chain apply to join the notary group through the notary group contract, and at the same time choose the evaluation and election mechanism of notaries and deploy it in the notary group contract.
[0012] Furthermore, step S2 specifically includes the following steps:
[0013] S21: The two parties agree on and determine the transaction details off-chain, including: the specific transaction amount on both chains; the identities of the two parties, one of whom is the initiator of the transaction and the other is the participant; the corresponding time of the time lock in the transaction; the time of the notary's intervention in the transaction; the transaction initiation waiting time; each party determines the preimages OA and OB of the hash lock, and generates the corresponding hash values HashA and HashB based on them, and exchanges the hash values off-chain.
[0014] S22: The transaction initiator submits a transaction application to the hash time lock contract on blockchain Chain1. The parameters passed in include the transaction addresses of the transaction initiator and the transaction participants on the two chains, the hash values of both parties, the time of the time lock, the transaction initiation waiting time, the notary intervention time, the transaction amount on the two chains, and their identities in the transaction. The corresponding funds are then transferred to the hash time lock contract account, and the assets will be locked by this hash time lock contract.
[0015] S23: Upon receiving a transaction application, the hash time-lock contract first checks whether the transferred amount matches the amount stated in the information and whether the time lock time and the notary's intervention time comply with the rules. If any issues are found, the balance will be returned to the transaction initiator, and they will be notified of the creation failure. If no issues are found, a transaction ID will be generated for the transaction using a hash function based on the submitted data. A notary will be elected through a notary group contract and a pre-set notary election scheme. The transaction ID will be communicated to the notary and the initiator, and the notary's address will be provided to the transaction participants. After receiving the notification, the transaction participants will submit a transaction application on the Chain2 blockchain. The hash time-lock contract on Chain2 will generate the same transaction ID using the same method and parameters and lock the participants' assets. At this point, the transaction has not yet been activated. Before the notary activates the transaction, either the transaction initiator or the transaction participants can withdraw the application.
[0016] S24: After receiving the notification of being elected, the notary will check on the Chain2 blockchain for the existence of a corresponding transaction using the received transaction ID. If the transaction exists, the notary will activate the transaction on both chains to proceed to the next step. If the transaction does not exist, the notary will continue to monitor the Chain2 blockchain until the corresponding transaction is created or the pre-set transaction initiation waiting time is reached. If the transaction fails to be created within the transaction initiation waiting time, the transaction creation will fail and the transferred funds will be returned.
[0017] S25: After the notary successfully activates the transactions on both chains, the transaction is officially established. At this time, the transaction initiator sends an asset withdrawal request to the hash time-lock contract on Chain2. By submitting the transaction ID and the pre-determined hash preimage OA, the transaction initiator can withdraw the assets locked by the transaction participants. If the OA is correct, the hash time-lock contract on Chain2 will send the assets to the address of the transaction initiator and notify the transaction participants by triggering an event. The hash preimage OA will be sent to the participants as a parameter of the event. If the OA is incorrect, the asset withdrawal will fail. Once the transaction is officially established, it cannot be unilaterally cancelled. To cancel the transaction, an application to cancel the transaction must be submitted to the hash time-lock contract. Either the transaction participant or the transaction initiator can cancel the transaction.
[0018] S26: After receiving the event triggered by the hash time lock contract on Chain2, the transaction participant obtains the hash preimage OA. At this time, the transaction participant initiates an asset withdrawal request to the hash time lock contract on Chain1, and withdraws the assets locked in it by the transaction initiator by submitting the transaction ID and the received hash preimage OA. If the OA is correct, the hash time lock contract on Chain1 will send the assets to the participant's address, and the transaction ends. If the OA is incorrect, the asset withdrawal will fail.
[0019] S27: If an unexpected situation occurs during the transaction process, causing either the initiator or the participant to fail to complete the transaction according to the above procedures, or if the initiator of the transaction attempts to forcibly cancel the transaction by refusing to withdraw assets, then after the notary intervenes, the notary will submit a transaction settlement application to the hash time lock contract on both chains.
[0020] S28: When the hash time lock contract receives the notary's transaction settlement application, it confirms whether the current time has reached the notary's intervention time and the status of the transaction. If the notary's intervention time has reached and the assets have not yet been withdrawn, then the assets are sent to the corresponding address.
[0021] Furthermore, step S23 specifically includes the following steps:
[0022] S231: If either the transaction participant or the transaction initiator wants to withdraw the transaction, they must first submit a transaction withdrawal application to the hash time lock contract that locks the applicant's assets, and provide the transaction ID and the hash preimage previously generated and held.
[0023] S232: Upon receiving a transaction withdrawal request, the hash time lock contract first verifies the applicant's identity, transaction ID, and hash image. If correct, it withdraws the transaction, returns the locked assets to the sending address, and notifies the notary of the transaction.
[0024] S233: After receiving the transaction revocation notice, the notary first writes the revocation information to another chain, and then cancels the monitoring of the original transaction.
[0025] Furthermore, step S25 specifically includes the following steps:
[0026] S251: If either the transaction participant or the transaction initiator wants to cancel the transaction, they must first initiate an asset freeze request to the hash time lock contract that locks the assets of the transaction cancellation applicant, and submit the hash preimage and transaction ID they hold.
[0027] S252: After receiving an asset freeze application, the hash time lock contract verifies the hash preimage of the cancellation transaction applicant and the asset status. If the asset has not yet been withdrawn, the locked asset will be frozen, and the freeze notice and the hash preimage of the cancellation transaction applicant used to freeze the asset will be sent to the other party.
[0028] S253: The other party, as the counterparty to the transaction who is applying for cancellation of the transaction, after receiving the asset freeze notice, submits a transaction cancellation request to the hash time lock contract that has locked its assets using the received hash preimage, its own hash preimage, and the transaction ID; after receiving the transaction cancellation request, the hash time lock contract returns the assets locked by the counterparty to the transaction and sends a transaction cancellation notice and the counterparty's hash preimage to the applicant for cancellation of the transaction.
[0029] S254: After receiving a transaction cancellation request, the hash time lock contract will return the locked assets to the participants and send a transaction cancellation notification and OB to the initiator.
[0030] S255: After receiving the hash preimage of the counterparty, the cancellation applicant submits a cancellation request to the hash time lock contract that locks the cancellation applicant's assets and withdraws the assets by using the hash preimages they hold and the hash preimages of the counterparty they receive.
[0031] In summary, the advantages or beneficial effects of the present invention are as follows:
[0032] 1. This invention employs a combination of hash time locks and a notary mechanism. Besides the notary, both parties can also drive the transaction. Even if the notary goes offline, it will not affect the normal progress of the transaction. After completing the transaction activation, the notary will only intervene in the transaction process if either party deviates from the normal procedure. This avoids the problem of excessive reliance on the notary in the transaction process and prevents the transaction from failing due to the notary's offline status or inaction.
[0033] 2. This invention employs double hash lock technology to ensure that transaction cancellation requires the consent of both parties. This resolves the issue of unequal power between the transacting parties, preventing the initiator from unilaterally canceling the transaction and protecting the rights of all participants. Furthermore, by using a contract address instead of the notary / notary group's address for transactions, the assets of both parties do not enter the notary or notary group's account, ensuring the security of user assets. Attached Figure Description
[0034] Figure 1 A functional module diagram of a cross-chain transaction method combining hash time lock and notary mechanism provided for the implementation of this invention. Detailed Implementation
[0035] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. However, the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention; that is, the described embodiments are merely some embodiments of the invention, not all embodiments. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention.
[0036] The functional modules of the cross-chain transaction method of this invention are as follows: Figure 1 As shown, the processing steps include the following:
[0037] Step S1: Deployment of the hash time lock contract and determination of the notary group management strategy;
[0038] Step S2: Initiating cross-chain transactions and handling transaction withdrawal and cancellation;
[0039] Furthermore, step S1 specifically includes the following steps:
[0040] S11: Create a notary association contract on blockchains Chain1 and Chain2 for the management and election of notaries, and create a hash time lock contract on these two chains for the initiation, withdrawal and cancellation of transactions.
[0041] S12: Rules for the joining and election of notaries: Ordinary nodes on the chain apply to join the notary group through the notary group contract, and at the same time choose the evaluation and election mechanism of notaries and deploy it in the notary group contract.
[0042] Furthermore, step S2 specifically includes the following steps:
[0043] S21: The two parties agree on and determine the transaction details off-chain, including: the specific transaction amount on both chains; the identities of the two parties, one of whom is the initiator of the transaction and the other is the participant; the corresponding time of the time lock in the transaction; the time of the notary's intervention in the transaction; the transaction initiation waiting time; each party determines the preimages OA and OB of the hash lock, and generates the corresponding hash values HashA and HashB based on them, and exchanges the hash values off-chain.
[0044] S22: The transaction initiator submits a transaction application to the hash time lock contract on blockchain Chain1 with parameters as shown in Table 1, and transfers the corresponding funds to the hash time lock contract account. The assets will be locked by this hash time lock contract.
[0045] Table 1 Transaction Application Parameters of the Initiator
[0046] Parameter symbol Parameter meaning Amo1 Transaction amounts on Chain1 Amo2 Transaction amounts on Chain2 <![CDATA[Sender A ]]> The address of the transaction initiator on Chain1 <![CDATA[Sender B ]]> Addresses of transaction participants on Chain2 <![CDATA[Receiver A ]]> The address of the transaction initiator on Chain2 <![CDATA[Receiver B ]]> Addresses of transaction participants on Chain1 HashA Hash value of the transaction initiator HashB Hash values of transaction participants Role Identity in a transaction <![CDATA[Time lock ]]> Time lock time <![CDATA[Time wait ]]> Transaction initiation waiting time <![CDATA[Time intervene ]]> Notary intervention time
[0047] S23: Upon receiving a transaction application, the hash time lock contract first checks whether the transferred amount matches the amount stated in the information and whether the time lock time and the notary's intervention time comply with the rules. If any issues are found, the balance will be returned to the transaction initiator, and they will be notified of the creation failure. If no issues are found, a transaction ID will be generated for the transaction using a hash function based on the submitted data. A notary will be elected through a notary group contract and a pre-set notary election scheme. The transaction ID will be communicated to the notary and the initiator, and the notary's address will be provided to the transaction participants. After receiving the notification, the transaction participants submit a transaction application on the blockchain Chain2. The application parameters are shown in Table 2. The hash time lock contract on Chain2 uses the same method and parameters to generate the same transaction ID and locks the participants' assets. The same ID can be generated only when both parties correctly submit the transaction information, eliminating the need to verify the transaction information and simplifying the transaction process. At this point, the transaction has not yet been activated. Before the notary activates the transaction, either the transaction initiator or the transaction participants can withdraw the transaction.
[0048] Table 2 Transaction Application Parameters of Participants
[0049] Parameter symbol Parameter meaning Amo1 Transaction amounts on Chain1 Amo2 Transaction amounts on Chain2 <![CDATA[Sender A ]]> The address of the transaction initiator on Chain1 <![CDATA[Sender B ]]> Addresses of transaction participants on Chain2 <![CDATA[Receiver A ]]> The address of the transaction initiator on Chain2 <![CDATA[Receiver B ]]> Addresses of transaction participants on Chain1 HashA Hash value of the transaction initiator HashB Hash values of transaction participants Role Identity in a transaction <![CDATA[Time lock ]]> Time lock time <![CDATA[Time wait ]]> Transaction initiation waiting time <![CDATA[Time intervene ]]> Notary intervention time <![CDATA[Address Notary ]]> The notary's address on Chain2
[0050] S24: After receiving the notification of being elected, the notary will check on the Chain2 blockchain for the existence of a corresponding transaction using the received transaction ID. If the transaction exists, the notary will activate the transaction on both chains to proceed to the next step. If the transaction does not exist, the notary will continue to monitor the Chain2 blockchain until the corresponding transaction is created or the pre-set transaction initiation waiting time is reached. If the transaction fails to be created within the transaction initiation waiting time, the transaction creation will fail and the transferred funds will be returned.
[0051] S25: After the notary successfully activates the transactions on both chains, the transaction is officially established. At this time, the transaction initiator sends an asset withdrawal request to the hash time-lock contract on Chain2. By submitting the transaction ID and the pre-determined hash preimage OA, the transaction initiator can withdraw the assets locked by the transaction participants. If the OA is correct, the hash time-lock contract on Chain2 will send the assets to the address of the transaction initiator and notify the transaction participants by triggering an event. The hash preimage OA will be sent to the participants as a parameter of the event. If the OA is incorrect, the asset withdrawal will fail. Once the transaction is officially established, it cannot be unilaterally cancelled. To cancel the transaction, an application to cancel the transaction must be submitted to the hash time-lock contract. Either the transaction participant or the transaction initiator can cancel the transaction.
[0052] S26: After receiving the event triggered by the hash time lock contract on Chain2, the transaction participant obtains the hash preimage OA. At this time, the transaction participant initiates an asset withdrawal request to the hash time lock contract on Chain1, and withdraws the assets locked in it by the transaction initiator by submitting the transaction ID and the received hash preimage OA. If the OA is correct, the hash time lock contract on Chain1 will send the assets to the participant's address, and the transaction ends. If the OA is incorrect, the asset withdrawal will fail.
[0053] S27: If an unexpected situation occurs during the transaction process, causing either the initiator or the participant to fail to complete the transaction according to the above procedures, or if the initiator of the transaction attempts to forcibly cancel the transaction by refusing to withdraw assets, then after the notary intervenes, the notary will submit a transaction settlement application to the hash time lock contract on both chains.
[0054] Compared to traditional hash time locks, this invention introduces a notary public. By having a notary public intervene, the transaction can be effectively prevented from failing due to the initiator refusing to withdraw assets, thus effectively protecting the rights and interests of the transaction participants.
[0055] S28: When the hash time lock contract receives the notary's transaction settlement application, it confirms whether the current time has reached the notary's intervention time and the status of the transaction. If the notary's intervention time has reached and the assets have not yet been withdrawn, then the assets are sent to the corresponding address.
[0056] In this invention, although the transaction still requires the assistance of a notary, after the transaction is activated, both parties can complete the remaining transaction process themselves according to the above method, which greatly reduces the dependence on the notary. At the same time, the transaction assets will not enter the notary's account, which reduces the notary's motivation to do evil and ensures the safety of users' funds.
[0057] Furthermore, step S23 specifically includes the following steps:
[0058] S231: Either party can initiate a withdrawal before the transaction is activated. If the initiator wants to withdraw the transaction, it must first submit a transaction withdrawal request to the hash time lock contract on Chain1 and provide the transaction ID and the previously generated hash preimage. If the participant wants to withdraw the transaction, the same operation is performed on Chain2.
[0059] S232: Upon receiving a transaction withdrawal request, the hash time lock contract will first verify the applicant's identity, transaction ID, and hash image. If correct, the transaction will be withdrawn, the locked assets will be returned to the sending address, and the transaction's notary will be notified.
[0060] S233: After receiving the transaction revocation notice, the notary first writes the revocation information to another chain, and then cancels the monitoring of the original transaction.
[0061] Furthermore, step S25 specifically includes the following steps:
[0062] S251: Either party to a transaction may attempt to cancel the transaction, and the process is the same for both parties. If the initiator needs to cancel the transaction, it must first send an asset freeze request to the hash time lock contract that locks its assets, namely Chain1, and submit its hash preimage OA and transaction ID.
[0063] S252: After receiving an asset freeze application, the hash time lock contract will verify the hash preimage and asset status. If the asset has not yet been withdrawn, the locked asset will be frozen, and a freeze notification and the hash preimage OA used to freeze the asset will be sent to the participants.
[0064] S253: After receiving the asset freeze notice, the participant uses the received hash preimage OA, its own hash preimage OB, and the transaction ID to submit a transaction cancellation request to the hash time lock contract that has locked the participant's assets, namely Chain2.
[0065] In this invention, canceling a transaction requires the joint effort of both parties using the aforementioned method. Neither party can unilaterally force cancellation. However, if one party refuses to cancel, a notary public can intervene to ensure the smooth progress of the transaction. This guarantees the equality of rights between the two parties during the transaction process and ensures its successful completion.
[0066] S254: After receiving a transaction cancellation request, the hash time lock contract will return the locked assets to the participants and send a transaction cancellation notification and OB to the initiator.
[0067] S255: After receiving the OB, the initiator submits a cancellation request to the hash time lock contract that locks the initiator's assets and withdraws the assets through its own OA and the obtained OB.
Claims
1. A cross-chain transaction method combining hash time locks and a notary mechanism, characterized in that, It includes: Step S1: Deployment of the hash time lock contract and determination of the notary group management strategy; Notary association contracts are created on the two chains of the blockchain: Chain1 and Chain2 for the management and election of notaries. At the same time, hash time lock contracts are created on these two chains for the initiation, withdrawal, and cancellation of transactions. The rules for joining and electing notaries are stipulated: ordinary nodes on the chain apply to join the notary group through the notary group contract, and at the same time, they choose the evaluation and election mechanism for notaries and deploy it in the notary group contract; Step S2: Initiating cross-chain transactions and withdrawing or canceling them; Step S2 specifically includes the following steps: S21: The two parties to the transaction agree on and confirm the transaction details off-chain; S22: The transaction initiator submits a transaction application to the hash time lock contract on blockchain Chain1 and transfers the corresponding funds to the hash time lock contract account. The assets will be locked by this hash time lock contract. S23: Upon receiving a transaction application, the hash time-lock contract first checks whether the transferred amount matches the amount stated in the information and whether the time lock time and the notary's intervention time comply with the rules. If any issues are found, the balance will be returned to the transaction initiator, and they will be notified of the creation failure. If no issues are found, a transaction ID will be generated for the transaction using a hash function based on the submitted data. A notary will be elected through a notary group contract and a pre-set notary election scheme. The transaction ID will be communicated to the notary and the initiator, and the notary's address will be provided to the transaction participants. After receiving the notification, the transaction participants submit a transaction application on the Chain2 blockchain. The hash time-lock contract on Chain2 generates the same transaction ID using the same method and parameters and locks the participants' assets. At this point, the transaction has not yet been activated. Before the notary activates the transaction, either the transaction initiator or the transaction participants can withdraw the application. S24: After receiving the notification of being elected, the notary checks whether a corresponding transaction exists on the Chain2 blockchain using the received transaction ID; if it exists, the notary activates the transaction on both chains to proceed to the next step. S25: After the notary successfully activates the transactions on both chains, the transaction is officially established. At this time, the transaction initiator sends an asset withdrawal request to the hash time lock contract on Chain2, and withdraws the assets locked in by the transaction participants by submitting the transaction ID and the pre-determined hash preimage OA. Once the transaction is officially established, it cannot be unilaterally cancelled. To cancel the transaction, an application to cancel the transaction must be submitted to the hash time lock contract. Either the transaction participant or the transaction initiator can cancel the transaction. S26: After receiving the event triggered by the hash time lock contract on Chain2, the transaction participant obtains the hash preimage OA; at this time, the transaction participant initiates an asset withdrawal request to the hash time lock contract on Chain1, and withdraws the assets locked in it by the transaction initiator by submitting the transaction ID and the received hash preimage OA.
2. The cross-chain transaction method according to claim 1, characterized in that, In step S21, the transaction content includes: the specific transaction amount on both chains; the identities of the two parties to the transaction, one of whom is the initiator of the transaction and the other is the participant in the transaction; the corresponding time of the time lock in the transaction; the time of the notary's intervention in the transaction; the transaction initiation waiting time; each party determines the preimages OA and OB of the hash lock, and generates the corresponding hash values HashA and HashB based on them, and exchanges the hash values off-chain.
3. The cross-chain transaction method according to claim 1, characterized in that, In step S22, the parameters passed in the transaction application also include the transaction addresses of the transaction initiator and the transaction participants on the two chains, the hash values of both parties, the time lock time, the transaction initiation waiting time, the notary intervention time, the transaction amount on the two chains, and their identities in the transaction.
4. The cross-chain transaction method according to claim 1, characterized in that, Step S23 specifically includes the following steps: S231: If either the transaction participant or the transaction initiator wants to withdraw the transaction, they must first submit a transaction withdrawal application to the hash time lock contract that locks the applicant's assets, and provide the transaction ID and the hash preimage previously generated and held. S232: After receiving a transaction withdrawal request, the hash time lock contract first verifies the applicant's identity, transaction ID and hash image. If correct, it will withdraw the transaction and return the locked assets to the sending address, while notifying the notary of the transaction. S233: After receiving the transaction revocation notice, the notary first writes the revocation information to another chain, and then cancels the monitoring of the original transaction.
5. The cross-chain transaction method according to claim 1, characterized in that, In step S24, the notary checks whether a corresponding transaction exists on the blockchain Chain2 using the received transaction ID. If it does not exist, the notary continues to monitor the blockchain Chain2 until the corresponding transaction is created or the pre-set transaction initiation waiting time is reached. If the transaction fails to be created within the transaction initiation waiting time, the transaction creation fails and the transferred funds are returned.
6. The cross-chain transaction method according to claim 1, characterized in that, In step S25, if the OA is correct, the hash time lock contract on Chain2 will send the assets to the address of the transaction initiator and notify the transaction participants by triggering an event. The hash preimage OA will be sent to the participants as a parameter of the event. If the OA is incorrect, the asset withdrawal will fail.
7. The cross-chain transaction method according to claim 1, characterized in that, Step S25 specifically includes the following steps: S251: If either the transaction participant or the transaction initiator wants to cancel the transaction, they must first initiate an asset freeze request to the hash time lock contract that locks the assets of the transaction cancellation applicant, and submit their own hash preimage and transaction ID. S252: After receiving an asset freeze application, the hash time lock contract verifies the hash preimage of the cancellation transaction applicant and the asset status. If the asset has not yet been withdrawn, the locked asset will be frozen, and the freeze notice and the hash preimage of the cancellation transaction applicant used to freeze the asset will be sent to the other party. S253: The other party, as the counterparty to the transaction who is applying for cancellation of the transaction, after receiving the asset freeze notice, submits a transaction cancellation request to the hash time lock contract that has locked its assets using the received hash preimage, its own hash preimage, and the transaction ID; after receiving the transaction cancellation request, the hash time lock contract returns the assets locked by the counterparty to the transaction and sends a transaction cancellation notice and the counterparty's hash preimage to the applicant for cancellation of the transaction. S255: After receiving the hash preimage of the counterparty, the cancellation applicant submits a cancellation request to the hash time lock contract that locks the cancellation applicant's assets and withdraws the assets by using the hash preimages they hold and the hash preimages of the counterparty they receive.
8. The cross-chain transaction method according to claim 1, characterized in that, In step S26, if the OA is correct, the hash time lock contract on the Chain will send the assets to the participant's address, and the transaction will end; if the OA is incorrect, the asset withdrawal will fail.
9. The cross-chain transaction method according to claim 1, characterized in that, Step S26 is followed by: S27: If an unexpected situation occurs during the transaction process, causing one of the initiators or participants to fail to complete the transaction or the initiator of the transaction to forcibly cancel the transaction by refusing to withdraw assets, then after the notary intervenes, the notary will submit a transaction settlement application to the hash time lock contract on both chains. S28: When the hash time lock contract receives the notary's transaction settlement application, it confirms whether the current time has reached the notary's intervention time and the status of the transaction. If the notary's intervention time has reached and the assets have not yet been withdrawn, then the assets are sent to the corresponding address.
Citation Information
Patent Citations
Cross-chain transaction method and system based on Hash locking and side chain technology, and storable medium
CN113627906A
Decentralized cross-chain protocol communication method based on notary and Hash locking
CN114363050A