WO2020248656A1 - Method and apparatus for unlocking account in block chain - Google Patents

Method and apparatus for unlocking account in block chain Download PDF

Info

Publication number
WO2020248656A1
WO2020248656A1 PCT/CN2020/081989 CN2020081989W WO2020248656A1 WO 2020248656 A1 WO2020248656 A1 WO 2020248656A1 CN 2020081989 W CN2020081989 W CN 2020081989W WO 2020248656 A1 WO2020248656 A1 WO 2020248656A1
Authority
WO
WIPO (PCT)
Prior art keywords
account
transaction
authentication information
blockchain
smart contract
Prior art date
Application number
PCT/CN2020/081989
Other languages
French (fr)
Chinese (zh)
Inventor
方思羽
左军
Original Assignee
创新先进技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Publication of WO2020248656A1 publication Critical patent/WO2020248656A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the embodiments of this specification relate to the field of blockchain technology, and more specifically, to a method and device for unlocking an account in a blockchain.
  • Blockchain technology is built on a peer-to-peer (P2P) network, using chained data structures to verify and store data, using distributed node consensus algorithms to generate and update data, and using cryptography to ensure the security of data transmission and access.
  • P2P peer-to-peer
  • the blockchain is, for example, the Ethereum blockchain.
  • Ethereum the concept of accounts has been added, among which the accounts created by users are external accounts in Ethereum.
  • each external account has a pair of public and private keys, where the private key is used for digital signatures, and the public key is used for signature verification.
  • the data table of all accounts in the blockchain is maintained in the form of a state tree in the local database of the node.
  • the state tree is the mapping between the account address and the account content, and the account content includes: Account balance, account key information (hash value), etc.
  • the embodiments of this specification aim to provide a more effective solution for unlocking accounts in the blockchain.
  • one aspect of this specification provides a method for storing authentication information of an account in a blockchain.
  • the blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes.
  • the method is executed by the first account client in the blockchain, and includes: sending a first transaction to any of the full nodes, the first transaction being used to deposit authentication information of the first account in the blockchain, so The data field of the first transaction includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account.
  • the authentication information includes two authentication items, and the two authentication items are any two of the following items: private key, password, mobile phone number, and SMS verification code.
  • sending the first transaction to any of the full nodes includes sending the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway is connected to the blockchain .
  • Another aspect of this specification provides a method for depositing account authentication information in a blockchain, where the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the method is determined by the block chain.
  • the execution of all nodes in the chain includes: receiving a first transaction initiated by a first account from the blockchain, and the first transaction is used to deposit authentication information of the first account in the blockchain, and the first The data field of the transaction includes the authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items; and based on the For the first transaction, the authentication information of the first account is stored locally.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing the authentication information of the account
  • storing the authentication information of the first account locally includes storing the authentication information in the first account in the local state tree by executing the first smart contract locally.
  • Another aspect of this specification provides a method for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally prestore the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the method is executed by the first account client and includes: reporting to any of the full nodes A second transaction is sent, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
  • the second transaction is a transaction for invoking a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  • Another aspect of this specification provides a method for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally prestore the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is the locked state, and the method is executed by all nodes in the blockchain, including: from the blockchain Receive a second transaction initiated by the first account, the second transaction is used to unlock the first account in the blockchain; obtain the authentication information of the first account locally; based on the authentication information, verify the Whether the authentication information is included in the second transaction; and in the case where the verification is passed, the first account is unlocked locally.
  • the second transaction is a transaction for invoking a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  • the first transaction is performed locally.
  • the unlocking of the account includes unlocking the first account by executing the second smart contract locally.
  • the authentication information is stored in the local state tree of the full node, wherein obtaining the authentication information of the first account locally includes obtaining the authentication information of the first account from the local state tree. Certification Information.
  • the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the device is deployed in a district.
  • the first account client in the blockchain includes:
  • the transaction initiation unit is configured to send a first transaction to any one of the full nodes, where the first transaction is used to store authentication information of the first account in the blockchain, and the data field of the first transaction includes The authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  • the transaction initiation unit is further configured to send the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway is connected to the blockchain.
  • the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the device is deployed in a district.
  • the full node in the block chain includes: a receiving unit configured to receive a first transaction initiated by the first account from the block chain, and the first transaction is used for verification of depositing the first account in the block chain Information, the data field of the first transaction includes the authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentications Item; and a deposit unit configured to deposit authentication information of the first account locally based on the first transaction.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account
  • the The deposit unit is further configured to store the authentication information under the first account in the local state tree by executing the first smart contract locally.
  • Another aspect of this specification provides a device for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally pre-store the first
  • the authentication information of the account wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on the first account client and includes: a transaction initiation unit configured to, A second transaction is sent to any of the full nodes, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
  • the second transaction is a transaction for invoking a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  • Another aspect of this specification provides a device for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally prestore the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on a full node in the blockchain and includes: a receiving unit configured to , Receiving a second transaction initiated by the first account from the blockchain, where the second transaction is used to unlock the first account in the blockchain; the obtaining unit is configured to obtain the first account locally Authentication information; a verification unit configured to, based on the authentication information, verify whether the second transaction includes the authentication information; and an unlocking unit configured to, in the case of passing the verification, perform a local verification of the first Unlock the account.
  • the second transaction is a transaction that calls a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account
  • the unlocking unit is also configured In order to unlock the first account by executing the second smart contract locally.
  • the authentication information is stored in the local state tree of the full node, wherein the obtaining unit is further configured to obtain the authentication information of the first account from the local state tree.
  • Another aspect of this specification provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed in a computer, the computer is caused to execute any of the above methods.
  • Another aspect of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, any one of the above methods is implemented.
  • this solution adopts the multi-authentication authentication method, and the user pre-stores his own set authentication information in the blockchain, so that the user can When thawing is required, a safe and convenient account thawing operation can be performed based on the authentication information. Improved the usability of the blockchain platform.
  • Fig. 1 shows a schematic diagram of a blockchain system 100 according to an embodiment of the present specification
  • Figure 2 shows a flow chart of a method for depositing account authentication information in a blockchain according to an embodiment of this specification
  • Figure 3 shows a schematic form of the first transaction
  • Fig. 4 shows a flowchart of a method for depositing authentication information of an account in a blockchain according to an embodiment of the present specification
  • Fig. 5 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification
  • Fig. 6 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification
  • FIG. 7 shows a device 700 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification
  • FIG. 8 shows a device 800 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification
  • FIG. 9 shows a device 900 for unlocking an account in the blockchain according to an embodiment of the present specification
  • Fig. 10 shows a device 1000 for unlocking an account in a blockchain according to an embodiment of the present specification.
  • Fig. 1 shows a schematic diagram of a blockchain system 100 according to an embodiment of the present specification.
  • the blockchain system 100 includes a consortium chain 11, which includes four consensus nodes (full nodes) 1, 2, 3, and 4 in the figure.
  • the consortium chain 11 also includes multiple user clients These user clients have their own accounts, private keys, and public keys, which can be regarded as light nodes of the blockchain, or they can perform operations in the blockchain through the gateway 12.
  • the user client includes client A and client B, for example.
  • the client B is a malicious client, which, for example, may steal the private key of the client A's account to conduct illegal transactions.
  • the gateway 12 is provided by a trusted platform, which can be connected to any full node in the blockchain, so that the user client can use it to perform various operations related to the blockchain, such as sending transactions.
  • Client A can store its authentication information in the blockchain by initiating the first transaction. For example, after client B steals the account private key of client A, and locks the account of client A in the blockchain, client A can initiate a second transaction in the case of retrieving the private key, so that Unlock its account in the blockchain.
  • FIG. 1 is only schematic and is not used to limit the scope of the embodiments of the present specification.
  • the process of depositing authentication information and unlocking the account will be described in detail below.
  • Fig. 2 shows a flow chart of a method for storing authentication information of an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes,
  • the method is executed by the first account client in the blockchain and includes:
  • Step S202 Send a first transaction to any of the full nodes, the first transaction is used to store the authentication information of the first account in the blockchain, and the data field of the first transaction includes the authentication information The authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  • the alliance chain includes, for example, four full nodes. These four full nodes are trusted nodes, and their locals include all blocks and account data in the blockchain, which can be used as The consensus node or accounting node constitutes the server of the blockchain and provides services to the client of the blockchain platform.
  • the consortium chain is the consortium chain of the financial system, so that each full node of the consortium chain is various banks, financial institutions, etc., and these banks and financial institutions jointly provide users with financial services through the blockchain platform.
  • the non-tampering and security of transaction information is guaranteed through the consensus of various banks and financial institutions.
  • user transaction information, personal information, etc. are stored at each trusted full node, so as not to cause personal information The leak.
  • user A in Figure 1 belongs to a user in the blockchain, and uses the services in the blockchain through the client corresponding to its first account.
  • the client may be a light node in the blockchain, that is, the local Blocks and account information in the blockchain are not stored, or the client can use the services provided in the blockchain through the gateway provided by the trusted platform as shown in Figure 1.
  • the client can use a specific service in the blockchain by sending a transaction to any full node, or the client can send a transaction to any full node through a gateway.
  • step S202 a first transaction is sent to any of the full nodes, and the first transaction is used to store the authentication information of the first account in the blockchain, and the data field of the first transaction
  • the authentication information is included in the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account.
  • the first smart contract includes, for example, a set1() function, which is used to set the preset authentication information field of the account in the state tree in the blockchain.
  • the sending field (From) in the first transaction Is the first account
  • the receiving field (To) is the contract account of the first smart contract
  • the data field (Data) is the call to the set1() function in the first smart contract, such as ⁇ set1(strings, strings)," 6f8ae --, "186115 -- ⁇ , where "6f8ae" is the private key of the first account, for example, and "186115" is the mobile phone number, which is the two input parameters of the set1() function.
  • the A transaction includes a digital signature generated by the private key of the first account.
  • the first account sends the first transaction to any full node in FIG. 1 (for example, node 1).
  • node 1 After receiving the first transaction, node 1 will spread the first transaction in the consensus node after verifying the first transaction. transaction.
  • the first smart contract is executed at the accounting node, so that the authentication information field of the first account in the local state tree of the accounting node is set to the above transmission by executing the first smart contract. Enter the parameters (ie, private key and mobile phone number).
  • the authentication information is used to unlock the first account when needed.
  • the authentication information includes a private key and a mobile phone number
  • the embodiment of this specification is not limited to this.
  • the authentication information may also include three or four authentication items, etc., and the authentication items are not limited to private keys and mobile phone numbers, but can be determined by users themselves, such as private keys, preset passwords, and mobile phone numbers. Number, any two or more of the SMS verification code, etc.
  • the authentication information of the account is automatically stored in the state tree through the smart contract
  • this specification is not limited to this.
  • the Set function included in the function of the first smart contract may not perform any operation, and is only used for The authentication information is transferred, so that the authentication information and the call of the smart contract are stored in the block as a transaction for subsequent authentication information search.
  • the node in the blockchain can determine that the transaction is a transaction for depositing authentication information based on the smart contract account called in the transaction, so as to update the first account's pre-order in the local state tree.
  • Authentication information field set set.
  • the first transaction is, for example, a common transaction (such as a transfer transaction) sent by the first account to any full node.
  • a predetermined flag can be set to identify the The transaction is used to deposit authentication information.
  • the data field of the transaction includes the text of "deposit authentication information" and the authentication information itself. Therefore, the first account sends such a first transaction to the second account.
  • the first transaction After the consensus is stored in the block, that is, the first account stores the authentication information of the first account in the blockchain, and the authentication information can be based on the first account and the text "deposit authentication information" Retrieve from the block.
  • Fig. 4 shows a flow chart of a method for depositing authentication information of an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes, The method is executed by all nodes in the blockchain and includes:
  • Step S402 Receive a first transaction initiated by a first account from the blockchain, the first transaction is used to deposit authentication information of the first account in the blockchain, and the data field of the first transaction includes The authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items; and
  • Step S404 Based on the first transaction, the authentication information of the first account is stored locally.
  • This method is a process in which each full node in the blockchain deposits the authentication information of the first account in the blockchain based on the first transaction after the first account client sends the first transaction to the blockchain.
  • depositing to the blockchain includes depositing to the local state tree, or depositing to the local block, and so on.
  • step S402 a first transaction initiated by a first account is received from the blockchain, the first transaction is used to deposit authentication information of the first account in the blockchain, and the data of the first transaction
  • the field includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  • the full node is, for example, an accounting node determined by consensus. It can be any full node in the blockchain, such as nodes 1, 2, 3, and 4 in Figure 1.
  • the full node can be accessed from the first account client
  • the first transaction is received, or the first transaction can be received from any other full node.
  • the full node used to execute the method is not limited to the accounting node.
  • it may be a consensus node of the accounting node, which receives the first transaction contained in the newly generated block from the accounting node, thereby Receive the first transaction.
  • the first transaction is, for example, a transaction that calls the first smart contract.
  • step S404 based on the first transaction, the authentication information of the first account is stored locally.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a pre-deployed block chain for depositing into an account.
  • Smart contract for authentication information. Therefore, the full node automatically stores the authentication information under the first account in the local state tree by executing the first smart contract locally. Or, the set function included in the first smart contract may not perform any operation and is only used to transmit information. Therefore, the full node executes the first smart contract locally and based on predetermined rules, the full node itself The authentication information is stored under the first account in the local state tree.
  • the first transaction includes a predetermined mark (for example, the account of the first smart contract, or the text "deposit authentication information"), which is used to indicate the first transaction.
  • a transaction is a transaction used to store authentication information in the blockchain. For example, after the accounting node generates a new block based on the first transaction, it stores the block in the local block database, and spreads the block to other full nodes, so as to be in a new area of the blockchain. The authentication information of the first account is stored in the block.
  • Fig. 5 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes
  • the authentication information of the first account is pre-stored locally, where the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the method is executed by the first account client and includes:
  • Step S502 Send a second transaction to any of the full nodes, where the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
  • the authentication information of the first account has been stored in the blockchain.
  • the first account is locked due to the loss or theft of the private key, the first account is forbidden to conduct any transactions other than the second transaction.
  • the first account retrieves the private key, The first account can be unlocked by sending a second transaction.
  • the second transaction is a transaction for invoking a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  • the second smart contract includes the "UnLock()" function, which is used when it is determined that the predetermined conditions are met, that is, when it is determined that the authentication information is included in the second transaction, the state tree in the blockchain Modify the lock state of the specified account to the normal state.
  • the specific form of the second transaction invoking the second smart contract initiated by the first account is similar to that of the first transaction. It also includes a sending field, a receiving field, and a data field.
  • the sending field is the first account and the receiving field is the second
  • the contract account of the smart contract is the call to the "UnLock()" function, for example ⁇ UnLock(strings,strings), "6f8ae --, "186115" ⁇ .
  • "6f8ae" and "186115" are the private key and mobile phone number, which are two verification items.
  • the second smart contract is not limited to including the above UnLock function, so as to modify the state of the account in the state tree by executing the function.
  • the UnLock function included in the second smart contract may not Any operation performed is only used to transfer the information for unlocking the first account, so that each node of the blockchain actively modifies the state of the first account based on predetermined rules when executing the smart contract.
  • the second transaction is, for example, an ordinary transaction (such as a transfer transaction) sent by the first account to any full node.
  • a predetermined flag can be set to identify the The transaction is used to unlock the account.
  • the data field of the transaction includes the text "Unlock Account" and authentication information. Therefore, the first account sends such a second transaction.
  • the second transaction is stored in the block after consensus, that is, the first account spreads the information for unlocking the first account to the blockchain.
  • Fig. 6 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the full nodes
  • the authentication information of the first account is pre-stored locally, where the authentication information includes at least two authentication items, the current state of the first account is the locked state, and the method is executed by all nodes in the blockchain, including :
  • Step S602 receiving a second transaction initiated by the first account from the blockchain, where the second transaction is used to unlock the first account in the blockchain;
  • Step S604 Obtain authentication information of the first account locally
  • Step S606 Based on the authentication information, verify whether the authentication information is included in the second transaction;
  • step S608 if the verification is passed, the first account is unlocked locally.
  • the accounting node is generated through the consensus of the consensus node in the blockchain, so that the accounting node and its consensus node can execute Figure 6
  • the consensus nodes should all be full nodes in the blockchain, that is, all blocks and account databases are included locally, so that the transaction can be verified based on the content in the database.
  • step S602 a second transaction initiated by the first account is received from the blockchain, and the second transaction is used to unlock the first account in the blockchain.
  • the billing node may directly receive the second transaction from the second account, or may receive the second transaction from other full nodes in the block.
  • step S604 the authentication information of the first account is obtained locally.
  • the authentication information is stored in the local state tree of the full node, wherein obtaining the authentication information of the first account locally includes obtaining all the authentication information from the local state tree. Describe the authentication information of the first account.
  • the authentication information is stored in a block, where obtaining the authentication information of the first account locally includes retrieving a transaction with the first account and a predetermined mark from multiple blocks in the local area. (That is, the above-mentioned first transaction), thereby obtaining the authentication information of the first account.
  • the full node After the full node receives the second transaction and obtains the authentication information, it first uses the public key of the first account to verify the digital signature of the transaction. In addition, in Ethereum, for example, the full node also checks the first account's The remaining fuel for verification, etc. will not be listed here.
  • the second transaction is a transaction that calls a second smart contract, so that the full node starts to execute the above Unlock() function in the smart contract, thereby executing the function
  • the following steps S606-S608 are automatically performed.
  • the second transaction includes a predetermined flag for indicating that the second transaction is a transaction for unlocking an account, so that the full node locally executes the following steps S606-S608 .
  • step S606 based on the authentication information, verify whether the authentication information is included in the second transaction.
  • the authentication information can be compared with the information included in the second transaction to determine whether the authentication information is included in the second transaction. For example, if the authentication information includes two authentication items, a private key and a mobile phone number, the obtained private key and mobile phone number can be compared with the private key and mobile phone number included in the data field of the second transaction respectively to determine Whether the second transaction includes the authentication information.
  • step S608 if the verification is passed, the first account is unlocked locally.
  • the second transaction is a transaction that calls a second smart contract.
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account, so that The account node unlocks the first account by executing the second smart contract locally, that is, by executing the above-mentioned "UnLock()" function, step S606 is executed, and if the verification is passed, the local state tree is automatically changed The locked state of the first account in is changed to the normal state.
  • the second transaction is a normal transaction. As described above, it transmits the information for unlocking the first account to the accounting node, so that the accounting node can put the local state tree in the local state tree if the verification is passed. The locked state of the first account of is changed to the unlocked state.
  • the second transaction is packaged into a block and sent to other full nodes, thereby storing the block in the blockchain.
  • other nodes can also modify the state of the first account in the local state tree based on the second transaction, so as to achieve the data consistency of each full node.
  • Fig. 7 shows a device 700 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes.
  • the device is deployed on the first account client terminal in the blockchain, and includes: a transaction initiation unit 71, configured to send a first transaction to any of the full nodes, and the first transaction is used to deposit in the blockchain Enter the authentication information of the first account, the data field of the first transaction includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication The information includes at least two authentication items.
  • the transaction initiation unit is further configured to send the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway is connected to the blockchain.
  • Fig. 8 shows a device 800 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes.
  • the device is deployed on a full node in the blockchain and includes: a receiving unit 81 configured to receive a first transaction initiated by a first account from the blockchain, and the first transaction is used to store in the blockchain Enter the authentication information of the first account, the data field of the first transaction includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication The information includes at least two authentication items; and the deposit unit 82 is configured to deposit the authentication information of the first account locally based on the first transaction.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account
  • the The depositing unit 82 is further configured to store the authentication information under the first account in the local state tree by executing the first smart contract locally.
  • Fig. 9 shows a device 900 for unlocking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes are local
  • the authentication information of the first account is pre-stored, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on the first account client, including: transaction initiation
  • the unit 91 is configured to send a second transaction to any one of the full nodes, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
  • the second transaction is a transaction for invoking a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  • Fig. 10 shows a device 1000 for unlocking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes are local
  • the authentication information of the first account is pre-stored, where the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device deployed on a full node in the blockchain includes:
  • the receiving unit 101 is configured to receive a second transaction initiated by the first account from the blockchain, and the second transaction is used to unlock the first account in the blockchain;
  • the acquiring unit 102 is configured to:
  • the authentication information of the first account is acquired locally;
  • the second transaction is a transaction that calls a second smart contract
  • the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account
  • the unlocking unit 104 also It is configured to unlock the first account by executing the second smart contract locally.
  • the authentication information is stored in the local state tree of the full node, wherein the obtaining unit 102 is further configured to obtain the authentication information of the first account from the local state tree.
  • Another aspect of this specification provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed in a computer, the computer is caused to execute any of the above methods.
  • Another aspect of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, any one of the above methods is implemented.
  • this solution adopts the multi-authentication authentication method, and the user pre-stores his own set authentication information in the blockchain, so that the user can When thawing is required, a safe and convenient account thawing operation can be performed based on the authentication information. Improved the usability of the blockchain platform.
  • the steps of the method or algorithm described in the embodiments disclosed in this document can be implemented by hardware, a software module executed by a processor, or a combination of the two.
  • the software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or all areas in the technical field. Any other known storage medium.

Abstract

A method and an apparatus for unlocking an account in a block chain. The block chain is a consortium chain, and a full node in the consortium chain is a trusted node. The full node locally pre-stores authentication information of a first account, the authentication information comprising at least two authentication items, and when the current state of the first account is a locked state, said method is performed by the full node in the block chain, and comprises: receiving, from the block chain, a second transaction initiated by the first account, the second transaction being used for unlocking the first account in the block chain (S602); acquiring authentication information of the first account locally (S604); verifying, on the basis of the authentication information, whether the authentication information is included in the second transaction (S606); and if the verification is passed, unlocking the first account locally (S608).

Description

一种在区块链中解锁账户的方法和装置Method and device for unlocking account in blockchain 技术领域Technical field
本说明书实施例涉及区块链技术领域,更具体地,涉及一种在区块链中解锁账户的方法和装置。The embodiments of this specification relate to the field of blockchain technology, and more specifically, to a method and device for unlocking an account in a blockchain.
背景技术Background technique
区块链技术是构建在点对点(P2P)网络上,利用链式数据结构来验证与存储数据,利用分布式节点共识算法来生成和更新数据,利用密码学的方式保证数据传输和访问的安全,利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算范式。所述区块链例如为以太坊区块链。在以太坊中,新增了账户的概念,其中,由用户创建的账户为以太坊中的外部账户。通常,每个外部账户拥有一对公私钥,其中,私钥用于进行数字签名,公钥用于验证签名。另外,在各个全节点中,在节点本地的数据库中以状态树的形式维持区块链中全部账户的数据表,该状态树为账户地址与账户内容之间的映射,所述账号内容包括,账户余额、账户密钥信息(哈希值)等。然而,在目前已有的区块链中,当用户发现区块链账户的密钥丢失或被盗从而冻结账户后,一般无法进行账户解锁操作,从而导致用户账户内的资产无法转出。Blockchain technology is built on a peer-to-peer (P2P) network, using chained data structures to verify and store data, using distributed node consensus algorithms to generate and update data, and using cryptography to ensure the security of data transmission and access. A new distributed infrastructure and computing paradigm that uses smart contracts composed of automated script codes to program and manipulate data. The blockchain is, for example, the Ethereum blockchain. In Ethereum, the concept of accounts has been added, among which the accounts created by users are external accounts in Ethereum. Generally, each external account has a pair of public and private keys, where the private key is used for digital signatures, and the public key is used for signature verification. In addition, in each full node, the data table of all accounts in the blockchain is maintained in the form of a state tree in the local database of the node. The state tree is the mapping between the account address and the account content, and the account content includes: Account balance, account key information (hash value), etc. However, in existing blockchains, when users find that the key of the blockchain account is lost or stolen and thus freeze the account, the account cannot be unlocked generally, resulting in the inability to transfer the assets in the user account.
因此,需要一种更有效的在区块链中解锁账户的方案。Therefore, a more effective solution for unlocking accounts in the blockchain is needed.
发明内容Summary of the invention
本说明书实施例旨在提供一种更有效的在区块链中解锁账户的方案。The embodiments of this specification aim to provide a more effective solution for unlocking accounts in the blockchain.
为实现上述目的,本说明书一个方面提供一种在区块链中存入账户的认证信息的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述方法由区块链中的第一账户客户端执行,包括:向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。In order to achieve the above objective, one aspect of this specification provides a method for storing authentication information of an account in a blockchain. The blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes. The method is executed by the first account client in the blockchain, and includes: sending a first transaction to any of the full nodes, the first transaction being used to deposit authentication information of the first account in the blockchain, so The data field of the first transaction includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约。In one embodiment, the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account.
在一个实施例中,所述认证信息包括两个认证项,所述两个认证项为以下多项中的任意两项:私钥、密码、手机号、短信验证码。In one embodiment, the authentication information includes two authentication items, and the two authentication items are any two of the following items: private key, password, mobile phone number, and SMS verification code.
在一个实施例中,向任一所述全节点发送第一交易包括,通过可信平台提供的网关向任一所述全节点发送第一交易,其中,所述网关与所述区块链连接。In one embodiment, sending the first transaction to any of the full nodes includes sending the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway is connected to the blockchain .
本说明书另一方面提供一种在区块链中存入账户的认证信息的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述方法由区块链中的全节点执行,包括:从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项;以及基于所述第一交易,在本地存入所述第一账户的认证信息。Another aspect of this specification provides a method for depositing account authentication information in a blockchain, where the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the method is determined by the block chain. The execution of all nodes in the chain includes: receiving a first transaction initiated by a first account from the blockchain, and the first transaction is used to deposit authentication information of the first account in the blockchain, and the first The data field of the transaction includes the authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items; and based on the For the first transaction, the authentication information of the first account is stored locally.
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约,其中,基于所述第一交易,在本地存入所述第一账户的认证信息包括,通过在本地执行所述第一智能合约而将所述认证信息存入本地的状态树中的第一账户下。In one embodiment, the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing the authentication information of the account, wherein the In the first transaction, storing the authentication information of the first account locally includes storing the authentication information in the first account in the local state tree by executing the first smart contract locally.
本说明书另一方面提供一种在区块链中解锁账户的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述方法由第一账户客户端执行,包括:向任一所述全节点发送第二交易,所述第二交易用于在区块链中解锁所述第一账户,所述第二交易的数据字段中包括所述认证信息。Another aspect of this specification provides a method for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally prestore the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the method is executed by the first account client and includes: reporting to any of the full nodes A second transaction is sent, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约。In one embodiment, the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
本说明书另一方面提供一种在区块链中解锁账户的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述方法由区块链中的全节点执行,包括:从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户;从本地获取所述第一账户的认证信息;基于所述认证信息,验证所述第二交易中是否包括所述认证信息;以及在验证通过的情况中,在本地进行对第一账户的解锁。Another aspect of this specification provides a method for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally prestore the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is the locked state, and the method is executed by all nodes in the blockchain, including: from the blockchain Receive a second transaction initiated by the first account, the second transaction is used to unlock the first account in the blockchain; obtain the authentication information of the first account locally; based on the authentication information, verify the Whether the authentication information is included in the second transaction; and in the case where the verification is passed, the first account is unlocked locally.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约 为区块链中预先部署的用于解锁账户的智能合约,其中,在本地进行对第一账户的解锁包括,通过在本地执行所述第二智能合约而进行对第一账户的解锁。In one embodiment, the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account. The first transaction is performed locally. The unlocking of the account includes unlocking the first account by executing the second smart contract locally.
在一个实施例中,所述认证信息被存储在所述全节点的本地状态树中,其中,从本地获取所述第一账户的认证信息包括,从本地状态树中获取所述第一账户的认证信息。In one embodiment, the authentication information is stored in the local state tree of the full node, wherein obtaining the authentication information of the first account locally includes obtaining the authentication information of the first account from the local state tree. Certification Information.
本说明书另一方面提供一种在区块链中存入账户的认证信息的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述装置部署于区块链中的第一账户客户端,包括:Another aspect of this specification provides a device for storing authentication information of an account in a blockchain. The blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the device is deployed in a district. The first account client in the blockchain includes:
交易发起单元,配置为,向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。The transaction initiation unit is configured to send a first transaction to any one of the full nodes, where the first transaction is used to store authentication information of the first account in the blockchain, and the data field of the first transaction includes The authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
在一个实施例中,所述交易发起单元还配置为,通过可信平台提供的网关向任一所述全节点发送第一交易,其中,所述网关与所述区块链连接。In an embodiment, the transaction initiation unit is further configured to send the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway is connected to the blockchain.
本说明书另一方面提供一种在区块链中存入账户的认证信息的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述装置部署于区块链中的全节点,包括:接收单元,配置为,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项;以及存入单元,配置为,基于所述第一交易,在本地存入所述第一账户的认证信息。Another aspect of this specification provides a device for storing authentication information of an account in a blockchain. The blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the device is deployed in a district. The full node in the block chain includes: a receiving unit configured to receive a first transaction initiated by the first account from the block chain, and the first transaction is used for verification of depositing the first account in the block chain Information, the data field of the first transaction includes the authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentications Item; and a deposit unit configured to deposit authentication information of the first account locally based on the first transaction.
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约,其中,所述存入单元还配置为,通过在本地执行所述第一智能合约而将所述认证信息存入本地的状态树中的第一账户下。In one embodiment, the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account, wherein the The deposit unit is further configured to store the authentication information under the first account in the local state tree by executing the first smart contract locally.
本说明书另一方面提供一种在区块链中解锁账户的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述装置部署于第一账户客户端,包括:交易发起单元,配置为,向任一所述全节点发送第二交易,所述第二交易用于在区块链中解锁所述第一账户,所述第二交易的数据字段中 包括所述认证信息。Another aspect of this specification provides a device for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally pre-store the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on the first account client and includes: a transaction initiation unit configured to, A second transaction is sent to any of the full nodes, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约。In one embodiment, the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
本说明书另一方面提供一种在区块链中解锁账户的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述装置部署于区块链中的全节点,包括:接收单元,配置为,从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户;获取单元,配置为,从本地获取所述第一账户的认证信息;验证单元,配置为,基于所述认证信息,验证所述第二交易中是否包括所述认证信息;以及解锁单元,配置为,在验证通过的情况中,在本地进行对第一账户的解锁。Another aspect of this specification provides a device for unlocking an account in a blockchain, where the blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally prestore the first The authentication information of the account, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on a full node in the blockchain and includes: a receiving unit configured to , Receiving a second transaction initiated by the first account from the blockchain, where the second transaction is used to unlock the first account in the blockchain; the obtaining unit is configured to obtain the first account locally Authentication information; a verification unit configured to, based on the authentication information, verify whether the second transaction includes the authentication information; and an unlocking unit configured to, in the case of passing the verification, perform a local verification of the first Unlock the account.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约,其中,所述解锁单元还配置为,通过在本地执行所述第二智能合约而进行对第一账户的解锁。In an embodiment, the second transaction is a transaction that calls a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account, wherein the unlocking unit is also configured In order to unlock the first account by executing the second smart contract locally.
在一个实施例中,所述认证信息被存储在所述全节点的本地状态树中,其中,所述获取单元还配置为,从本地状态树中获取所述第一账户的认证信息。In an embodiment, the authentication information is stored in the local state tree of the full node, wherein the obtaining unit is further configured to obtain the authentication information of the first account from the local state tree.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项方法。Another aspect of this specification provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute any of the above methods.
本说明书另一方面提供一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项方法。Another aspect of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, any one of the above methods is implemented.
相比于传统区块链平台中用户的账户冻结之后无法解冻的问题,本方案通过采用多认证项认证方式,通过用户预先在区块链中存入其自身设定的认证信息,使得用户在需要解冻时可基于该认证信息进行安全方便的账户解冻操作。提高了区块链平台的可用性。Compared with the problem that the user’s account cannot be unfrozen after being frozen in the traditional blockchain platform, this solution adopts the multi-authentication authentication method, and the user pre-stores his own set authentication information in the blockchain, so that the user can When thawing is required, a safe and convenient account thawing operation can be performed based on the authentication information. Improved the usability of the blockchain platform.
附图说明Description of the drawings
通过结合附图描述本说明书实施例,可以使得本说明书实施例更加清楚。By describing the embodiments of this specification in conjunction with the drawings, the embodiments of this specification can be made clearer.
图1示出根据本说明书实施例的区块链系统100的示意图;Fig. 1 shows a schematic diagram of a blockchain system 100 according to an embodiment of the present specification;
图2示出根据本说明书实施例的一种在区块链中存入账户的认证信息的方法流程图;Figure 2 shows a flow chart of a method for depositing account authentication information in a blockchain according to an embodiment of this specification;
图3示出了第一交易的示意形式;Figure 3 shows a schematic form of the first transaction;
图4示出根据本说明书实施例的一种在区块链中存入账户的认证信息的方法流程图;Fig. 4 shows a flowchart of a method for depositing authentication information of an account in a blockchain according to an embodiment of the present specification;
图5示出根据本说明书实施例的一种在区块链中解锁账户的方法流程图;Fig. 5 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification;
图6示出根据本说明书实施例的一种在区块链中解锁账户的方法流程图;Fig. 6 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification;
图7示出根据本说明书实施例的一种在区块链中存入账户的认证信息的装置700;FIG. 7 shows a device 700 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification;
图8示出根据本说明书实施例的一种在区块链中存入账户的认证信息的装置800;FIG. 8 shows a device 800 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification;
图9示出根据本说明书实施例的一种在区块链中解锁账户的装置900;FIG. 9 shows a device 900 for unlocking an account in the blockchain according to an embodiment of the present specification;
图10示出根据本说明书实施例的一种在区块链中解锁账户的装置1000。Fig. 10 shows a device 1000 for unlocking an account in a blockchain according to an embodiment of the present specification.
具体实施方式Detailed ways
下面将结合附图描述本说明书实施例。The embodiments of this specification will be described below with reference to the drawings.
图1示出根据本说明书实施例的区块链系统100的示意图。如图1所示,区块链系统100中包括联盟链11,其中包括图中1、2、3、4四个共识节点(全节点),另外,联盟链11中还包括多个用户客户端,这些用户客户端拥有自己的账户、私钥和公钥,其可视为该区块链的轻节点,或者其通过网关12进行区块链中的操作。如图中所示,所述用户客户端例如包括客户端A和客户端B。其中,客户端B为恶意客户端,其例如可能会盗取客户端A的账户私钥,以进行非法交易活动。网关12由可信平台提供,其可与区块链中任一全节点连接,从而使得用户客户端可通过其进行与区块链相关的各种操作,例如发送交易。客户端A可通过发起第一交易,而在区块链中存入其认证信息。在例如客户端B盗取客户端A的账户私钥,从而在区块链中锁定客户端A的账户之后,客户端A在找回私钥的情况中,可发起第二交易,以使得在区块链中对其账户进行解锁。Fig. 1 shows a schematic diagram of a blockchain system 100 according to an embodiment of the present specification. As shown in Figure 1, the blockchain system 100 includes a consortium chain 11, which includes four consensus nodes (full nodes) 1, 2, 3, and 4 in the figure. In addition, the consortium chain 11 also includes multiple user clients These user clients have their own accounts, private keys, and public keys, which can be regarded as light nodes of the blockchain, or they can perform operations in the blockchain through the gateway 12. As shown in the figure, the user client includes client A and client B, for example. Among them, the client B is a malicious client, which, for example, may steal the private key of the client A's account to conduct illegal transactions. The gateway 12 is provided by a trusted platform, which can be connected to any full node in the blockchain, so that the user client can use it to perform various operations related to the blockchain, such as sending transactions. Client A can store its authentication information in the blockchain by initiating the first transaction. For example, after client B steals the account private key of client A, and locks the account of client A in the blockchain, client A can initiate a second transaction in the case of retrieving the private key, so that Unlock its account in the blockchain.
可以理解,上文参考图1的描述仅是示意性的,并不用于限制本说明书实施例的范围。下面将详细描述上述存入认证信息和解锁账户的过程。It can be understood that the above description with reference to FIG. 1 is only schematic and is not used to limit the scope of the embodiments of the present specification. The process of depositing authentication information and unlocking the account will be described in detail below.
图2示出根据本说明书实施例的一种在区块链中存入账户的认证信息的方法流程图,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述方法由区块链中的 第一账户客户端执行,包括:Fig. 2 shows a flow chart of a method for storing authentication information of an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes, The method is executed by the first account client in the blockchain and includes:
步骤S202,向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。Step S202: Send a first transaction to any of the full nodes, the first transaction is used to store the authentication information of the first account in the blockchain, and the data field of the first transaction includes the authentication information The authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
如图1中所示,联盟链中例如包括四个全节点,这四个全节点为可信节点,其本地都包括区块链中的全部区块和账户数据,可用作为区块链中的共识节点或记账节点,其构成区块链的服务端,对区块链平台的客户端提供服务。例如,所述联盟链为金融体系的联盟链,从而,该联盟链的各个全节点为各个银行、金融机构等,这些银行、金融机构通过区块链平台共同为用户提供金融服务。在该联盟链中,通过各个银行、金融机构的共识保证了交易信息的不可篡改和安全性,同时用户的交易信息、个人信息等都保存在各个可信全节点处,从而不会造成个人信息的泄露。As shown in Figure 1, the alliance chain includes, for example, four full nodes. These four full nodes are trusted nodes, and their locals include all blocks and account data in the blockchain, which can be used as The consensus node or accounting node constitutes the server of the blockchain and provides services to the client of the blockchain platform. For example, the consortium chain is the consortium chain of the financial system, so that each full node of the consortium chain is various banks, financial institutions, etc., and these banks and financial institutions jointly provide users with financial services through the blockchain platform. In the consortium chain, the non-tampering and security of transaction information is guaranteed through the consensus of various banks and financial institutions. At the same time, user transaction information, personal information, etc. are stored at each trusted full node, so as not to cause personal information The leak.
例如图1中的用户A属于该区块链中的用户,其通过与其第一账户对应的客户端使用区块链中的服务,该客户端例如可以为区块链中的轻节点,即本地不存储有区块链中的区块、账户信息等,或者,该客户端可如图1所示通过可信平台提供的网关使用区块链中提供的服务。例如,该客户端可通过向任一全节点发送交易而使用区块链中的特定服务,或者,该客户端可通过网关向任一全节点发送交易。For example, user A in Figure 1 belongs to a user in the blockchain, and uses the services in the blockchain through the client corresponding to its first account. The client may be a light node in the blockchain, that is, the local Blocks and account information in the blockchain are not stored, or the client can use the services provided in the blockchain through the gateway provided by the trusted platform as shown in Figure 1. For example, the client can use a specific service in the blockchain by sending a transaction to any full node, or the client can send a transaction to any full node through a gateway.
在该方法中,在步骤S202,向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。In this method, in step S202, a first transaction is sent to any of the full nodes, and the first transaction is used to store the authentication information of the first account in the blockchain, and the data field of the first transaction The authentication information is included in the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约。所述第一智能合约中例如包括set1()函数,用于在区块链中的状态树中设置账户的预置的认证信息字段。当第一账户发起调用第一智能合约的第一交易时,第一交易例如如图3所示,图3示出了第一交易的示意形式,其中,第一交易中的发送字段(From)为第一账户,接收字段(To)为该第一智能合约的合约账户,数据字段(Data)为对第一智能合约中的set1()函数的调用,例如{set1(strings,strings),”6f8ae…”,“186115…”},其中,“6f8ae…”例如为第一账户的私钥,“186115…”例如为手机号,其为set1()函数的两个输入参数,另外,该第 一交易包括通过第一账户的私钥生成的数字签名。第一账户例如向图1中的任一全节点(例如节点1)发送该第一交易,节点1在接收该第一交易之后,对该第一交易进行验证之后在共识节点中扩散该第一交易。在通过共识节点确定记账节点之后,在记账节点执行该第一智能合约,从而通过执行该第一智能合约将记账节点本地的状态树中的第一账户的认证信息字段设置为上述传入参数(即私钥和手机号)。In one embodiment, the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account. The first smart contract includes, for example, a set1() function, which is used to set the preset authentication information field of the account in the state tree in the blockchain. When the first account initiates the first transaction that calls the first smart contract, the first transaction is, for example, as shown in FIG. 3, which shows a schematic form of the first transaction, where the sending field (From) in the first transaction Is the first account, the receiving field (To) is the contract account of the first smart contract, and the data field (Data) is the call to the set1() function in the first smart contract, such as {set1(strings, strings)," 6f8ae...", "186115..."}, where "6f8ae..." is the private key of the first account, for example, and "186115..." is the mobile phone number, which is the two input parameters of the set1() function. In addition, the A transaction includes a digital signature generated by the private key of the first account. For example, the first account sends the first transaction to any full node in FIG. 1 (for example, node 1). After receiving the first transaction, node 1 will spread the first transaction in the consensus node after verifying the first transaction. transaction. After the accounting node is determined by the consensus node, the first smart contract is executed at the accounting node, so that the authentication information field of the first account in the local state tree of the accounting node is set to the above transmission by executing the first smart contract. Enter the parameters (ie, private key and mobile phone number).
所述认证信息用于在需要时解锁第一账户,虽然在上文中,认证信息包括私钥和手机号,本说明书实施例不限于此。例如,认证信息中还可以包括三项、四项认证项等,并且,所述认证项不限于为私钥和手机号,而可以由用户自己确定,例如可以为私钥、预置密码、手机号、短信验证码中的任意两项或多项等等。通过在认证信息中包括至少两个认证项,并且由用户自身确定该至少两个认证项,增加了恶意用户破解该认证信息的难度,提高了安全性。The authentication information is used to unlock the first account when needed. Although in the above, the authentication information includes a private key and a mobile phone number, the embodiment of this specification is not limited to this. For example, the authentication information may also include three or four authentication items, etc., and the authentication items are not limited to private keys and mobile phone numbers, but can be determined by users themselves, such as private keys, preset passwords, and mobile phone numbers. Number, any two or more of the SMS verification code, etc. By including at least two authentication items in the authentication information, and determining the at least two authentication items by the user himself, the difficulty for a malicious user to crack the authentication information is increased, and the security is improved.
可以理解,这里虽然通过智能合约自动在状态树中存入账户的认证信息,本说明书不限于此,例如,所述第一智能合约的函数包括的Set函数可以不进行任何操作,从而仅用于传递该认证信息,使得将该认证信息与该智能合约的调用一起作为交易被存入区块中,以用于后续的认证信息的查找。或者可通过预定好的规则,使得区块链中的节点基于该交易中调用的智能合约账户,确定该交易为用于存入认证信息的交易,从而在本地状态树中更新第一账户的预置的认证信息字段。It can be understood that although the authentication information of the account is automatically stored in the state tree through the smart contract, this specification is not limited to this. For example, the Set function included in the function of the first smart contract may not perform any operation, and is only used for The authentication information is transferred, so that the authentication information and the call of the smart contract are stored in the block as a transaction for subsequent authentication information search. Or, through a predetermined rule, the node in the blockchain can determine that the transaction is a transaction for depositing authentication information based on the smart contract account called in the transaction, so as to update the first account's pre-order in the local state tree. Authentication information field set.
在一个实施例中,所述第一交易例如为由第一账户发送给任一全节点的普通交易(例如转账交易),在该交易的数据字段中,可设置预定标志,以用于标识该交易用于存入认证信息,例如,该交易的数据字段中包括“存入认证信息”文本和认证信息本身,从而,第一账户通过对第二账户发送这样的第一交易,当第一交易在经过共识被存入区块中之后,也即,第一账户向区块链中存入了第一账户的认证信息,该认证信息可通过基于第一账户和“存入认证信息”文本在区块中进行检索获取。In one embodiment, the first transaction is, for example, a common transaction (such as a transfer transaction) sent by the first account to any full node. In the data field of the transaction, a predetermined flag can be set to identify the The transaction is used to deposit authentication information. For example, the data field of the transaction includes the text of "deposit authentication information" and the authentication information itself. Therefore, the first account sends such a first transaction to the second account. When the first transaction After the consensus is stored in the block, that is, the first account stores the authentication information of the first account in the blockchain, and the authentication information can be based on the first account and the text "deposit authentication information" Retrieve from the block.
图4示出根据本说明书实施例的一种在区块链中存入账户的认证信息的方法流程图,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述方法由区块链中的全节点执行,包括:Fig. 4 shows a flow chart of a method for depositing authentication information of an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes, The method is executed by all nodes in the blockchain and includes:
步骤S402,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括 至少两个认证项;以及Step S402: Receive a first transaction initiated by a first account from the blockchain, the first transaction is used to deposit authentication information of the first account in the blockchain, and the data field of the first transaction includes The authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items; and
步骤S404,基于所述第一交易,在本地存入所述第一账户的认证信息。Step S404: Based on the first transaction, the authentication information of the first account is stored locally.
该方法即为在第一账户客户端向区块链发出第一交易之后,区块链中的各个全节点基于第一交易向区块链中存入第一账户的认证信息的过程。如上文所述,此处,向区块链中存入包括,向本地状态树中存入,或向本地区块中存入,等等。This method is a process in which each full node in the blockchain deposits the authentication information of the first account in the blockchain based on the first transaction after the first account client sends the first transaction to the blockchain. As mentioned above, here, depositing to the blockchain includes depositing to the local state tree, or depositing to the local block, and so on.
首先,在步骤S402,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。First, in step S402, a first transaction initiated by a first account is received from the blockchain, the first transaction is used to deposit authentication information of the first account in the blockchain, and the data of the first transaction The field includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
该全节点例如为通过共识确定的记账节点,其可以为区块链中的任一全节点,如图1中的节点1、2、3、4,该全节点可从第一账户客户端接收该第一交易,或者可从其它任意全节点接收该第一交易。可以理解,用于执行该方法的全节点不限于为记账节点,例如,其可以为记账节点的共识节点,其通过从记账节点接收新生成的区块中包含的第一交易,从而接收该第一交易。参考上文对步骤S202中的描述,该第一交易例如为调用第一智能合约的交易。The full node is, for example, an accounting node determined by consensus. It can be any full node in the blockchain, such as nodes 1, 2, 3, and 4 in Figure 1. The full node can be accessed from the first account client The first transaction is received, or the first transaction can be received from any other full node. It can be understood that the full node used to execute the method is not limited to the accounting node. For example, it may be a consensus node of the accounting node, which receives the first transaction contained in the newly generated block from the accounting node, thereby Receive the first transaction. With reference to the description in step S202 above, the first transaction is, for example, a transaction that calls the first smart contract.
在步骤S404,基于所述第一交易,在本地存入所述第一账户的认证信息。In step S404, based on the first transaction, the authentication information of the first account is stored locally.
参考上文中对步骤S202中的描述,在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约。从而,该全节点通过在本地执行所述第一智能合约而自动将所述认证信息存入本地的状态树中的第一账户下。或者,所述第一智能合约包括的set函数可不进行任何操作,仅用于传递信息,从而,该全节点通过在本地执行所述第一智能合约,基于预定规则,由全节点自身将所述认证信息存入本地的状态树中的第一账户下。With reference to the above description of step S202, in one embodiment, the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a pre-deployed block chain for depositing into an account. Smart contract for authentication information. Therefore, the full node automatically stores the authentication information under the first account in the local state tree by executing the first smart contract locally. Or, the set function included in the first smart contract may not perform any operation and is only used to transmit information. Therefore, the full node executes the first smart contract locally and based on predetermined rules, the full node itself The authentication information is stored under the first account in the local state tree.
参考上文中对步骤S202中的描述,在一个实施例中,所述第一交易中包括预定标志(例如第一智能合约的账户,或者“存入认证信息”文本),用于指示该第一交易为用于向区块链中存入认证信息的交易。例如记账节点基于所述第一交易生成新的区块之后,将该区块存入本地的区块数据库中,并将该区块扩散给其它全节点,从而在区块链的新的区块中存入第一账户的认证信息。With reference to the above description of step S202, in one embodiment, the first transaction includes a predetermined mark (for example, the account of the first smart contract, or the text "deposit authentication information"), which is used to indicate the first transaction. A transaction is a transaction used to store authentication information in the blockchain. For example, after the accounting node generates a new block based on the first transaction, it stores the block in the local block database, and spreads the block to other full nodes, so as to be in a new area of the blockchain. The authentication information of the first account is stored in the block.
图5示出根据本说明书实施例的一种在区块链中解锁账户的方法流程图,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账 户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述方法由第一账户客户端执行,包括:Fig. 5 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes The authentication information of the first account is pre-stored locally, where the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the method is executed by the first account client and includes:
步骤S502,向任一所述全节点发送第二交易,所述第二交易用于在区块链中解锁所述第一账户,所述第二交易的数据字段中包括所述认证信息。Step S502: Send a second transaction to any of the full nodes, where the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
在如上所述执行图2和图4所示方法之后,区块链中已存入了第一账户的认证信息。在该情况中,当第一账户由于私钥丢失或被窃取等原因而被锁定之后,第一账户被禁止进行除第二交易以外的任何交易,在第一账户找回私钥的情况中,第一账户可通过发送第二交易进行账户解锁。After the methods shown in FIGS. 2 and 4 are executed as described above, the authentication information of the first account has been stored in the blockchain. In this case, when the first account is locked due to the loss or theft of the private key, the first account is forbidden to conduct any transactions other than the second transaction. In the case where the first account retrieves the private key, The first account can be unlocked by sending a second transaction.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约。例如,第二智能合约中包括“UnLock()”函数,其用于在确定满足预定条件的情况中,即,在确定第二交易中包括认证信息的情况中,在区块链中的状态树中将指定账户的锁定状态修改为正常状态。第一账户发起的调用第二智能合约的第二交易的具体形式与第一交易的形式类似,其也包括发送字段、接收字段和数据字段,其中发送字段为第一账户,接收字段为第二智能合约的合约账户,数据字段为对“UnLock()”函数的调用,例如{UnLock(strings,strings),“6f8ae…”,“186115…”}。如上文所述,”6f8ae…”,“186115…”分别为私钥和手机号,即为两个验证项。In one embodiment, the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account. For example, the second smart contract includes the "UnLock()" function, which is used when it is determined that the predetermined conditions are met, that is, when it is determined that the authentication information is included in the second transaction, the state tree in the blockchain Modify the lock state of the specified account to the normal state. The specific form of the second transaction invoking the second smart contract initiated by the first account is similar to that of the first transaction. It also includes a sending field, a receiving field, and a data field. The sending field is the first account and the receiving field is the second The contract account of the smart contract, the data field is the call to the "UnLock()" function, for example {UnLock(strings,strings), "6f8ae...", "186115..."}. As mentioned above, "6f8ae..." and "186115..." are the private key and mobile phone number, which are two verification items.
可以理解,同样地,所述第二智能合约不限于包括上述UnLock函数,以通过执行该函数而在状态树中修改账户的状态,在一个实施例中,第二智能合约包括的UnLock函数可以不进行任何操作,仅用于传递解锁第一账户的信息,从而使得在区块链各个节点在执行该智能合约时基于预定规则主动修改第一账户的状态。It can be understood that, similarly, the second smart contract is not limited to including the above UnLock function, so as to modify the state of the account in the state tree by executing the function. In one embodiment, the UnLock function included in the second smart contract may not Any operation performed is only used to transfer the information for unlocking the first account, so that each node of the blockchain actively modifies the state of the first account based on predetermined rules when executing the smart contract.
在一个实施例中,所述第二交易例如为由第一账户发送给任一全节点的普通交易(例如转账交易),在该交易的数据字段中,可设置预定标志,以用于标识该交易用于解锁账户,例如,该交易的数据字段包括“解锁账户”文本和认证信息。从而,第一账户通过发送这样的第二交易,当第二交易在经过共识被存入区块中之后,也即,第一账户向区块链中传播了解锁第一账户的信息。In one embodiment, the second transaction is, for example, an ordinary transaction (such as a transfer transaction) sent by the first account to any full node. In the data field of the transaction, a predetermined flag can be set to identify the The transaction is used to unlock the account. For example, the data field of the transaction includes the text "Unlock Account" and authentication information. Therefore, the first account sends such a second transaction. After the second transaction is stored in the block after consensus, that is, the first account spreads the information for unlocking the first account to the blockchain.
图6示出根据本说明书实施例的一种在区块链中解锁账户的方法流程图,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁 定状态,所述方法由区块链中的全节点执行,包括:Fig. 6 shows a flowchart of a method for unlocking an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the full nodes The authentication information of the first account is pre-stored locally, where the authentication information includes at least two authentication items, the current state of the first account is the locked state, and the method is executed by all nodes in the blockchain, including :
步骤S602,从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户;Step S602, receiving a second transaction initiated by the first account from the blockchain, where the second transaction is used to unlock the first account in the blockchain;
步骤S604,从本地获取所述第一账户的认证信息;Step S604: Obtain authentication information of the first account locally;
步骤S606,基于所述认证信息,验证所述第二交易中是否包括所述认证信息;Step S606: Based on the authentication information, verify whether the authentication information is included in the second transaction;
步骤S608,在验证通过的情况中,在本地进行对第一账户的解锁。In step S608, if the verification is passed, the first account is unlocked locally.
在第一账户进行图5所示方法之后,即向区块链中发起第二交易之后,区块链中通过共识节点的共识产生记账节点,从而记账节点及其共识节点可执行图6所示的方法,所述共识节点都应为区块链中的全节点,即,本地都包括全部区块和账户数据库,从而可基于数据库中的内容进行对交易的验证。After the method shown in Figure 5 is performed on the first account, that is, after the second transaction is initiated in the blockchain, the accounting node is generated through the consensus of the consensus node in the blockchain, so that the accounting node and its consensus node can execute Figure 6 In the method shown, the consensus nodes should all be full nodes in the blockchain, that is, all blocks and account databases are included locally, so that the transaction can be verified based on the content in the database.
首先,在步骤S602,从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户。First, in step S602, a second transaction initiated by the first account is received from the blockchain, and the second transaction is used to unlock the first account in the blockchain.
第一账户客户端在如上所述将该第二交易发送给区块链中的任一全节点之后,该任一全节点然后将该第二交易扩散给其它全节点。从而,例如记账节点可以从第二账户直接接收第二交易,或者可从区块中的其它全节点接收第二交易。After the first account client sends the second transaction to any full node in the blockchain as described above, the any full node then spreads the second transaction to other full nodes. Thus, for example, the billing node may directly receive the second transaction from the second account, or may receive the second transaction from other full nodes in the block.
在步骤S604,从本地获取所述第一账户的认证信息。In step S604, the authentication information of the first account is obtained locally.
如上为所述,在一个实施例中,所述认证信息被存储在所述全节点的本地状态树中,其中,从本地获取所述第一账户的认证信息包括,从本地状态树中获取所述第一账户的认证信息。As described above, in one embodiment, the authentication information is stored in the local state tree of the full node, wherein obtaining the authentication information of the first account locally includes obtaining all the authentication information from the local state tree. Describe the authentication information of the first account.
在一个实施例中,所述认证信息被存储在区块中,其中,从本地获取所述第一账户的认证信息包括,从本地的多个区块中检索具有第一账户和预定标志的交易(即上述第一交易),从而获取第一账户的认证信息。In one embodiment, the authentication information is stored in a block, where obtaining the authentication information of the first account locally includes retrieving a transaction with the first account and a predetermined mark from multiple blocks in the local area. (That is, the above-mentioned first transaction), thereby obtaining the authentication information of the first account.
该全节点在接收到该第二交易并获取认证信息之后,首先使用第一账户的公钥对该交易的数字签名进行验证,另外,在例如以太坊中,该全节点还对第一账户的剩余燃料进行验证等,在此不一一列出。After the full node receives the second transaction and obtains the authentication information, it first uses the public key of the first account to verify the digital signature of the transaction. In addition, in Ethereum, for example, the full node also checks the first account's The remaining fuel for verification, etc. will not be listed here.
在进行上述常规的验证之后,在一个实施例中,所述第二交易为调用第二智能合约的交易,从而该全节点开始执行该智能合约中的上述Unlock()函数,从而通过执行该函数自动进行下述的步骤S606-S608。在一个实施例中,如上文所述,所述第二交易中 包括预定标志,用于指示该第二交易为用于解锁账户的交易,从而使得该全节点本地执行下述的步骤S606-S608。After performing the above-mentioned conventional verification, in one embodiment, the second transaction is a transaction that calls a second smart contract, so that the full node starts to execute the above Unlock() function in the smart contract, thereby executing the function The following steps S606-S608 are automatically performed. In one embodiment, as described above, the second transaction includes a predetermined flag for indicating that the second transaction is a transaction for unlocking an account, so that the full node locally executes the following steps S606-S608 .
在步骤S606,基于所述认证信息,验证所述第二交易中是否包括所述认证信息。In step S606, based on the authentication information, verify whether the authentication information is included in the second transaction.
在获取认证信息之后,可通过将该认证信息与第二交易中包括的信息相比对,从而确定第二交易中是否包括所述认证信息。例如,所述认证信息中包括私钥和手机号两个认证项,则可将获取的私钥和手机号分别与第二交易的数据字段中包括的私钥和手机号进行比对,从而确定第二交易是否包括所述认证信息。After obtaining the authentication information, the authentication information can be compared with the information included in the second transaction to determine whether the authentication information is included in the second transaction. For example, if the authentication information includes two authentication items, a private key and a mobile phone number, the obtained private key and mobile phone number can be compared with the private key and mobile phone number included in the data field of the second transaction respectively to determine Whether the second transaction includes the authentication information.
在步骤S608,在验证通过的情况中,在本地进行对第一账户的解锁。In step S608, if the verification is passed, the first account is unlocked locally.
在一个实施例中,所述第二交易为调用第二智能合约的交易,如上文所述,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约,从而,记账节点通过在本地执行所述第二智能合约而进行对第一账户的解锁,也即,通过执行上述“UnLock()”函数,执行步骤S606,在验证通过的情况中,自动将本地状态树中的第一账户的锁定状态修改为正常状态。In one embodiment, the second transaction is a transaction that calls a second smart contract. As described above, the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account, so that The account node unlocks the first account by executing the second smart contract locally, that is, by executing the above-mentioned "UnLock()" function, step S606 is executed, and if the verification is passed, the local state tree is automatically changed The locked state of the first account in is changed to the normal state.
在一个实施例中,所述第二交易为普通交易,如上文所述,其向记账节点传递了解锁第一账户的信息,从而记账节点可在验证通过的情况中将本地状态树中的第一账户的锁定状态修改为解锁状态。In one embodiment, the second transaction is a normal transaction. As described above, it transmits the information for unlocking the first account to the accounting node, so that the accounting node can put the local state tree in the local state tree if the verification is passed. The locked state of the first account of is changed to the unlocked state.
记账节点在修改本地状态树之后,将第二交易打包到区块中并发送给其它全节点,从而将该区块存入区块链中。其它节点在接收包括第二交易的区块之后,可同样地基于第二交易,修改本地状态树中第一账户的状态,从而达到各个全节点的数据一致性。After the accounting node modifies the local state tree, the second transaction is packaged into a block and sent to other full nodes, thereby storing the block in the blockchain. After receiving the block including the second transaction, other nodes can also modify the state of the first account in the local state tree based on the second transaction, so as to achieve the data consistency of each full node.
图7示出根据本说明书实施例的一种在区块链中存入账户的认证信息的装置700,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述装置部署于区块链中的第一账户客户端,包括:交易发起单元71,配置为,向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。Fig. 7 shows a device 700 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes. The device is deployed on the first account client terminal in the blockchain, and includes: a transaction initiation unit 71, configured to send a first transaction to any of the full nodes, and the first transaction is used to deposit in the blockchain Enter the authentication information of the first account, the data field of the first transaction includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication The information includes at least two authentication items.
在一个实施例中,所述交易发起单元还配置为,通过可信平台提供的网关向任一所述全节点发送第一交易,其中,所述网关与所述区块链连接。In an embodiment, the transaction initiation unit is further configured to send the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway is connected to the blockchain.
图8示出根据本说明书实施例的一种在区块链中存入账户的认证信息的装置800, 所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述装置部署于区块链中的全节点,包括:接收单元81,配置为,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项;以及存入单元82,配置为,基于所述第一交易,在本地存入所述第一账户的认证信息。Fig. 8 shows a device 800 for depositing authentication information of an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, and all nodes in the consortium chain are trusted nodes. The device is deployed on a full node in the blockchain and includes: a receiving unit 81 configured to receive a first transaction initiated by a first account from the blockchain, and the first transaction is used to store in the blockchain Enter the authentication information of the first account, the data field of the first transaction includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication The information includes at least two authentication items; and the deposit unit 82 is configured to deposit the authentication information of the first account locally based on the first transaction.
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约,其中,所述存入单元82还配置为,通过在本地执行所述第一智能合约而将所述认证信息存入本地的状态树中的第一账户下。In one embodiment, the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account, wherein the The depositing unit 82 is further configured to store the authentication information under the first account in the local state tree by executing the first smart contract locally.
图9示出根据本说明书实施例的一种在区块链中解锁账户的装置900,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述装置部署于第一账户客户端,包括:交易发起单元91,配置为,向任一所述全节点发送第二交易,所述第二交易用于在区块链中解锁所述第一账户,所述第二交易的数据字段中包括所述认证信息。Fig. 9 shows a device 900 for unlocking an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes are local The authentication information of the first account is pre-stored, wherein the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on the first account client, including: transaction initiation The unit 91 is configured to send a second transaction to any one of the full nodes, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约。In one embodiment, the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
图10示出根据本说明书实施例的一种在区块链中解锁账户的装置1000,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述装置部署于区块链中的全节点,包括:接收单元101,配置为,从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户;获取单元102,配置为,从本地获取所述第一账户的认证信息;验证单元103,配置为,基于所述认证信息,验证所述第二交易中是否包括所述认证信息;以及解锁单元104,配置为,在验证通过的情况中,在本地进行对第一账户的解锁。Fig. 10 shows a device 1000 for unlocking an account in a blockchain according to an embodiment of the present specification. The blockchain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes are local The authentication information of the first account is pre-stored, where the authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device deployed on a full node in the blockchain includes: The receiving unit 101 is configured to receive a second transaction initiated by the first account from the blockchain, and the second transaction is used to unlock the first account in the blockchain; the acquiring unit 102 is configured to: The authentication information of the first account is acquired locally; the verification unit 103 is configured to verify whether the authentication information is included in the second transaction based on the authentication information; and the unlocking unit 104 is configured to: In this case, the first account is unlocked locally.
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约,其中,所述解锁单元104还配置为,通过在本地执行所述第二智能合约而进行对第一账户的解锁。In one embodiment, the second transaction is a transaction that calls a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account, wherein the unlocking unit 104 also It is configured to unlock the first account by executing the second smart contract locally.
在一个实施例中,所述认证信息被存储在所述全节点的本地状态树中,其中,所述获取单元102还配置为,从本地状态树中获取所述第一账户的认证信息。In an embodiment, the authentication information is stored in the local state tree of the full node, wherein the obtaining unit 102 is further configured to obtain the authentication information of the first account from the local state tree.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项方法。Another aspect of this specification provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute any of the above methods.
本说明书另一方面提供一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项方法。Another aspect of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, any one of the above methods is implemented.
相比于传统区块链平台中用户的账户冻结之后无法解冻的问题,本方案通过采用多认证项认证方式,通过用户预先在区块链中存入其自身设定的认证信息,使得用户在需要解冻时可基于该认证信息进行安全方便的账户解冻操作。提高了区块链平台的可用性。Compared with the problem that the user’s account cannot be unfrozen after being frozen in the traditional blockchain platform, this solution adopts the multi-authentication authentication method, and the user pre-stores his own set authentication information in the blockchain, so that the user can When thawing is required, a safe and convenient account thawing operation can be performed based on the authentication information. Improved the usability of the blockchain platform.
需要理解,本文中的“第一”,“第二”等描述,仅仅为了描述的简单而对相似概念进行区分,并不具有其他限定作用。It should be understood that the descriptions of "first", "second", etc. in this text are merely used to distinguish similar concepts for simplicity of description, and do not have other limiting effects.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
本领域普通技术人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执轨道,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art should be further aware that the units and algorithm steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two, in order to clearly illustrate the hardware For the interchangeability with software, the composition and steps of each example have been described generally in accordance with the function in the above description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of this application.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执轨道的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、 只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the method or algorithm described in the embodiments disclosed in this document can be implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or all areas in the technical field. Any other known storage medium.
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The specific implementations described above further describe the purpose, technical solutions and beneficial effects of this application in detail. It should be understood that the above are only specific implementations of this application and are not intended to limit the scope of this application. The scope of protection, any modification, equivalent replacement, improvement, etc. made within the spirit and principles of this application shall be included in the scope of protection of this application.

Claims (24)

  1. 一种在区块链中存入账户的认证信息的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述方法由区块链中的第一账户客户端执行,包括:A method for storing authentication information of an account in a blockchain, where the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the method is determined by the first account in the blockchain Client execution, including:
    向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。Send a first transaction to any of the full nodes, where the first transaction is used to store the authentication information of the first account in the blockchain, the data field of the first transaction includes the authentication information, the The authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  2. 根据权利要求1所述的方法,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约。The method according to claim 1, wherein the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account .
  3. 根据权利要求1所述的方法,其中,所述认证信息包括两个认证项,所述两个认证项为以下多项中的任意两项:私钥、密码、手机号、短信验证码。The method according to claim 1, wherein the authentication information includes two authentication items, and the two authentication items are any two of the following items: a private key, a password, a mobile phone number, and a short message verification code.
  4. 根据权利要求1所述的方法,其中,向任一所述全节点发送第一交易包括,通过可信平台提供的网关向任一所述全节点发送第一交易,其中,所述网关与所述区块链连接。The method according to claim 1, wherein sending the first transaction to any of the full nodes comprises sending the first transaction to any of the full nodes through a gateway provided by a trusted platform, wherein the gateway and the all nodes The blockchain connection.
  5. 一种在区块链中存入账户的认证信息的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述方法由区块链中的全节点执行,包括:A method for storing authentication information of an account in a blockchain, the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the method is executed by all nodes in the blockchain ,include:
    从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项;以及A first transaction initiated by a first account is received from the blockchain, the first transaction is used to deposit authentication information of the first account in the blockchain, and the data field of the first transaction includes the authentication Information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items; and
    基于所述第一交易,在本地存入所述第一账户的认证信息。Based on the first transaction, the authentication information of the first account is stored locally.
  6. 根据权利要求5所述的方法,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约,其中,基于所述第一交易,在本地存入所述第一账户的认证信息包括,通过在本地执行所述第一智能合约而将所述认证信息存入本地的状态树中的第一账户下。The method according to claim 5, wherein the first transaction is a transaction that calls a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account , Wherein, based on the first transaction, storing the authentication information of the first account locally includes storing the authentication information in the local state tree by executing the first smart contract locally. Under the account.
  7. 一种在区块链中解锁账户的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述方法由第一账户客户端执行,包括:A method for unlocking an account in a block chain, the block chain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally pre-store the authentication information of the first account, wherein The authentication information includes at least two authentication items, the current state of the first account is a locked state, and the method is executed by the first account client, including:
    向任一所述全节点发送第二交易,所述第二交易用于在区块链中解锁所述第一账户,所述第二交易的数据字段中包括所述认证信息。A second transaction is sent to any of the full nodes, the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the authentication information.
  8. 根据权利要求7所述的方法,其中,所述第二交易为调用第二智能合约的交易, 所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约。The method according to claim 7, wherein the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  9. 一种在区块链中解锁账户的方法,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述方法由区块链中的全节点执行,包括:A method for unlocking an account in a block chain, the block chain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally pre-store the authentication information of the first account, wherein The authentication information includes at least two authentication items, the current state of the first account is a locked state, and the method is executed by all nodes in the blockchain and includes:
    从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户;Receiving a second transaction initiated by the first account from the blockchain, where the second transaction is used to unlock the first account in the blockchain;
    从本地获取所述第一账户的认证信息;Obtain the authentication information of the first account locally;
    基于所述认证信息,验证所述第二交易中是否包括所述认证信息;以及Based on the authentication information, verify whether the authentication information is included in the second transaction; and
    在验证通过的情况中,在本地进行对第一账户的解锁。If the verification is passed, the first account is unlocked locally.
  10. 根据权利要求9所述的方法,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约,其中,在本地进行对第一账户的解锁包括,通过在本地执行所述第二智能合约而进行对第一账户的解锁。The method according to claim 9, wherein the second transaction is a transaction that calls a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account, wherein Unlocking the first account locally includes unlocking the first account by executing the second smart contract locally.
  11. 根据权利要求9所述的方法,其中,所述认证信息被存储在所述全节点的本地状态树中,其中,从本地获取所述第一账户的认证信息包括,从本地状态树中获取所述第一账户的认证信息。The method according to claim 9, wherein the authentication information is stored in the local state tree of the full node, wherein obtaining the authentication information of the first account locally includes obtaining all the authentication information from the local state tree. Describe the authentication information of the first account.
  12. 一种在区块链中存入账户的认证信息的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述装置部署于区块链中的第一账户客户端,包括:A device for storing authentication information of an account in a blockchain, where the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the device is deployed in the first part of the blockchain. Account client, including:
    交易发起单元,配置为,向任一所述全节点发送第一交易,所述第一交易用于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项。The transaction initiation unit is configured to send a first transaction to any one of the full nodes, where the first transaction is used to store authentication information of the first account in the blockchain, and the data field of the first transaction includes The authentication information, the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items.
  13. 根据权利要求12所述的装置,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约。The device according to claim 12, wherein the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account .
  14. 根据权利要求12所述的装置,其中,所述认证信息包括两个认证项,所述两个认证项为以下多项中的任意两项:私钥、密码、手机号、短信验证码。The device according to claim 12, wherein the authentication information includes two authentication items, and the two authentication items are any two of the following items: a private key, a password, a mobile phone number, and a short message verification code.
  15. 根据权利要求12所述的装置,其中,所述交易发起单元还配置为,通过可信平台提供的网关向任一所述全节点发送第一交易,其中,所述网关与所述区块链连接。The device according to claim 12, wherein the transaction initiation unit is further configured to send the first transaction to any one of the full nodes through a gateway provided by a trusted platform, wherein the gateway and the blockchain connection.
  16. 一种在区块链中存入账户的认证信息的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述装置部署于区块链中的全节点,包括:A device for storing authentication information of an account in a blockchain, where the blockchain is a consortium chain, all nodes in the consortium chain are trusted nodes, and the device is deployed on all nodes in the blockchain ,include:
    接收单元,配置为,从区块链中接收由第一账户发起的第一交易,所述第一交易用 于在区块链中存入第一账户的认证信息,所述第一交易的数据字段中包括所述认证信息,所述认证信息用于在所述第一账户被锁定之后解锁所述第一账户,其中,所述认证信息包括至少两个认证项;以及The receiving unit is configured to receive, from the blockchain, a first transaction initiated by a first account, the first transaction is used to store authentication information of the first account in the blockchain, and data of the first transaction The field includes the authentication information, and the authentication information is used to unlock the first account after the first account is locked, wherein the authentication information includes at least two authentication items; and
    存入单元,配置为,基于所述第一交易,在本地存入所述第一账户的认证信息。The deposit unit is configured to deposit the authentication information of the first account locally based on the first transaction.
  17. 根据权利要求16所述的装置,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的认证信息的智能合约,其中,所述存入单元还配置为,通过在本地执行所述第一智能合约而将所述认证信息存入本地的状态树中的第一账户下。The device according to claim 16, wherein the first transaction is a transaction for invoking a first smart contract, and the first smart contract is a smart contract pre-deployed in the blockchain for depositing authentication information of an account , Wherein the depositing unit is further configured to store the authentication information under the first account in the local state tree by executing the first smart contract locally.
  18. 一种在区块链中解锁账户的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述装置部署于第一账户客户端,包括:A device for unlocking an account in a block chain, the block chain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally pre-store the authentication information of the first account, wherein The authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on the first account client, including:
    交易发起单元,配置为,向任一所述全节点发送第二交易,所述第二交易用于在区块链中解锁所述第一账户,所述第二交易的数据字段中包括所述认证信息。The transaction initiation unit is configured to send a second transaction to any of the full nodes, where the second transaction is used to unlock the first account in the blockchain, and the data field of the second transaction includes the Certification Information.
  19. 根据权利要求18所述的装置,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约。The device according to claim 18, wherein the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account.
  20. 一种在区块链中解锁账户的装置,所述区块链为联盟链,所述联盟链中的全节点为可信节点,所述全节点本地预先存储有第一账户的认证信息,其中,所述认证信息包括至少两个认证项,所述第一账户的当前状态为锁定状态,所述装置部署于区块链中的全节点,包括:A device for unlocking an account in a block chain, the block chain is a consortium chain, the full nodes in the consortium chain are trusted nodes, and the full nodes locally pre-store the authentication information of the first account, wherein The authentication information includes at least two authentication items, the current state of the first account is a locked state, and the device is deployed on a full node in the blockchain, including:
    接收单元,配置为,从区块链中接收由第一账户发起的第二交易,所述第二交易用于在区块链中解锁所述第一账户;The receiving unit is configured to receive a second transaction initiated by the first account from the blockchain, where the second transaction is used to unlock the first account in the blockchain;
    获取单元,配置为,从本地获取所述第一账户的认证信息;The obtaining unit is configured to obtain the authentication information of the first account locally;
    验证单元,配置为,基于所述认证信息,验证所述第二交易中是否包括所述认证信息;以及A verification unit configured to, based on the authentication information, verify whether the authentication information is included in the second transaction; and
    解锁单元,配置为,在验证通过的情况中,在本地进行对第一账户的解锁。The unlocking unit is configured to unlock the first account locally when the verification is passed.
  21. 根据权利要求20所述的装置,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于解锁账户的智能合约,其中,所述解锁单元还配置为,通过在本地执行所述第二智能合约而进行对第一账户的解锁。The device according to claim 20, wherein the second transaction is a transaction for invoking a second smart contract, and the second smart contract is a smart contract pre-deployed in the blockchain for unlocking an account, wherein, The unlocking unit is further configured to unlock the first account by executing the second smart contract locally.
  22. 根据权利要求20所述的装置,其中,所述认证信息被存储在所述全节点的本地状态树中,其中,所述获取单元还配置为,从本地状态树中获取所述第一账户的认证 信息。The apparatus according to claim 20, wherein the authentication information is stored in a local state tree of the full node, and wherein the obtaining unit is further configured to obtain the information of the first account from the local state tree. Certification Information.
  23. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-11中任一项的所述的方法。A computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method of any one of claims 1-11.
  24. 一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-11中任一项所述的方法。A computing device, comprising a memory and a processor, characterized in that executable code is stored in the memory, and when the processor executes the executable code, the device described in any one of claims 1-11 is implemented method.
PCT/CN2020/081989 2019-06-12 2020-03-30 Method and apparatus for unlocking account in block chain WO2020248656A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910507859.4A CN110415114A (en) 2019-06-12 2019-06-12 A kind of method and apparatus of the unlocking account in block chain
CN201910507859.4 2019-06-12

Publications (1)

Publication Number Publication Date
WO2020248656A1 true WO2020248656A1 (en) 2020-12-17

Family

ID=68358973

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/081989 WO2020248656A1 (en) 2019-06-12 2020-03-30 Method and apparatus for unlocking account in block chain

Country Status (3)

Country Link
CN (1) CN110415114A (en)
TW (1) TWI770486B (en)
WO (1) WO2020248656A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110415114A (en) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 A kind of method and apparatus of the unlocking account in block chain
CN113762963A (en) * 2021-08-27 2021-12-07 中国银联股份有限公司 Transaction processing method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107067255A (en) * 2017-02-27 2017-08-18 腾讯科技(深圳)有限公司 The treating method and apparatus of account in block chain
CN107623569A (en) * 2017-09-30 2018-01-23 矩阵元技术(深圳)有限公司 Block chain key escrow and restoration methods, device based on Secret sharing techniques
WO2018112038A1 (en) * 2016-12-14 2018-06-21 Wal-Mart Stores, Inc. Controlling access to a locked space using cryptographic keys stored on a blockchain
CN108777684A (en) * 2018-05-30 2018-11-09 招商银行股份有限公司 Identity identifying method, system and computer readable storage medium
CN108830577A (en) * 2018-06-07 2018-11-16 北京连琪科技有限公司 The account of block chain is established and restoration methods
CN110415114A (en) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 A kind of method and apparatus of the unlocking account in block chain

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106920080B (en) * 2017-02-15 2021-03-30 捷德(中国)科技有限公司 Account management method and system for digital currency
US10911237B2 (en) * 2017-03-10 2021-02-02 Jim Zubov Virally connected network of people as a means to recover encrypted data should the encryption key become lost
CN108881120B (en) * 2017-05-12 2020-12-04 创新先进技术有限公司 Data processing method and device based on block chain
CN108647964B (en) * 2018-05-02 2023-07-28 郑杰骞 Block chain data processing method and device and computer readable storage medium
CN109035012B (en) * 2018-06-11 2020-11-17 西安纸贵互联网科技有限公司 Cross-chain processing method of block chain system and computer readable storage medium
CN108810137B (en) * 2018-06-11 2021-10-01 西安纸贵互联网科技有限公司 Alliance block chain system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018112038A1 (en) * 2016-12-14 2018-06-21 Wal-Mart Stores, Inc. Controlling access to a locked space using cryptographic keys stored on a blockchain
CN107067255A (en) * 2017-02-27 2017-08-18 腾讯科技(深圳)有限公司 The treating method and apparatus of account in block chain
CN107623569A (en) * 2017-09-30 2018-01-23 矩阵元技术(深圳)有限公司 Block chain key escrow and restoration methods, device based on Secret sharing techniques
CN108777684A (en) * 2018-05-30 2018-11-09 招商银行股份有限公司 Identity identifying method, system and computer readable storage medium
CN108830577A (en) * 2018-06-07 2018-11-16 北京连琪科技有限公司 The account of block chain is established and restoration methods
CN110415114A (en) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 A kind of method and apparatus of the unlocking account in block chain

Also Published As

Publication number Publication date
TWI770486B (en) 2022-07-11
CN110415114A (en) 2019-11-05
TW202046208A (en) 2020-12-16

Similar Documents

Publication Publication Date Title
US11651109B2 (en) Permission management method, permission verification method, and related apparatus
JP7442606B2 (en) Secure reuse of private keys for dynamic node groups
US11477032B2 (en) System and method for decentralized-identifier creation
US11496310B2 (en) Methods and systems for universal storage and access to user-owned credentials for trans-institutional digital authentication
US9635000B1 (en) Blockchain identity management system based on public identities ledger
CN110958110B (en) Block chain private data management method and system based on zero knowledge proof
KR102237014B1 (en) System and method for blockchain-based authentication
JP2023051935A (en) Method regarding blockchain network
KR20190042567A (en) Dynamic access control on block chaining
CN109617692B (en) Anonymous login method and system based on block chain
KR102236341B1 (en) System and method for blockchain-based data management
US20080010673A1 (en) System, apparatus, and method for user authentication
CN110930153B (en) Block chain privacy data management method and system based on hidden third party account
US20200204338A1 (en) Securing public key cryptographic algorithms
US11646897B2 (en) Method and apparatus for utilizing off-platform-resolved data as an input to code execution on a decentralized platform
WO2020248656A1 (en) Method and apparatus for unlocking account in block chain
US20200202349A1 (en) Multiple asset transactions
CN108604990A (en) The application method and device of local authorized certificate in terminal
US11823194B2 (en) Decentralized biometric authentication platform
CN108449348A (en) A kind of on-line authentication system and method for supporting user identity secret protection
US20200202344A1 (en) Private asset transactions
WO2020248657A1 (en) Method and apparatus for locking account in blockchain
KR20210069865A (en) REST API Based Cryptocurrency Trading System
CN116862519A (en) Method, device and equipment for processing anonymous account resource transfer based on blockchain
CN111898112A (en) Intellectual property trading platform based on block chain technology

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20821987

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20821987

Country of ref document: EP

Kind code of ref document: A1