Invention content
The purpose of the present invention is to provide the method and devices merchandised on a kind of block chain, it is intended to solve the friendship on block chain
The problem of easy to operate cumbersome, overhead is big.
To achieve the above object, the present invention provides a kind of method merchandised on block chain, the side to merchandise on the block chain
Method includes:
S1, after certificate revocation list is published on block chain by certificate authority, the block chain synchronizes the card
Book revocation list to the block chain each node;
S2 after the intelligent contract on the node receives the transaction request for carrying parameter transaction, accesses the block
Permission on chain revokes system, and the certificate revocation revoked based on the permission on system, the parameter transaction and the node is clear
The permission of transaction request described in single pair is verified, according to transaction request described in verification result response or refusal respond.
Preferably, the step S2 includes:
S21 revokes system by the permission and the parameter transaction is parsed;
S22 when parsing obtains certificate information and certificate authority, analyzes the certificate information and whether belongs to the certificate and hang
The certificate revocation information in inventory is sold, is verified with the permission to the transaction request;
S23, if the certificate information belongs to the certificate revocation information in the certificate revocation list, refusal respond institute
State transaction request;
S24 if the certificate information belongs to the non-certificate revocation information in the certificate revocation list, responds the friendship
Easily request.
Preferably, also record has whether the corresponding each fraction limit of non-certificate revocation information is hung in the certificate revocation list
The information of pin, then the step S24 further include:
S241, will the corresponding each fraction limit of non-certificate revocation information respectively with respectively not revoking card in the certificate revocation list
Letter ceases corresponding certificate authority and is compared;
S242 if there is fraction limit not to be revoked, responds the transaction request;
S243, if each fraction limit is revoked, transaction request described in refusal respond.
Preferably, it after the step S21, further includes:
If the certificate authority, transaction request described in refusal respond are not obtained after parsing.
To achieve the above object, it the present invention also provides the device merchandised on a kind of block chain, merchandises on the block chain
Device includes:
Synchronization module, for working as after certificate revocation list is published on block chain by certificate authority, the block chain
The certificate revocation list is synchronized to each node of the block chain;
Transaction modules after the intelligent contract for working as on the node receives the transaction request for carrying parameter transaction, are visited
It asks that the permission on the block chain revokes system, is revoked on system, the parameter transaction and the node based on the permission
Certificate revocation list verifies the permission of the transaction request, is asked according to transaction described in verification result response or refusal respond
It asks.
Preferably, the transaction modules include:
Access unit parses the parameter transaction for revoking system by the permission;
Authentication unit, for when parsing obtains certificate information and certificate authority, analyzing whether the certificate information belongs to
Certificate revocation information in the certificate revocation list, is verified with the permission to the transaction request;
First processing units, if belonging to the letter of certificate revocation in the certificate revocation list for the certificate information
It ceases, then transaction request described in refusal respond;
Second processing unit, if belonging to the non-certificate revocation letter in the certificate revocation list for the certificate information
Breath, then respond the transaction request.
Preferably, also record has whether the corresponding each fraction limit of non-certificate revocation information is hung in the certificate revocation list
The information of pin, the second processing unit further include:
Comparison subunit, for will the corresponding each fraction limit of non-certificate revocation information respectively in the certificate revocation list
Respectively the corresponding certificate authority of non-certificate revocation information is compared;
Third handles subelement, if for there is fraction limit not to be revoked, responds the transaction request;
Fourth process subelement, if being revoked for each fraction limit, transaction request described in refusal respond.
Preferably, the transaction modules further comprise:5th processing unit, if for not obtaining the certificate after parsing
Permission, then transaction request described in refusal respond.
The beneficial effects of the invention are as follows:After the certificate revocation list of the present invention is published to block chain, block chain is synchronized
To each node of block chain, i.e., certificate revocation list is stored directly on block chain, is asked when intelligent contract receives transaction
When asking, can certificate revocation list be directly obtained in real time on block chain, system, transaction request are revoked according to the permission accessed
The parameter transaction of middle carrying verifies the permission of the transaction request with certificate revocation list, does not need to be believable by one
Mechanism inquires the permission of transaction from CA so that transactional operation is simple and efficient, mitigates overhead.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and
It is non-to be used to limit the scope of the present invention.
As shown in FIG. 1, FIG. 1 is the flow diagram of one embodiment of method merchandised on block chain of the present invention, the block chains
The method of upper transaction includes the following steps:
Step S1, after certificate revocation list is published on block chain by certificate authority, the block chain synchronizes institute
Certificate revocation list is stated to each node of the block chain;
Block chain (Blockchain) be by a string using cryptography methods generate data chunk into, each block
The cryptographic Hash (hash) of a block is contained, current block, shape are initially connected to from original block (genesis block)
Blocking chain.Block chain is also the distributed data base system participated in by node, is substantially the database account of a decentralization
This, records all transaction records, by taking the block chain of bit coin as an example, each person of participating in business is the section of block network
Point, each node have a complete public account book backup, have recite transaction letter all since bit coin is born above
Breath.Any one node initiates trading activity and is required for each node being transmitted to relevant information in block network, so as to
Account book on all nodes can verify this transaction behavior and accurately update.In addition, account book is blockette storage, with
The increase of transaction, new data block can be attached on already present chain, form chain structure.
After certificate revocation list is published on block chain by certificate authority, block chain can utilize the equity of itself
Certificate revocation list is synchronized on each node of block chain by (Peer-to-peer, P2P) network and common recognition algorithm, will be demonstrate,proved
Book revocation list is propagated on each node of block chain.Wherein, it preserves in certificate revocation list and is hung by certificate authority
Each information of certificate revocation of pin and the non-certificate revocation information not being revoked, if certificate information has been revoked, do not have
It has permission and performs corresponding intelligent contract, i.e., no permission is traded, if certificate information is not revoked, i.e., certificate revocation is clear
There is no the certificate information in list, then have permission and perform corresponding intelligent contract, that is, have permission and be traded.
In addition, the information of certificate revocation in certificate revocation list may change, at this point, certificate authority meeting
Publication one carries updated certificate revocation list to block chain, and the certificate revocation list of storage is replaced with update by block chain again
Certificate revocation list or the certificate revocation list according to the change storage of updated certificate revocation list afterwards.
Step S2, after the intelligent contract on the node receives the transaction request for carrying parameter transaction, described in access
Permission on block chain revokes system, revokes the certificate on system, the parameter transaction and the node based on the permission and hangs
Pin inventory verifies the permission of the transaction request, according to transaction request described in verification result response or refusal respond.
In the present embodiment, intelligent contract that each node on block chain can be on storage running block chain, an intelligence
Contract is a set of promise (promises) defined in digital form, these promises can be performed above including contract participant
Agreement.When the transaction request that one carries parameter transaction is passed on the node of block chain, this parameter transaction can be recorded
Intelligent contract corresponding with the parameter transaction is transmitted on to the corresponding transaction journal of the node and simultaneously to go to run, and by the transaction
Code on the corresponding intelligent contract of parameter is updated the data of intelligent contract.
Wherein, parameter transaction includes certificate information and corresponding certificate authority, and certificate information includes certification authority, card
Preface row number, validity period of certificate, certificate holder user information etc..
After the intelligent contract on node receives the transaction request for carrying parameter transaction, by accessing the power on block chain
Limit revokes system to obtain certificate information and the corresponding certificate authority in parameter transaction, but it is possible that there is card in the parameter transaction
Book permission is also possible to no certificate authority.Permission revokes system for handling relevant permission matters, such as permission revokes and is
System, which can perform, the parameter transaction such as parses.When the permission to transaction request is verified, if it is possible to join from transaction
Certificate information and certificate authority are got in number, then by the certificate revocation list on certificate information node corresponding with intelligent contract
In the information of certificate revocation be compared, to verify whether the certificate information is certificate revocation information, if the certificate is believed
Breath is certificate revocation information, then the transaction request lack of competence is traded, if the certificate information is not certificate revocation letter
Breath, then the transaction request, which has permission, is traded.
Compared with prior art, after the certificate revocation list of the present embodiment is published to block chain, block chain is synchronized to
Certificate revocation list, i.e., be stored directly on block chain by each node of block chain, when intelligent contract receives transaction request
When, system, transaction request can be revoked according to the permission accessed from directly certificate revocation list is obtained in real time on block chain
The parameter transaction of middle carrying verifies the permission of the transaction request with certificate revocation list, does not need to be believable by one
Mechanism inquires the permission of transaction from CA so that transactional operation is simple and efficient, mitigates overhead.
In a preferred embodiment, as shown in Fig. 2, on the basis of the embodiment of above-mentioned Fig. 1, above-mentioned steps S2 is into one
Step includes:
S21 revokes system by the permission and the parameter transaction is parsed;
S22 when parsing obtains certificate information and certificate authority, analyzes the certificate information and whether belongs to the certificate and hang
The certificate revocation information in inventory is sold, is verified with the permission to the transaction request;
S23, if the certificate information belongs to the certificate revocation information in the certificate revocation list, refusal respond institute
State transaction request;
S24 if the certificate information belongs to the non-certificate revocation information in the certificate revocation list, responds the friendship
Easily request.
In the present embodiment, if the intelligent contract for running or storing on the node of block chain, which receives, carries parameter transaction
After transaction request, the permission that can be accessed by predetermined address on the block chain chain revokes system with to the transaction request
Permission verified, specifically, access the block chain chain on permission revoke system when, by permission revoke system to transaction
Parameter is parsed, if parsing obtains certificate information but do not parse to obtain certificate authority, illustrates the transaction request lack of competence
It is traded, intelligent contract refuses the transaction request;If parsing obtains certificate information and certificate authority, further analysis is demonstrate,proved
Whether letter breath belongs to the certificate revocation information in certificate revocation list, specifically, can be by certificate information and certificate revocation
The information of certificate revocation in inventory is compared one by one, to determine whether the certificate information belongs to having revoked in revocation list
Certificate information.If certificate information belongs to the certificate revocation information in certificate revocation list, which carries out
Transaction, intelligent contract refusal respond transaction request;If certificate information is not belonging to the certificate revocation in certificate revocation list
Information, then the transaction request, which has permission, is traded, and intelligent contract responds the transaction request.
If in addition, can only parse to obtain certificate information from parameter transaction, but failing to access certificate authority after parsing,
Then also lack of competence is traded the transaction request.
The present embodiment revokes system when the permission to transaction request is verified, by accessing the permission on block chain,
System is revoked by permission to parse parameter transaction, when parsing obtains certificate information and certificate authority, passes through certificate of analysis
The information of certificate revocation whether information belongs in certificate revocation list is verified come the permission to transaction request, can improve
The rate of transaction data processing.
In a preferred embodiment, as shown in figure 3, on the basis of the embodiment of above-mentioned Fig. 2, in certificate revocation list
The information whether corresponding each fraction limit of non-certificate revocation information is revoked can also be recorded, in this embodiment, if detection
The certificate revocation information being not belonging to the certificate information in the certificate revocation list, then the step S24 can also be into
One step includes the following steps:
Step S241, will the corresponding each fraction limit of non-certificate revocation information respectively with not hung respectively in the certificate revocation list
The corresponding certificate authority of pin certificate information is compared, and determines whether the fraction limit has been revoked.If so, it enters step
Otherwise S242, performs step S243.
Step S242 responds the transaction request.
Step S243, transaction request described in refusal respond.
In the present embodiment, record has whether the corresponding each fraction limit of non-certificate revocation information is revoked in certificate revocation list
Information, that is, record the information that each fraction limit has been revoked or do not revoked.
In the present embodiment, a certificate information corresponds to multiple fraction limits, in order to enable user is revoked in part fraction limit
Afterwards, other certificate authority affairs can also be performed on block chain by certificate information, the present embodiment is in certificate revocation list
The information that whether corresponding each fraction limit is revoked under certificate information is had recorded, if certificate information is not revoked, further
It will the corresponding each fraction limit of non-certificate revocation information certificate corresponding with non-certificate revocation information each in certificate revocation list respectively
Permission is compared, if there is fraction limit not revoke, response transaction request, if each fraction limit has been revoked, refusal respond is handed over
Easily request.
As shown in figure 4, Fig. 4 is the structure diagram of one embodiment of device merchandised on block chain of the present invention, the block chain
The device of upper transaction includes:
Synchronization module 101, for working as after certificate revocation list is published on block chain by certificate authority, the block
Chain synchronizes the certificate revocation list to each node of the block chain;
Block chain (Blockchain) be by a string using cryptography methods generate data chunk into, each block
The cryptographic Hash (hash) of a block is contained, current block, shape are initially connected to from original block (genesis block)
Blocking chain.Block chain is also the distributed data base system participated in by node, is substantially the database account of a decentralization
This, records all transaction records, by taking the block chain of bit coin as an example, each person of participating in business is the section of block network
Point, each node have a complete public account book backup, have recite transaction letter all since bit coin is born above
Breath.Any one node initiates trading activity and is required for each node being transmitted to relevant information in block network, so as to
Account book on all nodes can verify this transaction behavior and accurately update.In addition, account book is blockette storage, with
The increase of transaction, new data block can be attached on already present chain, form chain structure.
After certificate revocation list is published on block chain by certificate authority, block chain can utilize the equity of itself
Certificate revocation list is synchronized on each node of block chain by (Peer-to-peer, P2P) network and common recognition algorithm, will be demonstrate,proved
Book revocation list is propagated on each node of block chain.Wherein, it preserves in certificate revocation list and is hung by certificate authority
Each information of certificate revocation of pin and the non-certificate revocation information not being revoked, if certificate information has been revoked, do not have
It has permission and performs corresponding intelligent contract, i.e., no permission is traded, if certificate information is not revoked, i.e., certificate revocation is clear
There is no the certificate information in list, then have permission and perform corresponding intelligent contract, that is, have permission and be traded.
In addition, the information of certificate revocation in certificate revocation list may change, at this point, certificate authority meeting
Publication one carries updated certificate revocation list to block chain, and the certificate revocation list of storage is replaced with update by block chain again
Certificate revocation list or the certificate revocation list according to the change storage of updated certificate revocation list afterwards.
Transaction modules 102, after the intelligent contract for working as on the node receives the transaction request for carrying parameter transaction,
The permission accessed on the block chain revokes system, is revoked on system, the parameter transaction and the node based on the permission
Certificate revocation list the permission of the transaction request is verified, according to verification result response or refusal respond described in transaction
Request.
In the present embodiment, intelligent contract that each node on block chain can be on storage running block chain, an intelligence
Contract is a set of promise (promises) defined in digital form, these promises can be performed above including contract participant
Agreement.When the transaction request that one carries parameter transaction is passed on the node of block chain, this parameter transaction can be recorded
Intelligent contract corresponding with the parameter transaction is transmitted on to the corresponding transaction journal of the node and simultaneously to go to run, and by the transaction
Code on the corresponding intelligent contract of parameter is updated the data of intelligent contract.
Wherein, parameter transaction includes certificate information and corresponding certificate authority, and certificate information includes certification authority, card
Preface row number, validity period of certificate, certificate holder user information etc..
After the intelligent contract on node receives the transaction request for carrying parameter transaction, by accessing the power on block chain
Limit revokes system to obtain certificate information and the corresponding certificate authority in parameter transaction, but it is possible that there is card in the parameter transaction
Book permission is also possible to no certificate authority, and permission revokes system for handling relevant permission matters, such as permission revokes and is
System, which can perform, the parameter transaction such as parses.When the permission to transaction request is verified, if it is possible to join from transaction
Certificate information and certificate authority are got in number, then by the certificate revocation list on certificate information node corresponding with intelligent contract
In the information of certificate revocation be compared, to verify whether the certificate information is certificate revocation information, if the certificate is believed
Breath is certificate revocation information, then the transaction request lack of competence is traded, if the certificate information is not certificate revocation letter
Breath, then the transaction request, which has permission, is traded.
In a preferred embodiment, on the basis of the embodiment of above-mentioned Fig. 4, above-mentioned transaction modules 102 are further wrapped
It includes:
Access unit parses the parameter transaction for revoking system by the permission;
Authentication unit, for when parsing obtains certificate information and certificate authority, analyzing whether the certificate information belongs to
Certificate revocation information in the certificate revocation list, is verified with the permission to the transaction request;
First processing units, if belonging to the letter of certificate revocation in the certificate revocation list for the certificate information
It ceases, then transaction request described in refusal respond;
Second processing unit, if belonging to the non-certificate revocation letter in the certificate revocation list for the certificate information
Breath, then respond the transaction request.
In the present embodiment, if the intelligent contract for running or storing on the node of block chain, which receives, carries parameter transaction
After transaction request, the permission that can be accessed by predetermined address on the block chain chain revokes system with to the transaction request
Permission verified, specifically, access the block chain chain on permission revoke system when, by permission revoke system to transaction
Parameter is parsed, if parsing obtains certificate information but do not parse to obtain certificate authority, illustrates the transaction request lack of competence
It is traded, intelligent contract refuses the transaction request;If parsing obtains certificate information and certificate authority, further analysis is demonstrate,proved
Whether letter breath belongs to the certificate revocation information in certificate revocation list, specifically, can be by certificate information and certificate revocation
The information of certificate revocation in inventory is compared one by one, to determine whether the certificate information belongs to having revoked in revocation list
Certificate information.If certificate information belongs to the certificate revocation information in certificate revocation list, which carries out
Transaction, intelligent contract refusal respond transaction request;If certificate information is not belonging to the certificate revocation in certificate revocation list
Information, then the transaction request, which has permission, is traded, and intelligent contract responds the transaction request.
If in addition, can only parse to obtain certificate information from parameter transaction, but failing to access certificate authority after parsing,
Then also lack of competence is traded the transaction request.
The present embodiment revokes system when the permission to transaction request is verified, by accessing the permission on block chain,
System is revoked by permission to parse parameter transaction, when parsing obtains certificate information and certificate authority, passes through certificate of analysis
The information of certificate revocation whether information belongs in certificate revocation list is verified come the permission to transaction request, can improve
The rate of transaction data processing.
In a preferred embodiment, it also records to have on the basis of the above embodiments, in certificate revocation list and not hang
The information whether corresponding each fraction limit of pin certificate information is revoked, if the certificate information belongs to non-certificate revocation information, institute
Second processing unit is stated to include:
Comparison subunit, for will the corresponding each fraction limit of non-certificate revocation information respectively in the certificate revocation list
Respectively the corresponding certificate authority of non-certificate revocation information is compared;
Third handles subelement, if for there is fraction limit not revoke, responds the transaction request;
Fourth process subelement, if having been revoked for each fraction limit, transaction request described in refusal respond.
In the present embodiment, a certificate information corresponds to multiple fraction limits, in order to enable user is revoked in part fraction limit
Afterwards, other certificate authority affairs can also be performed on block chain by certificate information, the present embodiment is in certificate revocation list
The information that whether corresponding each fraction limit is revoked under certificate information is had recorded, if certificate information is not revoked, further
It will the corresponding each fraction limit of non-certificate revocation information certificate corresponding with non-certificate revocation information each in certificate revocation list respectively
Permission is compared, if there is fraction limit not revoke, response transaction request, if each fraction limit has been revoked, refusal respond is handed over
Easily request.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.