Disclosure of Invention
The application provides a certificate exchange method and a block chain system based on a public chain, which aim to solve the problems that the traditional certificate exchange method is controlled by a centralized program and the exchange efficiency is low.
In a first aspect, the present application provides a certificate exchange method based on a public link, applied to a public link network, including:
receiving a supply transaction initiated by a supply chain, the supply transaction including a type of supply certificate and a number of supply certificates transferred to the public chain;
inquiring the supply amount of the supply certificate in the public chain network, and calculating the exchange rate of the supply certificate and the public chain certificate according to the supply amount of the supply certificate;
according to the exchange rate of the supply certificate and the public chain certificate, transferring the public chain certificate with the value such as the number of the supply certificate and the like to the supply chain;
receiving an exchange transaction initiated by an exchange chain, wherein the exchange transaction comprises an initial certificate and certificate amount transferred to a public chain and an exchange certificate and certificate type;
inquiring the supply amount of the initial certificate and the exchange certificate in the public chain network, and calculating the exchange ratio of the exchange certificate and the initial certificate according to the supply amount;
and transferring the exchange certificate certificates with the value such as the number of the initial certificate certificates to the exchange chain according to the exchange ratio of the exchange certificate certificates and the initial certificate certificates.
Optionally, the step of querying the supply amount of the supply certificate in the public chain network, and calculating the exchange ratio of the supply certificate and the public chain certificate according to the supply amount of the supply certificate comprises:
receiving a pledge certificate which transfers accounts in a supply chain, wherein the pledge certificate comprises a preset number of supply certificates which transfer accounts in a public chain and a public chain certificate which transfers accounts in the public chain at the same time;
calculating an initial exchange rate according to the quantity relationship between the supply certificate and the public chain certificate in the received pledge certificate;
and storing the initial exchange rate, and adjusting the exchange rate in real time according to the subsequent transfer quantity of the supply certificate on the basis of the initial exchange rate.
Optionally, before the step of receiving a supply transaction initiated by a supply chain, the method further includes:
verifying the supply qualification of the supply chain supply certificate access to the public chain network through the quantity of the public chain certificate access owned by the supply chain;
if the quantity of the public chain certification owned by the supply chain is larger than or equal to the verification threshold value, determining that the supply chain has supply qualification, and receiving a supply transaction initiated by the supply chain;
if the quantity of the public chain certificates owned by the supply chain is less than the verification threshold value, determining that the supply chain does not have the supply qualification, sending verification prompt information to the supply chain, and storing the types of the supply certificates which can be provided by the supply chain.
Optionally, the steps of inquiring the supply amount of the initial certificate and the exchange certificate in the public chain network, and calculating the exchange ratio of the exchange certificate and the initial certificate according to the supply amount comprise:
judging whether the initial certificate is a public chain certificate;
if the starting certificate is a public chain certificate, inquiring the supply amount of the exchange certificate in a public chain network;
calculating the exchange ratio of the exchange certificate card to the public chain certificate card according to the supply amount of the exchange certificate card;
if the initial certificate is not the public chain certificate, inquiring the supply amount of the initial certificate and the exchange certificate in the public chain network;
calculating the exchange rate of the initial certificate and the public chain certificate according to the supply amount of the initial certificate;
calculating the exchange ratio of the exchange certificate card to the public chain certificate card according to the supply amount of the exchange certificate card;
calculating the exchange ratio of the exchange certificate to the initial certificate.
Optionally, before the step of receiving a supply transaction initiated by the supply chain, verifying whether the supply chain is configured with an intelligent contract meeting a public chain conversion rule, and if the supply chain is not configured with an intelligent contract, the step of configuring an intelligent contract to the supply chain includes:
judging whether the supply chain supports configuration intelligent contracts or not;
if the supply chain supports configuration intelligent contracts, configuring the intelligent contracts to the supply chain;
if the supply chain does not support the configuration intelligent contract, configuring a parallel chain to the supply chain, wherein the parallel chain is part of nodes in a public chain network;
the intelligent contracts are configured for the parallel chains such that the parallel chains initiate a supply transaction to the public chain.
In a second aspect, the present application provides a certificate exchange method based on public chain, applied to a supply chain network, including:
initiating a provisioning transaction to a public chain, the provisioning transaction including a type of a provisioning certificate transferred to the public chain and a number of the provisioning certificate;
receiving the exchange rate of the supply certificate and the public chain certificate calculated by the public chain according to the supply amount of the supply certificate, and confirming whether the transaction is completed;
and after the transaction is confirmed to be completed, receiving the public chain certificate of value such as the public chain transfer and the supply certificate quantity.
Optionally, the step of receiving the exchange ratio of the supply certificate and the public chain certificate calculated by the public chain according to the supply amount of the supply certificate and confirming whether the transaction is completed comprises:
initiating a supply transaction to a parallel chain corresponding to the supply chain;
controlling the parallel chain to generate an inquiry transaction according to the supply transaction, and initiating the inquiry transaction to the public chain so that the public chain returns the exchange ratio of the supply certificate and the public chain certificate to the parallel chain according to the inquiry transaction;
controlling the parallel chain to calculate the number of the available public chain certificates according to the exchange rate of the supply certificates and the public chain certificates, and sending the number of the public chain certificates to the supply chain;
receiving a public link warranty amount, determining whether to complete the transaction, and controlling the parallel link to initiate a supply transaction to the public link upon determining that the transaction is complete.
In a third aspect, the present application provides a certificate exchange method based on a public chain, applied to an exchange chain network, including:
initiating an exchange transaction to a public chain, wherein the exchange transaction comprises an initial certificate and certificate number transferred to the public chain and an exchange certificate type;
receiving the exchange rate of the exchange certificate and the public chain certificate calculated by the public chain according to the supply amount of the initial certificate and the exchange certificate, and confirming whether the transaction is completed;
and after the transaction is confirmed to be completed, receiving the exchange certificate of value such as the public chain transfer, the public chain certificate number and the like.
Optionally, the step of receiving the exchange rate of the certificate exchange and the certificate exchange of the public chain calculated according to the supply amount of the certificate exchange and confirming whether the transaction is completed comprises:
initiating an exchange transaction through a parallel chain corresponding to the exchange chain;
controlling the parallel chain to generate an inquiry transaction according to the exchange transaction, and initiating the inquiry transaction to the public chain so that the public chain returns the exchange ratio of the exchange certificate and the initial certificate to the parallel chain according to the inquiry transaction;
controlling the parallel chain to calculate the available number of the redemption certificates and the number of the redemption certificates to be sent to the exchange chain according to the exchange ratio of the redemption certificates and the initial certificates;
receiving an exchange number, determining whether the transaction is completed, and controlling the parallel chain to initiate an exchange transaction to the public chain after determining that the transaction is completed.
In a fourth aspect, the present application provides a public-chain-based blockchain system, comprising: the system comprises a public chain, a supply chain and an exchange chain which are accessed to a public chain network, wherein the public chain, the supply chain and the exchange chain are point-to-point networks;
wherein the supply chain is configured to: initiating a supply transaction to the public chain, the supply transaction including a type of supply certificate transferred to the public chain and a quantity of supply certificates; and receiving a public chain certificate of the public chain transfer;
the redemption chain is configured to: initiating an exchange transaction to the public chain, wherein the exchange transaction comprises the initial certificate and certificate amount transferred to the public chain and the exchange certificate and certificate type; receiving a conversion certificate of the public chain transfer;
the male chain is configured to: receiving a supply transaction initiated by a supply chain; inquiring the supply amount of the supply certificate in the public chain network, and calculating the exchange rate of the supply certificate and the public chain certificate according to the supply amount of the supply certificate; according to the exchange rate of the supply certificate and the public chain certificate, transferring the public chain certificate with the value such as the number of the supply certificate and the like to the supply chain;
receiving an exchange transaction initiated by the exchange chain; inquiring the supply amount of the exchange certificate and the initial certificate in the public chain network, and calculating the exchange ratio of the exchange certificate and the initial certificate according to the supply amount of the exchange certificate and the initial certificate; and transferring the exchange certificate certificates with the value such as the number of the initial certificate certificates to the exchange chain according to the exchange ratio of the exchange certificate certificates and the initial certificate certificates.
According to the technical scheme, the certificate exchange method and the block chain system based on the public chain are provided, in practical application, a plurality of supply chains initiate supply transaction to the public chain, the supply certificates provided by the supply chains are exchanged into the public chain certificates with equal value, and the public chain stores various supply certificates transferred by the supply chains and records supply amount; the exchange chain initiates exchange transaction to the public chain so that the public chain calculates the exchange rate according to the specified initial certificate and the supply amount of the exchange certificate in the exchange transaction, extracts the exchange certificate with the value such as the initial certificate from the stored supply certificate and accounts the exchange certificate to the exchange chain. The method judges the exchange rate among different certificates through the public chain, and can provide objective and reasonable exchange environment. And after the supply transaction occurs, the supply certificate is stored through the public chain, so that the transaction occurs only between the exchange chain and the public chain when the exchange transaction is performed, the exchange opponent is not required to be contacted to avoid the participation of a centralized program, and the exchange efficiency is improved.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
In the technical solution provided by the present application, the blockchain network refers to a peer-to-peer (P2P) network with decentralized application architecture, and the blockchain network can perform distributed storage, public consensus, digital encryption, transaction accounting, and verification. I.e., a transaction platform that encompasses distributed technology, cryptography, P2P network architecture, and various consensus algorithms that may be applied. The block chain or block chain information refers to accounting information generated according to transaction information when transactions occur in the block chain network, namely, a plurality of specific transactions form a block, and a plurality of blocks form a block chain. The blockchain network comprises nodes which establish point-to-point network connection with each other, and each node is configured with a corresponding consensus mechanism, such as an intelligent contract, and has enough computing power to perform transaction verification and accounting procedures. The nodes also have interface specifications that conform to some uniform standard to enable access to more nodes or other types of blockchain networks through the interface specifications.
In this application, references to public chains, redemption chains, supply chains, and parallel chains refer to different blockchain networks that conform to blockchain technology. Unless otherwise stated in the present application, the public chain, the exchange chain, the supply chain and the parallel chain all refer to corresponding networks, namely a public chain network, an exchange chain network, a supply chain network and a parallel chain network. The public link network is used as a basic platform arranged in the whole network, and node interfaces of the public link network are accessed into a plurality of block link networks, such as an industry chain, a alliance chain, a private chain and a third-party block link network which are built based on public link interface specifications. Each blockchain network can be used as an independent development platform and provides corresponding services for the inside of the network. The public chain defines and specifies a standard interface mode so as to facilitate network interfacing with other block chains, such as a conversion chain and a supply chain. The public chain in the application has the capability of supporting cross-chain intermediary and also has the capabilities of storing certificates, decentralized application and intelligent contractual.
The exchange chain and the supply chain refer to block chains accessed into a public chain network, namely in the application, the public chain provides a basic platform, and the exchange chain and the supply chain are used as the accessed block chain network and have respective functions and services. The exchange chain and the supply chain can be block chain networks built based on the public chain network standard and the interface specification, namely, the exchange chain and the supply chain can directly carry out communication and service interface with the public chain network. The exchange chain and the supply chain can also be independent networks, and have respective proprietary interface specifications, such as the existing block chain network bitcoin, ether house, and the like, or industry chains and alliance chains developed by some industries, even private chains built for achieving certain service requirements. These existing blockchains, industry chains, alliance chains, and private chains are due to their proprietary network interface specifications. Generally, the public link and other networks can be connected through parallel links because the public link and other networks cannot directly trade with each other or even trade with the public link network.
The parallel chain can be composed of partial nodes in a public chain network, and the public chain and other networks which cannot directly trade can be bridged through the parallel chain. In the application, for networks which cannot directly transact, each block chain network corresponds to a parallel chain, the parallel chains are set to have the complete function of the corresponding block chain network, and can synchronously convert transactions in the block chain network and transmit the transactions to a public chain network. Therefore, in the technical solution provided in the present application, the parallel chain may be determined as a mirror image of the corresponding blockchain network, and for convenience of description, the corresponding blockchain network becomes a parent chain. In the present application, the parallel chain is composed of partial nodes in the public chain network, and the nodes are also nodes in the mother chain to carry out the transmission of the transaction information.
Based on the components, the public chain can provide cross-chain relay in practical application, and work such as transaction verification, data certification, asset transfer, intelligent contract execution and the like is completed. The public link unifies external interface specifications, so that other block link networks can be rapidly accessed into the public link network. The public link also provides basic blockchain platform capability, namely, rapidly completing scheme deployment and verification and completing distributed storage and billing programs in the public link network. In addition, as a basic platform, the public chain can also provide a public development function, so that the cooperative development and deployment of a plurality of parallel chain intelligent contracts can be completed at one time.
The public link can be used for storing the information summary of the corresponding cross-link transaction, namely the transaction summary, besides recording the block chain information of the public link. Related content of cross-chain transaction is recorded through the formatted transaction data. Meanwhile, in order to reduce the occupation of the distributed storage space on the public link, when the public link records certain information, the third-party blockchain information can be recorded through a specific compression algorithm. Illustratively, the chunk data formed and stored in the public chain may include the following: block id (e.g., sequence number, timestamp, block hash value, and previous block hash value), block attribution (i.e., block generator), block other information (e.g., random value, difficulty value, and additional information), block weight, message digest (e.g., transaction tree, status tree, receipt tree, and data tree), transaction cost, reward, size, etc.
Fig. 1 is a schematic flow chart of a certificate exchange method applied to a public link network. As can be seen from fig. 1, the certificate exchange method provided in the present application, when applied to a public link network, includes the following steps:
s11: receiving a supply transaction initiated by a supply chain, the supply transaction including a type of supply certificate and a number of supply certificates transferred to the public chain;
s12: inquiring the supply amount of the supply certificate in the public chain network, and calculating the exchange rate of the supply certificate and the public chain certificate according to the supply amount of the supply certificate;
s13: and transferring the value of the public chain certificate currency, such as the number of the supply certificate currency and the public chain certificate currency to the supply chain according to the exchange rate of the supply certificate currency and the public chain certificate currency.
The purpose of the above steps is to complete the transaction operation of the supply certificate between the supply chain and the public chain, namely the supply transaction. As shown in FIG. 2, to complete a provisioning transaction, the supply chain is configured to perform the following procedural steps:
s21: initiating a provisioning transaction to a public chain, the provisioning transaction including a type of a provisioning certificate transferred to the public chain and a number of the provisioning certificate;
s22: receiving the exchange rate of the supply certificate and the public chain certificate calculated by the public chain according to the supply amount of the supply certificate, and confirming whether the transaction is completed;
s23: and after the transaction is confirmed to be completed, receiving the public chain certificate of value such as the public chain transfer and the supply certificate quantity.
According to the steps, before the exchange transaction is initiated by the exchange chain, the transfer transaction is completed between the supply chain and the public chain, and the certificate circulating in the supply chain is transferred to the public chain so as to participate in the subsequent exchange transaction. In practical application, the supply chain first initiates a supply transaction to the public chain, wherein the supply transaction includes the type of the certificate of supply and the number of certificates which can be supplied. For example, the public link network P is commonly connected to the networks a to F, and in the 6 blockchain networks, the respective certificate types (or certificate types supporting outward exchange transactions) distributed in the networks a to F are Ta, Tb, Tc, Td, Te, and Tf, respectively. When one of the blockchain networks, such as the network C, is to perform a certified provisioning transaction, a node (which may be referred to as a provisioning node) in the network C responsible for the cross-chain transaction first initiates the provisioning transaction to the public-chain network, that is, the provisioning chain performs the step of S21 described above. The offer transaction includes an offer voucher type, voucher Tc, for transfer to the public chain; and the number of offers to transfer, e.g., 1000 offers Tc to the public chain.
After the supply chain initiates the supply transaction, the public chain performs step S11 to query the supply amount of the supply certificate in the public chain network according to the content of the supply transaction. In practical applications, the same type of supply permit may originate from one blockchain network or from a plurality of blockchain networks, and therefore, for a supply transaction initiated by a supply chain, it may be first queried whether a corresponding supply permit is stored in a current public chain network. For example, after receiving the supply transaction, the public chain P extracts the type of the supply certificate Tc in the supply transaction, the number of the supply certificates is 1000, and then inquires the certificate Tc from various supply certificates stored in the public chain network, if the number of the current supply certificate Tc is 1053, the current supply amount of the supply certificate is determined to be 1053, and the public chain calculates the exchange ratio of the current time supply certificate Tc and the public chain certificate Tp according to the value of the supply amount and the public chain certificate Tp issued by the public chain.
In the technical scheme provided by the application, the specific mode of calculating the conversion ratio between the supply certificate Tc and the public chain certificate Tp according to the supply amount can be a public chain agreed calculation mode or a value conversion protocol which is known to be well known, such as a bancor protocol. In practical application, other factors can be comprehensively considered to further perform weighted calculation by calculating the exchange rate through the supply quantity of the supply certificate, such as a circulation degree weight, a block chain network certificate value stability weight and the like.
It should be noted that, in order to prevent the exchange rate from being abnormal or the value fluctuation condition from being extremely unbalanced when the supply amount of the supply certificate in the public chain network is 0 or too low, in the technical scheme provided by the present application, when each blockchain network accesses the public chain network, in a manner of constraint by the line, the accessed blockchain network transfers a part of the supply certificate to the public chain as the reserve amount of the type of the supply certificate, and the specific reserve amount value may be determined according to the scale of the accessed blockchain.
Further, as shown in fig. 3, the steps of inquiring the supply amount of the supply certificate in the public chain network, and calculating the exchange rate of the supply certificate and the public chain certificate according to the supply amount of the supply certificate comprise:
s131: receiving a pledge certificate which transfers accounts in a supply chain, wherein the pledge certificate comprises a preset number of supply certificates which transfer accounts in a public chain and a public chain certificate which transfers accounts in the public chain at the same time;
s132: calculating an initial exchange rate according to the quantity relationship between the supply certificate and the public chain certificate in the received pledge certificate;
s133: and storing the initial exchange rate, and adjusting the exchange rate in real time according to the subsequent transfer quantity of the supply certificate on the basis of the initial exchange rate.
That is, in the present embodiment, a supply chain corresponding to a supply permit is used as a redemption party of such a supply permit, and a part of the public chain permit is escorted to the public chain while transferring the supply permit to the public chain, that is, the public chain is transferred to the pledge, and the pledge includes the supply permit transferring a preset number to the public chain and the public chain permit transferring to the public chain at the same time. After the public chain receives the pledge certificate, the initial exchange proportion can be calculated according to the quantity proportion relation between the supply certificate and the public chain certificate. That is, in the solution provided by the present application, the initial redemption rate requires the project party to make a pledge on the public chain for the supply certificate and the public chain certificate. And subsequent supply nodes can decide to sell the supply certificate based on the initial pledge to obtain the public chain certificate; or buy the supply certificate and sell the public chain certificate. For convenience of description, after the supply chain transfers the pledge, a pool for certificate exchange can be formed in the public chain, and the supply certificate and the public chain certificate are arranged in the pool to support certificate exchange transactions. This pool can be understood as the concept of financial reserves.
The exchange rate between the supply certificate and the public chain certificate is updated in real time as the exchange transaction progresses. That is, in the initial case, the access node in the supply chain, through the intelligent contract provided by the public chain, provides a preset number of supply vouchers, along with corresponding public chain vouchers, to determine corresponding redemption rates. For example, the supply chain provides 1000 supply certificates, while providing 10 public chain certificates, and determines the corresponding exchange rate as 100: this portion of the originally supplied witness will serve as a reserve witness. In subsequent application, the intelligent contract can be called for many times, and the certificate exchange is completed once every time of calling, so that the corresponding exchange rate can be updated through continuous exchange.
Because no opponents are exchanged, the certificates are directly reserved for exchange, and the exchange rate is the current real-time rate. If the reserve certificate is exhausted, two conditions are presented: one is that the supply certificate is exhausted, and the supply certificate is short-pending when the supply certificate is over-bought, the supply certificate will increase in value, so the access chain network will be stimulated to provide the supply certificate, otherwise the price will increase uniformly; in another case, if the public chain certificate corresponding to the reserve certificate is exhausted and overdesign occurs, the supply certificate is sold and price collapse occurs, which leads to zero value of the supply certificate. Therefore, under the mechanism, all parties participating in the certificate exchange can maintain a fair exchange rate to the full extent, and the benefits of all parties are guaranteed. In this embodiment, by the above-mentioned updating manner of the exchange rate, the benefits of each exchange participant can be protected as much as possible, the value of maintaining the certificate of the exchange participant is ensured, and the security and the compliance of the public chain are maintained.
According to the technical scheme, before the certificate exchange is carried out, the block chain network accessed into the public chain network initiates supply transaction to supply various types of certificates. Therefore, the supply chain as the selling party can exchange the pre-sold certificate currency into the certificate currency of the public chain through the public chain, and then stores the sold certificate currency through the public chain, so that the exchange transaction can be completed without purchasing an opponent, and the selling efficiency of the supply certificate currency can be greatly increased.
In the application, when a supply chain initiates a supply transaction to a public chain, a supply node in the supply chain generates block data which conforms to a supply chain network transaction specification according to supply transaction information, and broadcasts the formed block data in a supply chain network and the public chain network respectively, so that a complete block chain is formed in the supply chain network. The node in the public link re-verifies the block data and forms or further converts the block data into block data which conforms to the public link transaction specification, so that a complete block chain based on the public link network is formed through broadcasting in the public link network to complete the accounting operation.
Similarly, after the exchange rate is calculated by the public chain, in the process of transferring the value such as the public chain certificate and the like to the supply chain according to the exchange rate and the number of the supply certificate and the certificate, the nodes in the public chain responsible for transferring the money form block data meeting the public chain transaction specification, and the block data is broadcasted in the public chain network to form a complete block chain. Meanwhile, the block data is sent to the supply chain network together with the transfer operation, and the block data is broadcasted from the supply chain network again to form a complete block chain so as to complete the accounting operation.
In this embodiment, as the public chain starts timing at the time of the public chain certification of value such as the number of supply certificates transferred to the supply chain by the public chain, since the block data includes the timestamp information, the timestamp of the first block data may be used as the timing start time, and the complete block chain, that is, the timestamp of the last block chain may be used as the timing start time. When the timing time reaches the time corresponding to the pledge period, the nodes in the public chain network initiate a refund transaction to the supply chain, the supply quantity of the supply certificate in the public chain network also needs to be inquired, the real-time exchange rate is calculated according to the supply quantity, and the supply certificate is refunded to the supply chain according to the exchange rate.
In practical applications, the blockchain network accessing the public chain network can be used as a supply chain to initiate a supply transaction to the public chain, but different blockchain networks often have respective dedicated interface specifications and require a special consensus mode, such as an intelligent contract or a public contract, to complete the transaction with the public chain. Therefore, in some embodiments provided in the present application, before the step of receiving a supply transaction initiated by a supply chain, it needs to be verified whether the supply chain is configured with an intelligent contract meeting the exchange rule of a public chain, and if the supply chain is configured with a corresponding intelligent contract, the supply transaction is initiated and completed directly through the intelligent contract; if the supply chain is not configured with an intelligent contract, as shown in FIG. 4, the method further comprises:
s101: judging whether the supply chain supports configuration intelligent contracts or not;
s102: if the supply chain supports configuration intelligent contracts, configuring the intelligent contracts to the supply chain;
s103: if the supply chain does not support the configuration intelligent contract, configuring a parallel chain to the supply chain, wherein the parallel chain is part of nodes in a public chain network;
s104: the intelligent contracts are configured for the parallel chains such that the parallel chains initiate a supply transaction to the public chain.
In this embodiment, it may be determined whether the supply chain supports the configuration intelligent contract, and for the supply chain supporting the configuration intelligent contract, for example, for a block chain network that is first brought online to the public chain network and has the same interface specification as the public chain network, it may support the configuration intelligent contract, so that the supply chain may be configured with the intelligent contract through the public chain. For the supply chain which does not support the configuration of the intelligent contract, a part of the common chain link points of the supply chain connected into the common chain can be selected as the parallel chain of the supply chain according to a preset rule or a nearby principle in the common chain. Nodes that are parallel chains may be configured to have all of the functionality and information of both the public chain and the supply chain, and have a bridging effect to complete supply transactions and transfers between the supply chain and the public chain.
After the parallel chain is configured for the supply chain, the public chain can configure an intelligent contract for the parallel chain, and since the parallel chain is a part of nodes in the public chain, the intelligent contract configured for the parallel chain only needs to set corresponding supply chain information in the intelligent contract, and the parallel chain is endowed with a bridging function, so that the supply chain can initiate supply transaction to the public chain through the parallel chain. It should be noted that the parallel link points may be from the public link network, or may be from the supply link network, or may be partially from the public link network, and partially from the supply link network. For nodes from a supply chain network, after the supply chain determines which nodes are parallel chain network nodes, the nodes are verified by the public chain, and the nodes which are parallel chains are determined to be capable of supporting the public chain network specification.
In some embodiments of the present application, in the case that the blockchain network accesses the public chain through the parallel chain, since the supply chain network cannot directly complete the transaction with the public chain, as shown in fig. 5, the step of confirming whether the transaction is completed or not at the receiving public chain according to the exchange rate of the supply certificate and the public chain certificate calculated by the supply amount of the supply certificate comprises:
s221: initiating a supply transaction to a parallel chain corresponding to the supply chain;
s222: controlling the parallel chain to generate an inquiry transaction according to the supply transaction, and initiating the inquiry transaction to the public chain so that the public chain returns the exchange ratio of the supply certificate and the public chain certificate to the parallel chain according to the inquiry transaction;
s223: controlling the parallel chain to calculate the number of the available public chain certificates according to the exchange rate of the supply certificates and the public chain certificates, and sending the number of the public chain certificates to the supply chain;
s224: receiving a public link warranty amount, determining whether to complete the transaction, and controlling the parallel link to initiate a supply transaction to the public link upon determining that the transaction is complete.
In this embodiment, after the supply chain initiates a supply transaction through the parallel chain, the parallel chain may generate a query transaction facing the public chain according to the supply transaction, where the query transaction may be a transaction in an agreed form, such as a transaction with a transaction voucher number of 0 or a transaction in an intelligent contract-specified form, and the query transaction needs to have supply voucher type information. And after the public chain receives the inquiry transaction, returning the exchange rate of the supply certificate and the public chain certificate to the parallel chain according to the inquiry transaction. The parallel chain then transmits the returned conversion rate to the supply chain, or calculates the number of the public chain certificates which can be converted according to the supply transaction and the conversion rate, and transmits the number of the available public chain certificates to the supply chain (or the supply node).
After receiving the number of the public chain certificates sent by the parallel chain, the supply chain can judge the public chain certificates and determine whether the exchange results can be accepted or not. The parallel chain may be controlled to send the supply transaction to the public chain if the supply chain is able to accept the redemption result, and to withdraw the supply transaction if the redemption result is not accepted.
Further, in order to ensure the value stability of the supply certificate, that is, before the step of receiving the supply transaction initiated by the supply chain, the public chain needs to verify the certificate supply qualification of the supply chain, as shown in fig. 6, a specific supply qualification verification method includes the following steps:
s105: verifying the supply qualification of the supply chain supply certificate access to the public chain network through the quantity of the public chain certificate access owned by the supply chain;
s106: if the quantity of the public chain certification owned by the supply chain is larger than or equal to the verification threshold value, determining that the supply chain has supply qualification, and receiving a supply transaction initiated by the supply chain;
s107: if the quantity of the public chain certificates owned by the supply chain is less than the verification threshold value, determining that the supply chain does not have the supply qualification, sending verification prompt information to the supply chain, and storing the types of the supply certificates which can be provided by the supply chain.
In this embodiment, when each blockchain network accesses the public chain, a certain amount of public chain certificates need to be acquired in the public chain to serve as the transaction capital of the blockchain network, so that the blockchain network with capacity or large scale needs to have a larger amount of public chain certificates, and further, the supply quality of the supply certificates is determined according to the amount of the public chain certificates owned by the supply chain. By verifying the supply qualification of the supply chain, the large fluctuation of the supply quantity can be avoided, and the abnormal condition of the exchange rate is reduced. Meanwhile, the supply qualification of the supply chain is verified, so that the condition that individual small block chain networks, such as private chains, issue false certificates can be avoided, and the exchange stability of a public chain system is prevented from being damaged.
According to the technical scheme, the supply chain supplies different types of certificates to the public chain and stores the certificates in the public chain so as to access other blockchain networks in the public chain network for conversion. It is clear that in the present application, the supply chain and the redemption chain refer to the roles played when performing different types of operations. For the blockchain network accessed to the public chain network, all blockchain networks accessed to the public chain network can be used as supply chains as long as the blockchain network can meet corresponding certificate provision quality, and meanwhile, all blockchain networks accessed to the public chain network can also be used as exchange chains to initiate exchange transactions to the public chain so as to obtain the required certificate. As shown in fig. 1, for a redemption transaction, the public chain is configured to perform the following procedural steps:
s14: receiving an exchange transaction initiated by an exchange chain, wherein the exchange transaction comprises an initial certificate and certificate amount transferred to a public chain and an exchange certificate and certificate type;
s15: inquiring the supply amount of the initial certificate and the exchange certificate in the public chain network, and calculating the exchange ratio of the exchange certificate and the initial certificate according to the supply amount;
s16: and transferring the exchange certificate certificates with the value such as the number of the initial certificate certificates to the exchange chain according to the exchange ratio of the exchange certificate certificates and the initial certificate certificates.
Accordingly, in performing a redemption transaction operation, as shown in fig. 7, the redemption chain is configured to perform the following procedural steps:
s31: initiating an exchange transaction to a public chain, wherein the exchange transaction comprises an initial certificate and certificate number transferred to the public chain and an exchange certificate type;
s32: receiving the exchange rate of the exchange certificate and the public chain certificate calculated by the public chain according to the supply amount of the initial certificate and the exchange certificate, and confirming whether the transaction is completed;
s33: and after the transaction is confirmed to be completed, receiving the exchange certificate of value such as the public chain transfer, the public chain certificate number and the like.
According to the technical scheme, a block chain network serving as an exchange chain firstly initiates an exchange transaction to a public chain, and the exchange transaction comprises the number of initial certificates and types of the exchange certificates. For example, if a blockchain network as a redemption chain is network a, and one or more nodes (i.e., redemption nodes) in network a want to use 100 certificates and Ta to redeem certificates and Tc, the node initiates a redemption transaction to the public chain, where the redemption transaction includes that the number of initial certificates and Ta transferred to the public chain is 100 certificates and the type of the redemption certificate is Tc. And the exchange chain sends the exchange transaction containing the information to a public chain, and after receiving the exchange transaction, the public chain inquires the supply amount of the initial certificate and the exchange certificate in a public chain network according to the types of the extracted initial certificate and the exchange certificate so as to calculate the exchange rate of the two certificates during exchange according to the supply amount of the two certificates. The conversion rate is calculated in the same manner as the supply chain when initiating the supply transaction.
In practical applications, for the exchange chain, the initial evidence type of the exchange may be in many different forms, for example, for the exchange chain network a, the initial evidence type used for the exchange may be circulation evidence Ta in the network a, public chain evidence Tp, or even evidence Tb, Te or Tf circulating in other blockchains. Thus, different approaches may be used in making the calculation of the redemption rate. Further, as shown in fig. 8, the steps of inquiring the supply amounts of the originating voucher and the redemption voucher in the public link network, and calculating the redemption rate of the redemption voucher to the originating voucher based on the supply amounts include:
s151: judging whether the initial certificate is a public chain certificate;
s152: if the starting certificate is a public chain certificate, inquiring the supply amount of the exchange certificate in a public chain network;
s153: calculating the exchange ratio of the exchange certificate card to the public chain certificate card according to the supply amount of the exchange certificate card;
s154: if the initial certificate is not the public chain certificate, inquiring the supply amount of the initial certificate and the exchange certificate in the public chain network;
s155: calculating the exchange rate of the initial certificate and the public chain certificate according to the supply amount of the initial certificate;
s156: calculating the exchange ratio of the exchange certificate card to the public chain certificate card according to the supply amount of the exchange certificate card;
s157: calculating the exchange ratio of the exchange certificate to the initial certificate.
In this embodiment, the initial certificate may be judged as to the certificate type according to the exchange transaction initiated by the exchange chain, that is, whether the initial certificate is a public chain certificate is judged. If the initial certificate is a public chain certificate, namely the exchange chain network A uses 100 public chain certificates Tp to exchange certificates Tc, the public chain only needs to acquire the supply amount of the exchange certificates, namely the supply amount of the certificates Tc. Then, the exchange ratio between the exchange certificate Tc and the public chain certificate Tp is calculated according to the supply amount of the exchange certificate Tc. If the initial certificate is not the public chain certificate, namely the exchange chain network A uses 100 certificates Ta to exchange certificates Tc, the public chain needs to inquire the supply amount of the initial certificate Ta and the exchange certificate Tc at the same time, then respectively calculate the exchange rate between the initial certificate Ta and the public chain certificate Tp and the exchange rate between the exchange certificate Tc and the public chain certificate Tp, and finally determine the exchange rate between the initial certificate Ta and the exchange certificate Tc according to the exchange rates calculated twice.
And after calculating the exchange rate between the initial certificate and the exchange certificate, the public chain transfers the exchange certificate with the value such as the initial certificate and the number of the initial certificate to the exchange chain according to the received transfer initial certificate and the number of the initial certificate. For example, if the exchange ratio between the initial certification Ta and the exchange certification Tc is 5:1, the public chain transfers 20 Tc to the exchange chain according to the exchange ratio when receiving 100 certification Ta, and stores 100 certification Ta in the public chain after transferring, and at this time, the supply amount of the certification Ta stored in the public chain is increased by 100.
Further, as shown in fig. 9, the step of confirming whether the transaction is completed or not for the exchange rate of the exchange certificate and the certificate of the public chain calculated from the supply amount of the exchange certificate for the receiving public chain includes:
s321: initiating an exchange transaction through a parallel chain corresponding to the exchange chain;
s322: controlling the parallel chain to generate an inquiry transaction according to the exchange transaction, and initiating the inquiry transaction to the public chain so that the public chain returns the exchange ratio of the exchange certificate and the initial certificate to the parallel chain according to the inquiry transaction;
s323: controlling the parallel chain to calculate the available number of the redemption certificates and the number of the redemption certificates to be sent to the exchange chain according to the exchange ratio of the redemption certificates and the initial certificates;
s324: receiving an exchange number, determining whether the transaction is completed, and controlling the parallel chain to initiate an exchange transaction to the public chain after determining that the transaction is completed.
In this embodiment, the form is similar to that at the time of the supply transaction. After the exchange chain initiates the exchange transaction through the parallel chain, the parallel chain can generate inquiry transaction facing to the public chain according to the exchange transaction. In the same example, the inquiry transaction may be an agreed-upon transaction, such as a transaction with a voucher amount of 0, or a transaction with a form specified by the intelligent contract, and the inquiry transaction needs to have voucher type information. And after receiving the inquiry transaction, the public chain returns the exchange rate of the exchange certificate and the initial certificate to the parallel chain according to the inquiry transaction. And the parallel chain transmits the returned exchange rate to the exchange chain, or calculates the number of the public chain certificates which can be exchanged according to the exchange transaction and the exchange rate, and transmits the number of the available public chain certificates to the exchange chain (or the exchange node).
After receiving the number of the official chain certificates sent by the parallel chain, the exchange chain can judge the number of the official chain certificates and determine whether the exchange result can be accepted or not. The parallel chain may be controlled to send the redemption transaction to the public chain if the redemption chain is able to accept the redemption result, and may be controlled to withdraw the redemption transaction if the redemption result is not accepted.
Similar to the supply transaction process initiated by the supply chain, in the application, when the supply transaction is initiated to the public chain by the exchange chain, the exchange node inside the exchange chain generates block data meeting the exchange chain network transaction specification according to the exchange transaction information, and broadcasts the formed block data in the exchange chain network and the public chain network respectively, so that a complete block chain is formed in the exchange chain network. The node in the public chain verifies the block data converted into the transaction again and forms or further converts the block data into the block data which conforms to the public chain transaction specification, so that a complete block chain based on the public chain network is formed through broadcasting in the public chain network to complete the accounting operation.
It should be noted that the exchange chain Ta and the supply chain Tc described in the above embodiments are only examples for convenience of description, and in practical applications, a blockchain network accessing a public chain network, such as a third-party public chain, a third-party industry chain and a federation chain, and a private chain, and a sub-chain developed based on public link interface specifications, etc. may be used as the exchange chain and the supply chain at the same time. Moreover, since different blockchain networks have respective functions, multiple types of certificates can be supplied to the same blockchain network. In addition, in the public chain transfer and exchange certificate and the public chain certificate to the supply chain or the exchange chain, the exchange chain and the supply chain can complete the transfer through a corresponding account on a public chain or a block chain network without directly receiving the transfer certificate, namely, the transfer can be completed through an account set on the public chain between two block chain networks which are partially incompatible, so that the problem that the exchange chain cannot identify the exchange certificate is avoided.
In the technical scheme provided by the application, for a supply chain, such as a supply chain network C, the essence of the transaction process is to use a certificate Tc to exchange another certificate, such as Ta, so for the supply chain, after the supply transaction is completed, the obtained certificate Tp of a public chain can be directly used for exchanging the certificate Tc, namely the network C can be used as an exchange chain to initiate exchange transaction, and 3000 certificate Tp of the public chain are transferred to the public chain to exchange the certificate Ta with the value.
Therefore, in the application, after the block chain network serving as the supply chain can exchange the public chain certificate for the public chain certificate, the public chain certificate is used for exchanging the certificate to be exchanged, and the whole process is completely free from contacting other block chain networks, namely the certificate exchange is completed under the condition of no opponent. Similarly, for the exchange chain, the certificate exchange is also completed through the public chain, and the exchange opponents do not need to be contacted. Therefore, the whole exchange process can be completed by a decentralized application in the public chain network, and the transaction process is completed by a billing program in the public chain and the participation block chain network simultaneously, so that a relatively objective and fair exchange environment can be provided.
In the method for exchanging the certificate provided by the application, whether the transaction is supplied or exchanged, the exchange ratio between the two certificates can be calculated according to the certificate supply amount provided by the scheme. A regularly refreshed exchange rate table can also be constructed in the public link network. The exchange rate table can provide exchange rates among various certificates, and the exchange rates can be calculated and provided by parts of nodes specially used for balancing the certificate value in the public chain or provided by a financial industry chain accessing to a public chain network. However, for the financial industry chain accessing the public chain network, when accessing the public chain network, the maintenance node in the public chain and other blockchain networks related to interest relevance can vote on the financial industry chain online to determine the authority and effectiveness of the financial industry so as to provide a more reasonable exchange rate. Obviously, in practical application, when determining the exchange rate between two certificates, the public chain can also guarantee the exchange rights and interests of both parties to the maximum extent on the premise of providing exchange efficiency by means of supply amount and referring to the exchange rate table.
Based on the above certificate exchange method, the present application further provides a block chain system based on public chain, as shown in fig. 10, the block chain system includes: the system comprises a public chain, a supply chain and an exchange chain which are accessed to a public chain network, wherein the public chain, the supply chain and the exchange chain are point-to-point networks;
wherein the supply chain is configured to: initiating a supply transaction to the public chain, the supply transaction including a type of supply certificate transferred to the public chain and a quantity of supply certificates; and receiving a public chain certificate of the public chain transfer;
the redemption chain is configured to: initiating an exchange transaction to the public chain, wherein the exchange transaction comprises the initial certificate and certificate amount transferred to the public chain and the exchange certificate and certificate type; receiving a conversion certificate of the public chain transfer;
the male chain is configured to: receiving a supply transaction initiated by a supply chain; inquiring the supply amount of the supply certificate in the public chain network, and calculating the exchange rate of the supply certificate and the public chain certificate according to the supply amount of the supply certificate; according to the exchange rate of the supply certificate and the public chain certificate, transferring the public chain certificate with the value such as the number of the supply certificate and the like to the supply chain;
receiving an exchange transaction initiated by the exchange chain; inquiring the supply amount of the exchange certificate and the initial certificate in the public chain network, and calculating the exchange ratio of the exchange certificate and the initial certificate according to the supply amount of the exchange certificate and the initial certificate; and transferring the exchange certificate certificates with the value such as the number of the initial certificate certificates to the exchange chain according to the exchange ratio of the exchange certificate certificates and the initial certificate certificates.
According to the technical scheme, the certificate exchange method and the block chain system based on the public chain are provided, in practical application, a plurality of supply chains initiate supply transaction to the public chain, the supply certificates provided by the supply chains are exchanged into the public chain certificates with equal value, and the public chain stores various supply certificates transferred by the supply chains and records supply amount; the exchange chain initiates exchange transaction to the public chain so that the public chain calculates the exchange rate according to the specified initial certificate and the supply amount of the exchange certificate in the exchange transaction, extracts the exchange certificate with the value such as the initial certificate from the stored supply certificate and accounts the exchange certificate to the exchange chain. The method judges the exchange rate among different certificates through the public chain, and can provide objective and reasonable exchange environment. And after the supply transaction occurs, the supply certificate is stored through the public chain, so that the transaction occurs only between the exchange chain and the public chain when the exchange transaction is performed, the exchange opponent is not required to be contacted to avoid the participation of a centralized program, and the exchange efficiency is improved.
The embodiments provided in the present application are only a few examples of the general concept of the present application, and do not limit the scope of the present application. Any other embodiments extended according to the scheme of the present application without inventive efforts will be within the scope of protection of the present application for a person skilled in the art.