Cross-chain transaction method combining Hash time lock and notarist mechanism

Through a cross-chain trading method combining hash time lock and notary mechanism, the problems of notary centralization and unequal status of both parties to the transaction in the existing technology are solved, and decentralization, equal rights of both parties to the transaction and asset security are achieved. Chain transaction effect.

CN119398917AActive Publication Date: 2025-02-07SHANGHAI SECOND POLYTECHNIC UNIVERSITY

Patent Information

Application Number
CN202411349328.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-07
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The existing cross-chain trading technology has centralized problems. The notary disconnection leads to the failure of the transaction, and the status of both parties to the transaction is unequal. The initiator of the transaction can unilaterally cancel the transaction, resulting in the risk of asset loss.

Method used

Combining hash time lock and notary mechanism, through the design of hash time lock contract and notary combination contract, ensure the atomicity of transactions, solve the centralization of notary, ensure the equal status of both parties to the transaction, and prevent assets from entering the notary account. .

Benefits of technology

Decentralized transactions are realized, which avoids transaction failures caused by notary disconnection, ensures equal rights of both parties to the transaction, reduces the risk of user asset losses, and reduces the motivation of notary to do evil.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398917A_ABST
    Figure CN119398917A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-chain transaction method combining a hash time lock and a notarist mechanism. The method comprises the following steps of: initializing a notarist group, deploying a contract, initiating a cross-chain transaction, and withdrawing and canceling the transaction. The method is designed by combining a notarist mechanism and a Hash time lock mechanism. The method can effectively deal with the transaction failure and user asset damage caused by the fact that the notarist does not act or the notarist is offline, can effectively ensure the asset safety of the user, reduces the dependence on the notarist, and increases the success rate of the transaction. Meanwhile, the problem that the initiator of the transaction has the right to cancel the transaction unilaterally is prevented, the fairness of the two parties in the transaction is improved, and the rights and interests of the two parties in the transaction are effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a cross-chain transaction method combining a hash time lock and a notary mechanism. Background Art

[0002] Blockchain technology originated from the paper published by Satoshi Nakamoto. After continuous development and improvement, blockchain technology has been applied in various industries. Because blockchain is open, transparent, decentralized, and tamper-proof, it has a wide range of application space and application prospects. However, there is a problem of difficulty in intercommunication between different blockchains. The mutual independence of blockchains hinders the circulation of assets and the transfer of value. It is imperative to solve the problem of "value islands". The information barrier between different blockchains not only restricts the development of blockchain technology, but also hinders the application of this technology in various industries, and blockchain cross-chain technology came into being.

[0003] At present, cross-chain technologies mainly include notary mechanism, side chain / relay mechanism, hash locking mechanism and distributed private key control. The notary mechanism is simple in principle and easy to implement compared with other cross-chain mechanisms, but this mechanism is extremely dependent on notaries and has the problem of centralization. Once the notary is offline, the transaction will face the risk of failure. Hash time lock is decentralized but lacks flexibility. The cancellation of the transaction can only passively wait for the unlocking of the time lock, which lacks flexibility. At the same time, as the initiator of the transaction, it can unilaterally decide whether to conduct the transaction and dominate the transaction process. The two parties to the transaction are not equal in the transaction process. Summary of the invention

[0004] In view of the deficiencies of the prior art mentioned above, the present invention combines hash time lock with notary mechanism to design a cross-chain transaction method combining hash time lock and notary mechanism; by combining hash time lock with notary mechanism, the atomicity of transaction is ensured while solving the serious centralization problem of notary mechanism and over-reliance on notary; the equal status of transaction parties in the transaction process is ensured to prevent the transaction initiator from unilaterally canceling the transaction; and the risk of user asset loss is reduced by avoiding assets from entering the notary account.

[0005] The technical solution of the present invention is specifically described as follows.

[0006] The present invention provides a cross-chain transaction method combining hash time lock and notary mechanism, which specifically includes the following steps:

[0007] Step S1: Deployment of hash time lock contract and determination of notary group management strategy;

[0008] Step S2: Initiate cross-chain transactions and withdraw and cancel transactions;

[0009] Further, the step S1 specifically includes the following steps:

[0010] S11: Create a notary group contract on 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 notary joining and election: Ordinary nodes on the chain apply to join the notary group through the notary group contract, and choose the notary evaluation and election mechanism by themselves and deploy it in the notary group contract.

[0012] Further, the step S2 specifically includes the following steps:

[0013] S21: The transaction parties agree and determine the transaction content off-chain, including: the specific transaction amount on the two chains; the identities of the transaction parties, one of which is the initiator of the transaction and the other is the participant of the transaction; the corresponding time of the time lock in the transaction; the intervention time of the notary in the transaction; the waiting time for the transaction to be initiated; each party determines the original image OA and OB of the hash lock, and generates the corresponding hash values ​​HashA and HashB based on this, 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 at the same time 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 the identity in the transaction. The corresponding funds are transferred to the hash time lock contract account, and the assets will be locked by this hash time lock contract.

[0015] S23: After receiving the transaction application, the hash time lock contract will first check whether the amount transferred is consistent with the amount stated in the information and whether the time lock time and the notary's intervention time are in compliance with the rules; if there is a problem after the check, the balance will be returned to the transaction initiator and the creation failure will be notified; if there is no problem after the check, a transaction ID will be generated for the transaction using the hash function based on the submitted data, and a notary will be elected through the notary group contract and the pre-set notary election plan, and the transaction ID will be notified to the notary and the initiator, and the notary address will be notified to the transaction participants; after receiving the notification, the transaction participants submit the transaction application on the blockchain Chain2, and the hash time lock contract on Chain2 uses the same method and parameters to generate the same transaction ID and lock the assets of the participants; at this time, the transaction has not been activated. Before the notary activates the transaction, either the transaction initiator or the transaction participant can withdraw it.

[0016] S24: After receiving the notification of being elected, the notary uses the received transaction ID to query whether there is a corresponding transaction on blockchain Chain2; if so, the notary will activate the transactions on the two chains to enter the next link; if not, the notary will continue to monitor blockchain Chain2 until the corresponding transaction is created or the pre-set transaction initiation waiting time is reached; if the transaction cannot be created within the transaction initiation waiting time, the transaction creation fails and the transferred funds will be returned.

[0017] S25: After the notary successfully activates the transactions on the two chains, the transaction is formally established. At this time, the transaction initiator initiates an asset withdrawal request to the hash time lock contract on Chain2, and extracts the assets locked in by the transaction participants by submitting the transaction ID and the predetermined hash original image OA. If OA is correct, the hash time lock contract on Chain2 will send the assets to the address of the transaction initiator and remind the transaction participants by triggering an event. The hash original image OA will be sent to the participants as the parameters of the event. If OA is wrong, the asset extraction will fail. After the transaction is formally established, it cannot be unilaterally revoked. If you want to cancel the transaction, you need to submit an application to cancel the transaction 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 participants obtain the hash preimage OA; at this time, the transaction participants initiate an asset withdrawal application to the hash time lock contract on Chain1, and extract the assets locked by the transaction initiator by submitting the transaction ID and the received hash preimage OA; if OA is correct, the hash time lock contract on Chain1 will send the assets to the address of the participant, and the transaction ends; if OA is wrong, the asset withdrawal will fail.

[0019] S27: If an unexpected situation occurs during the transaction, causing one of the initiators or participants to fail to conduct the transaction according to the above process, or the initiator of the transaction wants to forcibly cancel the transaction by refusing to withdraw assets, then when the notary intervenes, the notary will submit a transaction settlement application to the hash time lock contract on the two chains.

[0020] S28: When the hash time lock contract receives the transaction settlement application from the notary, it confirms whether the current time has reached the notary intervention time and the status of this transaction. If the notary intervention time has reached and the assets have not been withdrawn, the assets are sent to the corresponding address.

[0021] Further, the step S23 specifically includes the following steps:

[0022] S231: If either the transaction participant or the transaction initiator wishes 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 original image previously generated and held.

[0023] S232: After receiving a transaction withdrawal application, the hash time lock contract first verifies the applicant's identity, transaction ID and hash original image. If they are correct, the transaction will be withdrawn and the locked assets will be returned to the sending address while notifying the notary of the transaction.

[0024] S233: After receiving the withdrawal notification of the transaction, the notary first writes the withdrawal information of the message to another chain, and then cancels the monitoring of the original transaction.

[0025] Further, the step S25 specifically includes the following steps:

[0026] S251: If any party of the transaction participant or the transaction initiator wants to cancel the transaction as the transaction cancellation applicant, they should 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 original image and transaction ID they hold.

[0027] S252: After receiving the asset freezing application, the hash time lock contract verifies the hash original image and asset status of the transaction cancellation applicant. If the asset has not been withdrawn, the locked asset will be frozen. At the same time, the freezing notice and the hash original image of the transaction cancellation applicant used to freeze the asset will be sent to the other party.

[0028] S253: After receiving the asset freeze notice, the other party, as the counterparty of the transaction cancellation applicant, submits a transaction cancellation request to the hash time lock contract that locks its assets using the received hash original image, the hash original image held by itself, and the transaction ID; after receiving the transaction cancellation request, the hash time lock contract returns the assets locked by the transaction counterparty, and at the same time sends a transaction cancellation notice and the hash original image of the transaction counterparty to the transaction cancellation applicant.

[0029] S254: After receiving the transaction cancellation request, the hash time lock contract returns the locked assets to the participant and sends a transaction cancellation notification and OB to the initiator.

[0030] S255: After receiving the hash original image of the transaction counterparty, the transaction cancellation applicant submits a transaction cancellation request to the hash time lock contract that locks the transaction cancellation applicant's assets through the hash original image held by itself and the hash original image of the transaction counterparty obtained, and withdraws the assets.

[0031] In summary, the advantages or beneficial effects of the present invention are as follows:

[0032] 1. The present invention adopts a method combining hash time lock and notary mechanism. In addition to the notary, the transaction parties can also promote the transaction. Even if the notary is offline, it will not affect the normal transaction. After completing the transaction activation work, the notary will intervene in the transaction process only when the transaction parties deviate from the normal process. Avoid the problem of excessive dependence on the notary during the transaction process, and prevent the problem of the transaction being unable to proceed due to the notary being offline or the notary not taking action.

[0033] 2. The present invention adopts the technology of double hash lock to ensure that the cancellation of the transaction requires the consent of both parties. It solves the problem of unequal status of the two parties in the transaction process, prevents the initiator of the transaction from having the right to unilaterally cancel the transaction, and protects the rights and interests of the participants. At the same time, the contract address is used instead of the notary / notary group address for transactions. The assets of the two parties will not enter the account of the notary or notary group, ensuring the safety of user assets. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A functional module diagram of a cross-chain transaction method combining a hash time lock and a notary mechanism provided for the implementation of the present invention. DETAILED DESCRIPTION

[0035] In order to clearly illustrate the technical features of the present solution, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings. However, the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention, that is, the embodiments described are only part of the embodiments of the present invention, rather than all of the embodiments. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0036] The functional modules of the cross-chain transaction method of the present invention are as follows: Figure 1 As shown, the following processing steps are included:

[0037] Step S1: Deployment of hash time lock contract and determination of notary group management strategy;

[0038] Step S2: Initiate cross-chain transactions and withdraw and cancel transactions;

[0039] Further, the step S1 specifically includes the following steps:

[0040] S11: Create a notary group contract on blockchain 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 notary joining and election: Ordinary nodes on the chain apply to join the notary group through the notary group contract, and choose the notary evaluation and election mechanism by themselves and deploy it in the notary group contract.

[0042] Further, the step S2 specifically includes the following steps:

[0043] S21: The transaction parties agree and determine the transaction content off-chain, including: the specific transaction amount on the two chains; the identities of the transaction parties, one of which is the initiator of the transaction and the other is the participant of the transaction; the corresponding time of the time lock in the transaction; the intervention time of the notary in the transaction; the waiting time for the transaction to be initiated; each party determines the original image OA and OB of the hash lock, and generates the corresponding hash values ​​HashA and HashB based on this, 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 the 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 Symbols Parameter meaning Amo1 Transaction amount on Chain1 Amo2 Transaction amount on Chain2 <![CDATA[Sender A ]]> The transaction initiator's address on Chain1 <![CDATA[Sender B ]]> The address of the transaction participants on Chain2 <![CDATA[Receiver A ]]> The address of the transaction initiator on Chain2 <![CDATA[Receiver B ]]> The address of the transaction participants on Chain1 HashA Hash value of the transaction initiator HashB Hash value of transaction participants Role Identity in the transaction <![CDATA[Time lock ]]> Time lock time <![CDATA[Time wait ]]> Transaction initiation waiting time <![CDATA[Time intervene ]]> Notary Public Intervention Time

[0047] S23: After receiving the transaction application, the hash time lock contract will first check whether the amount transferred is consistent with the amount stated in the information and whether the time lock time and the notary intervention time are in compliance with the rules; if there is a problem after the check, the balance will be returned to the transaction initiator and the creation failure will be notified; if there is no problem after the check, a transaction ID is generated for the transaction using the hash function based on the submitted data, and a notary is elected through the notary group contract and the pre-set notary election scheme, and the transaction ID is notified to the notary and the initiator, and the notary address is notified to the transaction participants; after receiving the notification, the transaction participant submits the transaction application on the blockchain Chain2, and 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 lock the assets of the participants. The same ID can be generated only when both parties submit the transaction information correctly, which simplifies the transaction process by eliminating the process of verifying the transaction information in the transaction; at this time, the transaction has not been activated. Before the notary activates the transaction, either the transaction initiator or the transaction participant can withdraw it.

[0048] Table 2 Transaction application parameters of participants

[0049] Parameter Symbols Parameter meaning Amo1 Transaction amount on Chain1 Amo2 Transaction amount on Chain2 <![CDATA[Sender A ]]> The transaction initiator's address on Chain1 <![CDATA[Sender B ]]> The address of the transaction participants on Chain2 <![CDATA[Receiver A ]]> The address of the transaction initiator on Chain2 <![CDATA[Receiver B ]]> The address of the transaction participants on Chain1 HashA Hash value of the transaction initiator HashB Hash value of transaction participants Role Identity in the transaction <![CDATA[Time lock ]]> Time lock time <![CDATA[Time wait ]]> Transaction initiation waiting time <![CDATA[Time intervene ]]> Notary Public Intervention Time <![CDATA[Address Notary ]]> Notary’s address on Chain2

[0050] S24: After receiving the notification of being elected, the notary uses the received transaction ID to query whether there is a corresponding transaction on blockchain Chain2; if so, the notary will activate the transactions on the two chains to enter the next link; if not, the notary will continue to monitor blockchain Chain2 until the corresponding transaction is created or the pre-set transaction initiation waiting time is reached; if the transaction cannot be created within the transaction initiation waiting time, the transaction creation fails and the transferred funds will be returned.

[0051] S25: After the notary successfully activates the transactions on the two chains, the transaction is formally established. At this time, the transaction initiator initiates an asset withdrawal request to the hash time lock contract on Chain2, and extracts the assets locked in by the transaction participants by submitting the transaction ID and the predetermined hash original image OA. If OA is correct, the hash time lock contract on Chain2 will send the assets to the address of the transaction initiator and remind the transaction participants by triggering an event. The hash original image OA will be sent to the participants as the parameters of the event. If OA is wrong, the asset extraction will fail. After the transaction is formally established, it cannot be unilaterally revoked. If you want to cancel the transaction, you need to submit an application to cancel the transaction 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 participants obtain the hash preimage OA; at this time, the transaction participants initiate an asset withdrawal application to the hash time lock contract on Chain1, and extract the assets locked by the transaction initiator by submitting the transaction ID and the received hash preimage OA; if OA is correct, the hash time lock contract on Chain1 will send the assets to the address of the participant, and the transaction ends; if OA is wrong, the asset withdrawal will fail.

[0053] S27: If an unexpected situation occurs during the transaction, causing one of the initiators or participants to fail to conduct the transaction according to the above process, or the initiator of the transaction wants to forcibly cancel the transaction by refusing to withdraw assets, then when the notary intervenes, the notary will submit a transaction settlement application to the hash time lock contract on the two chains.

[0054] Compared with the traditional hash time lock, the present invention introduces a notary. Through the intervention of a notary, it can effectively avoid the situation where the transaction initiator refuses to withdraw assets, causing the transaction to fail, and effectively guarantee the rights and interests of the transaction participants.

[0055] S28: When the hash time lock contract receives the transaction settlement application from the notary, it confirms whether the current time has reached the notary intervention time and the status of this transaction. If the notary intervention time has reached and the assets have not been withdrawn, the assets are sent to the corresponding address.

[0056] In the present invention, although the transaction still needs to rely on the notary, after the transaction is activated, the two parties can complete the remaining transaction process by 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 user funds.

[0057] Further, the 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 application to the hash time lock contract on Chain1 and provide the transaction ID and the previously generated hash original image. If the participating party wants to withdraw the transaction, the same operation is performed on Chain2.

[0059] S232: After receiving a transaction withdrawal application, the hash time lock contract will first verify the applicant's identity, transaction ID and hash original image. If correct, it will withdraw the transaction and return the locked assets to the sending address while notifying the transaction notary.

[0060] S233: After receiving the withdrawal notification of the transaction, the notary first writes the withdrawal information of the message to another chain, and then cancels the monitoring of the original transaction.

[0061] Further, the step S25 specifically includes the following steps:

[0062] S251: Either party in the transaction can try to cancel the transaction, and the process is the same for either party to cancel the transaction. If the initiator needs to cancel the transaction, it first needs to initiate an asset freeze request to the hash time lock contract that locks its assets, namely Chain1, and submit the hash original image OA and transaction ID it holds.

[0063] S252: After receiving the asset freezing application, the hash time lock contract will verify the hash original image and asset status. If the asset has not been withdrawn, the locked asset will be frozen. At the same time, the freezing notice and the hash original image OA used to freeze the asset will be sent to the participating parties.

[0064] S253: After receiving the asset freeze notice, the participant uses the received hash preimage OA, the hash preimage OB held by himself, and the transaction ID to submit a transaction cancellation request to the hash time lock contract that locks the participant's assets, namely Chain2.

[0065] In the present invention, the cancellation of a transaction requires both parties to complete the above method together, and no party can unilaterally force the cancellation of the transaction. When one party refuses to cancel the transaction, the notary can intervene to ensure the smooth progress of the transaction. This ensures that the rights of both parties in the transaction process are equal and the transaction is carried out smoothly.

[0066] S254: After receiving the transaction cancellation request, the hash time lock contract returns the locked assets to the participant and sends a transaction cancellation notification and OB to the initiator.

[0067] S255: After receiving the OB, the initiator submits a request to cancel the transaction and withdraw the assets to the hash time lock contract that locks the initiator's assets through the OA held by itself and the obtained OB.

Claims

1. A cross-chain transaction method combining hash time lock and notary mechanism, characterized in that: It includes: Step S1: Deployment of hash time lock contract and determination of notary group management strategy; Create a notary group contract on two chains of the blockchain: 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; Specify the rules for notary joining and election: ordinary nodes on the chain apply to join the notary group through the notary group contract, and choose the notary evaluation and election mechanism by themselves and deploy it in the notary group contract; Step S2: Initiate cross-chain transactions and withdraw and cancel transactions.

2. The cross-chain transaction method according to claim 1, characterized in that: Step S2 specifically includes the following steps: S21: The two parties to the transaction agree and determine the transaction content off-chain, including: the specific transaction amount on the two chains; the identities of the two parties to the transaction, one of which is the initiator of the transaction and the other is the participant of the transaction; the corresponding time of the time lock in the transaction; the intervention time of the notary in the transaction; the waiting time for the transaction to be initiated; each party determines the original image 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; 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 the identity in the transaction. The corresponding funds are transferred to the hash time lock contract account, and the assets will be locked by this hash time lock contract. S23: After receiving the transaction application, the hash time lock contract will first check whether the amount transferred is consistent with the amount stated in the information and whether the time lock time and the notary’s intervention time are in compliance with the rules; if there is a problem after the check, the balance will be returned to the transaction initiator and the creation failure will be notified; if there is no problem after the check, a transaction ID will be generated for the transaction using the hash function based on the submitted data, and a notary will be elected through the notary group contract and the pre-set notary election scheme, and the transaction ID will be notified to the notary and the initiator, and the notary address will be notified to the transaction participants; after receiving the notification, the transaction participants submit the transaction application on the blockchain Chain2, and the hash time lock contract on Chain2 uses the same method and parameters to generate the same transaction ID and lock the assets of the participants; at this time, the transaction has not been activated. Before the notary activates the transaction, either the transaction initiator or the transaction participant can withdraw it; S24: After receiving the notification of being elected, the notary checks whether there is a corresponding transaction on the blockchain Chain2 through the received transaction ID; if so, the notary activates the transactions on the two chains to enter the next link; if not, 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 is not created within the transaction initiation waiting time, the transaction creation fails and the transferred funds are returned; S25: After the notary successfully activates the transactions on the two chains, the transaction is formally established; at this time, the transaction initiator initiates an asset withdrawal request to the hash time lock contract on Chain2, and extracts the assets locked by the transaction participants by submitting the transaction ID and the predetermined hash original image OA. If the OA is correct, the hash time lock contract on Chain2 will send the assets to the address of the transaction initiator and remind the transaction participants by triggering an event. The hash original image OA will be sent to the participants as the parameters of the event. If the OA is wrong, the asset extraction will fail; after the transaction is formally established, it cannot be unilaterally revoked. If you want to cancel the transaction, you need to submit an application to cancel the transaction 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 original image OA; at this time, the transaction participant initiates an asset withdrawal application to the hash time lock contract on Chain1, and withdraws the assets locked by the transaction initiator by submitting the transaction ID and the received hash original image OA; if OA is correct, the hash time lock contract on Chain1 will send the assets to the address of the participant, and the transaction ends; if OA is wrong, the asset withdrawal will fail; S27: If an unexpected situation occurs during the transaction, causing one of the initiator or participants to fail to conduct the transaction according to the above process, or the initiator of the transaction wants to forcibly cancel the transaction by refusing to withdraw assets, then when the notary intervenes, the notary will submit a transaction settlement application to the hash time lock contract on the two chains; S28: When the hash time lock contract receives the transaction settlement application from the notary, it confirms whether the current time has reached the notary intervention time and the status of this transaction. If the notary intervention time has reached and the assets have not been withdrawn, the assets are sent to the corresponding address.

3. The cross-chain transaction method according to claim 2, 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 original image generated and held previously; S232: After receiving the transaction withdrawal application, the hash time lock contract first verifies the applicant's identity, transaction ID and hash original image. If they are correct, the transaction will be withdrawn and the locked assets will be returned to the sending address while notifying the notary of the transaction; S233: After receiving the withdrawal notification of the transaction, the notary first writes the withdrawal information of the message to another chain, and then cancels the monitoring of the original transaction.

4. The cross-chain transaction method according to claim 2, 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 should 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 original image and transaction ID they hold; S252: After receiving the asset freezing application, the hash time lock contract verifies the hash original image and asset status of the transaction cancellation applicant. If the assets have not been withdrawn, the locked assets will be frozen. At the same time, the freezing notice and the hash original image of the transaction cancellation applicant used to freeze the assets will be sent to the other party; S253: The other party, as the counterparty of the transaction cancellation applicant, after receiving the asset freezing notice, uses the received hash original image, the hash original image held by itself, and the transaction ID to submit a transaction cancellation request to the hash time lock contract that has locked its assets; after receiving the transaction cancellation request, the hash time lock contract returns the assets locked by the counterparty, and at the same time sends a transaction cancellation notice and the hash original image of the counterparty to the transaction cancellation applicant; S255: After receiving the hash original image of the transaction counterparty, the transaction cancellation applicant submits a transaction cancellation request to the hash time lock contract that locks the transaction cancellation applicant's assets through the hash original image held by itself and the hash original image of the transaction counterparty obtained, and withdraws the assets.

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

  • Cross-chain transaction method and system based on combination of Hash locking and notary

    CN116415955A

  • Decentralization cross-chain transaction method based on notary and adapter signature

    CN117764583A

Cited By

  • Cross-border trade-oriented data interaction method between Hash time lock chains

    CN121052820A