Summary of the invention
This specification embodiment is intended to provide a kind of method and apparatus more effectively to lock an account in block chain, with solution
Deficiency certainly in the prior art.
To achieve the above object, this specification provides a kind of trust account letter that account is stored in block chain on one side
The method of breath, first account client executing of the method by the first user in block chain, comprising:
Second account of the second user in block chain is obtained, the second user is that the trust of first user is used
Family;And
Initiate the first transaction, the described first trust account information traded for being stored in the first account in block chain, institute
Second account that the trust account as the first account is included at least in the first transaction is stated, so that the trust account is believed
Second account is included at least in breath, wherein the permission trusted account and there is the first account of locking.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account information for being stored in account disposed in advance in block chain, the data word of first transaction
Second account is included at least in section.
In one embodiment, obtaining second account of the second user in block chain includes obtaining second user in area
The second account and its public key in block chain, wherein it further include the public key of the second account in the data field of first transaction, with
So that further including the public key of the second account in the trust account information.
On the other hand this specification provides a kind of method of trust account information that account is stored in block chain, the side
Method is executed by the full node in block chain, comprising:
The first transaction initiated by the first account is received from block chain, first transaction in block chain for being stored in
The trust account information of first account, it is described first transaction in include at least as the first account trust account the second account
Family, the permission trusted account and there is the first account of locking;And
Based on first transaction, in the trust account information for being locally stored in first account, wherein the trust account
Second account is included at least in the information of family.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account information for being stored in account disposed in advance in block chain, wherein handed over based on described first
Easily, include in the trust account information for being locally stored in first account, by be performed locally described first intelligent contract and
It will be under the first account in the local State Tree of the trust account information deposit.
In one embodiment, based on first transaction, in the trust account information for being locally stored in first account
Including being stored in the trust account information of the first account in local new block, wherein described based on first transaction
Include predetermined flag in first transaction, is used to indicate first transaction as being stored in the friendship for trusting account information into block chain
Easily.
On the other hand this specification provides a kind of method to lock an account in block chain, include multiple in the block chain
Full node, the full node are locally previously stored with the trust account information of the first account, in the trust account information at least
The second account including the trust account as the first account, the method is by the second account client executing, comprising:
The second transaction is initiated, second transaction in block chain for locking first account.
In one embodiment, transaction of second transaction for the intelligent contract of calling second, the described second intelligent contract
It include described for the intelligent contract for locking an account disposed in advance in block chain, in the data field of second transaction
One account.
On the other hand this specification provides a kind of method to lock an account in block chain, include multiple in the block chain
Full node, the full node are locally previously stored with the trust account information of the first account, in the trust account information at least
The second account including the trust account as the first account, the method are executed by the full node in block chain, comprising:
The second transaction for locking the first account initiated by the second account is received from block chain;
From the local trust account information for obtaining first account;
Based on the trust account information, verify second account whether be first account trust account;With
And
In the case where being verified, the locking to the first account is locally being carried out.
In one embodiment, transaction of second transaction for the intelligent contract of calling second, the described second intelligent contract
For the intelligent contract for locking an account disposed in advance in block chain, wherein locally carrying out the locking packet to the first account
It includes, the locking to the first account is carried out and being performed locally the second intelligence contract.
In one embodiment, the trust account information is stored in the local State Tree of the full node, wherein
It include the trust that first account is obtained from local State Tree from the local trust account information for obtaining first account
Account information.
In one embodiment, the trust account information is stored in block, wherein obtains described first from local
The trust account information of account includes that retrieval has the friendship of the first account and predetermined flag from the multiple blocks being locally stored
Easily, to obtain the trust account information of the first account.
On the other hand this specification provides a kind of device of trust account information that account is stored in block chain, the dress
Set the first account client for being deployed in the first user in block chain, comprising:
Acquiring unit is configured to, and obtains second account of the second user in block chain, and the second user is described the
The trust user of one user;And
Unit is initiated in transaction, is configured to, and initiates the first transaction, first transaction in block chain for being stored in the first account
The trust account information at family, it is described first transaction in include at least as the first account trust account second account,
So that including at least second account in the trust account information, wherein the trust account has the first account of locking
The permission at family.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account information for being stored in account disposed in advance in block chain, the data word of first transaction
Second account is included at least in section.
In one embodiment, the acquiring unit is additionally configured to, and obtains second account of the second user in block chain
And its public key, wherein further include the public key of the second account in the data field of first transaction, so that the trust account
It further include the public key of the second account in information.
On the other hand this specification provides a kind of device of trust account information that account is stored in block chain, the dress
Set the full node being deployed in block chain, comprising:
Receiving unit is configured to, and the first transaction initiated by the first account is received from block chain, and first transaction is used
The letter as the first account is included at least in the trust account information for being stored in the first account in block chain, first transaction
Appoint the second account of account, the permission trusted account and there is the first account of locking;And
It is stored in unit, is configured to, based on first transaction, in the trust account letter for being locally stored in first account
Breath, wherein second account is included at least in the trust account information.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account information for being stored in account disposed in advance in block chain, wherein the deposit unit is also
It is configured to, described will trust account information and being performed locally the first intelligence contract and be stored in local State Tree
Under first account.
In one embodiment, the deposit unit is additionally configured to, based on first transaction, in local new block
The trust account information of the first account of middle deposit, wherein include predetermined flag in first transaction, be used to indicate first friendship
It is easily the transaction for the deposit trust account information into block chain.
On the other hand this specification provides a kind of device to lock an account in block chain, include multiple in the block chain
Full node, the full node are locally previously stored with the trust account information of the first account, in the trust account information at least
The second account including the trust account as the first account, described device are deployed in the second account client, comprising:
Unit is initiated in transaction, is configured to, and initiates the second transaction, second transaction in block chain for locking described the
One account.
In one embodiment, transaction of second transaction for the intelligent contract of calling second, the described second intelligent contract
It include described for the intelligent contract for locking an account disposed in advance in block chain, in the data field of second transaction
One account.
On the other hand this specification provides a kind of device to lock an account in block chain, include multiple in the block chain
Full node, the full node are locally previously stored with the trust account information of the first account, in the trust account information at least
The second account including the trust account as the first account, described device are deployed in the full node in block chain, comprising:
Receiving unit is configured to, and is received from block chain and is used to lock the second of the first account by what the second account was initiated
Transaction;
Acquiring unit is configured to, from the local trust account information for obtaining first account;
Authentication unit is configured to, and is based on the trust account information, verifies whether second account is first account
The trust account at family;And
Lock cell is configured to, and in the case where being verified, is locally carrying out the locking to the first account.
In one embodiment, transaction of second transaction for the intelligent contract of calling second, the described second intelligent contract
For the intelligent contract for locking an account disposed in advance in block chain, wherein the lock cell is additionally configured to, by this
Ground executes the described second intelligent contract and carries out the locking to the first account.
In one embodiment, the trust account information is stored in the local State Tree of the full node, wherein
The acquiring unit is additionally configured to, and the trust account information of first account is obtained from local State Tree.
In one embodiment, the trust account information is stored in block, wherein the acquiring unit also configures
For retrieval has the transaction of the first account and predetermined flag from the multiple blocks being locally stored, to obtain the first account
Trust account information.
On the other hand this specification provides a kind of computer readable storage medium, be stored thereon with computer program, work as institute
When stating computer program and executing in a computer, computer is enabled to execute any of the above-described method.
On the other hand this specification provides a kind of calculating equipment, including memory and processor, which is characterized in that described to deposit
It is stored with executable code in reservoir, when the processor executes the executable code, realizes any of the above-described method.
In the scheme according to this specification embodiment, by using account mechanism is trusted, pass through the third party to trust
The permission to lock an account is authorized, so that account locking can be carried out by third party in the case where account private key is lost or is stolen,
To prevent loss further expansion.
Specific embodiment
This specification embodiment is described below in conjunction with attached drawing.
Fig. 1 shows the schematic diagram of the block chain 100 according to this specification embodiment.As shown in Figure 1, it is assumed that block chain 100
For alliance's chain, including 1 in figure, 2,3,4 four common recognition nodes (Quan Jiedian), in addition, further including multiple pass through in block chain
The user that client logs in, these users possess account, private key and the public key of oneself, and client visible is the light of the block chain
Node or its client carry out the operation in block chain by gateway.As shown in the figure, the user for example including user A,
User B and user C.Wherein, user C is malicious user, such as may steal the private key of user A, to carry out illegal transaction
Activity.This specification embodiment is trusted for user setting and is used to cope with the case where malice of such as user C steals private key for user
Its account is freezed and (locked) to family mechanism in order to which user can trust user by it after losing private key, to prevent into one
The loss of step.For example, user B is the trust user of user A, user A is and the first transaction of transmission into block chain in block
It is the information for trusting user that user B is stored in chain, and authorizes the user B permission for freezing user's A account.To when the private of user A
When key is lost, user A can be sent a notice user B by line, so that user B sends the second transaction to block chain, so that in block
Freeze the account of user A in chain.
It is appreciated that the description above with reference to Fig. 1 is only illustrative, it is not limited to the model of this specification embodiment
It encloses, for example, the block chain is not limited to alliance's chain, it may be public chain etc., in the case where block chain is public chain, user
A, the corresponding client of B, C can also be the full node in block chain.Hereinafter, it will be specifically described by taking alliance's chain as an example.
The process of above-mentioned authorization and the process of Frozen Account is described more fully below.
Fig. 2 shows a kind of sides for trusting account information that account is stored in block chain according to this specification embodiment
Method, first account client executing of the method by the first user in block chain, comprising:
Step S202, obtains second account of the second user in block chain, and the second user is first user
Trust user;And
Step S204 initiates the first transaction, the described first trust account traded for being stored in the first account in block chain
Family information, it is described first transaction in include at least as the first account trust account second account so that described
Trust and include at least second account in account information, wherein the permission trusted account and there is the first account of locking.
Firstly, in step S202, second account of the second user in block chain is obtained, the second user is described the
The trust user of one user.
This method passes through its first account client executing in block chain by the first user, for it to be arranged in block
Trust account in chain, the permission trusted account and there is locking first account.First user determines first to be made
For the user for trusting user, such as second user, for example, the first user can obtain down the agreement of the second user of its trust online
Later, second user is determined as trusting user.Later, the first account client obtain second user the second account, with
It trades in initiating first in next step.First account client for example can obtain second user from the input of the first user
Second account, alternatively, the first account client can receive second account, etc. from the second account client.
In one embodiment, while obtaining the second account of second user, the public key of the second account can also be obtained,
With the first transaction being supplied in next step.
It is appreciated that although the account for obtaining the trust user of the first user is only described in this step, at this
Multiple trust users of first user can be similarly set in specification embodiment by this method.
In step S204, the first transaction, the described first trust traded for being stored in the first account in block chain are initiated
Account information, it is described first transaction in include at least as the first account trust account second account so that institute
It states to trust and includes at least second account in account information, wherein the permission trusted account and there is the first account of locking.
It will be understood by those skilled in the art that client can be deposited by initiating transaction into block chain in block chain
Enter information, the information be by common recognition, each node it is consistent, therefore have higher safety, confidence level.In block chain
Including multitype database, such as block, account database (status data tree), therefore, into block chain be stored in information include to
Information is stored in the databases such as block, account database.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account for account to be arranged disposed in advance in block chain.It is for example wrapped in described first intelligent contract
Set1 () function is included, for the preset trust account field of account to be arranged in the State Tree in block chain.When the first account
When initiating to call the first transaction of the first intelligent contract, the first transaction is for example as shown in figure 3, Fig. 3 shows showing for the first transaction
Meaning form, wherein the transmission field (From) in the first transaction is the first account, and receiving field (To) is the first intelligent contract
Contract account, data field (Data) is the calling to set1 () function in the first intelligent contract, such as { set1
(strings), " the second account " }, that is, " the second account " is the input parameter of set1 () function, in addition, the first transaction packet
Include the digital signature generated by the private key of the first account.Any full node (such as node 1) of first account for example into Fig. 1
First transaction is sent, node 1 is after receiving first transaction, after verifying to first transaction in common recognition node
Spread first transaction.After determining accounting nodes by node of knowing together, the first intelligent contract is executed in accounting nodes, from
And the trust account field of the first account in the State Tree of accounting nodes local is arranged by executing the first intelligent contract
For the second account.It is appreciated that settable more than one trusts account field, such as three letters of setting in State Tree database
Appoint account field, so that the first account client can obtain three trust accounts first, and by adjusting three times in the first transaction
With set1 () function, so that three trust accounts be respectively set in State Tree.Accounting nodes, will after updating State Tree
First transaction is put into block deposit block chain, and the block is sent to other common recognition nodes, thus other common recognition nodes
Also update the trust account of the first account in local State Tree in the same manner after receiving the block.
It in one embodiment, further include set2 () function in addition to including set1 () function in the first intelligent contract,
The public key of trust account of the set2 () function for account to be arranged in State Tree.In this case, client is in step S202
In also obtain the public key of the second account, and set2 () function is similarly called in this step, for example, in the number of the first transaction
According to further including " set2 (strings), " the second account public key " " in field, to be arranged in State Tree by the first intelligent contract
The trust account public key field of first account, in order to the subsequent process that locks an account.
Although being appreciated that the trust account information for being stored in account in State Tree automatically by intelligent contract here, this
Specification is without being limited thereto, for example, the Set function that the function of the described first intelligent contract includes can be done nothing, from
And it is only used for the information of transmitting the second account of setting and its public key, so that by the second account and its tune of public key and the intelligence contract
It is stored into block with together as transaction, for the subsequent lookup for trusting account information.Or it can be by advance setting
Rule, so that the node in block chain determines that the transaction is to believe for being stored in based on the intelligent contract account called in the transaction
The transaction for appointing account information, to update the preset trust account information field of the first account in local State Tree.
In one embodiment, first transaction is, for example, that the general transaction of the second account is sent to by the first account
(such as money transfer transactions), in the data field of the transaction, settable predetermined flag, with for identify the transaction for be stored in letter
Appoint account information, for example, the data field of the transaction is " account information is trusted in deposit ", and appoints, the trust of the first account
Account is the reception account of the first transaction.To which, the first account is by sending such first transaction to the second account, when the
One transaction by common recognition after being stored into block, that is, the first account incorporates the trust of the first account into block chain
Account information, and be the second account by the trust Account Settings of the first account.In addition, in the data field of first transaction also
It may include the public key of the second account, to further include the public key of the second account in the trust account information of the first account.It can
To understand, the first transaction is not limited to the transaction that the first account is sent to the second account, and can be sent to area for the first account
The transaction of any account of non-second account in block chain, in this case, the data field of the transaction is for example including " general " second
Account " being set as trusting account ", so that being propagated into block chain by the second account setup is the trust account letter for trusting account
Breath.Alternatively, can be by the rule set in advance, so that the node in block chain is determined based on the predetermined flag in first transaction
First transaction is the transaction for being stored in trust account information, to update the preset of the first account in local State Tree
Trust account information field.
Fig. 4 shows a kind of side of trust account information that account is stored in block chain according to this specification embodiment
Method, the method are executed by the full node in block chain, comprising:
Step S402 receives the first transaction initiated by the first account from block chain, and first transaction is in area
It is stored in the trust account information of the first account in block chain, the trust account as the first account is included at least in first transaction
The second account, it is described trust account have locking the first account permission;And
Step S404, based on first transaction, in the trust account information for being locally stored in first account, wherein
Second account is included at least in the trust account information.
This method is each full section after the first account client issues the first transaction to block chain, in block chain
It o'clock trades based on first and to be stored in the process of the trust account information of the first account into block chain.As described above, herein, to area
In block chain deposit include be stored in into State Tree, or into block deposit, etc..
Firstly, receiving the first transaction initiated by the first account from block chain in step S402, first transaction is used
The letter as the first account is included at least in the trust account information for being stored in the first account in block chain, first transaction
Appoint the second account of account, the permission trusted account and there is the first account of locking.The full node is, for example, to pass through common recognition really
Fixed accounting nodes can be any full node in block chain, node 1,2,3,4 as shown in figure 1, therefore, with reference to above
To the description in step S202, which can receive first transaction from the first account client, or can be from other any
Full node receives first transaction.It is appreciated that the full node for executing this method is not limited to accounting nodes, for example, its
It can be the common recognition node of accounting nodes, by receiving the include in newly-generated block first transaction from accounting nodes, from
And receive first transaction.With reference to the description in step S204, which is, for example, to call the first intelligent contract above
Transaction or this first transaction data field in include predetermined flag, with for identify its be for being deposited in block chain
Enter the transaction of the trust account information of the first account.
In step S404, based on first transaction, it is stored in the trust account information of first account in local,
In, second account is included at least in the trust account information.
With reference to above to the description in step S204, in one embodiment, first transaction is the first intelligence of calling
The transaction of energy contract, the described first intelligent contract are to be disposed in advance in block chain for being stored in the trust account information of account
Intelligent contract.To, the full node by be performed locally described first intelligent contract and automatically by the trust account information
It is stored under the first account in local State Tree.Alternatively, the set function that the described first intelligent contract includes can be without any
Operation is only used for transmitting information, thus, which is based on pre-defined rule by being performed locally the described first intelligent contract,
It will be under the first account in the local State Tree of the trust account information deposit by full node itself.
With reference to above to the description in step S204, in one embodiment, calibrated in first transaction including pre-
Will (such as the account of the first intelligent contract, or " account information is trusted in deposit "), be used to indicate first transaction for for
The transaction of account information is trusted in deposit in block chain.Such as after accounting nodes generate new block based on first transaction,
The block is stored in local block data library, and the block is spread to other full nodes, thus other full node difference
The trust account information of the first account is stored in local new block.
Fig. 5 shows a kind of method to lock an account in block chain according to this specification embodiment, in the block chain
Including multiple full nodes, the full node is locally previously stored with the trust account information of the first account, the trust account letter
The second account of the trust account as the first account is included at least in breath, the method is in the second account client executing, packet
It includes:
Step 502, the second transaction is initiated, second transaction in block chain for locking first account.
After executing method shown in Fig. 2 and Fig. 4 as described above, the trust account of the first account has been incorporated in block chain
Information, that is, the trust account trusted in account information by the second account setup for the first account.In this case, second
Account has the permission for initiating the first account of locking.When the first user is in the case where private key is lost or is stolen, the first user can
Such as second user is informed by communication modes such as phone, network communications, and second user is requested to lock the first account.Second uses
Family can be issued by the second account client for locking the second of the first account after the request for receiving the first user
Transaction.
In one embodiment, transaction of second transaction for the intelligent contract of calling second, the described second intelligent contract
For the intelligent contract for locking an account disposed in advance in block chain.For example, including " Lock () " letter in the second intelligent contract
It is several, it is used in the case where determination meets predetermined condition, that is, determines that second account is the trust account of the first account
In situation, in the State Tree in block chain by the status modifier of destiny account be lock state.The calling that second account is initiated
The concrete form of second transaction of the second intelligent contract is similar with the form of the first transaction, also includes sending field, receiving word
Section and data field receive the contract account that field is the second intelligent contract, data field wherein sending field is the second account
For the calling to " Lock () " function, such as { Lock (strings), " the first account " }.
It is appreciated that similarly, the described second intelligent contract is not limited to include above-mentioned Lock function, by executing the letter
The state of account is counted and modifies in State Tree, in one embodiment, the Lock function that the second intelligent contract includes can not
Any operation is carried out, the information of transmitting the first account of locking is only used for, so that executing the intelligence in each node of block chain
The state of the first account is actively modified when energy contract based on pre-defined rule.
In one embodiment, second transaction is, for example, that the general transaction of the first account is sent to by the second account
(such as money transfer transactions), in the data field of the transaction, settable predetermined flag, for identifying the transaction for locking account
For example, the data field of the transaction is " locking an account ", and appoint that the reception account of the second transaction is to be locked in family
Account.To which the second account is by sending such second transaction to the first account, when the second transaction is stored by common recognition
After in block, that is, the second account has propagated the information of the first account of locking into block chain.Each node in block chain
After obtaining the information of the first account of locking in the second transaction, the status modifier of the first account can be locked into shape in local
State.It is appreciated that the second transaction is not limited to the transaction that the second account is sent to the first account, and can be sent for the second account
To the transaction of any account of the first account non-in block chain, in this case, the data field of the transaction is for example including " locking
" the first account " ", to propagate the information of the first account of locking into block chain.
Fig. 6 shows a kind of method to lock an account in block chain according to this specification embodiment, in the block chain
Including multiple full nodes, the full node is locally previously stored with the trust account information of the first account, the trust account letter
The second account of the trust account as the first account is included at least in breath, the method is executed by the full node in block chain,
Include:
Step S602 receives the second transaction for locking the first account initiated by the second account from block chain;
Step S604, from the local trust account information for obtaining first account;
Step S606 is based on the trust account information, verify second account whether be first account letter
Appoint account;And
Step S608 is locally carrying out the locking to the first account in the case where being verified.
After the second account carries out method shown in Fig. 5, i.e., after initiating the second transaction into block chain, lead in block chain
The common recognition for crossing common recognition node generates accounting nodes, so that method shown in fig. 6 can be performed in accounting nodes and its common recognition node, it is described
Common recognition node all should be the full node in block chain, that is, local all includes whole blocks and account database, so as to based on number
The verifying to transaction is carried out according to the content in library.
Firstly, being received from block chain in step S602 and being used to lock the second of the first account by what the second account was initiated
Transaction.
Second transaction is sent in block chain by the second account client when sending the second transaction into block chain
Any full node, any full node then by this second transaction diffusion to other full nodes.To, such as accounting nodes can
Directly to receive the second transaction from the second account, or the second transaction can be received from other full nodes in block.
In step S604, from the local trust account information for obtaining first account.
As above be it is described, in one embodiment, the trust account information is stored in the local shape of the full node
In state tree, wherein from the local trust account information for obtaining first account include obtaining described the from local State Tree
The trust account information of one account.
In one embodiment, the trust account information is stored in block, wherein obtains described first from local
The trust account information of account includes that retrieval has the transaction of the first account and predetermined flag from the multiple blocks being locally stored
(i.e. above-mentioned first transaction), to obtain the trust account information of the first account.
The full node second is traded and after obtaining the trust account information of the first account receiving this, uses the first
The public key of two accounts verifies digital signature of second transaction, in addition, in such as ether mill, the full node is also to the
The residual fuel of one account is verified etc., is not listed one by one herein.
In the case where further including the second account public key in trusting account information, accounting nodes can be from such as account status
The second account public key is obtained in tree, with the digital signature for verifying the second transaction.It does not include second when trusting in account information
In the case where account public key, accounting nodes can obtain the second account public key by other methods, such as be obtained by key management side
Second account public key etc..
After carrying out above-mentioned conventional verifying, in one embodiment, second transaction is closed for the second intelligence of calling
Transaction about, so that the full node starts to execute above-mentioned the lock () function in the intelligence contract, thus by executing the function
Automatically following step S606-S608 is carried out.It in one embodiment, as described above, include predetermined in second transaction
Mark, being used to indicate second transaction is the transaction for locking an account, so that the full node locally executes following steps
Rapid S606-S608.
Step S606 is based on the trust account information, verify second account whether be first account letter
Appoint account.
Obtain trust account information after, can be determined based on the information the second account whether be the first account trust account
Family.In one embodiment, which is stored under the first account of State Tree, thus, it may be determined that State Tree
In trust account field under first account whether include the second account, thus verifying the second account whether be the first account letter
Appoint account.In one embodiment, trust account information to be stored in a transaction of block, so as to based on the friendship in block
Easy information, determine the second account whether be the first account trust account.
In step S608, in the case where being verified, the locking to the first account is locally being carried out.
In one embodiment, second transaction is the transaction of calling the second intelligent contract, as described above, described the
Two intelligent contracts are the intelligent contract for locking an account disposed in advance in block chain, thus, accounting nodes pass through in local
It executes the described second intelligent contract and carries out the locking to the first account, that is, being held by executing above-mentioned " Lock () " function
The status modifier of the first account in local State Tree is automatically locking shape in the case where being verified by row step S606
State.
In one embodiment, second transaction is that general transaction delivers lock to accounting nodes as described above
The information of fixed first account, so that accounting nodes can be in the case where being verified by the shape of the first account in local State Tree
State is revised as lock state.
Second transaction is bundled in block after modifying local State Tree and is sent to other full sections by accounting nodes
Point, so that the block is stored in block chain.Other nodes can be similarly based on after receiving the block including the second transaction
Second transaction modifies the state of the first account in local State Tree, to reach the data consistency of each full node.
Fig. 7 shows a kind of device of trust account information that account is stored in block chain according to this specification embodiment
700, described device is deployed in first account client of first user in block chain, comprising:
Acquiring unit 71, is configured to, and obtains second account of the second user in block chain, the second user is described
The trust user of first user;And
Unit 72 is initiated in transaction, is configured to, and initiates the first transaction, first transaction is for being stored in first in block chain
The trust account information of account, it is described first transaction in include at least as the first account trust account second account
Family, so that including at least second account in the trust account information, wherein the trust account has locking first
The permission of account.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account information for being stored in account disposed in advance in block chain, the data word of first transaction
Second account is included at least in section.
In one embodiment, the acquiring unit 72 is additionally configured to, and obtains second account of the second user in block chain
Family and its public key, wherein further include the public key of the second account in the data field of first transaction, so that the trust account
It further include the public key of the second account in the information of family.
Fig. 8 shows a kind of device of trust account information that account is stored in block chain according to this specification embodiment
800, described device is deployed in the full node in block chain, comprising:
Receiving unit 81, is configured to, and the first transaction initiated by the first account, first transaction are received from block chain
For being stored in the trust account information of the first account in block chain, include at least in first transaction as the first account
Trust the second account of account, the permission trusted account and there is the first account of locking;And
It is stored in unit 82, is configured to, based on first transaction, in the trust account letter for being locally stored in first account
Breath, wherein second account is included at least in the trust account information.
In one embodiment, transaction of first transaction for the intelligent contract of calling first, the described first intelligent contract
For the intelligent contract for the trust account information for being stored in account disposed in advance in block chain, wherein the deposit unit 82
It is additionally configured to, described will trust account information and being performed locally the first intelligence contract and be stored in local State Tree
The first account under.
In one embodiment, the deposit unit 82 is additionally configured to, based on first transaction, in local new area
The trust account information of the first account is stored in block, wherein it is described first transaction in include predetermined flag, be used to indicate this first
Transaction is the transaction for the deposit trust account information into block chain.
Fig. 9 shows a kind of device 900 to lock an account in block chain according to this specification embodiment, the block chain
In include multiple full nodes, the full node is locally previously stored with the trust account information of the first account, the trust account
The second account of the trust account as the first account is included at least in information, described device is deployed in the second account client,
Include:
Unit 91 is initiated in transaction, is configured to, and initiates the second transaction, second transaction is for described in the locking in block chain
First account.
Figure 10 shows a kind of device 1000 to lock an account in block chain according to this specification embodiment, the block
It include multiple full nodes in chain, the full node is locally previously stored with the trust account information of the first account, the trust account
The second account of the trust account as the first account is included at least in the information of family, described device is deployed in the full section in block chain
Point, comprising:
Receiving unit 101, is configured to, and be used to lock the first account the initiated by the second account is received from block chain
Two transaction;
Acquiring unit 102, is configured to, from the local trust account information for obtaining first account;
Authentication unit 103, is configured to, and is based on the trust account information, verifies whether second account is described the
The trust account of one account;And
Lock cell 104, is configured to, and in the case where being verified, is locally carrying out the locking to the first account.
In one embodiment, transaction of second transaction for the intelligent contract of calling second, the described second intelligent contract
For the intelligent contract for locking an account disposed in advance in block chain, wherein the lock cell 104 is additionally configured to, and is passed through
It is performed locally the described second intelligent contract and carries out the locking to the first account.
In one embodiment, the trust account information is stored in the local State Tree of the full node, wherein
The acquiring unit 102 is additionally configured to, and the trust account information of first account is obtained from local State Tree.
In one embodiment, the trust account information is stored in block, wherein the acquiring unit 102 is also
It is configured to, retrieval has the transaction of the first account and predetermined flag from the multiple blocks being locally stored, to obtain the first account
The trust account information at family.
On the other hand this specification provides a kind of computer readable storage medium, be stored thereon with computer program, work as institute
When stating computer program and executing in a computer, computer is enabled to execute any of the above-described method.
On the other hand this specification provides a kind of calculating equipment, including memory and processor, which is characterized in that described to deposit
It is stored with executable code in reservoir, when the processor executes the executable code, realizes any of the above-described method.
In the scheme according to this specification embodiment, by using account mechanism is trusted, pass through the third party to trust
The permission to lock an account is authorized, so that account locking can be carried out by third party in the case where account private key is lost or is stolen,
To prevent loss further expansion.
It is to be understood that herein " first ", the description such as " second ", it is for illustration only simple and to similar concept into
Row is distinguished, and does not have other restriction effects.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
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.
Those of ordinary skill in the art should further appreciate that, describe in conjunction with the embodiments described herein
Each exemplary unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clear
Illustrate to Chu the interchangeability of hardware and software, generally describes each exemplary group according to function in the above description
At and step.These functions hold track actually with hardware or software mode, depending on technical solution specific application and set
Count constraint condition.Those of ordinary skill in the art can realize each specific application using distinct methods described
Function, but this realization is it is not considered that exceed scope of the present application.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can hold track with hardware, processor
Software module or the combination of the two implement.Software module can be placed in random access memory (RAM), memory, read-only storage
Device (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology neck
In any other form of storage medium well known in domain.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects
It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention
Protection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.