WO2020042931A1 - Public chain-based transaction method and blockchain system - Google Patents

Public chain-based transaction method and blockchain system Download PDF

Info

Publication number
WO2020042931A1
WO2020042931A1 PCT/CN2019/101048 CN2019101048W WO2020042931A1 WO 2020042931 A1 WO2020042931 A1 WO 2020042931A1 CN 2019101048 W CN2019101048 W CN 2019101048W WO 2020042931 A1 WO2020042931 A1 WO 2020042931A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
chain
public
initiation
service
Prior art date
Application number
PCT/CN2019/101048
Other languages
French (fr)
Chinese (zh)
Inventor
白杰
吴先锋
李冬云
Original Assignee
白杰
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
Priority claimed from CN201811496855.2A external-priority patent/CN110866823B/en
Application filed by 白杰 filed Critical 白杰
Publication of WO2020042931A1 publication Critical patent/WO2020042931A1/en

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • This application relates to the field of blockchain technology, and in particular, to a public chain-based transaction method and a blockchain system.
  • Blockchain technology is a decentralized system idea that can create a relatively objective anti-repudiation digital environment through public consensus.
  • Blockchain technology can ensure that network information cannot be changed once it is released. For example, if a transaction occurs in the blockchain network, nodes in the blockchain network will record the content of the transaction in the generated block, and Block data is broadcast throughout the network, and other nodes in the network store the block data synchronously or asynchronously to form an unchangeable blockchain.
  • the transaction has a broad meaning and does not refer to "commodity sale” or “item exchange” in the traditional sense, but refers to the content or operation result of a certain type or data on the blockchain network, for example, on the network
  • a query request a for the performance of a certain type of communication equipment is initiated, and the query request a is a transaction for the blockchain node B that undertakes the query service.
  • the node B sends the performance table b of the communication device of the model obtained to the node A to the node A.
  • Information A, a and information B, b as transaction information will be written into the data block of the blockchain.
  • Existing blockchain-based transaction methods can only be limited to the same blockchain network, that is, transactions between nodes in the blockchain network, and each blockchain network uses a unique virtual Currency as a medium of transaction.
  • the Bitcoin-based transaction method is only applicable to the Bitcoin blockchain network, and Bitcoin is used as a transaction virtual currency;
  • the Etherum-based transaction method is only applicable to the Ethereum blockchain network, Ethereum As a trading virtual currency.
  • more and more blockchain networks have been established, such as industry chains, alliance chains, private chains, etc., to achieve practical applications in specific fields.
  • the existing blockchain networks are basically independent of each other, and there is no unified and effective mechanism for communication and interaction between different chains.
  • Each type of blockchain can provide different capability sets due to different application scenarios.
  • the endogenous nature of the blockchain network determines that the capability sets provided by different chains cannot be interconnected, which results in an island effect of data and applications and limits Application based on blockchain transaction method.
  • This application provides a public chain-based transaction method and a blockchain system to solve the problem that traditional transaction methods do not support cross-chain transactions and limit the application of blockchain-based transaction methods.
  • this application provides a public chain-based transaction method, including:
  • the transaction initiation chain initiates a query transaction containing service type information to the public chain
  • the public chain queries the transaction target chain connected to the public chain network according to the service type information in the query transaction;
  • the public chain returns the transaction target chain information that matches the service type information to the transaction initiation chain.
  • the transaction target chain information includes the target chain address, transaction method, and transaction conditions.
  • the transaction initiation chain initiates service transactions to the public chain according to the transaction method and transaction conditions;
  • the public chain transfers service transactions to the transaction target chain
  • the transaction target chain verifies the transaction conditions and returns the service content to the public chain according to the received service transaction after the verification is qualified;
  • the public chain delivers service content to the transaction initiation chain.
  • the steps of the transaction initiation chain initiating a query transaction containing service type information to the public chain include:
  • the transaction nodes in the transaction initiation chain generate transaction requests based on the actual transaction information
  • the transaction node broadcasts the transaction request in the transaction initiation chain to form a blockchain bookkeeping that conforms to the transaction initiation chain;
  • the checkout node validates the transaction request and packages it into block data
  • the bookkeeping node broadcasts the block data to other nodes and initiates query transactions to the maintenance nodes in the public chain.
  • the smart contracts provided by the public chain include smart contracts created by the public chain and public smart contracts.
  • the method further includes:
  • the public chain initiates contract verification information to the blockchain network of the accessed public chain network to verify whether the accessed blockchain network supports the smart contract provided by the public chain;
  • the public chain sets a contract judgment label for the connected blockchain network according to the verification result of whether the smart contract is supported, including: setting a contract judgment label for the corresponding interface node of the accessed blockchain network; or, for the accessed block
  • the chain network address sets the contract judgment label.
  • the method can also pass the following steps Return the service content to the transaction initiation chain:
  • the transaction initiation chain initiates service transactions directly to the transaction target chain according to the transaction method and transaction conditions;
  • the transaction target chain verifies the transaction conditions, and returns the service content to the transaction initiation chain according to the received service transaction after the verification is qualified;
  • the transaction summary is synchronized to the public chain.
  • the step of initiating a query transaction including service type information in the transaction initiation chain to the public chain further includes:
  • the public chain judges whether the transaction initiation chain supports smart contracts
  • transaction initiation chain does not support smart contracts, create a smart contract for the transaction initiation chain through the public chain, or configure a public smart contract for the transaction initiation chain;
  • the public chain determines the addresses corresponding to the transaction initiation chain and the transaction target chain according to the smart contract or public smart contract.
  • the transaction conditions include the number of transaction tokens designated by the transaction target chain, and before the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions, the method further includes:
  • the transaction initiation chain is allowed to initiate service transactions to the public chain;
  • the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions includes: the transaction initiation chain creates a transfer transaction on the public chain to trigger the execution of the contract, and the transfer transaction includes a designated transaction certificate payment to the transaction target chain Quantity.
  • the steps of the public chain transmitting service transactions to the transaction target chain include:
  • the public chain locks the transfer transaction and initiates a request transaction to the transaction target chain according to the transfer transaction;
  • the transaction target chain provides return transaction results to the public chain according to the transaction request;
  • the public chain verifies the return transaction result. If the return transaction is consistent with the transfer transaction, the lock status of the transfer transaction is released;
  • the public chain transfers the payment of the transaction initiation chain to the transaction target chain, and transfers the service content to the transaction initiation chain.
  • the method further includes:
  • the public chain judges whether the transaction initiation chain and the transaction target chain support transactions directly through the Zhengtong of the public chain;
  • the parallel chain corresponding to the transaction initiation chain initiates service transactions to the public chain, and the parallel chain corresponding to the transaction target chain returns service content to the public chain.
  • this application also provides a public chain-based blockchain system, including: a transaction initiation chain, a public chain, and a transaction target chain; the transaction initiation chain establishes a network connection with the transaction target chain through the public chain;
  • the transaction initiation chain is configured to: initiate a query transaction including service type information to the public chain; and initiate a service transaction to the public chain according to the transaction conditions of the transaction target chain;
  • the public chain is configured to: according to the service type in the query transaction, query the transaction target chain connected to the public chain network; return the transaction target chain information corresponding to the service type information to the transaction initiation chain, and the transaction target chain information includes the target Chain address, transaction method and transaction conditions; and, passing service transactions to the transaction target chain, and passing service content to the transaction initiation chain;
  • the transaction target chain is configured to verify transaction conditions and return service content to the public chain according to the received service transaction after the verification is qualified.
  • the method first initiates a query transaction from the transaction initiation chain to the public chain, and then queries the transaction target chain connected to the public chain network through the public chain according to the service type information in the query transaction; In order to make the public chain return to the transaction initiation chain the transaction target chain information that conforms to the service type information; the transaction initiation chain then initiates a service transaction to the public chain according to the transaction method and transaction conditions required by the transaction target chain; After the transaction target chain verifies that the transaction conditions are qualified, the service content is returned to the public chain according to the received service transaction. Finally, the public chain passes the service content to the transaction initiation chain to complete the cross-chain transaction.
  • the method queries and transmits service transactions through the public chain network, so that the transaction initiation chain can obtain the service content of the transaction target chain, complete cross-chain transactions between different chain networks, and increase the application scope of the blockchain-based transaction method.
  • FIG. 1 is a schematic flowchart of a public chain-based transaction method of this application
  • FIG. 2 is a schematic flowchart of a process of initiating a query transaction to a public chain by a transaction initiation chain of this application;
  • FIG. 3 is a schematic flowchart of a process for judging whether a transaction initiation chain supports a smart contract
  • FIG. 4 is a schematic flowchart of a process for judging whether a transaction initiation chain and a transaction target chain support public chain token trading;
  • FIG. 5 is a schematic flowchart of a process for judging whether the number of transaction-initiated chain certificates meets requirements
  • FIG. 6 is a schematic diagram of a transaction process when the application chain is locked for transactions
  • FIG. 7 is a flowchart of a transaction when a transaction initiation chain and a transaction target chain support an interface specification agreed on by a public chain;
  • FIG. 8 is a schematic structural diagram of a public blockchain-based blockchain system.
  • a blockchain network refers to a peer-to-peer (P2P) network with a decentralized application architecture.
  • the blockchain network can perform distributed storage, public consensus, digital encryption, transaction accounting, and verification. That is, a trading platform that covers distributed technology, cryptography, P2P network architecture, and various consensus algorithms that may be applied.
  • Blockchain or blockchain information refers to the accounting information generated based on transaction information when a transaction occurs in the blockchain network, that is, multiple specific transactions form a block, and multiple blocks form an ordered block. chain.
  • Blockchain networks include nodes that establish peer-to-peer network connections with each other. Each node is configured with a corresponding consensus mechanism, such as a smart contract, and has sufficient computing power to perform transaction verification and accounting procedures. The nodes also have an interface specification that conforms to a certain unified standard to achieve access to more nodes or other types of blockchain networks through the interface specification.
  • the public chain network is used as a basic platform arranged on the entire network, and its node interfaces are connected to multiple blockchain networks, such as industry chains, alliance chains, and private chains based on public link interface specifications. Each blockchain network can serve as a development platform and provide corresponding services within its network.
  • the definition and specification of the public chain have standard interfaces and methods to facilitate network interconnection with other blockchains, such as the transaction initiation chain and the transaction target chain.
  • the public chain in this application has the ability to support cross-chain intermediation, as well as decentralized applications and smart contracting capabilities.
  • the transaction initiation chain and the transaction target chain refer to the block chain in the public chain network, that is, in this application, the public chain provides the basic platform, and the transaction initiation chain and the transaction target chain are the access networks, each with its own functions and service.
  • the transaction initiation chain and transaction target chain can be a blockchain network based on public chain network standards and interface specifications, that is, the transaction initiation chain and transaction target chain can directly communicate with and connect to the public chain network.
  • the transaction initiation chain and transaction target chain can also be independent networks, such as the existing blockchain network Bitcoin, Ethereum, etc., or industry chains and alliance chains developed by some industries, or even to achieve a certain service Private chains built on demand. These existing blockchains, industry chains, alliance chains, and private chains generally cannot directly trade with each other or even with the public chain network. Therefore, in this application, the public chain and other networks can be connected through parallel chains.
  • Parachains can be composed of some nodes in the public chain network, and through the parachains, the public chain can be bridged with other networks that cannot be directly traded.
  • each blockchain network corresponds to a parachain, and the parachain is set to have the complete function of the corresponding blockchain network, and can synchronize transactions in the blockchain network Transformation and transfer to the public chain network. Therefore, in the technical solution provided in this application, the parallel chain can be determined as a mirror image of the corresponding blockchain network, and for convenience of description, the corresponding blockchain network becomes the parent chain.
  • the parachain is composed of some nodes in the public chain network, and these nodes are also nodes in the parent chain to transfer transaction information.
  • the public chain can provide cross-chain relays in practical applications, completing transactions verification, data certification, asset transfer, and smart contract execution.
  • the public chain's unified external interface specifications enable other blockchain networks to quickly access the public chain network.
  • the public chain also provides the basic blockchain platform capabilities, which is to quickly complete the deployment and verification of the scheme, and to complete the distributed storage and accounting procedures in the public chain network.
  • the public chain can also provide public development functions, thereby completing the collaborative development and deployment of multiple parallel chain smart contracts at one time.
  • the public chain can also be used to store the information summary of the corresponding cross-chain transaction, that is, the transaction summary. Record the relevant content of cross-chain transactions through formatted transaction data.
  • the public chain in order to reduce the occupation of distributed storage space on the public chain, when the public chain records certain information, it can also record third-party blockchain information through a specific compression algorithm.
  • the block data formed and stored in the public chain can include the following: block identifiers (such as serial numbers, timestamps, block hash values, and previous block hash values), block ownership (that is, block producers) ), Other information of the block (such as random value, difficulty value and additional information, etc.), block weight, information summary (such as transaction tree, status tree, receipt tree, data tree, etc.), transaction costs, rewards, size, etc.
  • block identifiers such as serial numbers, timestamps, block hash values, and previous block hash values
  • block ownership that is, block producers
  • Other information of the block such as random value, difficulty value and additional information, etc.
  • block weight such as random value, difficulty value and additional information, etc.
  • information summary such as transaction tree, status tree, receipt tree, data tree, etc.
  • transaction costs such as rewards, size, etc.
  • the transaction method includes the following steps:
  • the transaction initiation chain initiates a query transaction containing service type information to the public chain.
  • the transaction initiation chain determines the type of service required on the transaction initiation chain according to its own service requirements, and sends it to the public chain network by querying the transaction. Since the transaction initiation chain is also a blockchain network connected to the public chain in this application, the initiating query transaction described herein may be initiated by a node in the transaction initiation chain. After a transaction node initiates a query transaction, the transaction initiation chain network first judges the service transaction to determine whether the service transaction can be completed within the transaction initiation chain network.
  • the transaction node completes the transaction between the transaction initiation chain and another node capable of providing the corresponding service type.
  • the transaction process can form blockchain information inside the transaction initiation chain, and perform distributed storage, verification and other procedures within the transaction initiation chain. If the current service transaction cannot be completed within the transaction initiation chain, a corresponding query transaction can be generated through a smart contract in the transaction initiation chain, and the query transaction is initiated to the public chain. Obviously, the type of service required in the service transaction must be included in the initiated query transaction.
  • query transactions can be passed to the public chain through parallel chains to initiate query transactions.
  • the network B contains 100 nodes, which are denoted as B00 to B99.
  • node B25 in network B needs to use 100 STOs Tb to exchange for Stoe Ta of the same value.
  • Node B25 acts as a transaction node, which creates query transactions and forms block data as required.
  • the query transactions include The service type is: exchange of tokens.
  • Node B25 can broadcast query transactions in network B, that is, broadcast to other nodes, such as B24 and B26.
  • other nodes in network B distribute the block data of query transactions. It can determine whether other nodes in the network B can satisfy the transaction request of the node B25, that is, whether other nodes can exchange the token pass Ta with the node B25.
  • the query transaction needs to be broadcast to the nodes in the public chain network P, so that the nodes in the public chain network P can determine networks A, C, D, and E based on the query transaction. Whether it is possible to exchange the certificate pass Ta to the node B25.
  • the transaction initiation chain initiating a query transaction containing service type information to the public chain may further include the following steps:
  • a transaction node in the transaction initiation chain generates transaction information according to an actual transaction
  • S102 the transaction node broadcasts the transaction information in a transaction initiation chain to form a blockchain account that conforms to the transaction initiation chain;
  • S103 The bookkeeping node verifies the transaction and adds block data
  • S104 The bookkeeping node broadcasts the block data to other nodes in the transaction initiation chain, and simultaneously initiates query transactions to the maintenance nodes in the public chain.
  • the smart contracts provided by the public chain include smart contracts and public smart contracts created by the public chain.
  • the transaction information can be broadcasted in the transaction initiation chain.
  • the transaction initiation chain writes the transaction information into the block data for distributed storage to form a transaction initiation.
  • Blockchain accounting data for the chain The block data records the actual transaction information initiated by the transaction node, such as: service type, number of transactions, transaction initiator, transaction target, hash value, etc.
  • the transaction nodes After broadcasting in the transaction initiation chain, the transaction nodes also add smart contract and service type information to the block data.
  • the transaction node B25 after initiating an inquiry transaction, the transaction node B25 generates block data containing the exchange services, and then broadcasts the transaction information of the inquiry transactions on the network B.
  • the specific broadcast form It can be determined according to the requirements of the broadcast form in network B.
  • the transaction node B25 can first broadcast the block data to neighboring nodes B24 and B26.
  • the neighboring nodes B24 and B26 verify the transaction, determine whether the transaction is legal, and block Data is stored to form a blockchain.
  • the neighboring nodes B24 and B26 broadcast to their respective neighboring nodes, so that all nodes in network B can verify and store the block data, and form a complete blockchain data that complies with the accounting specifications in network B.
  • the smart contracts provided by the public chain include smart contracts and public smart contracts created by the public chain.
  • the smart contract information is used to enable transactions with the public chain to initiate query transactions and subsequent service transactions; service type information includes Necessary service description information, or service code information stored in the public chain network, can be used to initiate query transactions.
  • the block data added with smart contract and service type information is broadcast to the maintenance nodes in the public chain, so as to initiate query transactions.
  • the maintenance node in the public chain network can be the node used to provide the interface for the transaction initiation chain, or it can be another designated node.
  • the computing power can be used to meet the conditions, and the node closer to the transaction initiation chain is used as a maintenance node to increase the broadcast speed of block data.
  • the service transaction includes specific transaction content, which may be a virtual currency exchange transaction, such as the exchange of a value such as a token in the transaction initiation chain into a transaction target chain CSI; it can also purchase certain services through virtual currency, such as network-oriented query services and reporting services.
  • Query transaction is a special transaction.
  • the transaction form is the same as the general transaction form, but it requires special agreement on specific transaction methods, such as transactions with smart contract information for query transactions, or transactions with an agreed number of STOs to be transferred.
  • smart contract verification can be performed on the transaction initiation chain through the public chain to determine whether the transaction initiation chain supports the smart contract provided by the public chain. That is, the public chain initiates contract verification information to the blockchain network of the public chain network that is accessed to verify whether the accessed blockchain network supports the smart contract provided by the public chain. Because in practice, every blockchain network connected to the public chain may be used as a transaction initiation chain. Therefore, in this embodiment, after a blockchain network is connected to the public chain, it can be intelligent. Contract verification.
  • the public chain may set a contract judgment label for the accessed blockchain network according to whether the smart contract verification result is supported. Specifically, a contract judgment label is set for the corresponding interface node of the accessed blockchain network; or a contract judgment label is set for the accessed blockchain network address.
  • the method for setting the contract judgment label for the corresponding interface node of the accessed blockchain network can be used to extract the judgment label set for the interface node when the corresponding blockchain network is used as the transaction initiation chain, so as to determine whether the current transaction initiation chain supports it. Smart contracts; and in the manner of setting a contract judgment label for the accessed blockchain network address, it can also determine whether the corresponding transaction initiating chain supports smart contracts by extracting the address of the transaction initiating chain.
  • a query transaction can be initiated directly to the public chain through a smart contract without the participation of a parallel chain.
  • the public chain can be used as The transaction initiation chain is configured with a smart contract, or a parallel chain bridging method is used to pass query transactions from the transaction node to the public chain.
  • the parallel chain has been configured with a smart contract. Therefore, as shown in FIG. 3, before the transaction initiation chain initiates a query transaction to the public chain, the transaction method may further include:
  • S105 the public chain judges whether the transaction initiation chain supports smart contracts
  • S106 If the transaction initiation chain does not support the smart contract, create a smart contract for the transaction initiation chain through the public chain, or configure a public smart contract for the transaction initiation chain;
  • the public chain determines the addresses corresponding to the transaction initiation chain and the transaction target chain according to the smart contract or the public smart contract.
  • the public chain can determine whether the transaction initiation chain supports smart contracts through the public chain.
  • the public chain can extract the contract judgment tags on the transaction initiation chain, that is, determine whether the transaction initiation chain supports smart contracts by analyzing the contract judgment tags.
  • a smart contract on the public chain can be used to initiate a specific format of the contract judgment transaction to the transaction initiation chain, and analyze the contract judgment results returned by the transaction initiation chain. If the transaction initiation chain can return content that meets the smart contract specifications, determine that the transaction initiation chain supports smart contracts; if the transaction initiation chain cannot return content that meets the smart contract specifications, or does not respond, determine that the transaction initiation chain does not support smart contracts.
  • a smart contract can be configured for the transaction initiation chain through the public chain, or a public contract can be selected for the transaction initiation chain through the public chain, and the selected public contract can be configured for the transaction initiation chain.
  • the public contract may be a contract used by a blockchain network with a high degree of application, or a contract specification agreed in the current industry field.
  • the public chain can also determine the address information of the transaction initiation chain and the transaction target chain, that is, the transaction initiation chain and the transaction target chain are clearly defined in order to implement subsequent transactions.
  • S2 The public chain inquires the transaction target chain connected to the public chain network according to the service type information in the query transaction.
  • the public chain after receiving a query transaction initiated by the transaction initiation chain, extracts service type information in the query transaction, and performs a query in the public chain network according to the service type information to find that it can provide the service.
  • the blockchain network of the type information corresponding service serves as the transaction target chain.
  • the network as a transaction target chain also includes multiple nodes, that is, multiple nodes constitute a transaction target chain. Therefore, the services that can be provided in the transaction target chain can be one or some nodes.
  • the results queried by the public chain can be the transaction target chain or the nodes that can provide services in the transaction target chain.
  • the result of the public chain query is a method of transaction target chain, in order to quickly determine the transaction target chain, and avoid the situation that the transaction target chain does not support public chain query.
  • the query of the transaction target chain by the public chain in the public chain network can be completed by the smart contract configured in the public chain or by a decentralized application in the public chain network.
  • the specific query process may be querying the information of the access to the blockchain network stored in the public chain network.
  • This query method requires that the public chain obtains the registered information of the accessed blockchain network through the communication of the access node when the blockchain network accesses.
  • the registered information may include: the types of services that can be provided, and the The types of exchanges that are exchanged, as well as the methods of conducting transactions and the conditions of transactions. Programs in the public chain store these registration information and corresponding network addresses and broadcast them on the entire network.
  • the query process can also be completed in the following form.
  • the public chain receives the query transaction, it broadcasts a transaction for service provision on the entire network.
  • the blockchain network connected to the public chain can respond accordingly to the transaction.
  • the response information can include transaction conditions and transaction methods.
  • the public chain chooses to reply to the earliest blockchain network as the transaction target chain, or judges the transaction conditions to determine the most suitable (such as the least number of STOs, or the best liquidity of STOs).
  • the method further includes:
  • S201 The public chain judges whether the transaction initiation chain and the transaction target chain support transactions directly through the Zhengtong of the public chain;
  • S203 The parallel chain corresponding to the transaction initiation chain initiates a service transaction to the public chain, and the parallel chain corresponding to the transaction target chain returns a service content to the public chain.
  • the public chain after querying the transaction target chain, the public chain can determine whether the transaction initiation chain and the transaction target chain support transactions directly through the public chain certificate exchange based on the information stored in the public chain. And the transaction target chain can be directly traded through the public chain Zhengtong, thereby facilitating the public chain to conduct accounting procedures and verify transaction settlement.
  • the transaction initiation chain and / or the transaction target chain do not support transactions directly through the stock exchange of the public chain
  • the transaction initiation chain and / or the parallel chain corresponding to the transaction target chain According to the conversion of the China Securities Exchange, according to the exchange ratio between the public securities exchange and the transaction initiation chain, and the transaction target chain, the securities exchange paid by the transaction initiation chain is first converted into an equivalent value of the public blockchain securities, and then passed through the public exchange. The chain passes the public chain certificate pass to the transaction target chain. And in the subsequent transaction process, service transactions are completed by the parallel chain.
  • the public chain returns transaction target chain information that conforms to the service type information to the transaction initiation chain, and the transaction target chain information includes a target chain address, a transaction method, and transaction conditions.
  • the public chain After querying the transaction target chain, the public chain can obtain the address information of the transaction target chain, the transaction method, and the transaction conditions. Obviously, the public chain can obtain the above information from the registration information stored in the public chain, or it can provide the information by one side of the transaction target chain by forwarding the query transaction to the transaction target chain. In order to increase the query efficiency, the present application preferably obtains the above information by means of registration information stored in the public chain. After the public chain obtains the transaction target chain information, it can send the obtained target chain information to the transaction initiation chain, so that the transaction initiation chain can determine whether to trade with it according to the transaction target chain information.
  • the target chain address is a registered address of the transaction target chain in the public chain network, or the node address of the interface provided when the transaction target is linked into the public chain.
  • the transaction method is the transaction time set by the transaction target chain, the block chain information format (template), and the type of stock exchange that supports the transaction.
  • Transaction conditions may include not only the specified number of STOs required to provide services, but also the qualification requirements for the transaction initiation chain, such as the number of STOs owned and the credit score of the transaction initiation chain.
  • some additional information can be attached to the query transaction, such as the type of transaction certificate that can be provided, the required service specifications, the service provision qualification of the transaction target chain, and the transaction certificate. Pass cap and so on.
  • the query transaction can be performed through the connection node BP (or interface node) between the network B and the public chain network P. Broadcast to the maintenance nodes P01 to P99 in the public chain network P. The maintenance nodes in the public chain also need to verify and distributed storage of the query transaction, and access other blocks on the public chain network P according to the query transaction. Whether the chain networks A, C, D, E can provide the exchange service of the Zhengtong.
  • the address information of Network A in the public chain network P is obtained, such as the IP address of the connecting node AP, and Network A is in the public domain.
  • the transaction conditions registered in the chain network P are the transaction conditions required when the Zentong Tb is exchanged for the Zentong Ta, such as the exchange ratio of the Zentong Tb and the Zentong Ta, and the exchange qualifications required by the transaction counterparty required by the network A.
  • the service node in the public chain P creates the query result of the address of the network A and the transaction conditions of the network A, and returns the query result to the transaction node B25.
  • the transaction initiation chain initiates a service transaction to the public chain according to the transaction method and transaction conditions.
  • the transaction initiation chain can analyze the transaction target chain information to extract the transaction mode and transaction conditions in the transaction target chain information.
  • the transaction initiation chain can determine whether to support the transaction method provided by the transaction target chain; and for the transaction conditions, it can automatically or manually determine whether the transaction conditions proposed by the transaction target chain can be accepted. If the transaction conditions can be accepted and the corresponding transaction methods are supported, the transaction initiation chain can initiate service transactions that meet the transaction conditions to the public chain in accordance with the specified transaction method.
  • the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions includes: the transaction initiation chain creates a transfer transaction on the public chain to trigger contract execution, and the transfer transaction includes a specified transaction paid to the transaction target chain The number of securities pass.
  • the transaction node B25 verifies the transaction conditions and transaction methods in the returned query result. On the one hand, it is determined whether the transaction meets the requirements, that is, whether it can Satisfying the request of the STO exchange service of B25 can determine whether the transaction conditions can be accepted, for example, whether the STO exchange rate required by the transaction target chain A can be accepted.
  • the above verification process can be judged automatically by Node B25, or it can actively choose whether to accept the transaction conditions.
  • the verification of the returned query results may also include whether the transaction node B25 can perform transactions in accordance with the transaction method specified by the transaction target chain A.
  • the transaction node B25 accepts the transaction conditions and is able to conduct transactions in the transaction mode specified by the transaction target chain A, the transaction node B25 initiates a formal service transaction, that is, transfers 100 securities pass Tb to the public chain network P.
  • a formal service transaction that is, transfers 100 securities pass Tb to the public chain network P.
  • the maintenance nodes in the public chain network have engaged in the corresponding query and storage operations, and in the subsequent transaction process, they will also participate in other operations, such as transfer, value conversion, Bookkeeping, etc., therefore, when the transaction node B25 initiates a formal service transaction to the public chain, it is also necessary to transfer a specific number of public chain tokens to the public chain network as a reward for maintaining nodes in the public chain.
  • the transaction conditions include the number of transaction certificates specified by the transaction target chain, and the step of initiating the service initiating a service transaction to the public chain according to the transaction conditions further includes:
  • S401 Determine whether the number of STOs owned by the transaction initiation chain meets the number of STOs designated by the transaction target chain;
  • S403 If the number of STOs owned by the transaction initiation chain does not satisfy the number of STOs designated by the transaction target chain, send prompt information to the transaction initiation chain, and continue to query other access to the public chain network according to the service type Transaction target chain.
  • the public chain can judge the balance of the designated tokens owned by the transaction initiation chain to determine whether the transaction initiation chain can meet the transaction target chain designation Trading conditions required. For the case where the transaction conditions can be met, the transaction initiation chain is allowed to initiate service transactions to the public chain; in the case where the transaction conditions cannot be met, a prompt message can be sent to the transaction initiation chain to inform the transaction initiation chain, and also You can continue to query other transaction target chains connected to the public chain network according to the service type, and repeat the above process until the query satisfies the transaction conditions.
  • the transaction condition required by the transaction target chain A is that the number of TBTs owned by the transaction node as the transaction initiator is not less than 100. Therefore, before initiating a formal service transaction, the certificate owned by the transaction node can be issued through the public chain network. Judging the number of transaction Tb, if the number of Tb of the transaction node owned by the transaction node is 53, it is determined that the transaction conditions are not met. At this time, the public chain network sends a reminder message to the transaction node B25, such as "The certificate that you own The balance of Tb is insufficient to complete the transaction. "" The transaction requires at least 100 Tb passes for the transaction, and you need 47 to complete the transaction. "
  • S5 The public chain passes the service transaction to the transaction target chain.
  • the service transaction sent by the transaction initiation chain to the public chain may not be processed in the public chain, and only the public chain network will pass the service transaction to the transaction target chain.
  • the public chain can extract the address information of the transaction target chain in the service transaction, obtain the position of the transaction target chain, and then send the service transaction to the transaction target chain according to the address of the transaction target chain.
  • the maintenance node in the public chain network P verifies the 100 Zentong Tb transferred by the transaction node, and forms block data that conforms to the public chain transaction form for the service transaction. And broadcast the formed block data in the public chain network, and then transfer the 100 TST to the Tb account corresponding to network A.
  • the public chain needs to perform distributed storage in the public chain network when transmitting the service transaction, that is, to keep accounts in the public chain network. Therefore, when the service transaction is delivered by the public chain, it is also a transaction that occurs in the public chain network.
  • the types of Zhengtong in circulation are different, and different types of Zhengtong often cannot directly trade. Therefore, in the technical solution provided in this application, in the process of the public chain transmitting the service transaction to the transaction target chain, the Zentong of the transaction initiation chain payment can be locked, and then other public funds of equal value are transferred to the transaction target chain.
  • the chain certificate is used to trigger the transaction target chain to return the service content.
  • the step of the public chain transmitting the service transaction to the transaction target chain includes:
  • S501 the public chain locks the transfer transaction, and initiates a request transaction to the transaction target chain according to the transfer transaction;
  • the transaction target chain provides a return transaction result to the public chain according to the transaction request;
  • S503 The public chain verifies the return transaction result, and if the return transaction result is consistent with the transfer transaction, releases the locked state of the transfer transaction;
  • S504 The public chain transfers the Zentong of the transaction initiation chain payment to the transaction target chain, and transfers the service content to the transaction initiation chain.
  • the public chain first locks the transfer transaction, that is, temporarily locks the Zentong of the transaction initiation chain payment, and then initiates a request transaction to the transaction target chain according to the transfer transaction.
  • the request transaction is used to trigger the transaction target chain to return the transaction.
  • the public chain then verifies the content of the return transaction. If the return transaction is consistent with the transfer transaction, the locked state of the transfer transaction is released, so that the public chain initiates the transaction through the chain of payment of the transaction, and transfers it to the transaction target chain, and Transfer the service content to the transaction initiation chain. Locking the transfer transaction through the public chain can verify the content of the transaction in the public chain network to determine whether it has truly met the transaction specifications and protect the transaction rights of both parties in the transaction.
  • the transaction target chain verifies the transaction conditions, and returns the service content to the public chain according to the received service transaction after the verification is qualified.
  • the transaction target chain after receiving the service transaction transmitted by the public chain, the transaction target chain first verifies the transaction conditions to determine whether the service transaction meets the transaction conditions. For example, whether the number of STOs paid by the service exchange meets the number of STOs required by the transaction target chain, and whether the transaction initiation chain has the transaction qualification required by the transaction target chain. If the transaction target chain verifies that the transaction conditions are qualified, the corresponding service content is returned according to the received service transaction, that is, the corresponding service is provided for the transaction initiation chain.
  • the service content may include specific service content in the return transaction, for example, a data retrieval report, or another specified number of Zhengtong exchanged.
  • the returned service contents may include corresponding network access information, verification codes, account numbers, etc.
  • the public chain does not need to directly participate in the subsequent data transfer process. Only when the service content is returned, the corresponding network access information, verification code, account number, and other information are passed to the transaction initiation chain. Distributed storage of the returned service content in the chain completes the accounting process.
  • S7 The public chain delivers the service content to the transaction initiation chain.
  • the public chain After receiving the service content returned by the transaction target chain, the public chain passes the service content to the transaction initiation chain in a relay manner. After the public chain forwards the service content to the transaction initiation chain, it represents the completion of the transaction. For example, after the public chain network P transfers 100 securities pass Tb to the Tb account corresponding to network A, the public chain network extracts certificates of equal value from the Ta account corresponding to network A after the transaction target chain is verified If the exchange ratio is 2: 1, then 50 securities exchange Ta will be extracted and transferred to the account corresponding to network B to complete the final service transaction.
  • the transaction initiation chain directly initiates a service transaction to the transaction target chain according to the transaction method and transaction conditions;
  • the transaction target chain verifies the transaction conditions, and returns a service content to the transaction initiation chain according to the received service transaction after the verification is qualified.
  • the transaction target chain verifies the transaction conditions after receiving the service transaction initiated by the transaction initiation chain, and the specific verification content is consistent with the content of the above embodiment. After the transaction conditions are qualified, the transaction target chain directly returns the transaction content to the transaction initiation chain according to the received service transaction to complete the final transaction.
  • a distributed accounting can be performed inside the transaction initiation chain, and the stored block data
  • a summary of the block data is sent to the public chain network for distributed storage; and, when the transaction target chain returns the service content, distributed accounting is performed in the transaction target chain, and the stored block data is also stored.
  • a summary of the block data is sent to the public chain network for distributed storage.
  • the public chain can also use the address information in the block data to make the block data sent by the transaction initiation chain and the transaction target chain consistent. Contrast, determine the legality of the transaction, etc.
  • the public chain network is only responsible for corresponding query transactions, that is, after the transaction initiation chain initiates a query transaction, the public chain network queries the transaction target chain according to the query transaction and then sets the address of the transaction target chain. The information is returned to the transaction node B25.
  • the transaction node B25 directly initiates a service transaction to the transaction target chain A, that is, transfers 100 securities pass Tb to the transaction target chain A, and the service node in the transaction target chain A receives it again. After 100 securities pass Tb, transfer another 50 securities pass Ta to the transaction node B25 to complete the transaction directly.
  • the formed block data is broadcast not only in network B, but also in the public chain network.
  • the service node of the transaction target chain A transfers 50 Zhengtong Ta to the transaction node B25, it also needs to broadcast simultaneously or asynchronously in the transaction target chain network A and the public chain network P.
  • the transaction node B25 transfers 100 securities pass Tb to the transaction target chain A, and the service node of the transaction target chain A transfers 50 transaction nodes B25
  • the Zhengtong Ta refers to the circulation direction of the Zhengtong or the transaction result, and does not really transfer the Zhengtong entity from one chain to another.
  • both parties to the transaction can have corresponding accounts in both networks, and the transfer transaction only transfers the Zentong to the corresponding account, that is, 100 Tb are exchanged on the B network and 50 Ta are exchanged on the A network.
  • 100 Tb are exchanged on the B network
  • 50 Ta are exchanged on the A network.
  • For network exchange only the transaction information and accounting data transmitted through the public chain describe the content of cross-chain transactions.
  • this application also provides a public chain-based blockchain system.
  • the system includes: a transaction initiation chain, a public chain, and a transaction target chain; the transaction initiation chain passes through the The public chain establishes a network connection with the transaction target chain; wherein the transaction initiation chain refers to the blockchain network as the transaction initiator, and the transaction target chain refers to the blockchain network as the transaction target.
  • the transaction initiation chain is configured to perform the following program steps: initiating a query transaction containing service type information to the public chain. That is, at the beginning of cross-chain transactions, the transaction initiation chain initiates query transactions to the public chain, so that the public chain can query the transaction target chain in the public chain network. And, a service transaction is initiated to the public chain according to the transaction conditions of the transaction target chain. That is, after the public chain returns the transaction target chain information that matches the service type information, a service transaction is initiated to the public chain.
  • the public chain is configured to: query the transaction target chain connected to the public chain network according to the service type in the query transaction; and return the transaction target chain information that matches the service type information to the transaction initiation chain.
  • the transaction target chain information includes a target chain address, a transaction method, and transaction conditions; and, passing the service transaction to the transaction target chain, and passing the service content to the transaction initiation chain;
  • the transaction target chain is configured to verify the transaction conditions, and return the service content to the public chain according to the received service transaction after the verification is qualified.
  • the transaction target chain can also provide the public chain with its own address information, transaction methods, and transaction conditions after the transaction chain is queried by the public chain.
  • the transaction initiation chain and the transaction target chain refer to a part of multiple blockchain networks connected to the public chain network, so any one of the multiple blockchain networks connected to the public chain network is It can be used as a transaction initiation chain, as long as it has a sufficient number of STOs to trigger a transaction.
  • each blockchain network can also be used as a transaction target chain, as long as it supports external transactions and can provide specific service content. That is, in the technical solution provided in this application, the transaction initiation chain and the transaction target chain are only for convenience of description, and do not limit the blockchain network.
  • the service content of the Zentong exchange is used as an example to describe the solution.
  • the transaction process is the same as the transaction process of the Zentong exchange, only at the transaction node.
  • the transaction target chain returns the specific transaction content according to the service transaction, such as the query result of the performance of a certain type of communication equipment.
  • the present application provides a public chain-based transaction method and a blockchain network.
  • the method first initiates a query transaction from the transaction initiation chain to the public chain, and then uses the public chain to query the transaction target chain connected to the public chain network according to the service type information in the query transaction;
  • the initiation chain returns information about the transaction target chain that meets the service type information;
  • the transaction initiation chain then initiates a service transaction to the public chain according to the transaction method and transaction conditions required by the transaction target chain;
  • the public chain passes the service transaction to the transaction target chain; and
  • the service content is returned to the public chain according to the received service transaction.
  • the public chain passes the service content to the transaction initiation chain to complete the cross-chain transaction.
  • the method queries and transmits service transactions through the public chain network, so that the transaction initiation chain can obtain the service content of the transaction target chain, complete cross-chain transactions between different chain networks, and increase the application scope of the blockchain-based transaction method.

Abstract

The present application provides a public chain-based transaction method and a blockchain system. The method comprises: a transaction initiation chain initiating a query transaction with respect to a public chain; the public chain querying a transaction target chain accessing a public chain network, and returning transaction target chain information matching service type information; the transaction initiation chain initiating a service transaction with respect to the public chain according to a transaction method and a transaction condition required by the transaction target chain; the public chain transmitting the service transaction to the transaction target chain; after verifying that the transaction condition is acceptable, the transaction target chain returning service content to the public chain according to the received service transaction; and the public chain transmitting the service content to the transaction initiation chain, so as to complete a cross-chain transaction. In the method, a public chain network queries and transmits a service transaction, such that a transaction initiation chain acquires service content of a transaction target chain, so as to complete a cross-chain transaction between different chain networks, thereby widening an application range of a blockchain-based transaction method.

Description

基于公链的交易方法及区块链系统Public chain-based transaction method and blockchain system
本申请要求在2018年8月28日提交中国专利局、申请号为201810986825.3、发明名称为“区块链标准应用模型及其应用方法”,以及,在2018年12月7日提交中国专利局、申请号为201811496855.2、发明名称为“基于公链的交易方法及区块链系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the submission of the China Patent Office on August 28, 2018, application number 201810986825.3, and the invention name as "Blockchain Standard Application Model and Application Method", and on December 7, 2018, the China Patent Office, The priority of a Chinese patent application with application number 201811496855.2 and invention name "public chain-based transaction method and blockchain system" is incorporated herein by reference in its entirety.
技术领域Technical field
本申请涉及区块链技术领域,尤其涉及一种基于公链的交易方法及区块链系统。This application relates to the field of blockchain technology, and in particular, to a public chain-based transaction method and a blockchain system.
背景技术Background technique
区块链技术是一种去中心化的系统思想,能通过公众共识的方式,创建一个相对客观的抗抵赖数字环境。区块链技术可以保证网络信息一经发布即不可更改,例如,区块链网络中发生一笔交易,区块链网络中的节点会在生成的区块中记载该笔交易的内容,并将区块数据进行全网广播,网络中的其他节点以同步或异步的方式存储该区块数据,形成不可更改的区块链。Blockchain technology is a decentralized system idea that can create a relatively objective anti-repudiation digital environment through public consensus. Blockchain technology can ensure that network information cannot be changed once it is released. For example, if a transaction occurs in the blockchain network, nodes in the blockchain network will record the content of the transaction in the generated block, and Block data is broadcast throughout the network, and other nodes in the network store the block data synchronously or asynchronously to form an unchangeable blockchain.
其中,所述交易具有广义性,不是指传统意义上的“商品买卖”、“物品交换”,而是指区块链网络上的某种或某个数据操作内容或操作结果,例如,在网络上某个区块链节点A发起一个某型号通信设备性能的查询请求a,所述查询请求a对于承担查询服务的区块链节点B来说就是一笔交易。同理。节点B将查询得到的该型号通信设备的性能表b发送给节点A也是一笔交易。信息A、a和信息B、b作为交易信息会被写入区块链的数据区块中。Among them, the transaction has a broad meaning and does not refer to "commodity sale" or "item exchange" in the traditional sense, but refers to the content or operation result of a certain type or data on the blockchain network, for example, on the network On a certain blockchain node A, a query request a for the performance of a certain type of communication equipment is initiated, and the query request a is a transaction for the blockchain node B that undertakes the query service. Similarly. It is also a transaction that the node B sends the performance table b of the communication device of the model obtained to the node A to the node A. Information A, a and information B, b as transaction information will be written into the data block of the blockchain.
现有基于区块链的交易方法,仅可局限于同一个区块链网络内,即多为区块链网络中节点与节点之间的交易,并且每种区块链网络以独有的虚拟货币作为交易媒介。例如基于比特币的交易方法仅适用于比特币区块链网络,以比特币(Bitcoin)作为交易虚拟货币;基于以太坊(Etherum)的交易方法只适用于以太坊区块链网络,以以太币作为交易虚拟货币。随着区块链网络技术是发展,越来越多的区块链网络被建立,例如行业链、联盟链以及私链,等等,以实现特定领域内的实际应用。Existing blockchain-based transaction methods can only be limited to the same blockchain network, that is, transactions between nodes in the blockchain network, and each blockchain network uses a unique virtual Currency as a medium of transaction. For example, the Bitcoin-based transaction method is only applicable to the Bitcoin blockchain network, and Bitcoin is used as a transaction virtual currency; the Etherum-based transaction method is only applicable to the Ethereum blockchain network, Ethereum As a trading virtual currency. With the development of blockchain network technology, more and more blockchain networks have been established, such as industry chains, alliance chains, private chains, etc., to achieve practical applications in specific fields.
可见,现有的区块链网络之间基本是相互独立的,不同链之间没有统一有效的机制来通讯和交互。而每种区块链因其应用场景的不同,可提供不同的能力集,区块链网络的内生性决定了不同链提供的能力集之间无法进行对接,即造成数据和应用孤岛效应,限制基于区块链交易方法的应用。It can be seen that the existing blockchain networks are basically independent of each other, and there is no unified and effective mechanism for communication and interaction between different chains. Each type of blockchain can provide different capability sets due to different application scenarios. The endogenous nature of the blockchain network determines that the capability sets provided by different chains cannot be interconnected, which results in an island effect of data and applications and limits Application based on blockchain transaction method.
发明内容Summary of the Invention
本申请提供了一种基于公链的交易方法及区块链系统,以解决传统交易方法不支持跨链交易,限制基于区块链交易方法应用的问题。This application provides a public chain-based transaction method and a blockchain system to solve the problem that traditional transaction methods do not support cross-chain transactions and limit the application of blockchain-based transaction methods.
一方面,本申请提供一种基于公链的交易方法,包括:In one aspect, this application provides a public chain-based transaction method, including:
交易发起链向公链发起包含服务类型信息的查询交易;The transaction initiation chain initiates a query transaction containing service type information to the public chain;
公链根据查询交易中的服务类型信息,查询接入公链网络的交易目标链;The public chain queries the transaction target chain connected to the public chain network according to the service type information in the query transaction;
公链向交易发起链返回符合服务类型信息的交易目标链信息,交易目标链信息包括目标链地址,交易方式以及交易条件;The public chain returns the transaction target chain information that matches the service type information to the transaction initiation chain. The transaction target chain information includes the target chain address, transaction method, and transaction conditions.
交易发起链根据交易方式和交易条件向公链发起服务交易;The transaction initiation chain initiates service transactions to the public chain according to the transaction method and transaction conditions;
公链传递服务交易至交易目标链;The public chain transfers service transactions to the transaction target chain;
交易目标链验证交易条件,以及在验证合格后根据接收到的服务交易向公链返回服务内容;The transaction target chain verifies the transaction conditions and returns the service content to the public chain according to the received service transaction after the verification is qualified;
公链传递服务内容至交易发起链。The public chain delivers service content to the transaction initiation chain.
可选的,交易发起链向公链发起包含服务类型信息的查询交易的步骤包括:Optionally, the steps of the transaction initiation chain initiating a query transaction containing service type information to the public chain include:
交易发起链中的交易节点根据实际交易信息生成交易请求;The transaction nodes in the transaction initiation chain generate transaction requests based on the actual transaction information;
交易节点将交易请求在交易发起链中广播,以形成符合交易发起链的区块链记账;The transaction node broadcasts the transaction request in the transaction initiation chain to form a blockchain bookkeeping that conforms to the transaction initiation chain;
结账节点将交易请求进行验证,并打包为区块数据;The checkout node validates the transaction request and packages it into block data;
记账节点将区块数据广播至其他节点,并向公链中的维护节点发起查询交易,公链提供的智能合约包括公链创建的智能合约和公共智能合约。The bookkeeping node broadcasts the block data to other nodes and initiates query transactions to the maintenance nodes in the public chain. The smart contracts provided by the public chain include smart contracts created by the public chain and public smart contracts.
可选的,在交易发起链向公链发起包含服务类型信息的查询交易的步骤前,所述方法还包括:Optionally, before the step of the transaction initiation chain initiating a query transaction including service type information to the public chain, the method further includes:
公链向接入的公链网络的区块链网络发起合约验证信息,验证接入的区块链网络是否支持公链提供的智能合约;The public chain initiates contract verification information to the blockchain network of the accessed public chain network to verify whether the accessed blockchain network supports the smart contract provided by the public chain;
公链根据是否支持智能合约的验证结果,为接入的区块链网络设置合约判断标签,包括:为接入的区块链网络对应接口节点设置合约判断标签;或者,为接入的区块链网络地址设置合约判断标签。The public chain sets a contract judgment label for the connected blockchain network according to the verification result of whether the smart contract is supported, including: setting a contract judgment label for the corresponding interface node of the accessed blockchain network; or, for the accessed block The chain network address sets the contract judgment label.
可选的,在公链向交易发起链返回符合服务类型信息的交易目标链信息的步骤后,如果交易发起链和交易目标链均支持公链约定的接口规范,所述方法还可以通过以下步骤向交易发起链返回服务内容:Optionally, after the public chain returns the transaction target chain information that conforms to the service type information to the transaction initiation chain, if both the transaction initiation chain and the transaction target chain support the interface specifications agreed by the public chain, the method can also pass the following steps Return the service content to the transaction initiation chain:
交易发起链根据交易方式和交易条件,直接向交易目标链发起服务交易;The transaction initiation chain initiates service transactions directly to the transaction target chain according to the transaction method and transaction conditions;
交易目标链验证交易条件,以及在验证合格后根据接收到的服务交易向交易发起链返回服务内容;The transaction target chain verifies the transaction conditions, and returns the service content to the transaction initiation chain according to the received service transaction after the verification is qualified;
交易发起链和交易目标链完成交易后,向公链同步交易摘要。After the transaction initiation chain and the transaction target chain complete the transaction, the transaction summary is synchronized to the public chain.
可选的,在交易发起链向公链发起包含服务类型信息的查询交易的步骤还包括:Optionally, the step of initiating a query transaction including service type information in the transaction initiation chain to the public chain further includes:
公链判断交易发起链是否支持智能合约;The public chain judges whether the transaction initiation chain supports smart contracts;
如果交易发起链不支持智能合约,通过公链为交易发起链创建智能合约,或者为交易发起链配置公共智能合约;If the transaction initiation chain does not support smart contracts, create a smart contract for the transaction initiation chain through the public chain, or configure a public smart contract for the transaction initiation chain;
公链根据智能合约或公共智能合约,确定交易发起链和交易目标链对应的地址。The public chain determines the addresses corresponding to the transaction initiation chain and the transaction target chain according to the smart contract or public smart contract.
可选的,所述交易条件包括交易目标链指定的交易证通数量,交易发起链根据交易条件向公链发起服务交易的步骤前还包括:Optionally, the transaction conditions include the number of transaction tokens designated by the transaction target chain, and before the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions, the method further includes:
判断交易发起链所拥有的证通数量,是否满足交易目标链指定的交易证通数量;Determine whether the number of STOs owned by the transaction initiation chain meets the number of STOs specified by the transaction target chain;
如果交易发起链拥有的证通数量满足交易目标链指定的交易证通数量,允许交易发起链向公链发起服务交易;If the number of STOs owned by the transaction initiation chain meets the number of STOs specified by the transaction target chain, the transaction initiation chain is allowed to initiate service transactions to the public chain;
如果交易发起链拥有的证通数量不满足交易目标链指定的交易证通数量,向交易发起 链发送提示信息,以及根据服务类型继续查询接入公链网络的其他交易目标链。If the number of STOs owned by the transaction initiation chain does not satisfy the number of STOs specified by the transaction target chain, send a prompt message to the transaction initiation chain and continue to query other transaction target chains connected to the public chain network according to the service type.
可选的,交易发起链根据交易条件向公链发起服务交易的步骤包括:交易发起链在公链上创建转账交易,以触发合约执行,转账交易中包括向交易目标链支付的指定交易证通数量。Optionally, the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions includes: the transaction initiation chain creates a transfer transaction on the public chain to trigger the execution of the contract, and the transfer transaction includes a designated transaction certificate payment to the transaction target chain Quantity.
可选的,公链传递服务交易至交易目标链的步骤包括:Optionally, the steps of the public chain transmitting service transactions to the transaction target chain include:
公链对转账交易进行锁定,以及根据转账交易,向交易目标链发起请求交易;The public chain locks the transfer transaction and initiates a request transaction to the transaction target chain according to the transfer transaction;
交易目标链根据交易请求,向公链提供返回交易结果;The transaction target chain provides return transaction results to the public chain according to the transaction request;
公链验证返回交易结果,如果返回交易与转账交易一致,解除转账交易的锁定状态;The public chain verifies the return transaction result. If the return transaction is consistent with the transfer transaction, the lock status of the transfer transaction is released;
公链将交易发起链支付的证通,转账至交易目标链,以及将服务内容转至交易发起链。The public chain transfers the payment of the transaction initiation chain to the transaction target chain, and transfers the service content to the transaction initiation chain.
可选的,公链在查询接入公链网络的交易目标链之后,所述方法还包括:Optionally, after the public chain queries the transaction target chain connected to the public chain network, the method further includes:
公链判断交易发起链和交易目标链,是否支持直接通过公链的证通进行交易;The public chain judges whether the transaction initiation chain and the transaction target chain support transactions directly through the Zhengtong of the public chain;
如果交易发起链,和/或交易目标链,不支持直接通过公链的证通进行交易,在交易发起链,和/或交易目标链对应的平行链中转换证通;If the transaction initiation chain and / or the transaction target chain do not support transactions directly through the Zhengtong of the public chain, convert the securities in the transaction initiation chain and / or the parallel chain corresponding to the transaction target chain;
由交易发起链对应的平行链向公链发起服务交易,以及由交易目标链对应的平行链向公链返回服务内容。The parallel chain corresponding to the transaction initiation chain initiates service transactions to the public chain, and the parallel chain corresponding to the transaction target chain returns service content to the public chain.
另一方面,本申请还提供一种基于公链的区块链系统,包括:交易发起链、公链以及交易目标链;所述交易发起链通过公链与交易目标链建立网络连接;On the other hand, this application also provides a public chain-based blockchain system, including: a transaction initiation chain, a public chain, and a transaction target chain; the transaction initiation chain establishes a network connection with the transaction target chain through the public chain;
所述交易发起链被配置为:向公链发起包含服务类型信息的查询交易;以及,根据交易目标链的交易条件向公链发起服务交易;The transaction initiation chain is configured to: initiate a query transaction including service type information to the public chain; and initiate a service transaction to the public chain according to the transaction conditions of the transaction target chain;
所述公链被配置为:根据查询交易中的服务类型,查询接入公链网络的交易目标链;向交易发起链返回符合服务类型信息的交易目标链信息,所述交易目标链信息包括目标链地址、交易方式和交易条件;以及,传递服务交易至交易目标链,和传递服务内容至交易发起链;The public chain is configured to: according to the service type in the query transaction, query the transaction target chain connected to the public chain network; return the transaction target chain information corresponding to the service type information to the transaction initiation chain, and the transaction target chain information includes the target Chain address, transaction method and transaction conditions; and, passing service transactions to the transaction target chain, and passing service content to the transaction initiation chain;
所述交易目标链被配置为:验证交易条件,以及在验证合格后根据接收到的服务交易向公链返回服务内容。The transaction target chain is configured to verify transaction conditions and return service content to the public chain according to the received service transaction after the verification is qualified.
由以上技术方案可知,所述方法在实际应用中,先由交易发起链向公链发起查询交易,再通过公链根据查询交易中的服务类型信息,查询接入公链网络的交易目标链;以使公链向交易发起链返回符合所述服务类型信息的交易目标链信息;交易发起链再根据交易目标链要求的交易方式和交易条件向公链发起服务交易;公链将服务交易传递至交易目标链;并且在交易目标链验证所述交易条件合格后根据接收到的服务交易向公链返回服务内容;最后公链再将服务内容传递至交易发起链,完成跨链交易。所述方法通过公链网络查询和传递服务交易,使交易发起链能够获得交易目标链的服务内容,在不同链网络之间完成跨链交易,提高基于区块链交易方法的应用范围。As can be known from the above technical solutions, in actual application, the method first initiates a query transaction from the transaction initiation chain to the public chain, and then queries the transaction target chain connected to the public chain network through the public chain according to the service type information in the query transaction; In order to make the public chain return to the transaction initiation chain the transaction target chain information that conforms to the service type information; the transaction initiation chain then initiates a service transaction to the public chain according to the transaction method and transaction conditions required by the transaction target chain; After the transaction target chain verifies that the transaction conditions are qualified, the service content is returned to the public chain according to the received service transaction. Finally, the public chain passes the service content to the transaction initiation chain to complete the cross-chain transaction. The method queries and transmits service transactions through the public chain network, so that the transaction initiation chain can obtain the service content of the transaction target chain, complete cross-chain transactions between different chain networks, and increase the application scope of the blockchain-based transaction method.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solution of the present application more clearly, the drawings needed to be used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, without any creative effort, Other drawings can be obtained from these drawings.
图1为本申请基于公链的交易方法流程示意图;FIG. 1 is a schematic flowchart of a public chain-based transaction method of this application;
图2为本申请交易发起链向公链发起查询交易的流程示意图;FIG. 2 is a schematic flowchart of a process of initiating a query transaction to a public chain by a transaction initiation chain of this application;
图3为本申请判断交易发起链是否支持智能合约的流程示意图;FIG. 3 is a schematic flowchart of a process for judging whether a transaction initiation chain supports a smart contract;
图4为本申请判断交易发起链和交易目标链是否支持公链证通交易的流程示意图;FIG. 4 is a schematic flowchart of a process for judging whether a transaction initiation chain and a transaction target chain support public chain token trading;
图5为本申请判断交易发起链证通数量是否符合要求的流程示意图;FIG. 5 is a schematic flowchart of a process for judging whether the number of transaction-initiated chain certificates meets requirements;
图6为本申请公链对交易锁定时的交易流程示意图;FIG. 6 is a schematic diagram of a transaction process when the application chain is locked for transactions;
图7为本申请交易发起链和交易目标链支持公链约定的接口规范时交易流程图;FIG. 7 is a flowchart of a transaction when a transaction initiation chain and a transaction target chain support an interface specification agreed on by a public chain;
图8为本申请一种基于公链的区块链系统的结构示意图。FIG. 8 is a schematic structural diagram of a public blockchain-based blockchain system.
具体实施方式detailed description
下面将详细地对实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下实施例中描述的实施方式并不代表与本申请相一致的所有实施方式。仅是与权利要求书中所详述的、本申请的一些方面相一致的系统和方法的示例。The embodiments will be described in detail below, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following examples do not represent all implementations consistent with this application. These are merely examples of systems and methods consistent with some aspects of the application as detailed in the claims.
在本申请提供的技术方案中,区块链网络是指具有去中心化应用架构的点对点(P2P)网络,所述区块链网络能够进行分布式存储、公共共识、数字加密、交易记账以及验证。即涵盖了分布式技术、密码学、P2P网络架构以及各种可能被应用的共识算法的交易平台。区块链或区块链信息是指在区块链网络中发生交易时,根据交易信息生成的记账信息,即多笔具体的交易组成一个区块,多个区块形成一条有序区块链。区块链网络中,包括相互建立点对点网络连接的节点,每一个节点都配置有相应的共识机制,如智能合约,并且具有足够的运算能力,以进行交易验证和记账程序。节点上还具有符合某种统一标准的接口规范,以实现通过接口规范接入更多的节点或者其他类型的区块链网络。In the technical solution provided in this application, a blockchain network refers to a peer-to-peer (P2P) network with a decentralized application architecture. The blockchain network can perform distributed storage, public consensus, digital encryption, transaction accounting, and verification. That is, a trading platform that covers distributed technology, cryptography, P2P network architecture, and various consensus algorithms that may be applied. Blockchain or blockchain information refers to the accounting information generated based on transaction information when a transaction occurs in the blockchain network, that is, multiple specific transactions form a block, and multiple blocks form an ordered block. chain. Blockchain networks include nodes that establish peer-to-peer network connections with each other. Each node is configured with a corresponding consensus mechanism, such as a smart contract, and has sufficient computing power to perform transaction verification and accounting procedures. The nodes also have an interface specification that conforms to a certain unified standard to achieve access to more nodes or other types of blockchain networks through the interface specification.
在本申请中,所提及的公链、交易发起链、交易目标链以及平行链,均是指符合区块链技术的不同区块链网络。本申请中除另有说明外,公链、交易发起链、交易目标链以及平行链均是指相应的网络,即公链网络、交易发起链网络、交易目标链网络以及平行链网络。本申请提供的技术方案中,公链网络作为布置在全网的基础平台,其节点接口接入多个区块链网络,如基于公链接口规范搭建的行业链、联盟链以及私有链。每个区块链网络可以作为一个开发平台,并为其网络内部提供相应的服务。其中,公链定义和规范有标准的接口和方式,以便于其他区块链,如交易发起链和交易目标链,进行网络对接。本申请中公链具有支持跨链中介的能力,还具有去中心化的应用和智能合约化能力。In this application, the public chain, transaction initiation chain, transaction target chain, and parallel chain mentioned all refer to different blockchain networks that conform to the blockchain technology. Unless otherwise stated in this application, the public chain, the transaction initiation chain, the transaction target chain, and the parallel chain all refer to the corresponding networks, namely the public chain network, the transaction initiation chain network, the transaction target chain network, and the parallel chain network. In the technical solution provided in this application, the public chain network is used as a basic platform arranged on the entire network, and its node interfaces are connected to multiple blockchain networks, such as industry chains, alliance chains, and private chains based on public link interface specifications. Each blockchain network can serve as a development platform and provide corresponding services within its network. Among them, the definition and specification of the public chain have standard interfaces and methods to facilitate network interconnection with other blockchains, such as the transaction initiation chain and the transaction target chain. The public chain in this application has the ability to support cross-chain intermediation, as well as decentralized applications and smart contracting capabilities.
交易发起链和交易目标链是指接入公链网络中的区块链,即在本申请中,公链提供基础平台,交易发起链和交易目标链作为接入的网络,具有各自的功能和服务。交易发起链和交易目标链可以是基于公链网络标准和接口规范搭建的区块链网络,即交易发起链和交易目标链可以直接与公链网络之间进行通信和服务对接。交易发起链和交易目标链也可以是各自独立的网络,如现有的区块链网络比特币、以太坊等,或者,某些行业开发的行业链和联盟链,甚至是为了达到某种服务需求而搭建的私有链。这些现有区块链、行业链、联盟链以及私有链,一般不能直接相互交易甚至不能与公链网络之间相互交易,因此,本申请中可通过平行链来连接公链与其他网络。The transaction initiation chain and the transaction target chain refer to the block chain in the public chain network, that is, in this application, the public chain provides the basic platform, and the transaction initiation chain and the transaction target chain are the access networks, each with its own functions and service. The transaction initiation chain and transaction target chain can be a blockchain network based on public chain network standards and interface specifications, that is, the transaction initiation chain and transaction target chain can directly communicate with and connect to the public chain network. The transaction initiation chain and transaction target chain can also be independent networks, such as the existing blockchain network Bitcoin, Ethereum, etc., or industry chains and alliance chains developed by some industries, or even to achieve a certain service Private chains built on demand. These existing blockchains, industry chains, alliance chains, and private chains generally cannot directly trade with each other or even with the public chain network. Therefore, in this application, the public chain and other networks can be connected through parallel chains.
平行链可以由公链网络中的部分节点组成,通过平行链可以对公链与其他不能直接交易的网络之间进行桥接。本申请中,对于不能直接交易的网络,每一个区块链网络都对应一个平行链,平行链被设置为具有对应区块链网络的完整功能,并且能够对区块链网络中的交易进行同步转化,并传递到公链网络中。因此,在本申请提供的技术方案中,平行链 可以确定为对应区块链网络的镜像,而为了便于描述,对应区块链网络成为母链。在本申请中,平行链由公链网络中的部分节点组成,并且这些节点也是母链中的节点,以进行交易信息的传递。Parachains can be composed of some nodes in the public chain network, and through the parachains, the public chain can be bridged with other networks that cannot be directly traded. In this application, for networks that cannot be directly traded, each blockchain network corresponds to a parachain, and the parachain is set to have the complete function of the corresponding blockchain network, and can synchronize transactions in the blockchain network Transformation and transfer to the public chain network. Therefore, in the technical solution provided in this application, the parallel chain can be determined as a mirror image of the corresponding blockchain network, and for convenience of description, the corresponding blockchain network becomes the parent chain. In this application, the parachain is composed of some nodes in the public chain network, and these nodes are also nodes in the parent chain to transfer transaction information.
基于上述组成部分,公链在实际应用中可提供跨链中继,完成交易验证,数据证明,资产转移和智能合约执行等工作。公链统一对外的接口规范,可使其他区块链网络能够快速接入公链网络。公链还提供基础的区块链平台能力,即快速完成方案部署和验证,完成在公链网络中的分布式存储和记账程序。另外,作为基础平台,公链还可以提供公共开发功能,从而一次性完成多个平行链智能合约协同开发和部署。Based on the above components, the public chain can provide cross-chain relays in practical applications, completing transactions verification, data certification, asset transfer, and smart contract execution. The public chain's unified external interface specifications enable other blockchain networks to quickly access the public chain network. The public chain also provides the basic blockchain platform capabilities, which is to quickly complete the deployment and verification of the scheme, and to complete the distributed storage and accounting procedures in the public chain network. In addition, as a basic platform, the public chain can also provide public development functions, thereby completing the collaborative development and deployment of multiple parallel chain smart contracts at one time.
公链除了记录自己的区块链信息外,还可以用于存储相应跨链交易的信息摘要,即交易摘要。通过格式化的交易数据记录跨链交易的相关内容。同时,为了减少对公链上分布式存储空间的占用,公链在记录某些信息时,还可以通过特定的压缩算法记录第三方区块链信息。示例地,在公链中形成和存储的区块数据可以包括以下内容:区块标识(如序号、时间戳、区块hash值以及前区块hash值)、区块归属(即区块生成者)、区块其他信息(如随机值、难度值以及附加信息等)、区块权重、信息摘要(如交易树、状态树、收据树以及数据树等)、交易费用、奖励、大小等。In addition to recording its own blockchain information, the public chain can also be used to store the information summary of the corresponding cross-chain transaction, that is, the transaction summary. Record the relevant content of cross-chain transactions through formatted transaction data. At the same time, in order to reduce the occupation of distributed storage space on the public chain, when the public chain records certain information, it can also record third-party blockchain information through a specific compression algorithm. By way of example, the block data formed and stored in the public chain can include the following: block identifiers (such as serial numbers, timestamps, block hash values, and previous block hash values), block ownership (that is, block producers) ), Other information of the block (such as random value, difficulty value and additional information, etc.), block weight, information summary (such as transaction tree, status tree, receipt tree, data tree, etc.), transaction costs, rewards, size, etc.
为了实现跨链交易,本申请提供的一种基于公链的交易方法,如图1所示,所述交易方法包括以下步骤:In order to achieve cross-chain transactions, a public chain-based transaction method provided in this application is shown in FIG. 1. The transaction method includes the following steps:
S1:交易发起链向公链发起包含服务类型信息的查询交易。S1: The transaction initiation chain initiates a query transaction containing service type information to the public chain.
本申请提供的技术方案中,交易发起链根据自身的服务需求,确定交易发起链上需要的服务类型,并以查询交易的方式发送给公链网络。由于本申请中,交易发起链也是接入公链的区块链网络,因此,此处所述的发起查询交易可以是交易发起链中的某个节点发起。交易节点发起查询交易后,交易发起链网络先对该服务交易进行判断,以确定在交易发起链网络内部是否可以完成该服务交易。In the technical solution provided in this application, the transaction initiation chain determines the type of service required on the transaction initiation chain according to its own service requirements, and sends it to the public chain network by querying the transaction. Since the transaction initiation chain is also a blockchain network connected to the public chain in this application, the initiating query transaction described herein may be initiated by a node in the transaction initiation chain. After a transaction node initiates a query transaction, the transaction initiation chain network first judges the service transaction to determine whether the service transaction can be completed within the transaction initiation chain network.
如果当前服务交易可以在所述交易发起链内部完成,则不需要向公链网络发起查询交易,即交易节点在交易发起链内部与另一个能够提供对应服务类型的节点之间完成交易,这一交易过程可以在交易发起链内部形成区块链信息,并且在交易发起链内部进行分布式存储、验证等程序。如果当前服务交易不能够在所述交易发起链内部完成,则可以通过交易发起链中的智能合约生成对应的查询交易,并向公链发起所述查询交易。显然,在发起的查询交易中必然包括服务交易中所需求的服务类型。另外,对于无法直接与公链进行交易的第三方区块链,查询交易可以通过平行链传递到公链上,以发起查询交易。If the current service transaction can be completed within the transaction initiation chain, there is no need to initiate a query transaction to the public chain network, that is, the transaction node completes the transaction between the transaction initiation chain and another node capable of providing the corresponding service type. The transaction process can form blockchain information inside the transaction initiation chain, and perform distributed storage, verification and other procedures within the transaction initiation chain. If the current service transaction cannot be completed within the transaction initiation chain, a corresponding query transaction can be generated through a smart contract in the transaction initiation chain, and the query transaction is initiated to the public chain. Obviously, the type of service required in the service transaction must be included in the initiated query transaction. In addition, for third-party blockchains that cannot directly trade with the public chain, query transactions can be passed to the public chain through parallel chains to initiate query transactions.
例如,接入公链网络P的区块链网络有5个,分别为区块链网络A~E,其中,网络B包含100个节点,分别记为B00~B99。在实际应用中,网络B中的节点B25需要使用100个证通Tb,兑换等价值的证通Ta,则节点B25作为交易节点,其根据需要创建查询交易并形成区块数据,查询交易中包含的服务类型为:证通兑换,节点B25可将查询交易现在网络B中进行广播,即广播至其他节点,如B24和B26,网络B中的其他节点一方面对查询交易的区块数据进行分布式存储,完成记账,另一方面可确定网络B中是否能够满足节点B25的交易请求的其他节点,即其他节点是否能够向节点B25兑换证通Ta。For example, there are five blockchain networks connected to the public chain network P, which are the blockchain networks A to E. Among them, the network B contains 100 nodes, which are denoted as B00 to B99. In practical applications, node B25 in network B needs to use 100 STOs Tb to exchange for Stoe Ta of the same value. Node B25 acts as a transaction node, which creates query transactions and forms block data as required. The query transactions include The service type is: exchange of tokens. Node B25 can broadcast query transactions in network B, that is, broadcast to other nodes, such as B24 and B26. On the one hand, other nodes in network B distribute the block data of query transactions. It can determine whether other nodes in the network B can satisfy the transaction request of the node B25, that is, whether other nodes can exchange the token pass Ta with the node B25.
如果网络B中的其他节点不能完成证通兑换,则需要将该查询交易广播给公链网络P中的节点,以便公链网络P中的节点根据该查询交易确定网络A、C、D、E是否能够向节 点B25兑换证通Ta。If other nodes in network B cannot complete the token exchange, the query transaction needs to be broadcast to the nodes in the public chain network P, so that the nodes in the public chain network P can determine networks A, C, D, and E based on the query transaction. Whether it is possible to exchange the certificate pass Ta to the node B25.
进一步地,如图2所示,交易发起链向公链发起包含服务类型信息的查询交易还可以进一步包括以下步骤:Further, as shown in FIG. 2, the transaction initiation chain initiating a query transaction containing service type information to the public chain may further include the following steps:
S101:所述交易发起链中的交易节点根据实际交易生成交易信息;S101: A transaction node in the transaction initiation chain generates transaction information according to an actual transaction;
S102:所述交易节点将所述交易信息在交易发起链中广播,以形成符合所述交易发起链的区块链记账;S102: the transaction node broadcasts the transaction information in a transaction initiation chain to form a blockchain account that conforms to the transaction initiation chain;
S103:记账节点将交易进行验证,并加入区块数据;S103: The bookkeeping node verifies the transaction and adds block data;
S104:记账节点将区块数据广播至交易发起链其他节点,同时向公链中的维护节点发起查询交易,公链提供的智能合约包括公链创建的智能合约和公共智能合约。S104: The bookkeeping node broadcasts the block data to other nodes in the transaction initiation chain, and simultaneously initiates query transactions to the maintenance nodes in the public chain. The smart contracts provided by the public chain include smart contracts and public smart contracts created by the public chain.
由以上步骤可知,在交易节点生成交易后,可以将交易信息在交易发起链中进行广播,交易发起链根据其记账规则,将交易信息写入区块数据进行分布式存储,形成符合交易发起链的区块链记账数据。所述区块数据中记载了交易节点所发起的实际交易信息,例如:服务类型、交易数量、交易发起方、交易目标方、hash值等。在交易发起链中进行广播后,交易节点还为区块数据添加智能合约和服务类型信息。From the above steps, after the transaction is generated by the transaction node, the transaction information can be broadcasted in the transaction initiation chain. According to its accounting rules, the transaction initiation chain writes the transaction information into the block data for distributed storage to form a transaction initiation. Blockchain accounting data for the chain. The block data records the actual transaction information initiated by the transaction node, such as: service type, number of transactions, transaction initiator, transaction target, hash value, etc. After broadcasting in the transaction initiation chain, the transaction nodes also add smart contract and service type information to the block data.
仍以上述证通兑换的服务为例,交易节点B25在发起查询交易以后,生成包含该证通兑换服务的区块数据,再对查询交易的交易信息在网络B中进行广播,具体的广播形式可以按照网络B中的广播形式要求来确定,例如,交易节点B25可以先将区块数据广播至临近节点B24和B26,临近节点B24和B26对交易进行验证,确定交易是否合法,并对区块数据进行存储形成区块链。再由临近节点B24和B26广播至各自的临近节点,从而使网络B中的全部节点都能够对该区块数据进行验证和存储,形成符合网络B中记账规范的完整区块链数据。Still using the above-mentioned exchange service for securities exchanges as an example, after initiating an inquiry transaction, the transaction node B25 generates block data containing the exchange services, and then broadcasts the transaction information of the inquiry transactions on the network B. The specific broadcast form It can be determined according to the requirements of the broadcast form in network B. For example, the transaction node B25 can first broadcast the block data to neighboring nodes B24 and B26. The neighboring nodes B24 and B26 verify the transaction, determine whether the transaction is legal, and block Data is stored to form a blockchain. Then, the neighboring nodes B24 and B26 broadcast to their respective neighboring nodes, so that all nodes in network B can verify and store the block data, and form a complete blockchain data that complies with the accounting specifications in network B.
本实施例中,公链提供的智能合约包括公链创建的智能合约和公共智能合约,智能合约信息用于实现能够与公链进行交易,以便发起查询交易以及后续的服务交易;服务类型信息包含必要的服务描述信息,或者公链网络中存储的服务代码信息,可以用于发起查询交易。再将添加了智能合约和服务类型信息的区块数据向公链中的维护节点广播,从而实现发起查询交易。公链网络中的维护节点可以是用于交易发起链提供接口的节点,也可以是指定的其他节点。为了便于发起查询交易,可以利用计算能力满足条件,并且与交易发起链的距离较近的节点作为维护节点,以增加区块数据的广播速度。In this embodiment, the smart contracts provided by the public chain include smart contracts and public smart contracts created by the public chain. The smart contract information is used to enable transactions with the public chain to initiate query transactions and subsequent service transactions; service type information includes Necessary service description information, or service code information stored in the public chain network, can be used to initiate query transactions. The block data added with smart contract and service type information is broadcast to the maintenance nodes in the public chain, so as to initiate query transactions. The maintenance node in the public chain network can be the node used to provide the interface for the transaction initiation chain, or it can be another designated node. In order to facilitate the initiation of a query transaction, the computing power can be used to meet the conditions, and the node closer to the transaction initiation chain is used as a maintenance node to increase the broadcast speed of block data.
需要说明的是,在本申请提供的技术方案中,所述服务交易包含具体的交易内容,可以是虚拟货币兑换交易,如通过交易发起链中的证通(token)等价值兑换成交易目标链中证通;也可以是通过虚拟货币购买某种服务,如面向网络的查询服务,报告服务等。查询交易是一种特殊交易,其交易形式与普通交易形式相同,但需要特殊约定具体的交易方式,例如带有查询交易智能合约信息的交易,或者约定转账的证通数量为0的交易。It should be noted that, in the technical solution provided in this application, the service transaction includes specific transaction content, which may be a virtual currency exchange transaction, such as the exchange of a value such as a token in the transaction initiation chain into a transaction target chain CSI; it can also purchase certain services through virtual currency, such as network-oriented query services and reporting services. Query transaction is a special transaction. The transaction form is the same as the general transaction form, but it requires special agreement on specific transaction methods, such as transactions with smart contract information for query transactions, or transactions with an agreed number of STOs to be transferred.
在本申请的部分实施例中,在所述交易发起链发起查询交易的步骤以前,还可以通过公链对交易发起链进行智能合约验证,确定交易发起链是否支持公链提供的智能合约。即,由所述公链向接入的所述公链网络的区块链网络发起合约验证信息,验证接入的区块链网络是否支持所述公链提供的智能合约。由于在实际应用中,每一个接入公链的区块链网络都有可能作为交易发起链,因此,本实施例中,可以在一个区块链网络接入公链后,即对其进行智能合约验证。In some embodiments of the present application, before the step of initiating a query transaction by the transaction initiation chain, smart contract verification can be performed on the transaction initiation chain through the public chain to determine whether the transaction initiation chain supports the smart contract provided by the public chain. That is, the public chain initiates contract verification information to the blockchain network of the public chain network that is accessed to verify whether the accessed blockchain network supports the smart contract provided by the public chain. Because in practice, every blockchain network connected to the public chain may be used as a transaction initiation chain. Therefore, in this embodiment, after a blockchain network is connected to the public chain, it can be intelligent. Contract verification.
在进行智能合约验证后,所述公链可根据是否支持所述智能合约的验证结果,为接入的所述区块链网络设置合约判断标签。具体为:为接入的所述区块链网络对应接口节点设置合约判断标签;或者,为接入的所述区块链网络地址设置合约判断标签。其中,为接入的区块链网络对应接口节点设置合约判断标签的方式,可以在对应区块链网络作为交易发起链时,提取为接口节点设置的判断标签,从而确定当前交易发起链是否支持智能合约;而为接入的所述区块链网络地址设置合约判断标签的方式,可以同样通过提取交易发起链的地址确定对应的交易发起链是否支持智能合约。After the smart contract verification is performed, the public chain may set a contract judgment label for the accessed blockchain network according to whether the smart contract verification result is supported. Specifically, a contract judgment label is set for the corresponding interface node of the accessed blockchain network; or a contract judgment label is set for the accessed blockchain network address. The method for setting the contract judgment label for the corresponding interface node of the accessed blockchain network can be used to extract the judgment label set for the interface node when the corresponding blockchain network is used as the transaction initiation chain, so as to determine whether the current transaction initiation chain supports it. Smart contracts; and in the manner of setting a contract judgment label for the accessed blockchain network address, it can also determine whether the corresponding transaction initiating chain supports smart contracts by extracting the address of the transaction initiating chain.
本实施例中,对于支持智能合约的交易发起链,可以直接通过智能合约向公链发起查询交易,不需要平行链的参与;而对于不支持智能合约的交易发起链,则可以通过公链为交易发起链配置智能合约,或者采用平行链桥接的方式,将查询交易从交易节点传递到公链,其中,平行链已经配置了智能合约。因此,如图3所示,在交易发起链向公链发起查询交易之前,所述交易方法还可以包括:In this embodiment, for a transaction initiation chain that supports smart contracts, a query transaction can be initiated directly to the public chain through a smart contract without the participation of a parallel chain. For a transaction initiation chain that does not support smart contracts, the public chain can be used as The transaction initiation chain is configured with a smart contract, or a parallel chain bridging method is used to pass query transactions from the transaction node to the public chain. Among them, the parallel chain has been configured with a smart contract. Therefore, as shown in FIG. 3, before the transaction initiation chain initiates a query transaction to the public chain, the transaction method may further include:
S105:所述公链判断所述交易发起链是否支持智能合约;S105: the public chain judges whether the transaction initiation chain supports smart contracts;
S106:如果所述交易发起链不支持所述智能合约,通过所述公链为所述交易发起链创建智能合约,或者为所述交易发起链配置公共智能合约;S106: If the transaction initiation chain does not support the smart contract, create a smart contract for the transaction initiation chain through the public chain, or configure a public smart contract for the transaction initiation chain;
S107:所述公链根据所述智能合约或所述公共智能合约,确定交易发起链和交易目标链对应的地址。S107: The public chain determines the addresses corresponding to the transaction initiation chain and the transaction target chain according to the smart contract or the public smart contract.
本实施例中,公链对交易发起链是否支持智能合约的判断,可以通过公链对交易发起链上合约判断标签的提取,即通过分析合约判断标签确定是否交易发起链是否支持智能合约,也可以通过公链上的智能合约向交易发起链发起一个的特定格式的合约判断交易,并分析交易发起链返回的合约判断结果。如果交易发起链能够返回符合智能合约规范的内容,确定交易发起链支持智能合约;如果交易发起链不能返回符合智能合约规范的内容,或者未做出响应,确定交易发起链不支持智能合约。In this embodiment, the public chain can determine whether the transaction initiation chain supports smart contracts through the public chain. The public chain can extract the contract judgment tags on the transaction initiation chain, that is, determine whether the transaction initiation chain supports smart contracts by analyzing the contract judgment tags. A smart contract on the public chain can be used to initiate a specific format of the contract judgment transaction to the transaction initiation chain, and analyze the contract judgment results returned by the transaction initiation chain. If the transaction initiation chain can return content that meets the smart contract specifications, determine that the transaction initiation chain supports smart contracts; if the transaction initiation chain cannot return content that meets the smart contract specifications, or does not respond, determine that the transaction initiation chain does not support smart contracts.
针对支持智能合约的交易发起链,可以执行后续交易步骤,即交易发起链通过智能合约向公链发起查询交易。而针对不支持智能合约的交易发起链,可以通过公链为所述交易发起链配置智能合约,或者通过公链为交易发起链选择一个公共合约,并为交易发起链配置选择的公共合约。本实施例中,公共合约可以是应用程度较高的区块链网络所使用的合约,或者当前行业领域约定的合约规范。在对交易发起链配置了智能合约或公共智能合约后,公链还可以确定交易发起链和交易目标链的地址信息,即明确交易发起链和交易目标链,以便实施后续交易。For the transaction initiation chain that supports smart contracts, subsequent transaction steps can be performed, that is, the transaction initiation chain initiates query transactions to the public chain through smart contracts. For a transaction initiation chain that does not support smart contracts, a smart contract can be configured for the transaction initiation chain through the public chain, or a public contract can be selected for the transaction initiation chain through the public chain, and the selected public contract can be configured for the transaction initiation chain. In this embodiment, the public contract may be a contract used by a blockchain network with a high degree of application, or a contract specification agreed in the current industry field. After a smart contract or a public smart contract is configured for the transaction initiation chain, the public chain can also determine the address information of the transaction initiation chain and the transaction target chain, that is, the transaction initiation chain and the transaction target chain are clearly defined in order to implement subsequent transactions.
S2:所述公链根据所述查询交易中的服务类型信息,查询接入公链网络的交易目标链。S2: The public chain inquires the transaction target chain connected to the public chain network according to the service type information in the query transaction.
本申请提供的技术方案中,公链在接收到交易发起链发起的查询交易后,提取查询交易中的服务类型信息,并根据服务类型信息在公链网络中进行查询,找到能够提供所述服务类型信息对应服务的区块链网络作为交易目标链。同样,作为交易目标链的网络中也包含多个节点,即多个节点组成交易目标链。因此,交易目标链中所能够提供的服务的可以是一个或部分节点。可见,在本申请提供的技术方案中,公链查询到的结果,可以是交易目标链,也可以是交易目标链中能够提供服务的节点。在本申请提供的技术方案中,优选公链查询到的结果是交易目标链的方式,以便快速确定交易目标链,避免交易目标链不支持公链查询的情况。In the technical solution provided in this application, after receiving a query transaction initiated by the transaction initiation chain, the public chain extracts service type information in the query transaction, and performs a query in the public chain network according to the service type information to find that it can provide the service. The blockchain network of the type information corresponding service serves as the transaction target chain. Similarly, the network as a transaction target chain also includes multiple nodes, that is, multiple nodes constitute a transaction target chain. Therefore, the services that can be provided in the transaction target chain can be one or some nodes. It can be seen that, in the technical solution provided in the present application, the results queried by the public chain can be the transaction target chain or the nodes that can provide services in the transaction target chain. In the technical solution provided by the present application, it is preferred that the result of the public chain query is a method of transaction target chain, in order to quickly determine the transaction target chain, and avoid the situation that the transaction target chain does not support public chain query.
本实施例中,公链在公链网络中进行交易目标链的查询,可以由公链中配置的智能合约完成,也可以由公链网络中的去中心化应用完成。具体查询过程,可以是在公链网络中存储的接入区块链网络的信息中查询。这样的查询方式,需要公链在有区块链网络接入时,通过接入节点通信,获取接入的区块链网络登记的信息,登记的信息可以包括:能够提供的服务类型,能够进行兑换的证通类型,以及进行交易的方式、交易的条件等。公链中的程序对这些登记信息与对应的网络地址进行对应存储,并在全网进行广播。In this embodiment, the query of the transaction target chain by the public chain in the public chain network can be completed by the smart contract configured in the public chain or by a decentralized application in the public chain network. The specific query process may be querying the information of the access to the blockchain network stored in the public chain network. This query method requires that the public chain obtains the registered information of the accessed blockchain network through the communication of the access node when the blockchain network accesses. The registered information may include: the types of services that can be provided, and the The types of exchanges that are exchanged, as well as the methods of conducting transactions and the conditions of transactions. Programs in the public chain store these registration information and corresponding network addresses and broadcast them on the entire network.
查询过程还可以通过以下形式完成,即公链在接收到查询交易后,在全网广播一次用于服务提供的交易。接入公链的区块链网络在接收到服务提供的交易后,可以针对该交易进行相应的回复,回复的信息中,可以包括交易条件和交易方式。公链选择回复最早的区块链网络作为交易目标链,或者对交易条件进行判断确定最适宜的(如需要证通数量最少的,或者交易证通流通性最好的)交易目标链。The query process can also be completed in the following form. After the public chain receives the query transaction, it broadcasts a transaction for service provision on the entire network. After receiving the transaction provided by the service, the blockchain network connected to the public chain can respond accordingly to the transaction. The response information can include transaction conditions and transaction methods. The public chain chooses to reply to the earliest blockchain network as the transaction target chain, or judges the transaction conditions to determine the most suitable (such as the least number of STOs, or the best liquidity of STOs).
进一步地,为了便于交易结算和完成记账程序,如图4所示,所述公链在查询接入公链网络的交易目标链之后,所述方法还包括:Further, in order to facilitate transaction settlement and complete accounting procedures, as shown in FIG. 4, after the public chain queries the transaction target chain connected to the public chain network, the method further includes:
S201:所述公链判断所述交易发起链和所述交易目标链,是否支持直接通过所述公链的证通进行交易;S201: The public chain judges whether the transaction initiation chain and the transaction target chain support transactions directly through the Zhengtong of the public chain;
S202:如果所述交易发起链,和/或所述交易目标链,不支持直接通过所述公链的证通进行交易,在所述交易发起链,和/或所述交易目标链对应的平行链中转换所述证通;S202: If the transaction initiation chain and / or the transaction target chain do not support transactions directly through the Zhengtong of the public chain, the transaction initiation chain and / or the corresponding parallel Convert the said Zhengtong in the chain;
S203:由所述交易发起链对应的平行链向公链发起服务交易,以及由所述交易目标链对应的平行链向公链返回服务内容。S203: The parallel chain corresponding to the transaction initiation chain initiates a service transaction to the public chain, and the parallel chain corresponding to the transaction target chain returns a service content to the public chain.
本实施例中,公链在查询到交易目标链以后,可以根据在公链中存储的信息,判断交易发起链和交易目标链之间是否支持直接通过公链证通进行交易,如果交易发起链和交易目标链可以直接通过公链证通进行交易,从而便于公链进行记账程序和检验交易结算。如果所述交易发起链,和/或所述交易目标链,不支持直接通过所述公链的证通进行交易,可以在所述交易发起链,和/或所述交易目标链对应的平行链中转换所述证通,即按照公链证通与交易发起链,和交易目标链之间的兑换比率,先将交易发起链支付的证通兑换成等价值的公链证通,再通过公链将公链证通传递至交易目标链。并且在后续的交易程序中,由平行链完成服务交易。In this embodiment, after querying the transaction target chain, the public chain can determine whether the transaction initiation chain and the transaction target chain support transactions directly through the public chain certificate exchange based on the information stored in the public chain. And the transaction target chain can be directly traded through the public chain Zhengtong, thereby facilitating the public chain to conduct accounting procedures and verify transaction settlement. If the transaction initiation chain and / or the transaction target chain do not support transactions directly through the stock exchange of the public chain, the transaction initiation chain and / or the parallel chain corresponding to the transaction target chain According to the conversion of the China Securities Exchange, according to the exchange ratio between the public securities exchange and the transaction initiation chain, and the transaction target chain, the securities exchange paid by the transaction initiation chain is first converted into an equivalent value of the public blockchain securities, and then passed through the public exchange. The chain passes the public chain certificate pass to the transaction target chain. And in the subsequent transaction process, service transactions are completed by the parallel chain.
S3:所述公链向所述交易发起链返回符合所述服务类型信息的交易目标链信息,所述交易目标链信息包括目标链地址,交易方式以及交易条件。S3: The public chain returns transaction target chain information that conforms to the service type information to the transaction initiation chain, and the transaction target chain information includes a target chain address, a transaction method, and transaction conditions.
公链在查询到交易目标链以后,可以获取交易目标链的地址信息以及交易方式、交易条件等信息。显然,公链可以从公链存储的登记信息中获取上述信息,也可以通过将查询交易转发给交易目标链的方式,由交易目标链一方提供该信息。为了增加查询效率,本申请优选通过公链存储的登记信息的方式获取上述信息。公链在获取到所述交易目标链信息后,可以将得到的目标链信息发送给交易发起链,以使交易发起链根据交易目标链信息确定是否与其进行交易。After querying the transaction target chain, the public chain can obtain the address information of the transaction target chain, the transaction method, and the transaction conditions. Obviously, the public chain can obtain the above information from the registration information stored in the public chain, or it can provide the information by one side of the transaction target chain by forwarding the query transaction to the transaction target chain. In order to increase the query efficiency, the present application preferably obtains the above information by means of registration information stored in the public chain. After the public chain obtains the transaction target chain information, it can send the obtained target chain information to the transaction initiation chain, so that the transaction initiation chain can determine whether to trade with it according to the transaction target chain information.
本申请提供的技术方案中,所述目标链地址,为交易目标链在公链网络中的登记地址,或者,交易目标链接入公链时,提供接口的节点地址。交易方式为交易目标链设定的交易时间、区块链信息格式(模板)、支持交易的证通类型等。交易条件不仅可以包括提供服务所需要收取的指定证通数量,而且可以包括对于交易发起链的资质要求,例如所拥有的 证通数量要求,交易发起链的信誉评分等。In the technical solution provided in the present application, the target chain address is a registered address of the transaction target chain in the public chain network, or the node address of the interface provided when the transaction target is linked into the public chain. The transaction method is the transaction time set by the transaction target chain, the block chain information format (template), and the type of stock exchange that supports the transaction. Transaction conditions may include not only the specified number of STOs required to provide services, but also the qualification requirements for the transaction initiation chain, such as the number of STOs owned and the credit score of the transaction initiation chain.
进一步地,为了获得更加合适的交易目标链,在查询交易中还可以附带一些附加信息,例如,所能够提供的交易证通类型,所需要的服务规范,交易目标链的服务提供资质,交易证通上限等。Further, in order to obtain a more suitable transaction target chain, some additional information can be attached to the query transaction, such as the type of transaction certificate that can be provided, the required service specifications, the service provision qualification of the transaction target chain, and the transaction certificate. Pass cap and so on.
示例地,交易节点B25发出的查询交易在网络B中没有能够该证通兑换服务的节点时,可以通过网络B和公链网络P之间的连接节点BP(或接口节点),将该查询交易广播至公链网络P中的维护节点P01~P99,公链中的维护节点同样需要对该查询交易进行验证和分布式存储,并根据该查询交易在公链网络P上接入的其他区块链网络A、C、D、E是否能够提供该证通兑换服务。如果查询到其他区块链网络中,有能够满足该证通兑换服务的网络A,则获取到网络A在公链网络P中的地址信息,如连接节点AP的IP地址,以及网络A在公链网络P中登记的交易条件,即进行证通Tb兑换证通Ta时所要求的交易条件,如证通Tb和证通Ta的兑换比率、网络A要求的交易对手所拥有的兑换资质等。公链P中的服务节点将网络A的地址,以及网络A的交易条件,创建查询结果,并将查询结果返回给交易节点B25。For example, when the query transaction issued by the transaction node B25 does not have a node capable of providing the token exchange service in the network B, the query transaction can be performed through the connection node BP (or interface node) between the network B and the public chain network P. Broadcast to the maintenance nodes P01 to P99 in the public chain network P. The maintenance nodes in the public chain also need to verify and distributed storage of the query transaction, and access other blocks on the public chain network P according to the query transaction. Whether the chain networks A, C, D, E can provide the exchange service of the Zhengtong. If other blockchain networks are queried and there is Network A that can satisfy the SECEX exchange service, then the address information of Network A in the public chain network P is obtained, such as the IP address of the connecting node AP, and Network A is in the public domain. The transaction conditions registered in the chain network P are the transaction conditions required when the Zentong Tb is exchanged for the Zentong Ta, such as the exchange ratio of the Zentong Tb and the Zentong Ta, and the exchange qualifications required by the transaction counterparty required by the network A. The service node in the public chain P creates the query result of the address of the network A and the transaction conditions of the network A, and returns the query result to the transaction node B25.
S4:所述交易发起链根据所述交易方式和交易条件向所述公链发起服务交易。S4: The transaction initiation chain initiates a service transaction to the public chain according to the transaction method and transaction conditions.
本申请提供的技术方案中,交易发起链在接收到公链返回的交易目标链信息后,可以对交易目标链信息进行分析,提取交易目标链信息中的交易方式和交易条件。其中,针对交易方式,交易发起链可以确定是否支持交易目标链提供的交易方式;而对于交易条件,可以自动或手动判断交易目标链所提出的交易条件是否能够被接受。如果能够接受交易条件,并且支持相应的交易方式,交易发起链可以按照指定交易方式,向公链发起满足交易条件的服务交易。In the technical solution provided in this application, after receiving the transaction target chain information returned by the public chain, the transaction initiation chain can analyze the transaction target chain information to extract the transaction mode and transaction conditions in the transaction target chain information. Among them, with regard to the transaction method, the transaction initiation chain can determine whether to support the transaction method provided by the transaction target chain; and for the transaction conditions, it can automatically or manually determine whether the transaction conditions proposed by the transaction target chain can be accepted. If the transaction conditions can be accepted and the corresponding transaction methods are supported, the transaction initiation chain can initiate service transactions that meet the transaction conditions to the public chain in accordance with the specified transaction method.
交易发起链根据交易条件向公链发起服务交易的步骤包括:交易发起链在所述公链上创建转账交易,以触发合约执行,所述转账交易中包括向所述交易目标链支付的指定交易证通数量。The step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions includes: the transaction initiation chain creates a transfer transaction on the public chain to trigger contract execution, and the transfer transaction includes a specified transaction paid to the transaction target chain The number of securities pass.
示例地,在公链网络P中的维护节点将查询结果返回给交易节点B25后,交易节点B25对返回的查询结果中交易条件和交易方式进行验证,一方面,确定交易是否符合要求即是否能够满足B25的证通兑换服务请求,另一方面可以确定交易条件是否能够被接受,例如,交易目标链A所要求的证通兑换比率是否可以被接受。上述验证过程可以通过节点B25自动判断,也可以主动选择是否接受该交易条件。此外,对返回查询结果的验证还可以包括,交易节点B25是否能够按照交易目标链A指定的交易方式进行交易。For example, after the maintenance node in the public chain network P returns the query result to the transaction node B25, the transaction node B25 verifies the transaction conditions and transaction methods in the returned query result. On the one hand, it is determined whether the transaction meets the requirements, that is, whether it can Satisfying the request of the STO exchange service of B25 can determine whether the transaction conditions can be accepted, for example, whether the STO exchange rate required by the transaction target chain A can be accepted. The above verification process can be judged automatically by Node B25, or it can actively choose whether to accept the transaction conditions. In addition, the verification of the returned query results may also include whether the transaction node B25 can perform transactions in accordance with the transaction method specified by the transaction target chain A.
如果交易节点B25接受该交易条件,并且能够按照交易目标链A指定的交易方式进行交易,则交易节点B25发起正式的服务交易,即向公链网络P转账100个证通Tb。需要说明的是,由于在此次跨链交易中,公链网络中的维护节点从事了相应的查询和存储操作,以及在后续的交易过程中,还会参与其他操作,如传递、价值转化、记账等,因此,在交易节点B25向公链发起正式的服务交易时,还需要向公链网络中转账特定数量公链证通以作为公链中维护节点的奖励。If the transaction node B25 accepts the transaction conditions and is able to conduct transactions in the transaction mode specified by the transaction target chain A, the transaction node B25 initiates a formal service transaction, that is, transfers 100 securities pass Tb to the public chain network P. It should be noted that, in this cross-chain transaction, the maintenance nodes in the public chain network have engaged in the corresponding query and storage operations, and in the subsequent transaction process, they will also participate in other operations, such as transfer, value conversion, Bookkeeping, etc., therefore, when the transaction node B25 initiates a formal service transaction to the public chain, it is also necessary to transfer a specific number of public chain tokens to the public chain network as a reward for maintaining nodes in the public chain.
进一步地,如图5所示,所述交易条件包括所述交易目标链指定的交易证通数量,所述交易发起链根据所述交易条件向公链发起服务交易的步骤前还包括:Further, as shown in FIG. 5, the transaction conditions include the number of transaction certificates specified by the transaction target chain, and the step of initiating the service initiating a service transaction to the public chain according to the transaction conditions further includes:
S401:判断所述交易发起链所拥有的证通数量,是否满足所述交易目标链指定的交易 证通数量;S401: Determine whether the number of STOs owned by the transaction initiation chain meets the number of STOs designated by the transaction target chain;
S402:如果所述交易发起链拥有的证通数量满足所述交易目标链指定的交易证通数量,允许所述交易发起链向所述公链发起服务交易;S402: If the number of STOs owned by the transaction initiation chain satisfies the number of STOs designated by the transaction target chain, allow the transaction initiation chain to initiate service transactions to the public chain;
S403:如果所述交易发起链拥有的证通数量不满足所述交易目标链指定的交易证通数量,向所述交易发起链发送提示信息,以及根据服务类型继续查询接入公链网络的其他交易目标链。S403: If the number of STOs owned by the transaction initiation chain does not satisfy the number of STOs designated by the transaction target chain, send prompt information to the transaction initiation chain, and continue to query other access to the public chain network according to the service type Transaction target chain.
在本实施例中,如果交易条件是交易目标链指定的交易证通数量,则公链可以对交易发起链所拥有的指定证通余额进行判断,以确定交易发起链能否满足交易目标链指定的交易条件要求。对于能够满足交易条件的情况,允许所述交易发起链向所述公链发起服务交易;对于不能够满足交易条件的情况,可以向所述交易发起链发送提示信息,告知交易发起链,并且还可以根据服务类型继续查询接入公链网络的其他交易目标链,并重复上述过程,直至查询到满足交易条件的情况。In this embodiment, if the transaction conditions are the number of transaction tokens designated by the transaction target chain, the public chain can judge the balance of the designated tokens owned by the transaction initiation chain to determine whether the transaction initiation chain can meet the transaction target chain designation Trading conditions required. For the case where the transaction conditions can be met, the transaction initiation chain is allowed to initiate service transactions to the public chain; in the case where the transaction conditions cannot be met, a prompt message can be sent to the transaction initiation chain to inform the transaction initiation chain, and also You can continue to query other transaction target chains connected to the public chain network according to the service type, and repeat the above process until the query satisfies the transaction conditions.
例如,交易目标链A要求的交易条件为作为交易发起方的交易节点所拥有的证通Tb数量不少于100个,因此在发起正式服务交易前,可通过公链网络对交易节点拥有的证通Tb的数量进行判断,如果交易节点拥有的证通Tb的数量为53个,则确定为不满足交易条件,此时公链网络向交易节点B25发送提示信息,如“您所拥有的证通Tb余额不足,无法完成交易”,“交易要求证通Tb数量不少于100个,您还需要47个才能完成交易”。For example, the transaction condition required by the transaction target chain A is that the number of TBTs owned by the transaction node as the transaction initiator is not less than 100. Therefore, before initiating a formal service transaction, the certificate owned by the transaction node can be issued through the public chain network. Judging the number of transaction Tb, if the number of Tb of the transaction node owned by the transaction node is 53, it is determined that the transaction conditions are not met. At this time, the public chain network sends a reminder message to the transaction node B25, such as "The certificate that you own The balance of Tb is insufficient to complete the transaction. "" The transaction requires at least 100 Tb passes for the transaction, and you need 47 to complete the transaction. "
S5:所述公链传递所述服务交易至所述交易目标链。S5: The public chain passes the service transaction to the transaction target chain.
本申请提供的技术方案中,交易发起链向公链发送的服务交易在公链中可以不做任何处理,仅由公链网络将服务交易传递至交易目标链。其中,公链可以对服务交易中的交易目标链的地址信息进行提取,获取交易目标链的位置,再根据交易目标链的地址将服务交易发送至交易目标链。In the technical solution provided in this application, the service transaction sent by the transaction initiation chain to the public chain may not be processed in the public chain, and only the public chain network will pass the service transaction to the transaction target chain. Among them, the public chain can extract the address information of the transaction target chain in the service transaction, obtain the position of the transaction target chain, and then send the service transaction to the transaction target chain according to the address of the transaction target chain.
例如,公链网络P中的维护节点在接收到交易节点B25发起的服务交易后,对交易节点转账的100个证通Tb进行验证,并针对服务交易形成符合公链交易形式的区块数据,并对形成的区块数据在公链网络中进行广播,再将这100个证通Tb转移至网络A所对应的Tb账户中。For example, after receiving the service transaction initiated by the transaction node B25, the maintenance node in the public chain network P verifies the 100 Zentong Tb transferred by the transaction node, and forms block data that conforms to the public chain transaction form for the service transaction. And broadcast the formed block data in the public chain network, and then transfer the 100 TST to the Tb account corresponding to network A.
由于服务交易的传递依赖于公链完成,因此为了达到抗抵赖交易效果,可以公链在传递所述服务交易时,需要在公链网络内进行分布式存储,即在公链网络中记账。因此在公链传递所述服务交易时,也是一种发生在公链网络中的交易。在实际应用中,针对不同区块链网络,流通的证通类型也不同,而不同类型的证通往往不能直接进行交易。因此在本申请提供的技术方案中,公链传递所述服务交易至所述交易目标链的过程中,可以先将交易发起链支付的证通进行锁定,再向交易目标链转移等价值的公链证通,以触发交易目标链返回服务内容。Because the transfer of service transactions depends on the completion of the public chain, in order to achieve the effect of non-repudiation transactions, the public chain needs to perform distributed storage in the public chain network when transmitting the service transaction, that is, to keep accounts in the public chain network. Therefore, when the service transaction is delivered by the public chain, it is also a transaction that occurs in the public chain network. In practical applications, for different blockchain networks, the types of Zhengtong in circulation are different, and different types of Zhengtong often cannot directly trade. Therefore, in the technical solution provided in this application, in the process of the public chain transmitting the service transaction to the transaction target chain, the Zentong of the transaction initiation chain payment can be locked, and then other public funds of equal value are transferred to the transaction target chain. The chain certificate is used to trigger the transaction target chain to return the service content.
即,在本申请的部分实施例中,如图6所示,所述公链传递所述服务交易至所述交易目标链的步骤包括:That is, in some embodiments of the present application, as shown in FIG. 6, the step of the public chain transmitting the service transaction to the transaction target chain includes:
S501:所述公链对所述转账交易进行锁定,以及根据所述转账交易,向所述交易目标链发起请求交易;S501: the public chain locks the transfer transaction, and initiates a request transaction to the transaction target chain according to the transfer transaction;
S502:所述交易目标链根据所述交易请求,向所述公链提供返回交易结果;S502: The transaction target chain provides a return transaction result to the public chain according to the transaction request;
S503:所述公链验证所述返回交易结果,如果所述返回交易结果与所述转账交易一致, 解除所述转账交易的锁定状态;S503: The public chain verifies the return transaction result, and if the return transaction result is consistent with the transfer transaction, releases the locked state of the transfer transaction;
S504:所述公链将所述交易发起链支付的证通,转账至所述交易目标链,以及将服务内容转至所述交易发起链。S504: The public chain transfers the Zentong of the transaction initiation chain payment to the transaction target chain, and transfers the service content to the transaction initiation chain.
本实施例中,公链先对转账交易进行锁定,即暂时锁定交易发起链支付的证通,再根据转账交易向交易目标链发起请求交易,其中,请求交易用于触发交易目标链返回交易,公链再对返回交易的内容进行验证,如果返回交易与转账交易一致,则解除对转账交易的锁定状态,以使所述公链将交易发起链支付的证通,转账至交易目标链,并且将服务内容转至交易发起链。通过公链对转账交易进行锁定,可以在公链网络中对交易内容进行验证,确定是否达真正符合交易规范,保障交易双方的交易权益。In this embodiment, the public chain first locks the transfer transaction, that is, temporarily locks the Zentong of the transaction initiation chain payment, and then initiates a request transaction to the transaction target chain according to the transfer transaction. The request transaction is used to trigger the transaction target chain to return the transaction. The public chain then verifies the content of the return transaction. If the return transaction is consistent with the transfer transaction, the locked state of the transfer transaction is released, so that the public chain initiates the transaction through the chain of payment of the transaction, and transfers it to the transaction target chain, and Transfer the service content to the transaction initiation chain. Locking the transfer transaction through the public chain can verify the content of the transaction in the public chain network to determine whether it has truly met the transaction specifications and protect the transaction rights of both parties in the transaction.
S6:所述交易目标链验证所述交易条件,以及在验证合格后根据接收到的所述服务交易向公链返回服务内容。S6: The transaction target chain verifies the transaction conditions, and returns the service content to the public chain according to the received service transaction after the verification is qualified.
本申请提供的技术方案中,交易目标链在接收到公链传递的服务交易后,先针对交易条件进行验证,确定服务交易是否满足交易条件。例如,服务交易所支付的证通数量是否符合交易目标链需要的证通数量,交易发起链是否具有交易目标链要求的交易资质等。如果交易目标链验证交易条件合格,则根据接收到的服务交易返回相应的服务内容,即为所述交易发起链提供对应的服务。In the technical solution provided in this application, after receiving the service transaction transmitted by the public chain, the transaction target chain first verifies the transaction conditions to determine whether the service transaction meets the transaction conditions. For example, whether the number of STOs paid by the service exchange meets the number of STOs required by the transaction target chain, and whether the transaction initiation chain has the transaction qualification required by the transaction target chain. If the transaction target chain verifies that the transaction conditions are qualified, the corresponding service content is returned according to the received service transaction, that is, the corresponding service is provided for the transaction initiation chain.
服务内容可以是返回交易中包含具体的服务内容,例如,数据检索报告,或者兑换的另一种指定数量的证通等。而对于需要长期维持的服务内容,在返回的服务内容中可以包含相应的网络接入信息,验证码,账号等。对于需要长期维持的服务内容,公链可以不必直接参与后续的数据传递过程,只在返回服务内容时,将相应的网络接入信息,验证码,账号等信息传递给交易发起链,并且在公链中对返回的服务内容进行分布式存储,完成记账程序。The service content may include specific service content in the return transaction, for example, a data retrieval report, or another specified number of Zhengtong exchanged. For service contents that need to be maintained for a long time, the returned service contents may include corresponding network access information, verification codes, account numbers, etc. For the service content that needs to be maintained for a long time, the public chain does not need to directly participate in the subsequent data transfer process. Only when the service content is returned, the corresponding network access information, verification code, account number, and other information are passed to the transaction initiation chain. Distributed storage of the returned service content in the chain completes the accounting process.
S7:所述公链传递所述服务内容至所述交易发起链。S7: The public chain delivers the service content to the transaction initiation chain.
公链在接收到交易目标链返回的服务内容后,以中继的方式将服务内容传递至交易发起链。在公链将服务内容转发到交易发起链后,即代表交易完成。例如,在公链网络P将100个证通Tb转移至网络A所对应的Tb账户中以后,公链网络在交易目标链验证通过后,从网络A所对应的Ta账户中提取等价值的证通Ta,如兑换比率为2:1,则提取50个证通Ta转账至网络B所对应的账户中,完成最终的服务交易。After receiving the service content returned by the transaction target chain, the public chain passes the service content to the transaction initiation chain in a relay manner. After the public chain forwards the service content to the transaction initiation chain, it represents the completion of the transaction. For example, after the public chain network P transfers 100 securities pass Tb to the Tb account corresponding to network A, the public chain network extracts certificates of equal value from the Ta account corresponding to network A after the transaction target chain is verified If the exchange ratio is 2: 1, then 50 securities exchange Ta will be extracted and transferred to the account corresponding to network B to complete the final service transaction.
在本申请的部分实施例中,如图7所示,在所述公链向所述交易发起链返回符合所述服务类型信息的交易目标链信息的步骤后,如果所述交易发起链和所述交易目标链均支持所述公链约定的接口规范,所述方法还可以通过以下步骤向所述交易发起链返回服务内容:In some embodiments of the present application, as shown in FIG. 7, after the step of the public chain returning the transaction target chain information corresponding to the service type information to the transaction initiation chain, if the transaction initiation chain and all The transaction target chains all support the agreed interface specifications of the public chain, and the method can also return service content to the transaction initiation chain through the following steps:
S8:所述交易发起链根据所述交易方式和交易条件,直接向所述交易目标链发起服务交易;S8: The transaction initiation chain directly initiates a service transaction to the transaction target chain according to the transaction method and transaction conditions;
S9:所述交易目标链验证所述交易条件,以及在验证合格后根据接收到的所述服务交易向所述交易发起链返回服务内容。S9: The transaction target chain verifies the transaction conditions, and returns a service content to the transaction initiation chain according to the received service transaction after the verification is qualified.
在部分区块链网络系统中,由于整个网络为点对点的网络,理论上任意两个节点之间均可以建立网络连接。因此,接入公链的不同区块链网络之间,可以直接进行通信交流,这样的区块链网络支持公链约定的接口规范。即,如果交易发起链和交易目标链均支持公链约定的接口规范,则在公链向所述交易发起链返回符合服务类型信息的交易目标链信息 后,交易发起链可以直接提取交易目标链信息中的交易目标链地址,并根据该地址直接向交易目标链发起服务交易。In some blockchain network systems, since the entire network is a point-to-point network, theoretically any two nodes can establish a network connection. Therefore, different blockchain networks connected to the public chain can communicate directly. Such a blockchain network supports the interface specifications agreed by the public chain. That is, if both the transaction initiation chain and the transaction target chain support the interface specifications agreed by the public chain, after the public chain returns the transaction target chain information that conforms to the service type information to the transaction initiation chain, the transaction initiation chain can directly extract the transaction target chain The address of the transaction target chain in the information, and directly initiate a service transaction to the transaction target chain according to the address.
交易目标链则在接收到交易发起链发起的服务交易后,对交易条件进行验证,具体的验证内容与上述实施例的内容一致。在交易条件验证合格后,交易目标链再根据接收到的服务交易,直接向交易发起链返回交易内容,完成最终的交易。The transaction target chain verifies the transaction conditions after receiving the service transaction initiated by the transaction initiation chain, and the specific verification content is consistent with the content of the above embodiment. After the transaction conditions are qualified, the transaction target chain directly returns the transaction content to the transaction initiation chain according to the received service transaction to complete the final transaction.
对于上述情况,为了保证交易发起链和交易目标链之间的交易记账程序,可以在交易发起链发起服务交易时,在交易发起链内部进行一次分布式记账,并且将存储的区块数据,或者区块数据的摘要发送至公链网络中进行分布式存储;并且,在交易目标链返回服务内容时,在交易目标链中进行一次分布式记账,同时也将存储的区块数据,或者区块数据的摘要发送至公链网络中进行分布式存储。并且,在交易目标链发送存储的区块链数据或数据摘要到公链以后,公链还可以针对区块数据中的地址信息,对交易发起链和交易目标链发送的区块数据进行一致性对比,确定交易的合法性等。For the above situation, in order to ensure the transaction accounting procedure between the transaction initiation chain and the transaction target chain, when the transaction initiation chain initiates a service transaction, a distributed accounting can be performed inside the transaction initiation chain, and the stored block data Or, a summary of the block data is sent to the public chain network for distributed storage; and, when the transaction target chain returns the service content, distributed accounting is performed in the transaction target chain, and the stored block data is also stored. Or a summary of the block data is sent to the public chain network for distributed storage. In addition, after the transaction target chain sends the stored blockchain data or data summary to the public chain, the public chain can also use the address information in the block data to make the block data sent by the transaction initiation chain and the transaction target chain consistent. Contrast, determine the legality of the transaction, etc.
本实施例与上述实施例的区别在于,公链网络仅负责相应的查询交易,即在交易发起链发起查询交易后,公链网络根据查询交易查询到交易目标链后,将交易目标链的地址信息返回给交易节点B25,交易节点B25根据目标链地址信息,直接向交易目标链A发起服务交易,即转账100个证通Tb给交易目标链A,交易目标链A中的服务节点再接收到100个证通Tb后,向交易节点B25再转账50个证通Ta,从而直接完成交易。显然,为了避免交易错误,在交易节点B25向交易目标链A转账100个证通Tb时,所形成的区块数据不仅在网络B中进行广播,还要在公链网络中进行广播,同理,在交易目标链A的服务节点向交易节点B25转账50个证通Ta时,也需要同时在交易目标链网络A和公链网络P中同步或异步进行广播。The difference between this embodiment and the above embodiment is that the public chain network is only responsible for corresponding query transactions, that is, after the transaction initiation chain initiates a query transaction, the public chain network queries the transaction target chain according to the query transaction and then sets the address of the transaction target chain. The information is returned to the transaction node B25. According to the target chain address information, the transaction node B25 directly initiates a service transaction to the transaction target chain A, that is, transfers 100 securities pass Tb to the transaction target chain A, and the service node in the transaction target chain A receives it again. After 100 securities pass Tb, transfer another 50 securities pass Ta to the transaction node B25 to complete the transaction directly. Obviously, in order to avoid transaction errors, when the transaction node B25 transfers 100 STOs Tb to the transaction target chain A, the formed block data is broadcast not only in network B, but also in the public chain network. When the service node of the transaction target chain A transfers 50 Zhengtong Ta to the transaction node B25, it also needs to broadcast simultaneously or asynchronously in the transaction target chain network A and the public chain network P.
需要说明的是,在本申请提供的技术方案中,为了描述方便,所述交易节点B25向交易目标链A转账100个证通Tb,以及交易目标链A的服务节点向交易节点B25转账50个证通Ta,是指证通或者交易结果的流转方向,并非真的将证通实体从一个链转到另一个链。在实际应用时,交易双方可以在两个网络里面都有对应的账号,而转账交易只是将证通转到对应的账号中,即100个Tb是在B网络进行交换,50个Ta是在A网络交换,通过公链传递的只是交易信息和记账数据等描述跨链交易的内容。It should be noted that, in the technical solution provided in the present application, for the convenience of description, the transaction node B25 transfers 100 securities pass Tb to the transaction target chain A, and the service node of the transaction target chain A transfers 50 transaction nodes B25 The Zhengtong Ta refers to the circulation direction of the Zhengtong or the transaction result, and does not really transfer the Zhengtong entity from one chain to another. In practical applications, both parties to the transaction can have corresponding accounts in both networks, and the transfer transaction only transfers the Zentong to the corresponding account, that is, 100 Tb are exchanged on the B network and 50 Ta are exchanged on the A network. For network exchange, only the transaction information and accounting data transmitted through the public chain describe the content of cross-chain transactions.
基于上述交易方法,本申请还提供一种基于公链的区块链系统,如图8所示,所述系统包括:交易发起链、公链以及交易目标链;所述交易发起链通过所述公链与所述交易目标链建立网络连接;其中,交易发起链是指作为交易发起方的区块链网络,交易目标链是指作为交易目标方的区块链网络。Based on the above transaction method, this application also provides a public chain-based blockchain system. As shown in FIG. 8, the system includes: a transaction initiation chain, a public chain, and a transaction target chain; the transaction initiation chain passes through the The public chain establishes a network connection with the transaction target chain; wherein the transaction initiation chain refers to the blockchain network as the transaction initiator, and the transaction target chain refers to the blockchain network as the transaction target.
为了完成跨链交易,所述交易发起链被配置为执行以下程序步骤:向公链发起包含服务类型信息的查询交易。即在跨链交易开始之初,交易发起链向公链发起查询交易,以使公链在公链网络中查询交易目标链。以及,根据所述交易目标链的交易条件向公链发起服务交易。即在公链返回符合所述服务类型信息的交易目标链信息后,向公链发起服务交易。In order to complete the cross-chain transaction, the transaction initiation chain is configured to perform the following program steps: initiating a query transaction containing service type information to the public chain. That is, at the beginning of cross-chain transactions, the transaction initiation chain initiates query transactions to the public chain, so that the public chain can query the transaction target chain in the public chain network. And, a service transaction is initiated to the public chain according to the transaction conditions of the transaction target chain. That is, after the public chain returns the transaction target chain information that matches the service type information, a service transaction is initiated to the public chain.
所述公链被配置为:根据所述查询交易中的服务类型,查询接入公链网络的交易目标链;向所述交易发起链返回符合所述服务类型信息的交易目标链信息,所述交易目标链信息包括目标链地址、交易方式和交易条件;以及,传递所述服务交易至所述交易目标链,和传递所述服务内容至所述交易发起链;The public chain is configured to: query the transaction target chain connected to the public chain network according to the service type in the query transaction; and return the transaction target chain information that matches the service type information to the transaction initiation chain. The transaction target chain information includes a target chain address, a transaction method, and transaction conditions; and, passing the service transaction to the transaction target chain, and passing the service content to the transaction initiation chain;
所述交易目标链被配置为:验证所述交易条件,以及在验证合格后根据接收到的所述服务交易向公链返回服务内容。此外,交易目标链还可以在公链查询到交易目标链以后,向公链提供自己的地址信息、交易方式以及交易条件。The transaction target chain is configured to verify the transaction conditions, and return the service content to the public chain according to the received service transaction after the verification is qualified. In addition, the transaction target chain can also provide the public chain with its own address information, transaction methods, and transaction conditions after the transaction chain is queried by the public chain.
本申请提供的技术方案中,交易发起链和交易目标链是指接入公链网络多个区块链网络中的一部分,因此接入公链网络的多个区块链网络中的任意一个都可以作为交易发起链,只要其拥有足够触发交易的证通数量。同样,每一个区块链网络也都可以作为交易目标链,只要其支持对外进行交易,并且能够提供具体的服务内容。即在本申请提供的技术方案中,所述交易发起链和交易目标链只是为了便于描述,并不对区块链网络进行限定。In the technical solution provided in this application, the transaction initiation chain and the transaction target chain refer to a part of multiple blockchain networks connected to the public chain network, so any one of the multiple blockchain networks connected to the public chain network is It can be used as a transaction initiation chain, as long as it has a sufficient number of STOs to trigger a transaction. Similarly, each blockchain network can also be used as a transaction target chain, as long as it supports external transactions and can provide specific service content. That is, in the technical solution provided in this application, the transaction initiation chain and the transaction target chain are only for convenience of description, and do not limit the blockchain network.
需要说明的是,本申请实施例中以证通兑换的服务内容作为示例,进行方案的描述,显然对于不同形式服务内容,其交易过程与证通兑换的交易过程是相同的,仅在交易节点发起服务交易时,交易节点向公链(或交易目标链)转账指定数量的证通后,交易目标链根据服务交易返回具体的交易内容,如返回某型号通信设备性能的查询结果。It should be noted that, in the embodiment of the present application, the service content of the Zentong exchange is used as an example to describe the solution. Obviously, for different forms of service content, the transaction process is the same as the transaction process of the Zentong exchange, only at the transaction node. When initiating a service transaction, after the transaction node transfers a specified amount of Zhengtong to the public chain (or transaction target chain), the transaction target chain returns the specific transaction content according to the service transaction, such as the query result of the performance of a certain type of communication equipment.
由以上技术方案可知,本申请提供一种基于公链的交易方法及区块链网络。所述方法在实际应用中,先由交易发起链向公链发起查询交易,再通过公链根据查询交易中的服务类型信息,查询接入公链网络的交易目标链;以使公链向交易发起链返回符合所述服务类型信息的交易目标链信息;交易发起链再根据交易目标链要求的交易方式和交易条件向公链发起服务交易;公链将服务交易传递至交易目标链;并且在交易目标链验证所述交易条件合格后根据接收到的服务交易向公链返回服务内容;最后公链再将服务内容传递至交易发起链,完成跨链交易。所述方法通过公链网络查询和传递服务交易,使交易发起链能够获得交易目标链的服务内容,在不同链网络之间完成跨链交易,提高基于区块链交易方法的应用范围。It can be known from the above technical solutions that the present application provides a public chain-based transaction method and a blockchain network. In practical applications, the method first initiates a query transaction from the transaction initiation chain to the public chain, and then uses the public chain to query the transaction target chain connected to the public chain network according to the service type information in the query transaction; The initiation chain returns information about the transaction target chain that meets the service type information; the transaction initiation chain then initiates a service transaction to the public chain according to the transaction method and transaction conditions required by the transaction target chain; the public chain passes the service transaction to the transaction target chain; and After the transaction target chain verifies that the transaction conditions are qualified, the service content is returned to the public chain according to the received service transaction. Finally, the public chain passes the service content to the transaction initiation chain to complete the cross-chain transaction. The method queries and transmits service transactions through the public chain network, so that the transaction initiation chain can obtain the service content of the transaction target chain, complete cross-chain transactions between different chain networks, and increase the application scope of the blockchain-based transaction method.
本申请提供的实施例之间的相似部分相互参见即可,以上提供的具体实施方式只是本申请总的构思下的几个示例,并不构成本申请保护范围的限定。对于本领域的技术人员而言,在不付出创造性劳动的前提下依据本申请方案所扩展出的任何其他实施方式都属于本申请的保护范围。Similar parts between the embodiments provided in this application can be referred to each other. The specific implementations provided above are just a few examples under the general concept of this application, and do not constitute a limitation of the protection scope of this application. For those skilled in the art, any other implementations extended according to the scheme of the present application under the premise of no creative labor belong to the protection scope of the present application.

Claims (10)

  1. 一种基于公链的交易方法,其特征在于,包括:A public chain-based transaction method is characterized in that it includes:
    交易发起链向公链发起包含服务类型信息的查询交易;The transaction initiation chain initiates a query transaction containing service type information to the public chain;
    公链根据查询交易中的服务类型信息,查询接入公链网络的交易目标链;The public chain queries the transaction target chain connected to the public chain network according to the service type information in the query transaction;
    公链向交易发起链返回符合服务类型信息的交易目标链信息,交易目标链信息包括目标链地址,交易方式以及交易条件;The public chain returns the transaction target chain information that matches the service type information to the transaction initiation chain. The transaction target chain information includes the target chain address, transaction method, and transaction conditions.
    交易发起链根据交易方式和交易条件向公链发起服务交易;The transaction initiation chain initiates service transactions to the public chain according to the transaction method and transaction conditions;
    公链传递服务交易至交易目标链;The public chain transfers service transactions to the transaction target chain;
    交易目标链验证交易条件,以及在验证合格后根据接收到的服务交易向公链返回服务内容;The transaction target chain verifies the transaction conditions and returns the service content to the public chain according to the received service transaction after the verification is qualified;
    公链传递服务内容至交易发起链。The public chain delivers service content to the transaction initiation chain.
  2. 根据权利要求1所述的交易方法,其特征在于,交易发起链向公链发起包含服务类型信息的查询交易的步骤包括:The transaction method according to claim 1, wherein the step of the transaction initiation chain initiating a query transaction containing service type information to the public chain comprises:
    交易发起链中的交易节点根据实际交易生成交易信息;The transaction nodes in the transaction initiation chain generate transaction information according to the actual transaction;
    交易节点将交易信息在交易发起链中广播,以形成符合交易发起链的区块链记账;The transaction node broadcasts the transaction information in the transaction initiation chain to form a blockchain bookkeeping that conforms to the transaction initiation chain;
    记账节点将交易进行验证,并加入区块数据;The bookkeeping node validates the transaction and adds block data;
    记账节点将区块数据广播至交易发起链其他节点,同时向公链中的维护节点发起查询交易,公链提供的智能合约包括公链创建的智能合约和公共智能合约。The bookkeeping node broadcasts the block data to other nodes in the transaction initiation chain, and simultaneously initiates query transactions to the maintenance nodes in the public chain. The smart contracts provided by the public chain include smart contracts and public smart contracts created by the public chain.
  3. 根据权利要求1所述的交易方法,其特征在于,在交易发起链向公链发起包含服务类型信息的查询交易的步骤前,所述方法还包括:The transaction method according to claim 1, characterized in that before the step of initiating a transaction initiating a transaction including service type information by the transaction initiation chain to the public chain, the method further comprises:
    公链向接入的公链网络的区块链网络发起合约验证信息,验证接入的区块链网络是否支持公链提供的智能合约;The public chain initiates contract verification information to the blockchain network of the accessed public chain network to verify whether the accessed blockchain network supports the smart contract provided by the public chain;
    公链根据是否支持智能合约的验证结果,为接入的区块链网络设置合约判断标签,包括:为接入的区块链网络对应接口节点设置合约判断标签;或者,为接入的区块链网络地址设置合约判断标签。The public chain sets a contract judgment label for the connected blockchain network according to the verification result of whether the smart contract is supported, including: setting a contract judgment label for the corresponding interface node of the accessed blockchain network; or, for the accessed block The chain network address sets the contract judgment label.
  4. 根据权利要求1所述的交易方法,其特征在于,在公链向交易发起链返回符合服务类型信息的交易目标链信息的步骤后,如果交易发起链和交易目标链均支持公链约定的接口规范,所述方法还可以通过以下步骤向交易发起链返回服务内容:The transaction method according to claim 1, wherein after the step of the public chain returning the transaction target chain information corresponding to the service type information to the transaction initiation chain, if both the transaction initiation chain and the transaction target chain support the interface agreed by the public chain Specification, the method can also return service content to the transaction initiation chain through the following steps:
    交易发起链根据交易方式和交易条件,直接向交易目标链发起服务交易;The transaction initiation chain initiates service transactions directly to the transaction target chain according to the transaction method and transaction conditions;
    交易目标链验证交易条件,以及在验证合格后根据接收到的服务交易向交易发起链返回服务内容;The transaction target chain verifies the transaction conditions, and returns the service content to the transaction initiation chain according to the received service transaction after the verification is qualified;
    交易发起链和交易目标链在完成交易后,向公链同步对应的交易摘要信息。After the transaction initiation chain and the transaction target chain complete the transaction, the corresponding transaction summary information is synchronized to the public chain.
  5. 根据权利要求1所述的交易方法,其特征在于,在交易发起链向公链发起包含服务类型信息的查询交易的步骤还包括:The transaction method according to claim 1, wherein the step of initiating a query transaction including service type information from the transaction initiation chain to the public chain further comprises:
    公链判断交易发起链是否支持智能合约;The public chain judges whether the transaction initiation chain supports smart contracts;
    如果交易发起链不支持智能合约,通过公链为交易发起链创建智能合约,或者为交易发起链配置公共智能合约;If the transaction initiation chain does not support smart contracts, create a smart contract for the transaction initiation chain through the public chain, or configure a public smart contract for the transaction initiation chain;
    公链根据智能合约或公共智能合约,确定交易发起链和交易目标链对应的地址。The public chain determines the addresses corresponding to the transaction initiation chain and the transaction target chain according to the smart contract or public smart contract.
  6. 根据权利要求1所述的交易方法,其特征在于,所述交易条件包括交易目标链指定的交易证通数量,交易发起链根据交易条件向公链发起服务交易的步骤前还包括:The transaction method according to claim 1, wherein the transaction conditions include the number of transaction tokens designated by the transaction target chain, and the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions further comprises:
    判断交易发起链所拥有的证通数量,是否满足交易目标链指定的交易证通数量;Determine whether the number of STOs owned by the transaction initiation chain meets the number of STOs specified by the transaction target chain;
    如果交易发起链拥有的证通数量满足交易目标链指定的交易证通数量,允许交易发起链向公链发起服务交易;If the number of STOs owned by the transaction initiation chain meets the number of STOs specified by the transaction target chain, the transaction initiation chain is allowed to initiate service transactions to the public chain;
    如果交易发起链拥有的证通数量不满足交易目标链指定的交易证通数量,向交易发起链发送提示信息,以及根据服务类型继续查询接入公链网络的其他交易目标链。If the number of STOs owned by the transaction initiation chain does not satisfy the number of STOs specified by the transaction target chain, send a prompt message to the transaction initiation chain and continue to query other transaction target chains connected to the public chain network according to the service type.
  7. 根据权利要求1所述的交易方法,其特征在于,交易发起链根据交易条件向公链发起服务交易的步骤包括:交易发起链在公链上创建转账交易,以触发合约执行,转账交易中包括向交易目标链支付的指定交易证通数量。The transaction method according to claim 1, wherein the step of the transaction initiation chain initiating a service transaction to the public chain according to the transaction conditions comprises: the transaction initiation chain creates a transfer transaction on the public chain to trigger contract execution, and the transfer transaction includes The number of designated transaction tokens paid to the transaction target chain.
  8. 根据权利要求7所述的交易方法,其特征在于,公链传递服务交易至交易目标链的步骤包括:The transaction method according to claim 7, wherein the step of the public chain transmitting the service transaction to the transaction target chain comprises:
    公链对转账交易进行锁定,以及根据转账交易,向交易目标链发起请求交易;The public chain locks the transfer transaction and initiates a request transaction to the transaction target chain according to the transfer transaction;
    交易目标链根据交易请求,向公链提供返回交易结果;The transaction target chain provides return transaction results to the public chain according to the transaction request;
    公链验证返回交易结果,如果返回交易与转账交易一致,解除转账交易的锁定状态;The public chain verifies the return transaction result. If the return transaction is consistent with the transfer transaction, the lock status of the transfer transaction is released;
    公链将交易发起链支付的证通,转账至交易目标链,以及将服务内容转至交易发起链。The public chain transfers the payment of the transaction initiation chain to the transaction target chain, and transfers the service content to the transaction initiation chain.
  9. 根据权利要求1所述的交易方法,其特征在于,公链在查询接入公链网络的交易目标链之后,所述方法还包括:The transaction method according to claim 1, wherein after the public chain queries the transaction target chain connected to the public chain network, the method further comprises:
    公链判断交易发起链和交易目标链,是否支持直接通过公链的证通进行交易;The public chain judges whether the transaction initiation chain and the transaction target chain support transactions directly through the Zhengtong of the public chain;
    如果交易发起链,和/或交易目标链,不支持直接通过公链的证通进行交易,在交易发起链,和/或交易目标链对应的平行链中转换证通;If the transaction initiation chain and / or the transaction target chain do not support transactions directly through the Zhengtong of the public chain, convert the securities in the transaction initiation chain and / or the parallel chain corresponding to the transaction target chain;
    由交易发起链对应的平行链向公链发起服务交易,以及由交易目标链对应的平行链向公链返回服务内容。The parallel chain corresponding to the transaction initiation chain initiates service transactions to the public chain, and the parallel chain corresponding to the transaction target chain returns service content to the public chain.
  10. 一种基于公链的区块链系统,其特征在于,包括:交易发起链、公链以及交易目标链;所述交易发起链通过公链与交易目标链建立网络连接;A public chain-based blockchain system is characterized by comprising: a transaction initiation chain, a public chain, and a transaction target chain; the transaction initiation chain establishes a network connection with the transaction target chain through the public chain;
    所述交易发起链被配置为:向公链发起包含服务类型信息的查询交易;以及,根据交易目标链的交易条件向公链发起服务交易;The transaction initiation chain is configured to: initiate a query transaction including service type information to the public chain; and initiate a service transaction to the public chain according to the transaction conditions of the transaction target chain;
    所述公链被配置为:根据查询交易中的服务类型,查询接入公链网络的交易目标链;向交易发起链返回符合服务类型信息的交易目标链信息,所述交易目标链信息包 括目标链地址、交易方式和交易条件;以及,传递服务交易至交易目标链,和传递服务内容至交易发起链;The public chain is configured to: according to the service type in the query transaction, query the transaction target chain connected to the public chain network; return the transaction target chain information corresponding to the service type information to the transaction initiation chain, and the transaction target chain information includes the target Chain address, transaction method and transaction conditions; and, passing service transactions to the transaction target chain, and passing service content to the transaction initiation chain;
    所述交易目标链被配置为:验证交易条件,以及在验证合格后根据接收到的服务交易向公链返回服务内容。The transaction target chain is configured to verify transaction conditions and return service content to the public chain according to the received service transaction after the verification is qualified.
PCT/CN2019/101048 2018-08-28 2019-08-16 Public chain-based transaction method and blockchain system WO2020042931A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201810986825 2018-08-28
CN201810986825.3 2018-08-28
CN201811496855.2 2018-12-07
CN201811496855.2A CN110866823B (en) 2018-08-28 2018-12-07 Public link-based transaction method and block chain system

Publications (1)

Publication Number Publication Date
WO2020042931A1 true WO2020042931A1 (en) 2020-03-05

Family

ID=69643128

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/101048 WO2020042931A1 (en) 2018-08-28 2019-08-16 Public chain-based transaction method and blockchain system

Country Status (1)

Country Link
WO (1) WO2020042931A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170046698A1 (en) * 2015-08-13 2017-02-16 The Toronto-Dominion Bank Systems and methods for establishing and enforcing transaction-based restrictions using hybrid public-private blockchain ledgers
CN107301600A (en) * 2017-06-23 2017-10-27 北京天德科技有限公司 A kind of core algorithm for the block chain the Internet model merchandised across chain
CN107742210A (en) * 2017-10-13 2018-02-27 布比(北京)网络技术有限公司 Across the chain fund transfer system and method for a kind of different blocks interchain
CN108347486A (en) * 2018-02-12 2018-07-31 众安信息技术服务有限公司 Across chain communication means, device and system based on block chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170046698A1 (en) * 2015-08-13 2017-02-16 The Toronto-Dominion Bank Systems and methods for establishing and enforcing transaction-based restrictions using hybrid public-private blockchain ledgers
CN107301600A (en) * 2017-06-23 2017-10-27 北京天德科技有限公司 A kind of core algorithm for the block chain the Internet model merchandised across chain
CN107742210A (en) * 2017-10-13 2018-02-27 布比(北京)网络技术有限公司 Across the chain fund transfer system and method for a kind of different blocks interchain
CN108347486A (en) * 2018-02-12 2018-07-31 众安信息技术服务有限公司 Across chain communication means, device and system based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BAI, JIE ET AL.: "The Standard of Blockchain Applications Model Publication and Deployment Technologies Research", INFORMATION AND NETWORK SECURITY, vol. 37, no. 8, 10 August 2018 (2018-08-10) *

Similar Documents

Publication Publication Date Title
CN110866823B (en) Public link-based transaction method and block chain system
TWI716140B (en) Data processing method and device based on blockchain
TWI724391B (en) Node management method and device based on blockchain
CN107180350B (en) Method, device and system for multi-party sharing transaction metadata based on block chain
WO2020088109A1 (en) Blockchain-based private transactions and usage method and apparatus therefor
CN109214818B (en) Cross-chain transaction method and device
TW201943250A (en) Cross-blockchain authentication method and apparatus, and electronic device
WO2020173500A1 (en) Public chain-based sub-chain business system
WO2020042934A1 (en) Non-repudiation cross-chain transaction method and blockchain system
TWI727284B (en) Block chain-based privacy transaction method, device and computer equipment, application method based on block chain privacy transaction and computer equipment
WO2020125234A1 (en) Blockchain-based data processing method and apparatus
WO2022161181A1 (en) Data processing method and apparatus based on blockchain, and electronic device
WO2020114242A1 (en) Token conversion method based on public blockchain and blockchain system
CN113255014B (en) Data processing method based on block chain and related equipment
CN110889761A (en) Cross-chain transaction method and storage medium
CN114066456B (en) ERC 1155-based cross-chain NFT transfer and settlement system
WO2020042930A1 (en) Parallel-chain-based transaction method and blockchain system
WO2020042931A1 (en) Public chain-based transaction method and blockchain system
NL2026376B1 (en) Public chain-based transaction method and blockchain system
WO2020114241A1 (en) Token exchange method based on public blockchain, and blockchain system
NL2026362B1 (en) Parallel chain-based transaction method and blockchain system
NL2026568B1 (en) Non-repudiation cross-chain transaction method and blockchain system
WO2020042928A1 (en) Block chain network system
CN114827175B (en) Registration method, electronic device, and readable storage medium
JP2008129926A (en) Sales contract system, processing method for it, sales contract device, and program for it

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19853596

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19853596

Country of ref document: EP

Kind code of ref document: A1