A kind of commodity transaction information sharing method based on block chain technologyTechnical field
The present invention relates to block chain field, specially a kind of commodity transaction information sharing method based on block chain technology.
Background technique
Block chain is the novel of the computer technologies such as Distributed Storage, point-to-point transmission, common recognition mechanism, Encryption AlgorithmApplication model.For narrow sense, block chain is that data block is combined by one kind in such a way that sequence is connected sequentially in timeA kind of linked data structure, and the distributed account book that can not be distorted He can not forge guaranteed in a manner of cryptography, broadly,Block chain technology be verified using block linked data structure algorithm of knowing together with storing data, using distributed node generating andMore new data, utilizes what is be made of automatized script code at the safety for guaranteeing data transmission and access in the way of cryptographyIntelligent contract programs the completely new distributed basis framework and calculation of one kind with operation data.
Existing staple commodities electronic transaction system is the staple commodities electronic transaction by being responsible for operation by marketplace operatorWhat platform carried out, the adequate and systematic service such as the platform provider product transaction, public information, INTEGRATED LOGISTICS, acceptance warehouse, financial service,The business for the various aspects such as relevant transaction, cargo acceptance, storage, information publication and risk control of trading to staple commodities, is transferred toProfessional institution, such as transaction platform, specified acceptance warehouse, third party's warehouse receipt publicity mechanism, third party's fund clearing mechanism and thirdFang Zijin Cun Guan bank, respectively using respective operation system under unified business rule, according to the respective division of labor and responsibility intoThe transaction of row staple commodities.When carrying out the electronic transaction of commodity, in order to guarantee reliability, the legitimacy of transaction, need to transactionInformation is shared.
Existing commodity transaction information sharing method is being traded usually by the Transaction Information transparence of both partiesIn the process, the flow process of commodity and commodity is added to mark one by one, commodity and Commodity Flow can be inquired by markDynamic specifying information.
But existing commodity transaction information sharing method has the following deficiencies:
(1) each participant on commodity transaction chain is at the state of information island mostly, and data are difficult to be handed overMutually, therefore information sharing is very insufficient, and folk prescription distorts that Transaction Information is easy, is unfavorable for the fidelity of guaranteeing the quality of commodity;
(2) flow step of the commodity in process of exchange is very various, and required shared information data is also many troublesome,Therefore it is unfavorable for the inquiry and supervision of each side, and when there are transaction issues, is difficult trade to trace to the source, is unfavorable for reconciliation of calling to accountCertainly problem.
Summary of the invention
In order to overcome the shortcomings of that prior art, the present invention provide a kind of commodity transaction information based on block chain technologySharing method, this method can be such that each participant on commodity transaction chain easily inquires by the way that shared third party is arrangedAll information of commodity transaction so that commodity transaction information sharing is more abundant, and can be avoided folk prescription on chain transaction and distort transactionInformation, meanwhile, by the node-classification and timestamp of block chain, can facilitate each side to numerous transaction data carry out inquiry andSupervision not only contributes to the transparency for improving transaction, additionally it is possible to and facilitate transaction to trace to the source, is conducive to transaction issues of calling to account and solve,It can effectively solve the problem of background technique proposes.
The technical solution adopted by the present invention to solve the technical problems is:
A kind of commodity transaction information sharing method based on block chain technology, includes the following steps:
S100, original seller's block group, buyer's block group, intermediate participant block group, information intermediate storage block are builtGroup and third party's block group, the user newly increased or information data generate new block according to classification, and new block and originalBlock forms block chain;
S200, intelligent contract is written in block chain, when both parties initiate transaction request, generates trading instruction, togetherWhen new transaction data is stored to newly-generated information intermediate storage block, the corresponding unique transaction of each transaction dataID simultaneously adds timestamp;
In entire flow process, merchandise news and flowing information when each step flows are stored to new for S300, commodityIn the information intermediate storage block of generation, and generate the intermediate ID for adding timestamp;
S400, both parties can generate a new third party when initiating transaction request, and generating trading instruction simultaneouslyBlock and third party's block identifying code, third party's block identifying code is published to automatically in block chain network, in addition, commodity are being handed overThe unique transaction id generated during easily and the intermediate ID generated in flow process are stored in third party's block.
Further, in the step s 100, newly-increased user generates the specific steps of new block are as follows:
S101, newly-increased the user registration information in block catenary system, and reliable authentication is carried out by identity card;
S102, after completing authentication, block catenary system stores user information to new block, and according to userNew block is divided in different block groups by identity;
After the registration is finished, block catenary system can provide one group of public and private key by S103, each user, for individualInformation carries out selection encryption;
S104, newly-increased user and the credit bank of block catenary system authorization reach an agreement, and according to participating in block chainThe ratio of each side's common recognition carries out the exchange of ideal money and legal tender.
Further, block catenary system be each original user and Add User distribution one number of segment word mark, for pairUnique user identity is answered, the intermediate ID that commodity generate when by the flowing of intermediate participant can add a prefix and one automaticallyA suffix, prefix are previous intermediate participant or the number mark of seller, and suffix is the intermediate participant that commodity will flow toOr the number mark of buyer.
Further, in step s 200,
When both parties initiate transaction request, generate trading instruction, block catenary system can be created according to trading instruction and be handed overEasy data, and a unique commodity ID is created to tradable commodity;
When generating commodity ID, block catenary system can automatically generate an activation code according to commodity ID, and as activation conditionA new information intermediate storage block and new third party's block are generated in block chain;
Newly-generated information intermediate storage block and third party's block is all provided with using corresponding commodity ID as store instructionSet a difference suffix;
All Activity data and merchandise news, flowing information under commodity ID pass through store instruction and store to correspondenceInformation intermediate storage block in, all intermediate ID and unique transaction id under commodity ID pass through store instruction store toIn corresponding third party's block.
Further, in step S400, third party's block identifying code can be bound together with commodity ID, both parties,Intermediate participant and regulator can obtain the corresponding third party of tradable commodity by commodity ID or out of block chain networkBlock identifying code inquires the content of corresponding third party's block storage, and unique transaction id by storing in third party's blockWith merchandise news, transaction data and the flowing information of the storage of intermediate ID query information intermediate storage block memory.
Further, in step s 200, when both parties initiate transaction request, and conclude the transaction agreement when, block chainSystem sends trade confirmation to both parties, if both parties confirm, system is by the void of the amount under buyer's accountQuasi- coin is transferred to seller's account, and supervises the flowing that seller sends commodity and commodity, meanwhile, Transaction Information is sent to blockChain network.
Further, the third party's block identifying code and Transaction Information being sent in block chain network can be stored to originalIn several nodes in information intermediate storage block group, and add timestamp.
Further, when concluding the transaction, block catenary system will create and disposes an order contract, order both partiesContract carries out contract supplement and perfect by seller, intermediate participant with chains of commodity flow, and during flowing.
Further, in step s 103, user can classify to personal information, and respectively with public key and private key intoRow encryption, public key publication is in block chain network, and when other users access, system transfers public key automatically and accesses, and onlyThe information of public key encryption can be accessed, and private key is stored by user itself, private key could be accessed by only being given by verifying or userThe information of encryption.
Further, data are handled by Hash when storing write-in, and commodity are in flow process, merchandise newsBy Hash, treated that hash value remains unchanged, if hash value changes, may determine that commodity go wrong.
Compared with prior art, the beneficial effects of the present invention are:
(1) present invention can be such that each participant on commodity transaction chain easily inquires by the way that shared third party is arrangedTo all information of commodity transaction, so that commodity transaction information sharing is more abundant, and it can be avoided folk prescription on chain transaction and distort friendshipEasy information is conducive to the fidelity of guaranteeing the quality of commodity;
(2) present invention is by the node-classification and timestamp of block chain, can facilitate each side to numerous transaction data intoRow inquiry and supervision not only contribute to the transparency for improving transaction, additionally it is possible to facilitate transaction to trace to the source, be conducive to call to account and solve to hand overEasy problem.
Detailed description of the invention
Fig. 1 is overall flow structural schematic diagram of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall within the protection scope of the present invention.
As shown in Figure 1, the present invention provides a kind of commodity transaction information sharing methods based on block chain technology, including such asLower step:
Step S100, original seller's block group, buyer's block group, intermediate participant block group, information intermediate storage are builtBlock group and third party's block group, the user newly increased or information data generate new block according to classification, and new block andOriginal block forms block chain, by the way that original block to be divided into different block groups, can facilitate different user and dataManagement.
In the step s 100, newly-increased user generates the specific steps of new block are as follows:
Step S101, newly-increased user registration information in block catenary system, and reliable identity is carried out by identity cardVerifying.
Step S102, after completing authentication, block catenary system stores user information to new block, and according toNew block is divided in different block groups by user identity.
Step S103, after the registration is finished, block catenary system can provide one group of public and private key to each user, for pairPersonal information carries out selection encryption.
In step s 103, user can classify to personal information, and one kind can disclose owner, another kind of choosingSelecting property discloses, and is encrypted respectively with public key and private key, and public key publication is in block chain network, when other users access,System transfers public key automatically and accesses, and can only access the information of public key encryption, and private key is stored by user itself, only logicalIt crosses verifying or user gives the information that could access private key encryption, verification mode is selected and formulated by user oneself.
Step S104, newly-increased user and the credit bank of block catenary system authorization reach an agreement, and according in block chainThe ratio for participating in each side's common recognition carries out the exchange of ideal money and legal tender, participates in all nodes that common recognition participates in block chainIt with reaching common understanding per family, and can not distort, avoid the benefit damage of user, before transaction, user can change by legal tenderEquivalent ideal money is taken, and carries out the transaction of commodity with ideal money, it is also possible to withdraw deposit to ideal money.
Step S200, intelligent contract is written in block chain, when both parties initiate transaction request, generates transaction and refers toIt enables, while new transaction data being stored to newly-generated information intermediate storage block, each transaction data corresponds to onlyOne transaction id simultaneously adds timestamp, by setting timestamp, can be avoided unique transaction id and is tampered.
Step S300, in entire flow process, merchandise news and flowing information when each step flows store commodityIn to newly-generated information intermediate storage block, and generate the intermediate ID for adding timestamp.
In step s 200, when both parties initiate transaction request, generate trading instruction, block catenary system can be according to friendshipEasily instruction creation transaction data, and a unique commodity ID is created to tradable commodity, commodity ID can be number and letterCombination.And it is generated according to commodity transaction sequence.
When generating commodity ID, block catenary system can automatically generate an activation code according to commodity ID, and as activation conditionA new information intermediate storage block and new third party's block are generated in block chain.
Newly-generated information intermediate storage block and third party's block is all provided with using corresponding commodity ID as store instructionA difference suffix is set, such as a store instruction is XXXXXX.1, another store instruction is XXXXXX.2, for differentStorage content carries out classification storage, meanwhile, it is capable to store each information of corresponding goods fast and accurately into correct block.
All Activity data and merchandise news, flowing information under commodity ID pass through store instruction and store to correspondenceInformation intermediate storage block in, all intermediate ID and unique transaction id under commodity ID pass through store instruction store toIn corresponding third party's block.
In step s 200, when both parties initiate transaction request, and conclude the transaction agreement when, block catenary system is to transactionBoth sides send trade confirmation, if both parties confirm, the virtual coin of the amount under buyer's account is transferred to by systemSeller's account, and the flowing that seller sends commodity and commodity is supervised, meanwhile, Transaction Information is sent to block chain network, ifBoth parties are without all confirmations, then cancellation of trading.
When concluding the transaction, block catenary system will create and disposes an order contract both parties, and order contract includesMerchandise news, commodity price, buyer address and logistics information, inspection information etc., order contract is being flowed with chains of commodity flowDuring contract supplement and perfect carried out by seller, intermediate participant, wherein merchandise news, commodity price, buyer address etc.It is filled in by seller, logistics information, inspection information etc. are filled in by each intermediate participant, by order contract, are conducive to transactionIt is supervised and is authenticated.
Block catenary system is each original user and the distribution one number of segment word mark that Adds User, for corresponding to unique useFamily identity, the intermediate ID that commodity generate when by the flowing of intermediate participant can add a prefix and a suffix automatically, precedingSewing is that previous intermediate participant or the digital of seller identify, and suffix is the number of intermediate participant or buyer that commodity will flow toWord mark, as pass through during chains of commodity flow seller, each intermediate participant, buyer number mark be respectively 100000,100001,100002,100003, commodity original intermediate ID for generating when by the flowing of intermediate participant be 200001,200002, the then intermediate ID ultimately generated are 100000.200001.100002 and 100001.200002.100003, are passed throughPrefix and suffix are added on intermediate ID, can be facilitated and the flowing of commodity be traced to the source and flowed to inquiry, thus handing overWhen easy or commodity problem, it is quickly found out commodity or problem appearance point, is conducive to transaction issues of calling to account or solve.
Step S400, both parties are initiating transaction request, and when generating trading instruction, can generate one new the simultaneouslyTripartite's block and third party's block identifying code, third party's block identifying code is published to automatically in block chain network, in addition, commodityThe unique transaction id generated in process of exchange and the intermediate ID generated in flow process are stored in third party's block.
In step S400, third party's block identifying code can be bound together with commodity ID, both parties, intermediate participantAnd regulator can obtain the corresponding third party's block identifying code of tradable commodity by commodity ID or out of block chain network,By third party's block identifying code, the content of corresponding third party's block storage is inquired, and passes through storage in third party's blockMerchandise news, transaction data and the flowing information of unique transaction id and the storage of centre ID query information intermediate storage block memory.
By the way that third party's block is arranged, so that both parties, intermediate participant and regulator can pass through commodity IDQuickly essential information, Transaction Information and the flowing information of inquiry commodity, so that each list of the commodity in process of exchangeSide is not at island state, so that commodity transaction information is shared more abundant, and can be avoided folk prescription on chain transaction and distorts friendshipEasy information is conducive to the fidelity of guaranteeing the quality of commodity, meanwhile, when supervising to transaction, regulator can be facilitated numerous many and diverseCommodity transaction information in, quickly find required Transaction Information, be conducive to improve transaction transparency, facilitate supervision.
The third party's block identifying code and Transaction Information being sent in block chain network can be stored to raw informationIn several nodes in memory block group, and add timestamp, it is each with per family can by timestamp in the information between storeRequired Transaction Information or third party's block identifying code are found in block.
Data are handled by Hash when storing write-in, and commodity, in flow process, merchandise news is by HashHash value after reason remains unchanged, if hash value changes, may determine that commodity go wrong, and Hash processing is random lengthInput be transformed into the output of regular length by hashing algorithm, this conversion is that a kind of compression maps, it is, hashed valueSpace, which is generally much less than the space inputted, can either reduce the occupied space of data, and can be right by handling data HashData are encrypted, and data is avoided to be tampered, simultaneously as the data of identical hash value, even if filename changes, content is also agreedFixed identical, therefore, commodity, if the hash value of description merchandise news changes, may determine that commodity go out in flow processShow problem, is conducive to the inspection of commodity.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er QieIn the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matterFrom the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended powerBenefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claimsVariation is included within the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.