CN113269545A - Hash time locking method and system based on cloud cross-chain transfer protocol - Google Patents

Hash time locking method and system based on cloud cross-chain transfer protocol Download PDF

Info

Publication number
CN113269545A
CN113269545A CN202110580256.4A CN202110580256A CN113269545A CN 113269545 A CN113269545 A CN 113269545A CN 202110580256 A CN202110580256 A CN 202110580256A CN 113269545 A CN113269545 A CN 113269545A
Authority
CN
China
Prior art keywords
cross
chain
link
gateway
contract
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110580256.4A
Other languages
Chinese (zh)
Inventor
黄步添
高翠霞
宁鹏
冯国棋
罗春凤
刘振广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Yunxiang Network Technology Co Ltd
Original Assignee
Hangzhou Yunxiang Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Yunxiang Network Technology Co Ltd filed Critical Hangzhou Yunxiang Network Technology Co Ltd
Priority to CN202110580256.4A priority Critical patent/CN113269545A/en
Publication of CN113269545A publication Critical patent/CN113269545A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Strategic Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a hash time locking method and a hash time locking device based on a cloud cross-chain transfer protocol, belongs to the technical field of block chains, and provides a hash time locking method based on a hash algorithm and an overtime mechanism. The method supports the concurrence of the cross-chain and non-cross-chain services in a temporary account mode, effectively enlarges the application range of the service scene, not only improves the performance, but also ensures the safety and trust in the information transmission process.

Description

Hash time locking method and system based on cloud cross-chain transfer protocol
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a hash time locking method and a hash time locking system based on a cloud cross-chain transfer protocol.
Background
The cross-link implementation in the current market is technically divided into 3 types, namely a repeater mechanism, a witness mechanism and hash locking.
The repeater mechanism constructs credible relay nodes between chains and performs relay transfer on data on different chains. However, the structure is complex, the flow is cumbersome and heavy, and the problem of organization and management of the relay chain is introduced, so that the relay chain is difficult to fall on the ground.
The witness mechanism is a degenerate repeater that transfers data in different blockchains through a centralized, trusted witness, requiring the cross-chain blockchain network and the associated operator to fully trust the witness, which creates a serious single point risk problem.
Hash locking is a cross-chain mode specially used for transferring digital money, and the core idea is to lock digital money on a chain by using a block chain account with a time limit and generate a corresponding token in another block chain. It is the best solution for digital asset transfer across chains.
However, the hash locking scheme only guarantees the transactional property of the cross-chain transfer of the assets, and cannot solve the trust and security problems of information transmission. The patent provides a new cloud cross-chain transfer protocol, which is used in cooperation with a hash time lock mechanism, and simultaneously supports concurrence of cross-chain and non-cross-chain services, thereby effectively enlarging the application range of a service scene, improving the performance and effectively promoting the real scene to fall to the ground.
Disclosure of Invention
In the background and the problems existing in the prior art, the invention provides a new cloud cross-chain transfer protocol, solves the problems of safety and trust of asset information transmission in the scene from the flow and the algorithm, expands the application range of the service scene to a certain extent and improves the performance. The technical scheme is as follows:
on one hand, the hash time locking method based on the cloud cross-chain transfer protocol is provided, and the specific implementation steps comprise:
the method comprises the steps that a service end sends an asset transfer request to a first block chain gateway, the first block chain gateway is connected with a second block chain gateway, and asset transfer is achieved through a technology of Hash time locking based on a cloud cross-chain transfer protocol;
a first cross-link gateway in the first block link gateway receives a service end instruction request, and records related information after system monitoring, wherein the first cross-link gateway comprises a cross-link routing function; the first cross-chain gateway issues GRPC service, interacts with a block chain by calling a plug-in, converts service sensitive information into a cloud cross-chain transfer protocol, performs data signing, and executes block chain contract and link event monitoring through an SDK (software development kit);
the first blockchain comprises a first cross-link contract and a first application contract, and the first application contract is connected with a transfer interface and a Lock function;
the second blockchain gateway is connected with the first cross-chain gateway through a P2P protocol, the internal structure of the second blockchain gateway comprises the second cross-chain gateway, the second cross-chain gateway issues GRPC service, and a plug-in is called to interact with the second blockchain, so that a cross-chain asset transfer request is realized; the second cross-link gateway includes a second cross-link routing function.
On one hand, the processing flow of the Hash time locking technology is based on a Hash algorithm, and the specific implementation steps comprise:
the first cross-link gateway selects a secret random number S, calls a first cross-link contract to calculate a hash value H of the S by using a hash algorithm, simultaneously calls an application contract A to lock an asset a, creates a cross-link request event, inputs two timeout times T0 and T1 and ensures that T0 is greater than T1;
the first cross-link gateway sends H and T1 to the second cross-link gateway, which confirms that asset a is locked, locks asset b by invoking the second cross-link contract and the second application contract and sends a response;
the first cross-link gateway determines that the asset a is locked after receiving the response, uses the secret random number S to transfer the first application contract for unlocking, and transfers the asset b to the first block chain;
and the second cross-chain gateway takes the secret random number S, calls a second application contract to unlock, and transfers the asset a to the second block chain.
On one hand, the processing flow of the hash time locking technology is also based on a timeout mechanism, and the specific implementation steps include:
the second block chain reaches the overtime T1, if the second block chain is unlocked, an abnormal condition occurs, and the abnormal processing mechanism gives an alarm; if the second blockchain is not unlocked, the account rolls back the asset. The alarm sending is realized on a cross-link gateway, and if a transaction message with locked Hash time is received, each transaction is checked and the state of the transaction is judged; if a cross-link event with the hash time locked is received, setting a transaction state according to an event execution result;
the first blockchain reaches the overtime T0, if the second blockchain is unlocked and the first blockchain asset continues to be locked, an abnormal condition occurs, and the abnormal processing mechanism gives an alarm; if the second blockchain is not unlocked, the account rolls back the asset.
On one hand, the first cross-link gateway sends H and T1 to the second cross-link gateway, and the specific implementation steps include: the first cross-link gateway monitors a cross-link request event by calling the SDK, converts the cross-link request event into a cloud cross-link transfer protocol, signs and encrypts uplink information of the request, stores the uplink information into the cloud cross-link transfer protocol, and transfers the uplink information to the second blockchain gateway from A through a cross-link, wherein the uplink information comprises a secret random number S, a hash value H, time T0 and time T1.
On one hand, the main functions provided by the asset transfer request realized by the participation of the first application contract in the Hash time locking include service locking, service unlocking and service rollback, the locking mode of the contract is a temporary account, and the specific implementation steps comprise:
in the service locking process, the available assets of the first blockchain account are reduced by the pre-locking amount, the account balance of the second blockchain account is unchanged, a temporary account is created in the application contract, and the temporary account balance is the pre-locking amount;
the temporary account in the service unlocking process is removed, and the cross-chain asset transfer is successful;
the temporary account of the service rollback process is cleared, and the service is rolled back to the state before locking.
On one hand, the locking mode of the first application contract also comprises key-value pair locking, and the specific implementation steps comprise:
setting a freezing field by a first application contract, subtracting the pre-freezing amount from the available assets of a first block chain account in the service locking process, adding the pre-freezing amount to the account balance of a second block chain account, and placing the pre-freezing amount in the freezing field;
in the service unlocking process, the frozen field is cleared, and the cross-chain asset transfer is successful;
the service rollback process clears the frozen field and the service rolls back to before locking.
On one hand, the asset transfer request supports concurrence of cross-chain service and non-cross-chain service, and the specific implementation steps comprise:
the first cross-link contract judges the transaction type of the asset transfer request through creating or receiving a transfer request interface, and realizes concurrence of cross-link services and non-cross-link services through a locking mode of the first application contract. The interface for creating or receiving the transfer request is divided into two roles and is used for indicating whether the cross-chain asset request belongs to an initiator or a participant;
if the transaction type is judged to be non-cross-link service, a transfer interface of the first application contract is called, and the state is updated to be Success or Failed; if the cross-link service is available, a Lock function of the application contract is called, the state is updated to LockState or Failed, and a cross-link request event is created.
In one aspect, a hash time locking system based on a cloud cross-link transfer protocol is provided, and specifically includes a contract method management module, a system monitoring module, an exception handling mechanism module, and two sets of blockchain gateways, where the two sets of blockchain gateways include a first blockchain gateway and a second blockchain gateway, the first blockchain gateway includes a first cross-link route, a first cross-link gateway, and a first blockchain, and the second blockchain gateway includes a second cross-link route, a second cross-link gateway, and a second blockchain:
the first cross-link route and the second cross-link route are used for providing a standard interface for the entrance platform and shielding the difference of bottom layer design.
The first cross-link gateway and the second cross-link gateway are used for interacting with the block chain and adapting to the function of the Hash time locking method;
the contract method management module is used for configuring accessible gateways, block chain contracts, methods and callback processing of transactions according to the serial numbers of the contract methods;
the system monitoring module is used for recording transaction and transaction flow information when performing cross-link transaction when the cross-link transaction is called by a service system;
and the exception handling mechanism module is used for processing one part across the link when the asset transfer transaction is carried out, and recording error information when the transaction is overtime and the other part cannot receive a processing result notice.
On one hand, the function of the method for locking the adaptive hash time of the cross-chain gateway module specifically comprises the following steps:
the management unit is used for checking each transaction and judging the related state of the transaction when the hash time locking related transaction message is received; when a cross-chain event related to hash time locking is received, setting a corresponding transaction state according to an event execution result;
the execution unit is used for executing the hash time locking related execution message sent by the management unit and calling a corresponding contract function for processing;
and the event monitoring unit is used for monitoring the hash time locking related event returned by the cross-chain and delivering the event to the management unit for processing.
Compared with the prior art, the invention adopts the Hash time locking technology based on the Hash algorithm and the overtime mechanism, and the Hash time locking transaction mechanism and the locking mode of the application contract in the framework ensure the concurrent execution of the cross-link service and the non-cross-link service, effectively expand the application range of the service scene and improve the performance; the temporary account locking mode is adopted, the original contract logic is not influenced when the service unlocking operation is carried out, the expansion and the maintenance are easy, and different authority management can be set; the key value pair locking mode is wide in application range, large in locking range and equivalent to the locking of the whole value structure under a certain key; data information is completed based on a cloud cross-chain transfer protocol in the transmission process, and safety and trust of asset information transmission are guaranteed.
Drawings
FIG. 1 is a cross-chain architecture according to an embodiment of the present invention.
Fig. 2 is a logic diagram of interaction between a cross-link gateway and a contract according to an embodiment of the present invention.
Fig. 3 is a flowchart of hash time locking according to an embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating an implementation process of a temporary account locking manner according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating an implementation of a key-value pair locking scheme according to an embodiment of the present invention.
Detailed Description
In order to clarify and clarify the technical solutions and advantages of the present invention, the present invention will be further described in detail with reference to the accompanying drawings in the following embodiments of the present invention.
As shown in fig. 1, the cross-chain architecture consists of several key modules:
application chain: the block chain where the service is located, a bottom layer block supports main flow block chains such as fabric, wherein the architecture comprises a first block chain and a second block chain, and the block chains comprise a service contract and a cross-link contract;
and (3) cross-chain contract: the intelligent contract deployed on the application chain is externally responsible for docking the cross-chain gateway, and is an entrance of the cross-chain gateway operation application chain. The cross-link contract also comprises partial logic of transaction processing, and creates a cross-link asset transfer request and response event;
and (3) cross-chain gateway: the system comprises a first cross-link gateway and a second cross-link gateway, is an entrance for interaction between an application chain and the outside, and is responsible for converting service sensitive information into a YCTP protocol and transmitting the YCTP protocol to a cross-link route;
across the link is composed of: the method comprises a first cross-link route and a second cross-link route, wherein a service call request is received through the first cross-link route of a transaction processing mechanism, a GRPC service is issued to be connected to cross-link gateways and is responsible for routing and information transfer among the cross-link gateways, and information communication is carried out by using a P2P protocol;
an entrance platform: a back end management program embedded in the cross-link router is an entrance for the operation of the service end and is also a call entrance of the chain;
as shown in FIG. 2, a cross-chain asset transfer flow completed by the present invention is described, which includes a cross-chain gateway, a cross-chain contract and a business contract for a first blockchain and a second blockchain. The service end sends an asset transfer request to the first cross-link gateway, and asset transfer is achieved through a technology of Hash time locking based on a cloud cross-link transfer protocol; the first cross-chain gateway comprises a cross-chain routing function, the first cross-chain gateway issues GRPC service, designs a cloud cross-chain transfer protocol in a plug-in mode and interacts with a first block chain, and executes a block chain contract method and link event monitoring through an SDK, wherein the first block chain comprises a first cross-chain contract and a service contract A; and the second cross-chain gateway is connected with the first cross-chain gateway through a P2P protocol to realize a cross-chain asset transfer request.
The interaction logic of the cross-link gateway and the contract comprises the following specific steps:
1) and the second block chain of the first block chain completes account creation operation in respective service systems respectively, which is a precondition for cross-chain asset transfer.
2) The first blockchain initiates an asset transfer request: and the first cross-link gateway calls the first cross-link contract to create a transfer proposal, the cross-link contract records a cross-link request, if the proposal type is non-cross-link, the service contract is called to transfer the assets, the success is returned, and the operation is finished. And if the proposal type is cross-chain, calling a service contract to lock the account, and setting a cross-chain request event.
3) After the second block chain receives the first block chain cross-chain request, the second cross-chain gateway calls a second cross-chain contract to receive a transfer proposal, records the cross-chain contract request, calls a service contract to lock an account, and sets a cross-chain response event.
4) And after the first block chain receives the second block chain cross-chain response, the first cross-chain gateway adjusts the first cross-chain contract to update the proposal state and sets a cross-chain response event.
5) And after the second block chain receives the first block chain cross-chain response, the second cross-chain gateway calls a second cross-chain contract unlocking resource, the second cross-chain contract calls a service contract B unlocking account, the proposal state is updated to be successful, and a cross-chain response event is set.
6) After the first block chain receives the second block chain cross-chain response, the first cross-chain gateway calls the first cross-chain contract unlocking resource, the first cross-chain contract calls the service contract A unlocking account, and the proposal state is updated to be successful.
7) And if the service contract receives a rollback request of the cross-link gateway, the service contract performs asset rollback, calls the cross-link contract and updates the proposal state to be failure.
The process of the Hash time locking method is initiated at a cross-chain transaction entrance of a cross-chain route, the cross-chain transaction entrance is handed to a cross-chain gateway, the cross-chain gateway calls a cross-chain contract, and the cross-chain contract recalls an application contract. As shown in fig. 3, the specific implementation steps include: the cross-chain transaction entrance firstly selects a secret random number S, a specific hash algorithm is used for calculating a hash value H of the S, and then the hash value H is sequentially transmitted in the above calling process and finally transmitted to two interfaces lock and rollback of the application contract. The random number S is passed in turn during the above call and finally to the interface unlock of the application contract.
The contract locking mode comprises a temporary account locking mode and a key value pair locking mode, and a service scene is assumed: taking the example that the account of the cross-chain operation a is reduced by 10 yuan, and the non-cross-chain transfer is concurrently executed by 20 yuan in the cross-chain operation, the balance change condition of the account under two locking schemes of the service contract is shown, for example, fig. 4 is a temporary account locking mode, and the state change in the whole lock calling process is as follows:
assuming that the initial asset is 100 yuan, performing cross-chain asset transfer operation to transfer 10 yuan from the account A, after lock, reducing the corresponding asset of the account A by 10, and sending the operation of adding 10 to the asset of the temporary account hash + account; after the lock, the first application contract before the unlock concurrently executes non-cross-chain transfer asset transfer operation, 20 yuan is transferred from the account A again, the corresponding asset of the account A is reduced by 20 yuan, and the temporary account is unchanged; after the operation of unlocking the service unlock is executed, the temporary account is removed, the substantial service is actually landed, and for the first application contract, the unlocking processing is to remove the temporary account while keeping the balance of the account A unchanged; the service rollback clears the temporary account, and before the substantial service rollback is carried out to the lock, the rollback processing of the first application contract is to add the available balance of the A account with the frozen amount, and the temporary account is cleared.
As shown in fig. 5, the state of the whole lock calling process changes as follows: assuming that the initial asset is 100 yuan, performing a cross-chain asset transfer operation to transfer 10 yuan from the account A, after lock, the account balance of the account A must be changed, the available assets are reduced by 10, and 10 is frozen in a single field, namely the frozen amount is 10; after the lock and before the unlock, the first application contract concurrently executes non-cross-chain asset transfer operation, and transfers 20 yuan again from the account A, so that the account balance and the available balance of the account A are reduced by 20 at the same time, and the frozen amount is kept unchanged; after the operation of unlocking the service unlock is executed, for a first application contract, the unlocking processing is to subtract the account balance of the account A by the frozen amount, clear the frozen field, and really land the service; and performing service rollback rolling to clear the frozen field, and performing rollback processing to the first application contract by adding the available balance of the account A to the frozen amount until the substantial service rolls back to the lock, wherein the balance of the account is unchanged.
The temporary account mode has the advantages that the original contract logic is not influenced when unlocking is carried out, the scene of temporary account delay rollback is not influenced by the operation of the original account, the expansion and the maintenance are easy, and different authority management can be set; the key value pair locking mode needs to perform field expansion on the original structure of the application contract, has a wide application range and a large locking range, and is equivalent to the locking of the whole value structure under a certain key.
The embodiments described above are presented to enable a person having ordinary skill in the art to make and use the invention. It is to be understood that the present invention is not limited to the application of the above-mentioned examples, and it is obvious to those skilled in the art that various modifications can be easily made to the above-mentioned examples, and those skilled in the art should make improvements and modifications to the present invention based on the disclosure of the present invention within the protection scope of the present invention.

Claims (9)

1. A hash time locking method based on a cloud cross-chain transfer protocol is characterized by comprising the following specific implementation steps:
the method comprises the steps that a service end sends an asset transfer request to a first block chain gateway, the first block chain gateway is connected with a second block chain gateway, and asset transfer is achieved through a Hash time locking technology based on a cloud cross-chain transfer protocol;
a first cross-link gateway in the first block link gateway receives a service end instruction request, and records related information after system monitoring, wherein the first cross-link gateway comprises a cross-link routing function; the first cross-chain gateway issues GRPC service, interacts with a block chain by calling a plug-in, converts service sensitive information into a cloud cross-chain transfer protocol, performs data signing, and executes block chain contract and link event monitoring through an SDK (software development kit);
the first blockchain comprises a first cross-link contract and a first application contract, and the first application contract is connected with a transfer interface and a Lock function;
the second blockchain gateway is connected with the first cross-chain gateway through a P2P protocol, the internal structure of the second blockchain gateway comprises the second cross-chain gateway, the second cross-chain gateway issues GRPC service, and a plug-in is called to interact with the second blockchain, so that a cross-chain asset transfer request is realized; the second cross-link gateway includes a second cross-link routing function.
2. The cloud cross-chain transfer protocol-based hash time locking method as claimed in claim 1, wherein the hash time locking technology is based on a hash algorithm in the processing flow, and the specific implementation steps include:
the first cross-link gateway selects a secret random number S, calls a first cross-link contract to calculate a hash value H of the S by using a hash algorithm, simultaneously calls a first application contract to lock an asset a, creates a cross-link request event, inputs two timeout times T0 and T1 and ensures that T0 is greater than T1;
the first cross-link gateway sends H and T1 to the second cross-link gateway, which confirms that asset a is locked, locks asset b by invoking the second cross-link contract and the second application contract and sends a response;
the first cross-link gateway determines that the asset a is locked after receiving the response, uses the secret random number S to transfer the first application contract for unlocking, and transfers the asset b to the first block chain;
and after the second cross-chain gateway takes the secret random number S, calling a second application contract to unlock, and transferring the asset a to a second block chain.
3. The cloud cross-chain transfer protocol-based hash time locking method as claimed in claim 2, wherein the processing flow of the hash time locking technology is based on a timeout mechanism, and the specific implementation steps include:
the second block chain reaches the overtime T1, if the second block chain is unlocked, an abnormal condition occurs, and an alarm is sent out by using an abnormal processing mechanism; if the second block chain is not unlocked, the account rolls back the asset; the alarm sending is realized on a cross-link gateway, and if a transaction message with locked Hash time is received, each transaction is checked and the state of the transaction is judged; if a cross-link event with the hash time locked is received, setting a transaction state according to an event execution result;
the first blockchain reaches the timeout time T0, if the second blockchain is unlocked and the first blockchain asset continues to be locked, an abnormal condition occurs, and an alarm is sent by utilizing an abnormal processing mechanism; if the second blockchain is not unlocked, the account rolls back the asset.
4. The cloud cross-chain transfer protocol-based hash time locking method of claim 2, wherein the first cross-chain gateway sends H and T1 to the second cross-chain gateway, and the specific implementation steps include: the first cross-link gateway monitors a cross-link request event by calling the SDK, converts the cross-link request event into a cloud cross-link transfer protocol, signs and encrypts uplink information, stores the uplink information in the cloud cross-link transfer protocol, and transfers the uplink information to the second blockchain gateway from A through a cross-link, wherein the uplink information comprises a secret random number S, a hash value H, time T0 and time T1.
5. The cloud cross-chain transfer protocol-based hash time locking method as claimed in claim 1, wherein the first blockchain participates in hash time locking to realize the asset transfer request, the contract locking mode is temporary account locking, and the temporary account locking specifically realizing steps include:
in the process of business locking, reducing the available assets of a first block chain account by the pre-locking amount, keeping the account balance of a second block chain account unchanged, and creating a temporary account in an application contract, wherein the temporary account balance is the pre-locking amount;
performing a business unlocking unlock operation, wherein the process is to clear the temporary account and successfully transfer the cross-chain assets;
if the abnormal condition of timeout occurs, the service rollback operation is executed, the process is to clear the temporary account, and the service rollback is performed before locking.
6. The cloud cross-chain transfer protocol-based hash time locking method of claim 5, wherein the business locking mode of the contract further comprises key-value pair locking, and the key-value pair locking is implemented by the following steps:
setting a freezing field for a first application contract, subtracting the pre-freezing amount from the available assets of a first block chain account in the process of business locking, adding the pre-freezing amount to the account balance of a second block chain account, and placing the pre-freezing amount in the freezing field;
when the operation of unlocking the unlock of the service is executed, the process is to clear the frozen field, and the cross-chain asset transfer is successful;
if the abnormal condition of timeout occurs, the operation of rolling the roll back is executed, the process is to clear the frozen field, and the operation rolls back to the state before locking.
7. The cloud cross-chain transfer protocol-based hash time locking method as claimed in claim 1, wherein the asset transfer request supports concurrence of cross-chain service and non-cross-chain service, and the specific implementation steps include:
the first cross-link contract judges the transaction type of the asset transfer request through creating or receiving a transfer request interface, and realizes concurrence of cross-link service and non-cross-link service through a locking mode of a first application contract; the interface for creating or receiving the transfer request is divided into two roles and is used for indicating whether the cross-chain asset request belongs to an initiator or a participant;
if the transaction type is judged to be non-cross-link service, a transfer interface of the first application contract is called, and the state is updated to be Success or Failed; if the cross-link service is available, a Lock function of the application contract is called, the state is updated to LockState or Failed, and a cross-link request event is created.
8. The hash time locking system based on the cloud cross-chain transfer protocol is characterized by comprising a contract method management module, a system monitoring module, an exception handling mechanism module and two groups of blockchain gateways, wherein the two groups of blockchain gateways comprise a first blockchain gateway and a second blockchain gateway, the first blockchain gateway comprises a first cross-chain route, a first cross-chain gateway and a first blockchain, and the second blockchain gateway comprises a second cross-chain route, a second cross-chain gateway and a second blockchain:
the first cross-link route and the second cross-link route are used for providing a standard interface for the entrance platform and shielding the difference of bottom layer design.
The first cross-link gateway and the second cross-link gateway are used for interacting with the block chain and adapting to the function of the Hash time locking method;
the contract method management module is used for configuring accessible gateways, block chain contracts, methods and callback processing of transactions according to the serial numbers of the contract methods;
the system monitoring module is used for recording transaction and transaction flow information when performing cross-link transaction when the cross-link transaction is called by a service system;
and the exception handling mechanism module is used for processing one part across the link when the asset transfer transaction is carried out, and recording error information when the transaction is overtime and the other part cannot receive a processing result notice.
9. The cloud cross-chain transfer protocol-based hash time locking system of claim 8, wherein the cross-chain gateway module adapting hash time locking method function specifically comprises:
the management unit is used for checking each transaction and judging the related state of the transaction when the hash time locking related transaction message is received; when a cross-chain event related to hash time locking is received, setting a corresponding transaction state according to an event execution result;
the execution unit is used for executing the hash time locking related execution message sent by the management unit and calling a corresponding contract function for processing;
and the event monitoring unit is used for monitoring the hash time locking related event returned by the cross-chain and delivering the event to the management unit for processing.
CN202110580256.4A 2021-05-26 2021-05-26 Hash time locking method and system based on cloud cross-chain transfer protocol Pending CN113269545A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110580256.4A CN113269545A (en) 2021-05-26 2021-05-26 Hash time locking method and system based on cloud cross-chain transfer protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110580256.4A CN113269545A (en) 2021-05-26 2021-05-26 Hash time locking method and system based on cloud cross-chain transfer protocol

Publications (1)

Publication Number Publication Date
CN113269545A true CN113269545A (en) 2021-08-17

Family

ID=77233133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110580256.4A Pending CN113269545A (en) 2021-05-26 2021-05-26 Hash time locking method and system based on cloud cross-chain transfer protocol

Country Status (1)

Country Link
CN (1) CN113269545A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691621A (en) * 2021-08-24 2021-11-23 上海点融信息科技有限责任公司 Block chain data uplink method
CN114095253A (en) * 2021-11-22 2022-02-25 杭州云象网络技术有限公司 Cross-link data access transmission method, system and device adopting multi-channel access
CN114363416A (en) * 2021-12-29 2022-04-15 杭州趣链科技有限公司 Block chain-based cross-chain processing method and device, storage medium and server
CN114979244A (en) * 2022-04-29 2022-08-30 上海交通大学 Multi-chain trusted transaction BaaS service platform architecture based on Hash time locking protocol
WO2023082883A1 (en) * 2021-11-15 2023-05-19 腾讯科技(深圳)有限公司 Cross-blockchain transaction processing method and apparatus, and computer device, computer storage medium and computer program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266655A (en) * 2019-05-30 2019-09-20 中国工商银行股份有限公司 A kind of across chain interconnected method, equipment and system based on block chain
CN111640017A (en) * 2020-05-06 2020-09-08 深圳前海微众银行股份有限公司 Transaction correctness verification method and device applied to alliance chain cross-chain transfer
CN112507393A (en) * 2020-12-10 2021-03-16 浙商银行股份有限公司 Method for guaranteeing consistency of cross-chain transactions of block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266655A (en) * 2019-05-30 2019-09-20 中国工商银行股份有限公司 A kind of across chain interconnected method, equipment and system based on block chain
CN111640017A (en) * 2020-05-06 2020-09-08 深圳前海微众银行股份有限公司 Transaction correctness verification method and device applied to alliance chain cross-chain transfer
CN112507393A (en) * 2020-12-10 2021-03-16 浙商银行股份有限公司 Method for guaranteeing consistency of cross-chain transactions of block chain

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691621A (en) * 2021-08-24 2021-11-23 上海点融信息科技有限责任公司 Block chain data uplink method
CN113691621B (en) * 2021-08-24 2023-10-13 上海点融信息科技有限责任公司 Block chain data uplink method
WO2023082883A1 (en) * 2021-11-15 2023-05-19 腾讯科技(深圳)有限公司 Cross-blockchain transaction processing method and apparatus, and computer device, computer storage medium and computer program product
CN114095253A (en) * 2021-11-22 2022-02-25 杭州云象网络技术有限公司 Cross-link data access transmission method, system and device adopting multi-channel access
CN114095253B (en) * 2021-11-22 2024-02-23 杭州云象网络技术有限公司 Cross-link data access transmission method, system and device adopting multi-channel access
CN114363416A (en) * 2021-12-29 2022-04-15 杭州趣链科技有限公司 Block chain-based cross-chain processing method and device, storage medium and server
CN114363416B (en) * 2021-12-29 2024-01-23 杭州趣链科技有限公司 Cross-chain processing method and device based on block chain, storage medium and server
CN114979244A (en) * 2022-04-29 2022-08-30 上海交通大学 Multi-chain trusted transaction BaaS service platform architecture based on Hash time locking protocol
CN114979244B (en) * 2022-04-29 2023-12-22 上海交通大学 Hash time locking protocol-based multi-chain trusted transaction BaaS service platform architecture

Similar Documents

Publication Publication Date Title
CN113269545A (en) Hash time locking method and system based on cloud cross-chain transfer protocol
CN109087080B (en) Cross-chain transaction method, device and storage medium
CN111598566A (en) Network payment system based on mixed cross-chain
CN112994892B (en) Cross-chain interaction method, device, system and electronic equipment
CN112583917B (en) CSCP-based hybrid chain construction method
US5440633A (en) Communication network access method and system
CN109685489A (en) A kind of assets across chain method of commerce between block chain
CN107947357B (en) Power distribution automation data acquisition device and method based on safety access area
CN112529706B (en) Decentralizing heterogeneous public chain asset exchange method
CN112507393B (en) Method for guaranteeing consistency of block chain cross-chain transaction
CN113115313B (en) LEO satellite network secure routing method based on node trust
CN111652617B (en) Service processing system of cross-block chain platform
CN110555765B (en) Method and system for carrying out asset circulation among various block chains
Dong et al. Blockchain-based cross-domain authentication strategy for trusted access to mobile devices in the IoT
WO2020042929A1 (en) Block chain system
CN111970370B (en) Communication equipment system-oriented multilayer block chain protocol expansion system and method
CN112699136B (en) Cross-link certificate storage method and related device
CN111127022A (en) Block chain cross-chain common evidence value conversion algorithm
CN114022150B (en) Resource transfer method, device, electronic equipment and storage medium
CN112615838A (en) Extensible block chain cross-chain communication method
CN112821934A (en) Block chain-based credible rapid switching method for spatial information network
CN115842676A (en) Cross-chain transaction method, system and medium based on notary group
CN113411338B (en) Resource transaction method based on-chain-down cooperation of state channel
CN114926172A (en) Block chain main and sub chain architecture-based chain crossing method
CN112653506B (en) Block chain-based handover flow method for spatial information network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210817