A kind of across chain distributed business system and method based on the development of block chainTechnical field
The present invention relates to across chain transaction technology field, in particular to a kind of across chain distributed service carried out based on block chainSystem and method.
Background technique
Traditional mode is traced there is problems, firstly, information is easy to be tampered or delete;Secondly, with regard to national modelFor enclosing, such a numbering system is also too huge, and workload is difficult to bear;It is shared can not to solve cross-platform safety for thirdThe problem of difficulty data.After introducing block chain, all circulation data are permanently stored in block chain, can not be modified, retrospectWith high credibility;Meanwhile block chain engine and the high performance network of block chain storage can support the data processing of magnanimityRequest and storage demand;Finally, the design standard of different enterprises and data system can be carried out unitized place by introducing block chainReason, simultaneously because its included opening, autonomy, can not tamper, anonymity the features such as, further reduced between enterpriseTrust cost, can more effectively integrate the information resources of Dispersed heterogeneous system.
Existing across chain technology such as Corda, Interledge realize the transfer across chain assets by notarial mode,But it is not carried out across chain contract and fairness is lower;Polkdot, COSMOS realize across chain contract by repeater, but cannotThe distributed service of more contracts under multichain is supported completely;For the technologies such as Atom Swap, WanChain, Fusion, EKT, also respectivelyIn place of from Shortcomings.Block chain is in addition to ideal money has typical case scene, and there are high time delays, throughput capacity for block chain technologyLimitation, memory capacity limitation etc. lead to industry practical landing service scene not yet.
Distributed transaction database product is when handling up for solution magnanimity connection, massive concurrent, magnanimity, is reliable and stable, lowProlong etc. what relationships trade type business scenario came into being, therefore application distribution formula is to produce in the business scenario of alliance's chain and privately owned chainThe pain spot of product solution block chain.And existing across chain technology cannot support the distributed service that contract is disposed under multichain completely.
Summary of the invention
It is an object of the invention in view of the above-mentioned drawbacks in the prior art, provide it is a kind of based on block chain carry out across chainDistributed business system supports the deployment of across chain intelligence contract, and support completely multichain, more contracts, multivariable distributionBusiness.
In order to achieve the above-mentioned object of the invention, present invention employs following technical solutions: it is a kind of based on block chain carry out acrossChain distributed business system comprising in across chain distributed service related side chain and with the side chain carry out information friendshipMutual relaying chain includes application device account on the side chain, has side chain variable in application device account, on the relaying chainIt is deployed with relaying chain contract, for receiving and handling various intelligent contracts;
Across the chain distributed business system further includes participating in object, and the participation object includes application device, Yong HujiePoint, monitoring node and execution node;
The application device and user node are the direct participant of business, and the state for participating in the relaying chain and side chain changesBecome, the application device is the provider of the side chain;
The state of side chain variable described in the monitoring monitoring nodes changes, and is packaged the state and changes as the relayingThe input of chain contract drives execution and the state transition of the relaying chain contract;
The implementing result of chain contract is relayed described in the execution monitoring nodes, and is packaged the implementing result as the sideThe input of chain drives the execution of the side chain to export final result.
In addition, the technical program further includes following attached technical scheme:
It is mapped in the relaying chain contract and the consistent relaying chain variable of the side chain variable.
Include the input of the relaying chain contract in the relaying chain contract, export, jump condition and dbjective state,The condition that jumps is to complete the condition across chain distributed service, and the input is the item that condition execution is jumped described in drivingPart, the output jump after condition has executed as a result, the dbjective state is the final demand of the user node to be described.
It further include event processing mechanism in the relaying chain contract, the event processing mechanism includes guarantee fund's mechanism, instituteIt states guarantee fund's mechanism and provides that the object needs to mortgage in the relaying chain contract when participating in across the chain distributed serviceCertain token is as guarantee fund.
The event processing mechanism further includes having Filtering system, penalty mechanism and incentive mechanism, and the Filtering system is usedIn filter out satisfactory monitoring node and execute node;The penalty mechanism and incentive mechanism are used for the participation objectCarry out corresponding rewards and punishments.
The relaying chain contract further includes arbitration mechanism, and the arbitration mechanism includes arbitration contract, and the arbitration contract is usedThe inspection when application device or user node have objection to the input for the relaying chain contract that the monitoring node is sent is graspedMake.
Across the chain distributed business system further includes controlled variable management system, and the application device can be in corresponding side chainOn establish the controlled variable management system, the application device can be assigned modification authority by the controlled variable management systemGive other agent nodes.
In order to achieve the above-mentioned object of the invention, the present invention additionally uses following technical solution: it is a kind of based on block chain carry outAcross chain distributed service method, the participation object across chain distributed service include application device, user node, monitoring node andNode is executed, the application device provides related side chain, includes application device account on side chain, deposits in application device accountThere are side chain variable, user node and application device creation relaying chain, and drafts the relaying chain contract being deployed on relaying chain;
Across the chain distributed service method the following steps are included:
Step 1: opening relaying chain contract, satisfactory monitoring node is added and executes node, relays and is reflected in chain contractIt has penetrated and the consistent relaying chain variable of side chain variable;
Step 2: the state of monitoring monitoring nodes side chain variable changes, and when state changes, monitoring node changes stateInput relaying chain contract, and require to change the state of relaying chain variable;
Step 3: when the state satisfaction for relaying chain variable jumps condition, relaying chain contract is jumped, and exports implementing result;
Step 4: executing monitoring nodes implementing result, after implementing result meets dbjective state, knot will be executed by executing nodeFruit inputs side chain and changes corresponding side chain variable, exports final result, closes relaying chain contract.
In addition, the technical program further includes following attached technical scheme:
Step 2 specific steps are as follows: the relaying chain contract provides that the monitoring node meets thresholding, when monitoring nodeWhen meeting thresholding, change the state of synchronous change relaying chain variable according to the state of side chain variable, makes the state for relaying chain variableWith the state consistency of side chain variable.
The relaying chain contract includes arbitration mechanism and arbitration term of validity, includes that arbitration is closed in the arbitration mechanismAbout, within arbitration term of validity, if application device or user node monitoring node is sent to relaying chain contract it is any defeatedWhen entering to have objection, relevant information is inputted into arbitration contract, final result is determined by arbitration mechanism.
The relaying chain contract includes penalty mechanism, if the final result shows monitoring, node is wrong, according to describedPenalty mechanism punishes the monitoring node.
Relaying chain contract further includes incentive mechanism, is more than after arbitration validity period, relaying chain contract is by incentive mechanism to answeringDisbursement and sattlement is carried out with mechanism and user node.
Relaying chain contract further includes contract term of validity, is more than contract term of validity, and relaying chain contract can be automatically closed, ifThe implementing result of relaying chain contract output does not meet dbjective state, will investigate the corresponding overdue responsibility for participating in object, holdsRow penalty mechanism.
In across chain distributed service, application device can establish controlled variable management system on side chain, by modification authorityOther agent nodes are assigned, the application device possesses external account and contract account, and specific authorisation step includes:
A: judge whether contract account is authorization initiator, if then continuing to authorize;If not then refusing to authorize, awardPower terminates;
B: application device often disposes a contract on side chain, and the address of contract is just indexed to controlled variable management systemIn;
C: the modification that application device obtains contract address, contract variable, agent node, agent rule and agent nodeAuthorization-duration is input in controlled variable management system;
D: authorization is then executed.
Compared with the prior art, the invention has the advantages that: it is of the invention based on block chain carry out across chain distributed serviceSystem and method supports the deployment of across chain intelligence contract, and support completely multichain, more contracts, multivariable distributed service,So that the intelligent contract of across chain deployment becomes possibility, an intelligent contract can execute different on multiple and different block chainsPart is perhaps all finished or all retracts the state before executing, imparts the great imagination of across chain cooperation, acrossChain distributed service will substantially expand the application scenarios of block chain.
Detailed description of the invention
Fig. 1 is that the present invention is based on the structural schematic diagrams across chain distributed business system that block chain is carried out.
Fig. 2 is the structural schematic diagram of controlled variable management system in the present invention.
Fig. 3 is that the present invention is based on across the chain distributed service method flow diagrams that block chain is carried out.
Fig. 4 is that incentive mechanism carries out disbursement and sattlement flow chart in the present invention.
Fig. 5 is controlled variable management system authorization flow figure in the present invention
Fig. 6 is the system structure diagram of embodiment one in the present invention.
Fig. 7 is the Claims Resolution flow chart of embodiment one in the present invention.
Specific embodiment
In conjunction with the preferred embodiment and its attached drawing is further non-limitingly described in detail technical solution of the present invention.
As shown in Figure 1, a kind of across chain distributed business system carried out based on block chain, coordinates k user in k side chainBetween occurrence and distribution formula business, in the present embodiment arrange k side chain be defined as Ci (i=1,2 ..., k), relaying chain be defined asR.Across chain distributed business system is included in related side chain in across chain distributed service and carries out information exchange with side chainRelaying chain, include application device account on side chain, have side chain variable in application device account, side chain variable is user in sideUser information on chain.Application device possesses corresponding relaying chain application device account on relaying chain.It is deployed on relaying chainChain contract is relayed, for receiving and handling various intelligent contracts, relays and is mapped with and the consistent relaying of side chain variable in chain contractChain variable.
Across chain distributed business system further includes participating in the participation object across chain distributed service, and participating in object includes applicationMechanism, user node, monitoring node and execution node;
Application device and user node are the direct participant of business, and the state for participating in relaying chain and side chain changes, userNode definition is USERi (i=1,2 ..., k), and user node possesses corresponding side in distributed service on related side chainChain account is defined as USERi (Cj)(0≤j≤k).User node possesses corresponding relaying chain user account in relaying chain, fixedJustice is USERi (R).Application device is the provider of side chain.
The state for monitoring monitoring nodes side chain variable changes, and is packaged state and changes as the input for relaying chain contract, drivesThe execution of dynamic relaying chain contract and state transition, monitoring node meets (n, k) thresholding, i.e., for n monitoring node, only needsWherein k monitoring node agrees to transaction, then can change relaying chain variable;
The implementing result of monitoring nodes relaying chain contract is executed, and is packaged input of the implementing result as side chain, driving sideChain executes output final result, executes node and meets (n, k) thresholding, i.e., for n execution node, only needs k thereinIt executes node to agree to, then can execute business.
The specific value of n and k in (n, k) thresholding be with relaying chain contract foundation, what user node was decided through consultation jointly,Wherein k≤n.
Relaying chain contract follows atomicity principle, and side chain variable and the state for relaying chain variable change or according to relaying chainsContract changes to new state, or is all retracted into reset condition.
Include the input for relaying chain contract in relaying chain contract, export, jump condition and dbjective state, inputs to driveThe dynamic condition for jumping condition execution exports to jump after condition has executed as a result, jumping condition is to complete across chain distribution industryThe condition of business, dbjective state are the final demand of user node.
It further include event processing mechanism in relaying chain contract, after business information is passed to relaying chain contract, triggering relaying chain is closedInformation judgement is about carried out, if incoming traffic information meets the condition of trigger event treatment mechanism work, by relaying chain contractThe automatic execution of relaying chain contract movement is selected according to treatment mechanism.
Event processing mechanism includes guarantee fund's mechanism, Filtering system, penalty mechanism and incentive mechanism.
Guarantee fund's mechanism given application mechanism, user node, monitoring node and execution node are participating in across chain distributionIt needs to mortgage certain token as guarantee fund in relaying chain contract when business.
Filtering system is for filtering out satisfactory monitoring node and execute node, monitoring node and executing node screeningPrinciple includes the guarantee fund's rate of filled vacancy and node stability of node credit value, node, is made before interior joint credit value finger joint pointFor the service accuracy of monitoring node or execution node;Guarantee fund's rate of filled vacancy of node refers to monitoring node or executes nodeWhether there are enough tokens as guarantee fund;Node stability refers to monitoring node or executes the continuous of node online serviceProperty.
Penalty mechanism is used for when certain application devices or user node in business or monitoring node or executes nodeFail to execute corresponding responsibility in time, or do not execute corresponding responsibility by regulation, then deduct its guarantee fund by a certain percentage, makeesRule application device or user node or monitoring node or the compensation for executing node are closed for other.
Incentive mechanism is for motivating user node to be timely completed business.Each user node is required in relaying chain in businessPrepaid services expense of a certain amount of token as monitoring node and execution node, active service expense=monitoring node are stored in contractPeriod+fixed service is executed with the guarantee fund * interest rate * relaying chain contract for executing node to take.
It further include arbitration mechanism in relaying chain contract, arbitration mechanism includes arbitration contract, arbitrates and is provided in contract simplyThe mechanism of payment authentication (SPV) realizes the arbitration to business.
It further include arbitration term of validity and contract term of validity in relaying chain contract, the execution needs for arbitrating contract are being arbitratedIn term of validity, the execution of relaying chain contract was also required within contract term of validity, if exceeding contract term of validity, relaying chain is closedAppointment is automatically closed.
Across chain distributed business system further includes controlled variable management system (as shown in Figure 2), and application device can be in side chainOn establish controlled variable management system, by this system, application device can will modify side chain by controlled variable management system and becomeThe permission of amount assigns other agent nodes.In a side chain, application device gathers around that there are two can modify the account of side chain variable.One is external account, and external account is application device account of the application device on corresponding side chain, it will be appreciated that is public key address;The other is contract account, contract account can be regarded as application device " contract of management variable modification authority " on corresponding side chainAddress, application device can by contract account by modify side chain variable permission be given to other agent nodes.The systemThe right to use only return application device all.
As shown in figure 3, a kind of across chain distributed service method carried out based on block chain, across chain distributed service participation pairAs including user node, monitoring node and execution node.
Application device provides related side chain, includes application device account on side chain, has side in application device accountChain variable;
User node and application device creation relaying chain, and the relaying chain contract being deployed on relaying chain is drafted, using machineApplication relays chain application device account and relaying chain user account accordingly in relaying chain respectively for structure and user node, using machineStructure and user node pay earnest money and prepaid services expense to relaying chain application device account and relaying chain user account branch respectively;
Across chain distributed service method the following steps are included:
Step 1: opening relaying chain contract, satisfactory monitoring node is added and executes node, relays and is reflected in chain contractIt has penetrated and the consistent relaying chain variable of side chain variable;
Step 1-1: monitoring node and execution node need to monitor account and relaying by the corresponding relaying chain of application in relaying chainChain executes account;
Step 1-2: monitoring node and execution node are protected to relaying chain monitoring account and relaying chain execution bill payment respectivelyCard gold.
Step 2: the state of monitoring monitoring nodes side chain variable changes, and when state changes, monitoring node changes stateInput relaying chain contract, and require to change the state of relaying chain variable;
Specific steps include:
When monitoring node satisfaction (n, k) thresholding, change synchronous change relaying chain variable according to the state of side chain variableState makes to relay the state of chain variable and the state consistency of side chain variable.
Step 3: when the state satisfaction for relaying chain variable jumps condition, relaying chain contract is jumped, and exports implementing result;
Step 4: executing monitoring nodes implementing result, after implementing result meets dbjective state, knot will be executed by executing nodeFruit inputs side chain and changes corresponding side chain variable, exports final result, closes relaying chain contract.
Relaying chain contract includes penalty mechanism, incentive mechanism, arbitration mechanism and arbitration term of validity, is wrapped in arbitration mechanismInclude arbitration contract;
Within arbitration term of validity, if application device or user node appoint monitoring node to relaying chain contract transmissionWhen what input has objection, relevant information is inputted into arbitration contract and carries out SPV operation, final result, tool are determined by arbitration mechanismBody arbitration step includes:
A: external third party sends a transaction into relaying chain contract, and content is the block head of newest side chain;
B: the validity for the block head that relaying chain contract is sent based on existing block head information checking, if verification passes through,Then it is added to the build chain that side chain is safeguarded in relaying chain contract;If verification does not pass through, carried out by the arbitration contract in relaying chainSPV verifying, judging result.
C: if final result shows monitoring, node is wrong, punishes according to penalty mechanism monitoring node, specifically punishesThe step is penalized to include:
The guarantee fund in the corresponding relaying chain monitoring account of wrong monitoring node is deducted according to penalty mechanism, compensation arrives otherIt closes and advises in the corresponding relaying chain monitoring account of monitoring node, relaying chain contract monitors in account more than final guarantee fund according to relaying chainVolume returns corresponding monitoring node.
After arbitration validity period, relaying chain contract carries out expense knot to application device and user node by incentive mechanismIt calculates, specific step of settling accounts includes:
If active service expense > prepaid services are taken, chain contract is relayed according to the input of monitoring node and determines specific applicationThe delay fault of mechanism perhaps user node is deducted in its corresponding relaying chain application device account or relaying chain user accountAll prepaid services take, other relaying chain application device accounts or relay chain user account in prepaid services take it is constant,Relaying chain contract is returned to pair according to the prepaid services expense amount of money final in relaying chain application device account and relaying chain user accountThe application device and user node answered;
If active service expense < prepaid services are taken, after business is finished, relaying chain contract is automatic according to active service expenseIt executes service charge to share out the work, and corresponding application is returned on remaining service charge (prepaid services take an active service expense) former roadMechanism and user node.
Relaying chain contract further includes contract term of validity, is more than contract term of validity, and relaying chain contract can be automatically closed, ifThe implementing result of relaying chain contract output does not meet dbjective state, then all relaying chain application device accounts, relaying chain are usedFamily account, relaying chain monitoring account and relay chain execute account in guarantee fund and prepaid services take it is all constant, investigate accordinglyApplication device or user node or execute node or monitor node overdue responsibility, execute penalty mechanism, deduct pairThe relaying chain application device account or relaying chain user account or relaying chain monitoring account or relaying chain answered execute accountIn guarantee fund, relaying chain contract according to relaying chain application device account, relaying chain user account, relaying chain monitoring account andRelaying chain executes final guarantee fund and the prepaid services expense amount of money in account and returns to corresponding application device, user node, monitoringNode and execution node;
In across chain distributed service, application device can establish controlled variable management system on side chain, by modification authorityOther agent nodes are assigned, specific authorisation step includes:
A: judge whether contract account is authorization initiator, if then continuing to authorize;If not then refusing to authorize, awardPower terminates;
B: application device often disposes a contract on side chain, and the address of contract is just indexed to controlled variable management systemIn;
C: the modification that application device obtains contract address, contract variable, agent node, agent rule and agent nodeAuthorization-duration is input in controlled variable management system;
D: authorization is then executed.
After the completion of authorization, if current time within modification authority validity period, agent node can to side chain variable intoRow modification;If current time is more than modification authority validity period, agent node loses the power of amendment to side chain variable.
Embodiment one
To better understand the essence of the present invention, below with example come the technology contents that the present invention will be described in detail, but thisThe content of invention is not limited thereto.
As shown in Fig. 4 to Fig. 5, it is assumed that user User1 has unfortunately run into Accident, and policy information is public by insuranceDepartment Insurer be stored on safety chain C1, apply Claims Resolution condition be there is public security bureau Police to provide be stored in traffic chain C2On the condition of the injury diagnostic message being stored on medical chain C3 provided of forensic information and hospital Hospital.If User1 wants to manageIt pays for successfully, then the policy information on safety chain C1, the forensic information on traffic chain C2 and the condition of the injury on medical chain C3 must be diagnosedInformation, which is all put together, can just obtain Claims Resolution as a result, the result that finally also needs will to settle a claim is updated to safety chain C1 and could complete to settle a claim.
In example 1, application device is respectively insurance company Insurer, public security bureau Police and hospitalHospital;User node is user User1;Associated side chain is respectively safety chain C1, traffic chain C2 and medical chain C3;Side chain variable is respectively policy information, forensic information and condition of the injury diagnostic message;Jumping condition is the declaration form letter on safety chain C1Breath, the forensic information on traffic chain C2 and the condition of the injury diagnostic message on medical chain C3, which are all put together, can just obtain Claims Resolution result;Dbjective state is user USER1Final Claims Resolution demand.
Across chain distribution Claims Resolution operational approach the following steps are included:
S1: insurance company Insurer, public security bureau Police and hospital Hospital provide across chain distribution Claims Resolution respectivelyIt include insurance company's account Insurer on the associated safety chain C1 of business, traffic chain C2 and medical chain C3, safety chain C1(C1), there is policy information in insurance company's account Insurer (C1), includes public security bureau's account Police on traffic chain C2(C2), there is forensic information in public security bureau's account Police (C2), includes hospital's account Hospital (C3), doctor on medical chain C3There is condition of the injury diagnostic message in institute account Hospital (C3);
S2: user User1, insurance company Insurer, public security bureau Police and hospital Hospital create relaying jointlyChain, and draft the relaying chain contract being deployed on relaying chain;
S2-1: after creation relays chain, insurance company Insurer, public security bureau Police, hospital Hospital and userUser1 need to apply for corresponding relaying chain application device account and relaying chain user account in relaying chain, be respectively defined asInsurer(R),Police(R),Hospital(R),User1(R);
S2-2: insurance company Insurer, public security bureau Police, hospital Hospital and user User1 respectively toInsurer (R), Police (R), Hospital (R), User1 (R) branch pay earnest money and prepaid services expense.
S3: opening relaying chain contract, and satisfactory monitoring node is added and executes node, relays and is mapped in chain contractWith the consistent relaying chain variable of side chain variable, relaying chain variable is policy information, forensic information and condition of the injury diagnostic message;
S3-1: it need to apply for corresponding relaying chain monitoring account and relaying chain in relaying chain in monitoring node and execution nodeExecute account;
S3-2: monitoring node and execution node guarantee to relaying chain monitoring account and relaying chain execution bill payment respectivelyGold.
S4: the state of monitoring monitoring nodes policy information, forensic information and condition of the injury diagnostic message changes, and works as policy informationWhen either forensic information or condition of the injury diagnostic message state change, state is changed input relaying chain contract by monitoring node, and is wantedThe state for changing relaying chain variable is sought, when monitoring node satisfaction (n, k) thresholding, according to policy information, forensic information and woundThe state of feelings diagnostic message changes the state of policy information, forensic information and condition of the injury diagnostic message in synchronous change relaying chain.
S5: when jumping condition according to the state satisfaction of policy information, forensic information and condition of the injury diagnostic message in the middle, relayingChain contract jumps, and exports implementing result;
S6: it executes monitoring nodes implementing result and meets user User1 most after implementing result meets dbjective stateEventually after Claims Resolution demand, insurance company Insurer changes policy information by executing node and inputting implementing result on safety chain C1,Including person liable, compensate the information such as mode, compensation amount, compensation state, the final Claims Resolution result of safety chain C1 output.
Within arbitration term of validity, insurance company Insurer, public security bureau Police, hospital Hospital and userUser1 either one to monitoring node to relaying chain contract send any input have objection when, by relevant information input arbitration closeAbout, final result is determined by arbitration mechanism.
If then punishing according to penalty mechanism monitoring node the result shows that monitoring node is wrong, deducting wrong monitoringGuarantee fund in the corresponding relaying chain monitoring account of node, compensation close the corresponding relaying chain of rule monitoring node to other and monitor accountIn.
After arbitration validity period, relaying chain contract passes through incentive mechanism to insurance company Insurer, public security bureauPolice, hospital Hospital and user User1 carry out disbursement and sattlement,
More than contract term of validity, relaying chain contract can be automatically closed, if the implementing result of relaying chain contract output is notHave and meet dbjective state, then policy information state is retracted into reset condition, and investigates user User1 or insurance companyThe overdue responsibility of Insurer or public security bureau Police or hospital Hospital, executes punishment, deducts its correspondence relaying chain and answersWith the guarantee fund in institution account or relaying chain user account.
In safety chain C1, insurance company Insurer can will change declaration form letter by establishing controlled variable management systemThe permission grant of breath is settled a claim to agent node by agent node Authorization execution node permission.
Across the chain distributed business system carried out based on block chain of the invention and method support the portion of across chain intelligence contractAdministration, and support completely multichain, more contracts, multivariable distributed service so that the intelligent contract of across chain deployment becomes possibility,One intelligent contract can execute different parts on multiple and different block chains, perhaps all be finished or wholeThe state before executing is retracted, the great imagination of across chain cooperation is imparted, across chain distributed service will substantially expand block chainApplication scenarios.
It is pointed out that the technical concepts and features of above-mentioned preferred embodiment only to illustrate the invention, its object is toThose skilled in the art can understand the contents of the present invention and implements accordingly, and protection of the invention can not be limited with thisRange.Any equivalent change or modification in accordance with the spirit of the invention should be covered by the protection scope of the present invention.