Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification one or more embodiment.Phase
Instead, they are only some aspects phases with the one or more embodiments of as detailed in the attached claim, this specification
The example of consistent device and method.
It should be understood that the sequence that might not show and describe according to this specification in other embodiments executes
The step of correlation method.In some other embodiments, step included by method can than described in this specification more
It is more or less.In addition, single step described in this specification, may be broken down into other embodiments multiple steps into
Row description;And multiple steps described in this specification, it may also be merged into single step progress in other embodiments
Description.
Fig. 1 is a kind of flow chart for contract record method based on block chain that an exemplary embodiment provides.Such as Fig. 1 institute
To show, this method is applied to block chain node, it may comprise steps of:
Step 102, the contract record request that client is submitted is received, the contract record request includes contract to be recorded
Clause.
In one embodiment, client can use for contract participant (including contract provider and contract user)
Any type of electronic equipment such as mobile phone, tablet computer, smartwatch, this specification are limited not to this.Contract participates in
Side can be interacted by logging in registered account on an electronic device with the block chain link point for accessing the electronic equipment.
In one embodiment, it between contract participant after signing a contract, can be accessed by client to the client
Block chain node submit contract record request so that the contract terms signed a contract are distributed to block by block chain node
In chain.Wherein, contract participant registered in advance can obtain unique corresponding digital identity, and the digital identity is by one group of public and private key
To characterizing.Correspondingly, client can pass through the digital body corresponding to contract participant when submitting contract record request
The private key of part signs to contract record request.Corresponding digital identity is passed through by contract participant based on contract record request
Sign, after receiving contract record request, it may be verified that signature and the contract participant recorded in the contract terms it
Between consistency so that being distributed to the block chain when verifying consistent.For example, the public affairs corresponding to contract participant can be passed through
Key carries out sign test, to determine that contract record request is authorized by the contract participant, and is not pretended to be by criminal
The identity of the contract participant is sent.And when sign test does not pass through, since client first passes through registered account in advance and closes
With participant bind, show the identity for pretending to be contract participant there may be criminal, then can trigger alarm operation and it is temporary
When block client access block chain link point permission.
Step 104, the information of the old version of the contract terms is obtained.
Step 106, the information of the contract terms and the old version is distributed to block chain in association.
In one embodiment, in one case, contract participant requests the contract item of request record by contract record
Money is signed for the first time;In another case, contract participant is by the contract terms that contract record requests request to record
It is updated for old version.Therefore, the information of the old version of the contract terms can be obtained, and by the contract item
The information of money and the old version is distributed to block chain in association.For example, can be by the information of contract terms and old version
It is recorded in same transaction.Wherein, the old version may include the previous version and/or the conjunction of the contract terms
With all existing versions of clause.The information of the old version may include at least one of: the storage of old version
The transaction journal number of transaction locating for address, old version.On the one hand, contract terms are released in block chain, each block chain
Record has a complete contract terms in node, even when there is the problem of corrupted data in some node, it will not shadow
Ring whole data integrity;Meanwhile take full advantage of block chain storing data can not tamper, to prevent criminal
Malicious modification contract terms ensure that the safety of institute's contract of record clause.On the other hand, based on contract terms and old version
Information is distributed to block chain in association, then contract participant can trace to the source to the contract terms of signature, can be inquired
Contract terms, to the evolution process of subsequent each more new version, improve the effect of contract participant inquiry contract terms from initial release
Rate.
In one embodiment, contract terms can be also compared with the old version of at least one contract terms, and
Export the comparison result between the contract terms and the old version of at least one contract terms.For example, can be by comparison result
It is back to client, so that contract participant is checked.Compare knot wherein it is possible to return after issuing contract terms to be recorded
Fruit can also return to comparison result after receiving for the comparison request of current contract terms and old version;This specification
It is limited not to this.
It further, can be direct when the block chain built is configured with above-mentioned comparison and exports the function of comparison result
The function of block chain itself is called to realize between above-mentioned output contract clause and the old version of at least one contract terms
Comparison result.It is, of course, also possible to by disposing intelligent contract in block chain to realize above-mentioned comparison and output comparison result
Function, this specification limited not to this.
In one embodiment, contract participant can also submit one and contract terms phase to block chain node by client
The transaction of pass, so that block chain node executes the transaction.So, block chain node can receive the transaction (institute that client is submitted
State transaction be marked as it is related to the contract terms), and according to the contract terms determine it is described transaction whether in violation of rules and regulations, with
The transaction is executed in the case where the non-violation of transaction.Wherein, the content of the transaction may include at least one of: institute
State the executing subject of transaction, the execution content of the transaction, the transaction reference clause, the transaction the execution time.Example
Such as, block chain node can inquire the correspondence portion of contract terms in block chain according to the above content in the transaction that client is submitted
Point, to determine the transaction whether in violation of rules and regulations;If warning message can be returned to client in violation of rules and regulations, to prompt this friendship of contract participant
Easily in violation of rules and regulations, otherwise which can be distributed to block chain and execute the transaction.
Similar, when the block chain built is configured with the above-mentioned determining transaction function whether violation and execution are traded,
The function of block chain itself can be called directly to realize.It is, of course, also possible to realized by disposing intelligent contract in block chain, this
Specification is limited not to this.
It should be noted that the transaction in block chain, there are points of the transaction of narrow sense and the transaction of broad sense.The friendship of narrow sense
Easily refer to the value Transfer that user issues to block chain;For example, in traditional bit coin block chain network, transaction can be with
It is that initiate in block chain one of user transfers accounts.And the transaction of broad sense refers to that one that user issues to block chain has business
The business datum of intention;For example, operator can build alliance's chain based on actual business demand, chain portion, alliance is relied on
Affix one's name to it is some it is unrelated with value Transfer it is other types of in line service (for example, business of renting a house, vehicle scheduling business, settlement of insurance claim
Business, credit services, medical services etc.), and in this kind of alliance's chain, transaction can be one that user issues in alliance's chain
The service message or service request being intended to business.
Fig. 2 is a kind of overall architecture schematic diagram for contract record scheme that an exemplary embodiment provides.As shown in Fig. 2,
Between contract participant can on-line signing (for the first time sign or update) contract terms, and sent out by client 21 to server 22
The contract record comprising contract terms to be recorded is sent to request.Further, server 22 receive the contract record request after,
The information of the old version of the contract terms is obtained, and the information of contract terms and old version is distributed to block in association
Chain.Meanwhile the contract terms can be also compared by server 22 at least one old version, and export comparison result for
Contract participant is checked to understand the update evolution process of contract terms.
In order to make it easy to understand, the operation realized during contract record respectively below for client 21, server 22
And function, it is described in detail in conjunction with contract record scheme of the Fig. 3 to this specification.Fig. 3 is that an exemplary embodiment provides
A kind of interaction schematic diagram for realizing contract record.As shown in figure 3, the interactive process may comprise steps of:
Step 301, the foundation to binding relationship is realized between client 21 and server 22.
In one embodiment, the binding relationship of required foundation is the identity information of contract participant and the equipment of client 21
Binding relationship between information.Based on the binding relationship, so that server 22 is in the contract for receiving the subsequent transmission of client 21
When record request, it can be confirmed that contract record request corresponds to the contract participant.
For example, contract participant can carry out account registration at server 22 in advance, and it is unique right with itself to obtain
The registered account answered.Then, contract participant can be by logging in the registered account in client 21, and server 22
Based on the log-on message of the registered account in client 21, the registered account (corresponding to contract participant) and visitor are determined
Binding relationship is established between family end 21.
Step 302, client 21 signs to contract terms to be recorded.
In one embodiment, it between contract participant after signing a contract, can be submitted by client 21 to server 22
Contract record request, so that the contract terms signed a contract are distributed in block chain by server 22.Wherein, contract participates in
Side registered in advance can obtain unique corresponding digital identity, which is characterized by one group of public private key pair.Correspondingly,
Client 21, can after getting the contract terms of contract participant input and receiving for the submission request of the contract terms
Generate contract record request (including the contract terms) and by the private key of the digital identity corresponding to contract participant to contract
Record request is signed.
Step 303, client 21 submits contract record request to server 22.
Step 304, the verifying of server 22 signature.
In one embodiment, the client for having block chain is run on server 22, so that the server 22 is configured as one
Block chain node.After receiving contract record request, the binding relationship that can be established based on above-mentioned steps 301 is determined server 22
The identity of contract participant out, so that sign test is carried out by the public key for corresponding to contract participant, to determine that the contract record is asked
It asks and is authorized by the contract participant, and not pretend to be the identity of the contract participant to send by criminal.
In one embodiment, when sign test does not pass through, since client first passes through registered account and contract participant in advance
Binding, shows the identity for pretending to be contract participant there may be criminal, operates then can trigger alarm and temporarily blocks visitor
Family terminates the permission into block chain node.
Step 305, server 22 obtains the information of the old version of contract terms to be recorded.
Step 306, contract terms and the information of old version are distributed to block chain by server 22 in association.
In one embodiment, it may be to sign for the first time that contract participant, which requests the contract terms of request record by contract record,
Administration, it is also possible to be updated for old version.Therefore, the information of the old version of contract terms can be obtained, and will
Contract terms and the information of the old version are distributed to block chain in association.For example, can be by contract terms and old version
Information is recorded in same transaction.Wherein, which can be the previous version of contract terms and/or all existing
Version, and the information of old version may include the transaction journal number of the storage address of old version, transaction locating for old version
Deng.On the one hand, contract terms are released in block chain, and record has a complete contract item in each block chain node
Money will not influence whole data integrity even when the problem of corrupted data occurs in some node;Meanwhile it is sufficiently sharp
With block chain storing data can not tamper to prevent criminal's malicious modification contract terms ensure that and recorded
The safety of contract terms.On the other hand, the information based on contract terms and old version is distributed to block chain in association, that
Contract participant can trace to the source to the contract terms of signature, can inquire contract terms from initial release to it is subsequent it is each more
The evolution process of new version improves the efficiency of contract participant inquiry contract terms.
For example, the structure of block chain is as shown in Figure 4 A, and the block head of each block includes " version number, a upper block
Cryptographic Hash, Merkle root node and timestamp ";Block body includes " record data ".Wherein, the data model of " record data "
As shown in Figure 4 B, " record data " include the information and contract terms of old version.Therefore, server 22 is after sign test passes through,
The information of old version and contract terms can be recorded in " the record data " of same block.
Step 307, contract terms are compared by server 22 with the old version of at least one contract terms.
Step 308, server 22 exports comparison result to client 21.
In one embodiment, server 22 can after contract terms and old version are associatedly distributed to block chain, into
One step compares the old version of the contract terms and at least one contract terms (for example, the previous version with the contract terms
Compare;For another example, with all existing edition comparisons of the contract terms), and to client 21 export comparison result, for using
The contract participant of client 21 is checked.
In one embodiment, server 22 can received for the contract terms and the contract terms currently recorded
After the comparison request (can be sent by contract participant using client 21) of old version, then compares the contract terms and asked with comparison
The old version of instruction is sought, and exports comparison result to client 21, for using the contract participant of client 21 to check.
In one embodiment, the contract terms of more each version be can configure when building block chain and knot is compared in output
The function of fruit, then server 22 can execute above-mentioned steps 307-308 by the function of configuring.Alternatively, may call upon portion
The intelligent contract (for the contract terms of more each version, and output comparison result) of block chain is deployed on to execute above-mentioned step
Rapid 307-308, this specification are limited not to this.
For example, it is assumed that the contract terms of previous version are " internal structure and finishing that Party B must not change house ",
And the contract terms of more new version are that " if you need to change the internal structure and finishing in house, need to first obtain Party A's written consent, and take
It is taken care of oneself with by Party B ".So, client 21 can be used to submit contract record request, server to server 22 for contract participant
After receiving contract record request, (sign test is after) is (preceding by the information of the contract terms of more new version and previous version
The locating transaction journal number traded of the storage address and previous version of one version contract terms) it is distributed to block chain, and pass through
Intelligent contract or the function of block chain itself configuration are by the comparison result (example of the more new version of contract terms and previous version
Such as, comparison result is that " condition of the internal structure and finishing that change house is written same by not allowing to be updated to obtain Party A
Meaning ") output is to client 21, so that contract participant is checked.
Step 309, client 21 submits transaction relevant to the contract terms to server 22.
In one embodiment, the content of transaction may include transaction executing subject, transaction executions content, trade draw
With clause, the information such as execution time of transaction.
Step 310, in violation of rules and regulations whether server 22 determine submitted transaction according to the contract terms for being published on block chain.
Step 311, server 22 executes the transaction in the case where transaction that client 21 is submitted non-violation.
In one embodiment, server can be determined according to the content for the contract terms and transaction that above-mentioned steps 306 are issued
Whether the transaction violates the relevant regulations of the contract terms.If the transaction is in violation of rules and regulations, warning message can be returned to client to mention
Show this transaction violation of contract participant, otherwise which can be distributed to block chain and execute the transaction.And executing the friendship
Yi Shi is similar to above-mentioned steps 307-308, and the function of block chain itself configuration can be used to realize, can also pass through calling intelligence
Contract (for executing the transaction of client submission) Lai Shixian, this specification are limited not to this.
Fig. 5 is a kind of structural schematic diagram for equipment that an exemplary embodiment provides.Referring to FIG. 5, in hardware view, it should
Equipment includes processor 502, internal bus 504, network interface 506, memory 508 and nonvolatile memory 510, is gone back certainly
It may include hardware required for other business.Processor 502 reads corresponding computer journey from nonvolatile memory 510
Then sequence is run into memory 508, the contract record device based on block chain is formed on logic level.Certainly, in addition to software
Except implementation, this specification one or more embodiment is not precluded other implementations, such as logical device or soft
Mode of combination of hardware etc., that is to say, that the executing subject of following process flow is not limited to each logic unit, can also
To be hardware or logical device.
Referring to FIG. 6, being somebody's turn to do the contract record device based on block chain may include: in Software Implementation
Request reception unit 61 receives the contract record request that client is submitted, and the contract record request is comprising wait remember
The contract terms of record;
Acquiring unit 62 obtains the information of the old version of the contract terms;
The information of the contract terms and the old version is distributed to block chain by release unit 63 in association.
Optionally, the contract record request is signed by contract participant by corresponding digital identity;The dress
It sets further include:
Authentication unit 64 verifies the consistency between the contract participant recorded in signature and the contract terms, so that
The block chain is distributed to when must verify consistent.
Optionally, further includes:
Transaction acceptance unit 65, receives the transaction that client is submitted, and the transaction is marked as and the contract terms phase
It closes;
Whether in violation of rules and regulations determination unit 66 determines the transaction according to the contract terms, in the non-violation of transaction
In the case of execute the transaction.
Optionally, the content of the transaction includes at least one of: the executing subject of the transaction, the transaction are held
Row content, the transaction reference clause, the transaction the execution time.
Optionally, the information of the old version includes at least one of: the storage address of old version, old version
The transaction journal number of locating transaction.
Optionally, the old version includes the previous version of the contract terms and/or owning for the contract terms
Existing version.
Optionally, further includes:
Output unit 67 exports the contract terms compared between the old version of at least one contract terms
As a result.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
In a typical configuration, computer includes one or more processors (CPU), input/output interface, network
Interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, based on graphene
Storage medium or other magnetic storage devices or any other non-transmission medium, can be used for storing can be accessed by a computing device
Information.As defined in this article, computer-readable medium does not include temporary computer readable media (transitory media),
Such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
The term that this specification one or more embodiment uses be only merely for for the purpose of describing particular embodiments, and
It is not intended to be limiting this specification one or more embodiment.In this specification one or more embodiment and the appended claims
Used in the "an" of singular, " described " and "the" be also intended to including most forms, unless context understands earth's surface
Show other meanings.It is also understood that term "and/or" used herein refers to and includes one or more associated list
Any or all of project may combine.
It will be appreciated that though this specification one or more embodiment may using term first, second, third, etc. come
Various information are described, but these information should not necessarily be limited by these terms.These terms are only used to same type of information area each other
It separates.For example, the first information can also be referred to as in the case where not departing from this specification one or more scope of embodiments
Two information, similarly, the second information can also be referred to as the first information.Depending on context, word as used in this is " such as
Fruit " can be construed to " ... when " or " when ... " or " in response to determination ".
The foregoing is merely the preferred embodiments of this specification one or more embodiment, not to limit this theory
Bright book one or more embodiment, all within the spirit and principle of this specification one or more embodiment, that is done is any
Modification, equivalent replacement, improvement etc. should be included within the scope of the protection of this specification one or more embodiment.