A kind of block chain intimacy protection system and its method based on homomorphic cryptography
Technical field
The present invention relates to block chain field of communication technology more particularly to a kind of block chain secret protections based on homomorphic cryptography
System and method.
Background technique
As the influence of bit coin is continuously increased, the block chain technology as bit coin bottom core initially enters people's
The visual field.Alliance's chain be using bit coin as the publicly-owned chain of representative after, it has been proposed that a kind of new model, compared with publicly-owned chain,
Under conditions of sacrificing certain decentralization, low efficiency present in publicly-owned chain can be effectively solved the disadvantage that.
Node in alliance's chain needs to be added by authorization, has certain foundation of trust between node, general suitable
It closes under the scenes such as the financial transaction being applied between enterprise;Often there is trade secret in financial transaction between enterprise, trades
Both sides do not want the details for allowing third party to obtain transaction;But due to needing to reach common understanding in block chain network, transaction letter
Breath, which must disclose, discloses node, can thus reveal the privacy of both parties.
In order to solve the problems, such as trading information safety on block chain, domestic and foreign scholars, which propose, can use password and gains knowledge
To protect the data on block chain.
The prior art 1: " mixed coin " mechanism is referred to as using a kind of mechanism, mixed coin mechanism derives from Chaum 1981 earliest
The article delivered, the thought for mixing coin is to obscure under the premise of not changing transaction results the content of transaction, so that with friendship
Easily unrelated node cannot efficiently find outputting and inputting for a transaction.Mixed coin mechanism again there are center and non-stop layer it
Point, there is the mixed coin agreement at center mainly to have mixcoin agreement and Dash agreement, the thinking that mixcoin protocol realization mixes coin is to use
Family pays the bit coin on old public key address to mixed coin center and provides a new address, mixes coin center for the bit of equivalent
Coin returns to the new public key address of user again, by introducing mixed coin center, realizes between the original address of user and new address not
It can be associated with, but mixed coin center is possible to that privacy of user can be revealed, the node that mixed coin agreement is executed in Dash agreement is known as main section
Point, all host nodes need system to pay a certain number of cash pledges before the mixed coin agreement for executing non-stop layer, once in violation of rules and regulations
Operation cash pledge will be deducted, and solve the risk of mixed coin center leakage privacy from economics point;
The prior art 2: non-stop layerization, which mixes coin scheme, mainly coinjion agreement, its mentality of designing is different user connection
It closes and creates a bit coin transaction, the input of transaction is the original public key address of all users, exports the public key new for all users
Address, other people can not be corresponding with output address by the input address of each user, to realize can not closing for the new old address of user
Connection property.
A kind of prior art 3: transmission that novel currency can be traded by using zero-knowledge proof technology with hidden blocks chain
Side, the value of beneficiary and transaction, but the process that algorithm generates proof is very slow, needs could generate new card within 1 minute
Bright, there are bottlenecks in efficiency.
The prior art 4: a kind of novel currency, it hides the recipient of transaction by using disposable addressing technique, every time
The output address of transaction is the new address by obtaining after the public key of recipient and the random number encryption of sender's generation, is used simultaneously
Ring signatures technology hides the sender of transaction, and transaction is generated the signature of people more than one by sender every time, and the unrelated side that trades is permissible
Confirmation transaction is signed by a wherein people, but can not confirm specific signer, realizes transaction not by both the above technology
Connectivity and anonymity controlled.
The prior art 5: a kind of block chain secret protection scheme based on homomorphic cryptography uses determinacy encryption, i.e.,
It corresponds to identical ciphertext when encryption in plain text every time, may constitute a threat in the case to the privacy of user, such as two use
The account book remaining sum ciphertext at family is identical, then wherein a side knows the account balance and the account balance phase of oneself of another party at once
Together.
In conclusion current solution is not yet in effect, perfect solves the problems, such as trading information safety on block chain.
Therefore, it is necessary to provide a kind of new block chain intimacy protection system based on homomorphic cryptography and its method solves
State technical problem.
Summary of the invention
In order to solve the above technical problems, the block chain intimacy protection system and its side provided by the invention based on homomorphic cryptography
Method, specific technical solution are as follows:
A kind of block chain intimacy protection system based on homomorphic cryptography, the intimacy protection system include:
Authentication center: the authentication center is for carrying out authentication, grant a certificate, periodically verifying account book;Area
Block chain node: the block chain node is for collection transaction, verifying transaction, sequence transaction and generates block;The block chain link
Point includes pretreatment node, confirmation node and ordering joint;User: the corresponding confirmation node of a user.
Preferably, the pretreatment node is used to verify Transaction Information in advance, abandon to illegal transaction, and described
Pretreatment node includes the account book of independent certificate and record user balance ciphertext;
The confirmation node is used to legal in block and illegal transaction distinguishing label;The confirmation node includes
Independent certificate, account book, the plaintext of corresponding user balance and the plaintext of random number for recording user balance ciphertext;
Ordering joint: for the ordering joint for being ranked up to the transaction received, the ordering joint includes independent
Certificate.
Preferably, the X.509 international standard that the certificate uses, including X.509 version number, certificate serial number, signature are calculated
The identifier of method, signed by name, validity period, main body name, the digital signature of the public key of holder of certificate and publisher.
Preferably, the account book includes the database and block chain that record User Status.
Preferably, the database of the User Status includes the record of the account balance under user name and ciphertext form,
The database of the User Status further includes one of affiliated company, transaction currency type, exchange hour or a variety of.
Preferably, the block chain is to connect block one by one by way of hash function to form chain type knot
Structure;It include Transaction Information in the block.
Preferably, the method for secret protection includes:
System initialization is carried out, including, after the node in network requests certificate, authentication center to need to generate to authentication center
It is continuous to need key to be used;
User's initialization is carried out, including, authentication center assesses user, and user awards firstly the need of to authentication center
One promise, then gives user account primary balance, and the node in last block networking network has user balance record initial
Onto account book;
Customer transaction is carried out, the user balance of oneself is split into two parts first including user, a part is trade gold
Volume, another part are residual amount, guarantee that the sum of they are equal to user balance, then respectively using after Paillier algorithm for encryption
In write-in transaction motion, finally transaction motion granting in block networking network;
Carry out supervision examination, comprising:
Authentication center checks whether there is user and initiates malice transaction one period of random selection, can be in the area in account book
The transaction record for thinking verifying is found in block, whether verifying transaction is true, if invalid, it can be assumed that this transaction is malice
Transaction;Otherwise, it regards as normally trading.
Carry out account book re-encryption, comprising:
User's re-encryption request is as a kind of special deal motion;
User reasonably selects a random number, and the content that random number is requested as special deal is the private key with oneself
Ordering joint is sent to after being signed;
After ordering joint receives request, the legitimacy of signature is verified, if signature is correct, special deal is requested single
It is solely put into a new block, withouts waiting for the pretreatment node being immediately issued to after other trading signatures in block chain network
With confirmation node;
Pretreatment node and confirmation node verify the signature of block after receiving the block comprising special deal request, if closed
Method carries out in next step;Otherwise, message is abandoned;
On Message Record to block chain and updating user's account book remaining sum.
Preferably, it is described carry out system initialization operation include:
Authentication center selects the private key of oneself, generates corresponding public key, signs to oneself public key and relevant information
Generate certificate;
User selects the private key of oneself, generates corresponding public key, and identity information in public key and certificate is sent in certification
The heart;
Whether the identity information that authentication center verifies in certificate is true;
User verifies signature using authentication center's public key;
Authentication center runs the initialization algorithm of Paiilier algorithm, public key and private key is generated, public key in block link network
Broadcasted in network, private key safety it is locally stored;
Pretreatment strategy in authentication center's setting network.
Preferably, it is described carry out user's initialization operation include:
User selects random number, calculates ciphertext using the public key of authentication center first, is calculated later using the private key of oneself
Ciphertext and signature and a guarantee fund are sent to authentication center by signature;
Authentication center, first using the legitimacy of verifying signature, is then offseted using the private key of oneself after receiving message
Breath decryption obtains random number, and the user that finally application is added in block chain network assesses, and gives certain initial of user
The amount of money calculates user balance using public key and carries out the signature that signature generates authentication center, user, user balance, authentication center
Signature be sent in ordering joint;
The transaction motion received, is carried out Byzantine failure tolerance algorithm, is sequenced by the legitimacy of ordering joint verifying signature
The block of sequence carries out signature and is sent in block chain network;
The legitimacy of pretreatment node and confirmation node verification signature in block chain network, if legal, more than user
Volume is recorded on account book as the corresponding user balance ciphertext of user.
Preferably, it is described carry out customer transaction operation include:
The plaintext of the account balance of oneself is split into two parts by user, is encrypted, and generate transaction motion issue it is pre-
Handle node;
Handle each pretreatment node for receiving transaction motion;
After user receives the pretreated transaction motion that pretreatment node returns, the processing of transaction request is carried out;
Ordering joint receives transaction request data set;
Confirm that node receives the block in network.
Compared with the relevant technologies, the block chain intimacy protection system and its method provided by the invention based on homomorphic cryptography
It has the following beneficial effects:
Effect 1: Transaction Information confidentiality may be implemented in block chain secret protection scheme.
Effect 2: block chain secret protection scheme can guarantee that Transaction Information can not be distorted.
Effect 3: block chain secret protection scheme can guarantee legitimacy of trading.
Effect 4: the re-encryption function in block chain secret protection scheme is safe.
Effect 5: classifying to the node in block chain network, and transaction is submitted to be carried out on confirmation node, and transaction executes
It is carried out on pretreatment node and confirmation node, the process reached common understanding carries out in ordering joint, realizes solution functionally
Coupling enhances the concurrency of transaction;The efficiency of selection more preferably Byzantine failure tolerance algorithm on common recognition algorithm, improves the effect of scheme
Rate.
Effect 6: can be applied in the financial business across company, and certification node can be served as by financial regulator
Role, each company serve as the role of confirmation node, may be implemented only have financial regulator and transaction double for a transaction
Side understands details, and the legitimacy that other companies are able to validate only transaction does not know the specifying information traded, finance activities
It can carry out safely and efficiently.
Detailed description of the invention
Fig. 1 is the system model figure of the block chain intimacy protection system provided by the invention based on homomorphic cryptography;
Fig. 2 is account book exemplary diagram provided by the invention.
Specific embodiment
The invention will be further described with embodiment with reference to the accompanying drawing.
The system model of as shown in FIG. 1, FIG. 1 is the provided by the invention block chain intimacy protection system based on homomorphic cryptography
Figure;
Authentication center: the authentication center is for carrying out authentication, grant a certificate, periodically verifying account book;
Top priority is to be authenticated, i.e., carries out authentication before network is added in node, only after through verifying
Allow node to be added in network, is node grant a certificate after node is added to network;Secondary task be periodically to account book into
Row is verified, and illegal transaction is prevented.
Block chain node: the block chain node is for collection transaction, verifying transaction, sequence transaction and generates block;Institute
Stating block chain node includes pretreatment node, confirmation node and ordering joint;
1, pretreatment node abandons illegal transaction, reduces illegal for verifying Transaction Information in advance
Transaction flow enters network, improves system effectiveness, and the certificate and record user balance on each pretreatment node with oneself are close
The account book of text;2, confirmation node is used to confirm transaction legitimacy, and legal in block and illegal transaction is distinguished label, is
The node of guarantee system safety;Each confirmation node has the certificate of oneself, records the account book of user balance ciphertext, corresponding use
The plaintext of family remaining sum and the plaintext of random number;3, ordering joint: being ranked up the transaction received, guarantees transaction in system
Consistency prevents honeysuckle from attacking, with the certificate of oneself in each ordering joint;
Above-mentioned certificate is using X.509 international standard, mainly includes following data:
X.509 version number: identifying the version of the certificate, and different editions certificate includes that content is different:
Certificate serial number: authentication center's certificate assigned serial number is different from other certificates of the entity granting;
The identifier of signature algorithm: authentication center's label write algorithm used when certificate for identification;
Signed by name: label write the X.500 name of the entity of frame number;
Validity period: having recorded the certificate certificate effective period, and the integer beyond the date is considered invalid;
Main body name: certificate can identify its physical name;
The public key of holder of certificate: the public key for the person of being certified is had recorded;
The digital signature of publisher: authentication center is to be signed with the private key of oneself to certificate.
User: the corresponding confirmation node of a user;
User is the individual participated in network, and a confirmation node corresponds to a user, is stored on confirmation node
The plaintext of the account balance of user and the plaintext of random number on it.
As shown in Fig. 2, Fig. 2 is in account book exemplary diagram provided by the invention;
Account book is made of the database and block chain that record User Status;User Status database needs to record user name
And the account balance under ciphertext form, in addition to this it is possible to have some optional record entries, such as affiliated company, transaction
Currency type, exchange hour etc.;Transaction Information is had recorded in block, block is connected by way of hash function one by one, shape
At chain structure, there is the characteristic that can not be distorted.It will do it verifying when user receives the new block in network, if tested
After new block by being just linked to the last one existing block by card, and user is updated according to the Transaction Information in new block
Slip condition database.
A kind of block chain method for secret protection based on homomorphic cryptography, the method for secret protection include:
Carry out system initialization, comprising: authentication center selects the private key of oneself, generates corresponding public key, to the public affairs of oneself
Key and relevant information carry out signature and generate certificate;User selects the private key of oneself, corresponding public key is generated, in public key and certificate
Identity information is sent to authentication center;Whether the identity information that authentication center verifies in certificate is true;User uses authentication center
Public key verifies signature;Authentication center runs the initialization algorithm of Paiilier algorithm, public key and private key is generated, public key
Broadcasted in block chain network, private key safety it is locally stored;Pretreatment strategy in authentication center's setting network.
User's initialization is carried out, including,
User selects random number, calculates ciphertext using the public key of authentication center first, is calculated later using the private key of oneself
Ciphertext and signature and a guarantee fund are sent to authentication center by signature;Authentication center is after receiving message, first using testing
The legitimacy of signed certificate name then decrypts message using the private key of oneself to obtain random number, and block link network finally is added to application
User in network assesses, and gives the certain initial amount of money of user, is calculated user balance using public key and sign generating and recognized
The signature at card center is sent to the signature of user, user balance, authentication center in ordering joint;Ordering joint verifying signature
Legitimacy, the transaction motion that receives is carried out Byzantine failure tolerance algorithm, obtains sorted block and carry out signature being sent to area
In block chain network;The legitimacy of pretreatment node and confirmation node verification signature in block chain network, if legal, user
Remaining sum is recorded on account book as the corresponding user balance ciphertext of user.
Customer transaction is carried out, including, the plaintext of the account balance of oneself is split into two parts by user, it is encrypted, and
It generates transaction motion and issues pretreatment node;Handle each pretreatment node for receiving transaction motion;User receives pre- place
After managing the pretreated transaction motion that node returns, the processing of transaction request is carried out;Ordering joint receives transaction request data
Collection;Confirm that node receives the block in network.
Carry out supervision examination, comprising:
Authentication center checks whether there is user and initiates malice transaction one period of random selection, can be in the area in account book
The transaction record for thinking verifying is found in block, whether verifying transaction is true, if invalid, it can be assumed that this transaction is malice
Transaction;Otherwise, it regards as normally trading.
Carry out account book re-encryption, comprising:
User's re-encryption request is as a kind of special deal motion;User reasonably selects a random number, and random number is made
It is to be sent to ordering joint after being signed with the private key of oneself for the content of special deal request;Ordering joint receives request
Afterwards, the legitimacy of signature is verified, if signature is correct, special deal request is individually put into a new block, no
It needs to wait the pretreatment node being immediately issued in block chain network after other trading signatures and confirms node;Pre-process node and
Confirmation node receives the signature of verifying block after the block comprising special deal request, if legal, carries out in next step;Otherwise,
Abandon message;On Message Record to block chain and updating user's account book remaining sum.
Above-mentioned block chain secret protection scheme is in the specific implementation:
Illustratively, authentication center is true and reliable, and authentication authorization and accounting center, which can be verified, participates in block chain network interior joint
True identity, and provide correct certificate to them;Node in network is honest and curiosity, i.e., node can be responded correctly
Request, but oneself interested information can be obtained as far as possible to the transaction of processing.
Signature algorithm is signature algorithm, and common parameter is (p, g), is defined first to symbol used in the present embodiment
And explanation:
PKCA: the public key of authentication center;
SKCA: the private key of authentication center;
PKi: the public key of user i;
SKi: the private key of user i;
The public key of PK:Paiilier algorithm;
The private key of SK:Paiilier algorithm;
Yi: the user balance of user i under ciphertext form;
Xi: the account balance of user i under plaintext version;
Ri: the corresponding random number of the user balance of user i;
H256(): the SHA256 algorithm that the present embodiment uses;
Certi: the certificate of user or authentication center;
σi: the signature of user or authentication center.
Each function in system is described below:
1, system initialization
1.1 authentication centers select the private key SK of oneselfCA, generate corresponding public key PKCA, to oneself public key and related letter
Breath carries out signature and generates certificate CertCA, later Digital signature service can be provided for other users.
1.2, user selects the private key SK of oneselfi, generate corresponding public key PKi, identity information msg in public key and certificate
It is sent to authentication center.
1.3, whether the identity information in authentication center's verifying certificate is true, and the private key SK of oneself is used if correctCA
Signature is carried out to the information of user and generates certificate Certi=(PKi,msg,σCA), wherein
Certificate is sent to user.
1.4, user uses authentication center's public key PKCASignature is verified, if Verify (σCA,PKCA)=1, explanation
It is to be signed by correct authentication center, certificate is stored in local later.
1.5, the initialization algorithm of authentication center's operation Paiilier algorithm, generates public key PK and private key SK, public key PK
Broadcasted in block chain network, private key SK safety it is locally stored.
1.6, the pretreatment strategy in authentication center's setting network, that is, licit traffic request need to obtain pretreatment section
The number or type of point endorsement, in other words, the transaction motion for only meeting pretreatment strategy is likely to be considered legal
's.
2, user initializes
2.1, user selects random number Ri, the public key PK of authentication center is used firstCACalculate ciphertext c=E (Ri,PKCA), it
The private key SK of oneself is used afterwardsiIt calculatesIt signs, (c, σi) and a guarantee golden hair
Give authentication center.
2.2, authentication center uses PK after receiving message firstiThe legitimacy of signature is verified, the private of oneself is then used
Key SKCAMessage is decrypted to obtain Ri, the user that finally application is added in block chain network assesses, and it is certain to give user
Initial amount of money Xinit, Y is calculated using PKinit=E (Xinit, R, PK), to (i, Yinit) carry out signature generation(i, Yinit,σCA) be sent in ordering joint.
2.3, ordering joint verifies signature sigmaCALegitimacy, the transaction motion that receives is carried out Byzantine failure tolerance algorithm, is obtained
Signature sigma is carried out to sorted blockordererIt is sent in block chain network.
2.4, the pretreatment node in block chain network and confirmation node verification signature sigmaordererLegitimacy,
If legal, YinitIt is recorded on account book as the corresponding user balance ciphertext of user i.
3, customer transaction
It is described by taking the primary transaction between user A and user B as an example, as shown in Figure 2;
3.1, user A possesses the plaintext X of oneself account balanceA, the plaintext of oneself splits into two parts trade gold by A first
Volume X1With residual amount X2And meet X1+X2=X, then, A select four random number Rs1, R2, M, T and meet R1·R2=
RA, the public key PK of Paillier algorithm PK and user B is used respectivelyBIt is encrypted
Y1=E (X1,R1,PK)
Y2=E (X2,R2,PK)
Y3=E (X1,M,PKB)
Y4=E (R1,T,PKB)
Obtain ciphertext group (Y1,Y2,Y3,Y4,Y′A), use the private key SK of oneselfAIt signs to transaction
(Y1,Y2,Y3,Y4,Y′A,σA) as trading, pretreatment node is issued in motion.
3.2, the pretreatment node i that transaction motion is received for each, is handled according to following scheme
3.2.1, the legitimacy for verifying trading signature, if signature is legal, into next step;Otherwise, transaction motion is abandoned.
3.2.2, from the user balance under the ciphertext form that local account book extracts A, calculate
Y '=Y1×Y2(modn2)
Verifying
Y '=YA=Y 'A
It is whether true, if set up, into next step;Otherwise, transaction motion is abandoned.
3.2.3, using private key SKiIt signs to transaction motion
(Y1,Y2,Y3,Y4,YA,σi) as trading, user is issued in motion.
3.3, it after user A receives the pretreated transaction motion that pretreatment node returns, is carried out according to following scheme
3.3.1, the legitimacy of verifying signature carries out in next step if legal;Otherwise, transaction request is abandoned.
3.3.2, the transaction request that same transaction different pretreatments node returns is packed into a collection and is collectively referred to as by user
Transaction request data set is verified and receives that treated whether transaction request meets pretreatment strategy, if meeting the requirements, transaction
Ordering joint is issued after requested data set signature;Otherwise, transaction request is abandoned, is submitted again later.
3.4, ordering joint receives transaction request data set
3.4.1, the legitimacy of verifying signature carries out in next step if legal;Otherwise, transaction request is abandoned.
3.4.2, Byzantine failure tolerance algorithm is carried out for the transaction request data set of different transaction requests, obtained sorted
Block carries out signature and is sent in block chain network.
3.5, confirmation node receives the block in network
3.5.1, verify block in transaction request in pre-process node signature and ordering joint signature be it is legal, such as
Fruit is legal, carries out in next step;Otherwise, transaction request is abandoned.
3.5.2, from the user balance under the ciphertext form that local account book extracts A, verifying
Y1·Y2=YA=Y 'A
It is whether true, verify whether transaction request data set in block meets pretreatment strategy, for the friendship met the requirements
Easy requested data set is labeled as licit traffic;Otherwise, it is labeled as illegal transaction.
3.5.3, all users need to update user A and user B on account book after receiving newly generated block on network
Account balance
YA←Y2
YB←YB·Y1
3.5.4, user A needs to update under plaintext version more than the account of oneself after receiving the block comprising oneself transaction
Volume XA, and update the random number R of oneself lower account in plain textA
XA←X2
RA←R2
User B needs to update under plaintext version the account balance X of oneself after receiving the block comprising oneself transactionB, with
And update the random number R of oneself lower account in plain textB
XB←XB+D(Y3,SKB)
RB←RB·D(Y4,SKB)
4, account book re-encryption
User's re-encryption request is described by taking user A as an example below as a kind of special deal motion
4.1, user A reasonably select a random number R ', the content that R ' is requested as special deal is the private with oneself
Key SKAOrdering joint is sent to after being signed.
4.2, after ordering joint receives request, the legitimacy of signature is verified, if signature is correct, special deal is asked
It asks and is individually put into a new block, without waiting for the pretreatment being immediately issued to after other trading signatures in block chain network
Node and confirmation node.
4.3, after pre-processing node and confirming that node receives the block comprising special deal request
4.3.1, the signature for verifying block carries out in next step if legal;Otherwise, message is abandoned.
4.3.2, on Message Record to block chain and updating user's A account book remaining sum,
YA←YA·R′nmodn2
In addition to this, user A updates oneself random number
RA←RA·R′
5, supervision examines
5.1, authentication center's random selection checks whether there is user in certain time and initiates malice transaction, can be in account book
The transaction record for thinking verifying is found in block, it is assumed that the transaction record for needing to check is TX, extracts Y from TX first1,Y2,
Y′AThree variables are calculated using the private key SK of Paiilier algorithm
X1=D (Y1,SK)
X2=D (Y2,SK)
X '=D (Y 'A,SK)
Verifying
X1+X2=X '
It is whether true, if invalid, it can be assumed that this transaction is traded for malice;Otherwise, it regards as normally handing over
Easily.
5.2, it trades for malice, authentication center traces it, account book the guarantee fund for deducting transaction initiator
On data revert to normal condition.
Embodiment provided by the present invention can obtain following effective effect:
Effect 1: Transaction Information confidentiality may be implemented in block chain secret protection scheme.
Effect 2: block chain secret protection scheme can guarantee that Transaction Information can not be distorted.
Effect 3: block chain secret protection scheme can guarantee legitimacy of trading.
Effect 4: the re-encryption function in block chain secret protection scheme is safe.
Effect 5: classifying to the node in block chain network, and transaction is submitted to be carried out on confirmation node, and transaction executes
It is carried out on pretreatment node and confirmation node, the process reached common understanding carries out in ordering joint, realizes solution functionally
Coupling enhances the concurrency of transaction;The efficiency of selection more preferably Byzantine failure tolerance algorithm on common recognition algorithm, improves the effect of scheme
Rate.
Effect 6: can be applied in the financial business across company, and certification node can be served as by financial regulator
Role, each company serve as the role of confirmation node, may be implemented only have financial regulator and transaction double for a transaction
Side understands details, and the legitimacy that other companies are able to validate only transaction does not know the specifying information traded, finance activities
It can carry out safely and efficiently.
Plan-validation analysis is carried out for above-mentioned beneficial effect:
Effect 1 is verified:
Transaction motion is encrypted using Paillier algorithm, only has authentication center to have in block chain network
The private key of Paillier algorithm, the unrelated side that trades go for transaction motion plaintext, can only by two methods, the first from
Authentication center obtains private key, voluntarily calculates the private key of Paillier algorithm for second.In above-mentioned implementation process, the present invention shows
Example property illustrates that authentication center is safe and reliable, and will not reveal private key to other participants, so first method is not
It is feasible;Paillier algorithm based on conjunction number power residue class problem this difficult problem, the unrelated side that trades can not be in multinomial
It is interior to crack ciphertext, therefore scheme can guarantee the confidentiality of Transaction Information.
Effect 2 is verified:
Transaction motion can obtain transaction motion, this hair in all participants in Internet communication, block chain network
It is bright to be signed using cryptographic Hash of the ElGamal signature algorithm to transaction, since opponent can not be signed in polynomial time
The corresponding private key of name, it is possible to guarantee that transaction motion will not be distorted by other people, and can also using ElGamal signature algorithm
To guarantee the non-repudiation of transaction.For there may be Replay Attack, timestamp means are can be used to avoid in the present invention.
Effect 3 is verified:
In the present invention, the Paillier algorithm for meeting additive homomorphism property, pretreatment node and confirmation section are used
Point is unable to get the plaintext of transaction amount in polynomial time, but can extract in transaction in the case where no private key
Ciphertext data, calculate
Verifying
Y1·Y2=YA
Whether true, if set up, it is legal for can illustrating to trade to a certain extent, that is, meeting above-mentioned condition is
Transaction motion is the necessary condition of licit traffic motion.It trades because opponent may initiate a malice, i.e., user is according to following
Two ways initiates transaction
X1+X2=X, X1>0,X2<0
X1+X2=X, X1<0,X2>0
Both method of commerce can be by above-mentioned inspection method, but is that malice is traded.The present invention passes through introducing
The examination and supervision function of authentication center reduces or even avoids such transaction.In the model based on prestige, if user sends out
It has played malice to trade, authentication center can be issued a certificate and make public, and deduct its guarantee fund and malicious user is existed
Prestige is lost in network.
After each transaction, all users in network can update the account book of oneself, and user also will be updated oneself
Account balance in plain text and random number plain text, ensure that next licit traffic can pass through verifying.
Effect 4 is verified:
After user carries out a random number expansion, the account book remaining sum of user A is close on pretreatment node and confirmation node
Text becomes
YA≡gm·Rn·R′n≡gm·(RR′)nmodn2
Ciphertext is decrypted
From the above equation, we can see that remaining unchanged in plain text, the random number that the corresponding random number of account book ciphertext and user are saved at this time
It is all RR ', it is possible to ensure being normally carried out for transaction next time.All users all obtain random number R ', but cannot calculate
New random number R R ' out, will not reveal the information about transaction amount.Meanwhile the present invention requests that re-encryption make in scheme
It for a kind of special transaction, is packaged immediately after ordering joint receives blocking, ensure that and do not have the account balance for before
The phenomenon that transaction is remaining in a network, avoids licit traffic that from may being solved.
Effect 5 is verified:
It is 1 self signed certificate of authentication center and progress Paillier algorithm in the main time loss of system initialisation phase
Initialization, each user interact 1 signature of progress and sign test with authentication center.Since system initialization only carries out 1 time, so right
The influence of scheme efficiency can be ignored.
It is mainly that 3 signatures and sign test, ordering joint are arranged in the time loss of each user of user's initial phase
The time of the time loss of sequence and the node updates account book in network.Since system initialization only carries out 1 for each user
It is secondary, it is in a linear relationship with number of users, so the influence to scheme efficiency can be ignored.
In customer transaction, the time loss of a transaction is mainly 4 cryptographic calculations, the operation under 2 ciphertexts, and 4 times
Signature and sign test, the time loss and nodes that ordering joint is ranked up update the time of account book.
The time trumpet that a re-encryption is requested in account book re-encryption is mainly 2 signatures and sign test, and and net
The time of network interior joint update account book.
The time loss once examined in supervision examines is mainly 3 decryption operations, due to examining that supervision is by authenticating
Center independently carries out, so the influence to scheme efficiency can be ignored.
It is encrypted in scheme using Paillier, as key length gradually increases, is disappeared in encryption and decryption processes
The time of consumption is also gradually increased, and is more than after 256 in key length, the time of encryption and decryption consumption can sharply increase, and protect
Demonstrate,prove the efficiency for selecting the smallest key length that scheme can be improved while safety.
Effect 5 is verified:
Transaction amount is illustratively integer in the present embodiment, but in real life, is inevitably used
Floating number, and Paillier algorithm can only encrypt integer, provide an ordinary solution for this problem, choosing
Select the currency type unit using inferior grade.Illustrate by taking RMB as an example, the minimum unit used in current transaction is point, then people
When people's coin is as transaction currency type, most common " member " can be abandoned as unit, and use " dividing " as the unit of transaction amount, this
Transaction amount can be become integer by sample entirely.Plaintext m < n is required in Paillier algorithm, is meaned using the currency type unit of inferior grade
In plain text can expand corresponding multiple, with " member " be unit and with " dividing " for unit, can be encrypted in the case of two kinds maximum plaintext
100 times of difference is about 10 with the greatest measure that " dividing " can encrypt for unit if the n selected in the algorithm is 128
40 powers, this is used enough in real life, so method is feasible.
Existing block chain secret protection scheme includes mixing coin scheme in the prior art, Zcash scheme, Monero scheme,
It will be compared between mixed coin scheme, Zcash scheme, Monero scheme and this embodiment scheme, as shown in table 1:
Block chain secret protection project plan comparison
It is analyzed for table 1:
First from application scenarios, the present embodiment propose scheme applied to alliance's chain on, other schemes
It is all applied to the scheme on publicly-owned chain;It is also with account since this embodiment scheme is using alliance's chain as application scenarios
The form of model saves user balance, and benefit is the remaining sum that can be saved storage space and can be quickly obtained account,
And other schemes are not spend the form of transaction output (UTXO) to store user balance;Secondly because being added in block chain
Have between user and trust to a certain degree, so this programme does not need to hide both parties' identity, and Zcash scheme and Monero
Scheme can hide both parties' identity;Mixing coin scheme again is simply to be mixed to the transaction for going out input, with how defeated
The form for entering corresponding multi output submits transaction, so transaction amount cannot be hidden, excess-three scheme can hide trade gold
Volume;Then Zcash scheme is that a trusted third party is needed to generate initiation parameter in initialization, if initiation parameter is let out
Reveal, many UTXO that can not determine source will be generated in whole network, this programme needs believable third party's initialization
To generate the parameter of Paillier Encryption Algorithm;Finally from the perspective of efficiency, Zcash scheme is needed using zk-SNARKs
Algorithm, which generates, to be proved, so efficiency is very low;Finally need to illustrate that a disadvantage of Monero scheme illustratively has 64.04%
Transaction input there is no not guaranteeing user identity by the way of mixing using multiple inputs, therefore user identity privacy can be caused
It threatens.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.