WO2020248657A1 - 一种在区块链中锁定账户的方法和装置 - Google Patents

一种在区块链中锁定账户的方法和装置 Download PDF

Info

Publication number
WO2020248657A1
WO2020248657A1 PCT/CN2020/082427 CN2020082427W WO2020248657A1 WO 2020248657 A1 WO2020248657 A1 WO 2020248657A1 CN 2020082427 W CN2020082427 W CN 2020082427W WO 2020248657 A1 WO2020248657 A1 WO 2020248657A1
Authority
WO
WIPO (PCT)
Prior art keywords
account
transaction
blockchain
trust
information
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2020/082427
Other languages
English (en)
French (fr)
Inventor
方思羽
左军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Publication of WO2020248657A1 publication Critical patent/WO2020248657A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Definitions

  • the embodiments of this specification relate to the field of blockchain technology, and more specifically, to a method and device for locking 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 method and device for locking an account in the blockchain.
  • one aspect of this specification provides a method for depositing trusted account information of an account in a blockchain.
  • the method is executed by a first user's first account client in the blockchain and includes: obtaining A second account of the second user in the blockchain, where the second user is a trusted user of the first user; and initiates a first transaction, where the first transaction is used to deposit the first account in the blockchain Trusted account information of the account, the first transaction includes at least the second account as the trusted account of the first account, so that the trusted account information includes at least the second account, wherein the trusted account Has the right to lock the first account.
  • the first transaction is a transaction that calls a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing trusted account information of the account
  • the first smart contract The data field of a transaction includes at least the second account.
  • acquiring the second account of the second user in the blockchain includes acquiring the second account of the second user in the blockchain and its public key, wherein the data field of the first transaction The public key of the second account is further included, so that the public key of the second account is also included in the trusted account information.
  • Another aspect of this specification provides a method for depositing trust account information of an account in a blockchain.
  • the method is executed by all nodes in the blockchain and includes: receiving from the blockchain the information initiated by the first account The first transaction, the first transaction is used to deposit the trust account information of the first account in the blockchain, the first transaction includes at least a second account that is the trust account of the first account, and the trust account Having the authority to lock the first account; and based on the first transaction, locally deposit the trusted account information of the first account, wherein the trusted account information includes at least the second account.
  • the first transaction is a transaction that calls a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing trust account information of the account, wherein, based on In the first transaction, storing the trusted account information of the first account locally includes storing the trusted account information under the first account in the local state tree by executing the first smart contract locally .
  • depositing the trust account information of the first account locally includes depositing the trust account information of the first account in a new block locally based on the first transaction Account information, wherein the first transaction includes a predetermined mark, which is used to indicate that the first transaction is a transaction for depositing trusted account information in the blockchain.
  • the blockchain includes multiple full nodes.
  • the full nodes locally pre-store the trust account information of the first account.
  • the trust account The information includes at least a second account that is a trusted account of the first account.
  • the method is executed by the second account client and includes:
  • a second transaction is initiated, and the second transaction is used to lock the first account in the blockchain.
  • 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 locking an account
  • the data field of the second transaction Including the first account
  • the blockchain includes multiple full nodes.
  • the full nodes locally pre-store the trust account information of the first account.
  • the trust account The information includes at least a second account that is a trusted account of the first account.
  • the method is executed by all nodes in the blockchain, and includes: receiving from the blockchain the second account initiated by the second account for locking the first account Second transaction; obtain the trusted account information of the first account locally; verify whether the second account is the trusted account of the first account based on the trusted account information; and in the case of passing the verification, Lock the first account 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 locking an account
  • the first transaction is performed locally.
  • the locking of the account includes locking the first account by executing the second smart contract locally.
  • the trust account information is stored in the local state tree of the full node, wherein obtaining the trust account information of the first account locally includes obtaining the first account information from the local state tree. Trust account information of the account.
  • the trust account information is stored in a block, wherein obtaining the trust account information of the first account locally includes retrieving the trust account information of the first account from a plurality of blocks stored locally. Mark the transaction to obtain the trust account information of the first account.
  • the device for depositing trusted account information of an account in a blockchain.
  • the device is deployed on the first user's first account client in the blockchain and includes: an acquiring unit configured to , Acquiring a second account of a second user in the blockchain, the second user being a trusted user of the first user; and a transaction initiation unit configured to initiate a first transaction, and the first transaction is used for Deposit the trusted account information of the first account in the blockchain, and the first transaction includes at least the second account as the trusted account of the first account, so that the trusted account information includes at least the first account.
  • Two accounts wherein the trusted account has the authority to lock the first account.
  • the first transaction is a transaction that calls a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing trusted account information of the account
  • the first smart contract The data field of a transaction includes at least the second account.
  • the acquiring unit is further configured to acquire the second user's second account in the blockchain and its public key, wherein the data field of the first transaction also includes the public key of the second account. Key, so that the trusted account information also includes the public key of the second account.
  • Another aspect of this specification provides a device for depositing trust account information of an account in a blockchain.
  • the device is deployed on a full node in the blockchain and includes a receiving unit configured to receive from the blockchain
  • the first transaction initiated by the first account the first transaction is used to deposit the trust account information of the first account in the blockchain, and the first transaction includes at least the second as the trust account of the first account Account, the trusted account has the authority to lock the first account; and the deposit unit is configured to locally deposit the trusted account information of the first account based on the first transaction, wherein the trusted account information Includes at least the second account.
  • the first transaction is a transaction that calls a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing trust account information in the account
  • the depositing unit is further configured to store the trusted account information under the first account in the local state tree by executing the first smart contract locally.
  • the depositing unit is further configured to deposit trust account information of the first account in a new block locally based on the first transaction, wherein the first transaction includes a predetermined The flag is used to indicate that the first transaction is a transaction for depositing trust account information in the blockchain.
  • the blockchain includes a plurality of full nodes.
  • the full nodes locally pre-store the trust account information of the first account, and the trust account
  • the information includes at least a second account that is a trusted account of the first account.
  • the device is deployed on the second account client and includes:
  • the transaction initiation unit is configured to initiate a second transaction, and the second transaction is used to lock the first account in the blockchain.
  • 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 locking an account
  • the data field of the second transaction Including the first account
  • the blockchain includes a plurality of full nodes.
  • the full nodes locally pre-store the trust account information of the first account, and the trust account
  • the information includes at least a second account that is a trust account of the first account.
  • the device is deployed on a full node in the blockchain and includes a receiving unit configured to receive the user initiated by the second account from the blockchain.
  • the obtaining unit is configured to obtain the trusted account information of the first account locally;
  • the verification unit is configured to verify whether the second account is based on the trusted account information
  • the trust account of the first account; and the locking unit configured to lock the first account locally when the verification is passed.
  • 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 locking an account
  • the locking unit is also configured In order to lock the first account by executing the second smart contract locally.
  • the trust account information is stored in the local state tree of the full node, wherein the obtaining unit is further configured to obtain the trust account information of the first account from the local state tree.
  • the trust account information is stored in a block
  • the obtaining unit is further configured to retrieve a transaction with the first account and a predetermined flag from a plurality of blocks stored locally, thereby obtaining Trust account information of the first account.
  • 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, the memory stores executable code, and the processor implements any of the above methods when the executable code is executed.
  • the authority of the account is locked by authorizing a trusted third party, so that when the private key of the account is lost or stolen, the account can be locked by a third party, thereby Prevent further expansion of losses.
  • Fig. 1 shows a schematic diagram of a blockchain 100 according to an embodiment of the present specification
  • Figure 2 shows a method for depositing trusted account information of an account in a blockchain according to an embodiment of this specification
  • Figure 3 shows a schematic form of the first transaction
  • Figure 4 shows a method for depositing trusted account information of an account in a blockchain according to an embodiment of this specification
  • Figure 5 shows a method for locking an account in a blockchain according to an embodiment of this specification
  • Figure 6 shows a method for locking an account in a blockchain according to an embodiment of this specification
  • FIG. 7 shows a device 700 for depositing trusted account information of an account in a blockchain according to an embodiment of the present specification
  • FIG. 8 shows a device 800 for depositing trusted account information of an account in a blockchain according to an embodiment of the present specification
  • Fig. 9 shows a device 900 for locking an account in a blockchain according to an embodiment of the present specification
  • Fig. 10 shows a device 1000 for locking an account in a blockchain according to an embodiment of the present specification.
  • Fig. 1 shows a schematic diagram of a blockchain 100 according to an embodiment of the present specification.
  • the blockchain 100 is a consortium chain, which includes four consensus nodes (full nodes) 1, 2, 3, and 4 in the figure.
  • the blockchain also includes a number of Users, these users have their own accounts, private keys, and public keys. Their clients can be regarded as light nodes of the blockchain, or their clients can perform operations in the blockchain through the gateway.
  • the users include user A, user B, and user C, for example.
  • the user C is a malicious user, who, for example, may steal the private key of the user A to conduct illegal transactions.
  • the embodiment of this specification sets up a trust user mechanism for the user, so that the user can freeze (ie lock) his account by trusting the user after losing the private key to prevent further Loss.
  • user B is a trusted user of user A
  • user A stores the information that user B is a trusted user in the blockchain by sending the first transaction to the blockchain, and grants user B the right to freeze user A's account. Therefore, when the private key of the user A is lost, the user A can notify the user B offline, so that the user B sends the second transaction to the blockchain, so that the account of the user A is frozen in the blockchain.
  • the blockchain is not limited to a consortium chain, it may also be a public chain, etc.
  • the block chain is a public chain
  • the clients corresponding to users A, B, and C can also be full nodes in the block chain.
  • the consortium chain will be taken as an example for specific description.
  • Fig. 2 shows a method for depositing trusted account information of an account in a blockchain according to an embodiment of the present specification. The method is executed by a first user's first account client in the blockchain, including:
  • Step S202 Obtain a second account of a second user in the blockchain, where the second user is a trusted user of the first user;
  • Step S204 initiate a first transaction, the first transaction is used to deposit the trust account information of the first account in the blockchain, and the first transaction includes at least the second trust account of the first account. Account, so that the trusted account information includes at least the second account, wherein the trusted account has the authority to lock the first account.
  • step S202 a second account of a second user in the blockchain is obtained, and the second user is a trusted user of the first user.
  • the method is executed by the first user through his first account client in the blockchain, and is used to set his trust account in the blockchain, and the trust account has the authority to lock the first account.
  • the first user first determines a user who can be a trusted user, such as a second user. For example, after the first user obtains the consent of the second user he trusts offline, the second user is determined as a trusted user.
  • the first account client obtains the second account of the second user for initiating the first transaction in the next step.
  • the first account client may obtain the second account of the second user from the input of the first user, or the first account client may receive the second account from the second account client, and so on.
  • the public key of the second account may also be acquired to provide it to the first transaction in the next step.
  • this step only describes obtaining the account of one trusted user of the first user, in the embodiment of this specification, multiple trusted users of the first user can be similarly set by this method.
  • step S204 a first transaction is initiated.
  • the first transaction is used to deposit the trust account information of the first account in the blockchain, and the first transaction includes at least the first account that is the trust account of the first account.
  • Two accounts so that the trusted account information includes at least the second account, wherein the trusted account has the authority to lock the first account.
  • the client can store information in the blockchain by initiating a transaction.
  • the information is consensus and consistent with each node, so it has higher security and reliability.
  • the blockchain includes a variety of databases, such as blocks, account databases (status data trees), etc. Therefore, storing information in the blockchain includes storing information in databases such as blocks and account databases.
  • 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 setting up a trust account of an account.
  • the first smart contract includes, for example, a set1() function, which is used to set the preset trust account 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), "second Account” ⁇ , that is, "second account” is an input parameter of the set1() function.
  • the first 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). 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 on the accounting node, so that the trust account field of the first account in the local state tree of the accounting node is set to the second by executing the first smart contract Account.
  • more than one trusted account field can be set in the state tree database, for example, three trusted account fields can be set, so that the first account client can first obtain three trusted accounts and call set1() three times in the first transaction Function to set three trust accounts in the state tree.
  • the accounting node updates the state tree, it puts the first transaction into the block and stores it in the blockchain, and sends the block to other consensus nodes, so that other consensus nodes will also do the same after receiving the block. Update the trust account of the first account in the local state tree.
  • the first smart contract in addition to the set1() function, also includes the set2() function.
  • the set2() function is used to set the public key of the trust account of the account in the state tree.
  • the client also obtains the public key of the second account in step S202, and similarly calls the set2() function in this step, for example, the data field of the first transaction also includes "set2(strings) ,”Second account public key”", so as to set the trusted account public key field of the first account in the state tree through the first smart contract to facilitate the subsequent process of locking the account.
  • the trust account 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, so that only The information for setting the second account and its public key is transferred, so that the second account and its public key are stored in the block as a transaction together with the call of the smart contract for subsequent search of trusted account information.
  • nodes in the blockchain can determine that the transaction is a transaction for depositing trust account information based on the smart contract account called in the transaction, thereby updating the first account in the local state tree The preset trust account information field.
  • the first transaction is, for example, a common transaction (such as a transfer transaction) sent from the first account to the second account.
  • a predetermined flag can be set to identify the transaction. It is used to deposit trust account information, for example, the data field of the transaction is "deposit trust account information", and it is agreed that the trust account of the first account is the receiving account of the first transaction. Therefore, the first account sends such a first transaction to the second account.
  • the first account deposits the first account's value in the blockchain. Trust account information, and set the trusted account of the first account as the second account.
  • the data field of the first transaction may also include the public key of the second account, so that the trust account information of the first account also includes the public key of the second account.
  • the first transaction is not limited to the transaction sent by the first account to the second account, but can be the transaction sent by the first account to any account in the blockchain that is not the second account.
  • the transaction The data field of includes, for example, "set the "second account” as a trusted account", so as to propagate the trust account information of setting the second account as the trusted account to the blockchain.
  • a predetermined rule can be used to enable nodes in the blockchain to determine that the first transaction is a transaction for depositing trusted account information based on a predetermined flag in the first transaction, so as to update the first transaction in the local state tree.
  • a preset trusted account information field of an account can be used to enable nodes in the blockchain to determine that the first transaction is a transaction for depositing trusted account information based on a predetermined flag in the first transaction, so as to update the first transaction in the local state tree.
  • Fig. 4 shows a method for depositing trusted account information of an account in a blockchain according to an embodiment of the present specification. The method is executed by a full node in the blockchain and includes:
  • Step S402 Receive a first transaction initiated by the first account from the blockchain, the first transaction is used to deposit trust account information of the first account in the blockchain, and the first transaction includes at least as A second account of the trust account of the first account, the trust account having the authority to lock the first account; and
  • Step S404 based on the first transaction, locally deposit the trusted account information of the first account, where the trusted account information includes at least the second account.
  • This method is a process in which after the first account client sends the first transaction to the blockchain, each full node in the blockchain deposits the trust account information of the first account into the blockchain based on the first transaction.
  • depositing to the blockchain includes depositing to the state tree, or depositing to the block, and so on.
  • a first transaction initiated by a first account is received from the blockchain, and the first transaction is used to deposit trust account information of the first account in the blockchain.
  • At least a second account is included as a trusted account of the first account, and the trusted account has the authority to lock the first account.
  • 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. Therefore, refer to the above for step S202.
  • the full node can receive the first transaction from the first account client, or can receive the first transaction 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.
  • the first transaction is, for example, a transaction that calls the first smart contract, or the data field of the first transaction includes a predetermined flag to identify that it is used in the blockchain Transactions of trusted account information deposited in the first account.
  • step S404 based on the first transaction, the trusted account information of the first account is stored locally, wherein the trusted account information includes at least the second account.
  • the first transaction is a transaction for invoking a first smart contract
  • the first smart contract is a pre-deployed blockchain for depositing into an account.
  • the trust account information is stored under the first account in the local state tree.
  • the first transaction includes a predetermined flag (for example, the account of the first smart contract, or "deposited trust account information"), which is used to indicate the first transaction.
  • a transaction is a transaction used to deposit trust account 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 that other full nodes are newly created locally. The trust account information of the first account is stored in the block of.
  • Fig. 5 shows a method for locking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain includes a plurality of full nodes, and the full nodes locally pre-store the trust account information of the first account,
  • the trusted account information includes at least a second account that is a trusted account of the first account, and the method executed on the second account client includes:
  • Step 502 Initiate a second transaction, and the second transaction is used to lock the first account in the blockchain.
  • the trust account information of the first account has been stored in the blockchain, that is, the second account is set as the trust of the first account in the trust account information Account.
  • the second account has the authority to initiate locking of the first account.
  • the first user may notify the second user through communication methods such as telephone or network communication, and request the second user to lock the first account.
  • the second user may send a second transaction for locking the first account through the second account client.
  • 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 locking an account.
  • the second smart contract includes the "Lock()" function, which is used in the case of determining that the predetermined condition is satisfied, that is, in the case of determining that the second account is the trusted account of the first account, in the blockchain Modify the status of the specified account to locked status in the status tree of.
  • the specific form of the second transaction invoking the second smart contract initiated by the second 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 second account and the receiving field is the second For the contract account of the smart contract, the data field is the call to the "Lock()" function, such as ⁇ Lock(strings), "first account” ⁇ .
  • the second smart contract is not limited to including the Lock function described above, so as to modify the state of the account in the state tree by executing the function.
  • the Lock function included in the second smart contract may not Performing any operation is only used to transmit the information for locking 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 second account to the first account.
  • a predetermined flag can be set to identify the transaction. It is used to lock the account.
  • the data field of the transaction is "lock account", and it is agreed that the receiving account of the second transaction is the account to be locked. Therefore, the second account sends such a second transaction to the first account.
  • the second transaction is stored in the block through consensus, that is, the second account propagates the lock of the first account to the blockchain. information. After each node in the blockchain obtains the information for locking the first account from the second transaction, it can locally modify the state of the first account to the locked state.
  • the second transaction is not limited to the transaction sent by the second account to the first account, but can be the transaction sent by the second account to any account other than the first account in the blockchain.
  • the transaction The data field of for example includes "lock "first account”", so as to propagate the information of locking the first account to the blockchain.
  • Fig. 6 shows a method for locking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain includes a plurality of full nodes, and the full nodes locally pre-store the trust account information of the first account,
  • the trusted account information includes at least a second account that is a trusted account of the first account, and the method is executed by a full node in the blockchain and includes:
  • Step S602 receiving a second transaction initiated by the second account for locking the first account from the blockchain;
  • Step S604 Obtain the trusted account information of the first account locally;
  • Step S606 based on the trusted account information, verify whether the second account is a trusted account of the first account;
  • step S608 if the verification is passed, the first account is locked locally.
  • the accounting node After the second account performs the method shown in Figure 5, 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
  • 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 second account for locking the first account is received from the blockchain.
  • the second account client When the second account client sends a second transaction to the blockchain, it will send the second transaction to any full node in the blockchain, and any full node will then spread the second transaction to other full nodes .
  • 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 trusted account information of the first account is obtained locally.
  • the trust account information is stored in the local state tree of the full node, wherein obtaining the trust account information of the first account locally includes: from the local state tree Obtain the trust account information of the first account.
  • the trust account information is stored in a block, wherein obtaining the trust account information of the first account locally includes retrieving the trust account information of the first account from a plurality of blocks stored locally.
  • the marked transaction that is, the above-mentioned first transaction to obtain the trust account information of the first account.
  • the full node After the full node receives the second transaction and obtains the trust account information of the first account, it first uses the public key of the second account to verify the digital signature of the second transaction. In addition, in Ethereum, for example, the full node The node also verifies the remaining fuel in the first account, etc., which are not listed here.
  • the billing node may obtain the second account public key from, for example, the account state tree, so as to verify the digital signature of the second transaction.
  • the accounting node may obtain the second account public key through other methods, such as obtaining the second account public key through the key manager.
  • the second transaction is a transaction that calls a second smart contract, so that the full node starts to execute the above-mentioned Lock() 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 locking an account, so that the full node locally executes the following steps S606-S608 .
  • Step S606 Based on the trusted account information, verify whether the second account is a trusted account of the first account.
  • the trust account information is stored under the first account of the state tree, so that it can be determined whether the trust account field under the first account of the state tree includes the second account, thereby verifying whether the second account is the first account.
  • Trust account of an account In one embodiment, the trust account information is stored in a transaction in the block, so that it can be determined whether the second account is the trust account of the first account based on the transaction information in the block.
  • step S608 if the verification is passed, the first account is locked 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 locking an account, so that The account node locks the first account by executing the second smart contract locally, that is, by executing the above-mentioned "Lock()" function, step S606 is executed, and if the verification is passed, the local state tree is automatically changed The status of the first account in is changed to locked status.
  • the second transaction is a normal transaction. As described above, it transmits the information for locking the first account to the billing node, so that the billing node can put the local state tree in the local state tree if the verification is passed. The status of the first account is changed to locked status.
  • 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 trusted account information of an account in a blockchain according to an embodiment of the present specification.
  • the device is deployed on the first user's first account client in the blockchain, and includes:
  • the obtaining unit 71 is configured to obtain a second account of a second user in the blockchain, where the second user is a trusted user of the first user;
  • the transaction initiation unit 72 is configured to initiate a first transaction, the first transaction is used to deposit trust account information of the first account in the blockchain, and the first transaction includes at least the trust account as the first account
  • the second account is such that the trusted account information includes at least the second account, wherein the trusted account has the authority to lock the first account.
  • the first transaction is a transaction that calls a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing trusted account information of the account
  • the first smart contract The data field of a transaction includes at least the second account.
  • the acquiring unit 71 is further configured to acquire the second account of the second user in the blockchain and its public key, wherein the data field of the first transaction also includes the The public key, so that the trusted account information also includes the public key of the second account.
  • FIG. 8 shows a device 800 for depositing trust account information of an account in a blockchain according to an embodiment of the present specification.
  • the device is deployed on a full node in the blockchain and includes:
  • the receiving unit 81 is configured to receive a first transaction initiated by a first account from the blockchain, the first transaction being used to deposit trust account information of the first account in the blockchain, and the first transaction Includes at least a second account that is a trusted account of the first account, and the trusted account has the authority to lock the first account; and
  • the depositing unit 82 is configured to deposit the trusted account information of the first account locally based on the first transaction, wherein the trusted account information includes at least the second account.
  • the first transaction is a transaction that calls a first smart contract
  • the first smart contract is a smart contract pre-deployed in the blockchain for depositing trust account information in the account
  • all The depositing unit 82 is further configured to store the trusted account information under the first account in the local state tree by executing the first smart contract locally.
  • the depositing unit 82 is further configured to deposit trust account information of the first account in a new block locally based on the first transaction, wherein the first transaction includes The predetermined flag is used to indicate that the first transaction is a transaction for depositing trust account information in the blockchain.
  • FIG. 9 shows a device 900 for locking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain includes a plurality of full nodes, and the full nodes locally pre-store the trust account information of the first account ,
  • the trusted account information includes at least a second account that is a trusted account of the first account, and the device deployed on the second account client includes:
  • the transaction initiation unit 91 is configured to initiate a second transaction, and the second transaction is used to lock the first account in the blockchain.
  • FIG. 10 shows a device 1000 for locking an account in a blockchain according to an embodiment of the present specification.
  • the blockchain includes a plurality of full nodes, and the full nodes locally pre-store the trust account information of the first account ,
  • the trusted account information includes at least a second account that is a trusted account of the first account, 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 second account for locking the first account from the blockchain;
  • the obtaining unit 102 is configured to obtain the trust account information of the first account locally;
  • the verification unit 103 is configured to verify whether the second account is a trusted account of the first account based on the trusted account information
  • the locking unit 104 is configured to lock the first account locally when the verification is passed.
  • 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 locking an account
  • the locking unit 104 also It is configured to lock the first account by executing the second smart contract locally.
  • the trust account information is stored in the local state tree of the full node, wherein the obtaining unit 102 is further configured to obtain the trust account information of the first account from the local state tree .
  • the trust account information is stored in a block
  • the acquiring unit 102 is further configured to retrieve a transaction with the first account and a predetermined flag from a plurality of blocks stored locally, thereby Obtain the trust account information of the first account.
  • 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, the memory stores executable code, and the processor implements any of the above methods when the executable code is executed.
  • the authority of the account is locked by authorizing a trusted third party, so that when the private key of the account is lost or stolen, the account can be locked by a third party, thereby Prevent further expansion of losses.
  • 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.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种在区块链中锁定账户的方法和装置,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述方法由区块链中的全节点执行,包括:从区块链中接收由第二账户发起的用于锁定第一账户的第二交易(S602);从本地获取所述第一账户的信任账户信息(S604);基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户(S606);以及在验证通过的情况中,在本地进行对第一账户的锁定(S608)。

Description

一种在区块链中锁定账户的方法和装置 技术领域
本说明书实施例涉及区块链技术领域,更具体地,涉及一种在区块链中锁定账户的方法和装置。
背景技术
区块链技术是构建在点对点(P2P)网络上,利用链式数据结构来验证与存储数据,利用分布式节点共识算法来生成和更新数据,利用密码学的方式保证数据传输和访问的安全,利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算范式。所述区块链例如为以太坊区块链。在以太坊中,新增了账户的概念,其中,由用户创建的账户为以太坊中的外部账户。通常,每个外部账户拥有一对公私钥,其中,私钥用于进行数字签名,公钥用于验证签名。另外,在各个全节点中,在节点本地的数据库中以状态树的形式维持区块链中全部账户的数据表,该状态树为账户地址与账户内容之间的映射,所述账号内容包括,账户余额、账户密钥信息(哈希值)等。然而,在目前已有的区块链中,当用户发现区块链账户的密钥丢失或被盗后,一般无法进行账户锁定操作,很有可能导致用户损失进一步扩大。
因此,需要一种更有效的在区块链中锁定账户的方案。
发明内容
本说明书实施例旨在提供一种更有效的在区块链中锁定账户的方法和装置。
为实现上述目的,本说明书一个方面提供一种在区块链中存入账户的信任账户信息的方法,所述方法由第一用户在区块链中的第一账户客户端执行,包括:获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户;以及发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,所述第一交易的数据 字段中至少包括所述第二账户。
在一个实施例中,获取第二用户在区块链中的第二账户包括,获取第二用户在区块链中的第二账户及其公钥,其中,所述第一交易的数据字段中还包括第二账户的公钥,以使得所述信任账户信息中还包括第二账户的公钥。
本说明书另一方面提供一种在区块链中存入账户的信任账户信息的方法,所述方法由区块链中的全节点执行,包括:从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限;以及基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,其中,基于所述第一交易,在本地存入所述第一账户的信任账户信息包括,通过在本地执行所述第一智能合约而将所述信任账户信息存入本地的状态树中的第一账户下。
在一个实施例中,基于所述第一交易,在本地存入所述第一账户的信任账户信息包括,基于所述第一交易,在本地的新的区块中存入第一账户的信任账户信息,其中,所述第一交易中包括预定标志,用于指示该第一交易为用于向区块链中存入信任账户信息的交易。
本说明书另一方面提供一种在区块链中锁定账户的方法,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述方法由第二账户客户端执行,包括:
发起第二交易,所述第二交易用于在区块链中锁定所述第一账户。
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,所述第二交易的数据字段中包括所述第一账户。
本说明书另一方面提供一种在区块链中锁定账户的方法,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述方法由区块链中的全节点执行,包括:从区块链中接收由第二账户发起的用于锁定第一账户的第二交易;从本地获取所述第一 账户的信任账户信息;基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户;以及在验证通过的情况中,在本地进行对第一账户的锁定。
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,其中,在本地进行对第一账户的锁定包括,通过在本地执行所述第二智能合约而进行对第一账户的锁定。
在一个实施例中,所述信任账户信息被存储在所述全节点的本地状态树中,其中,从本地获取所述第一账户的信任账户信息包括,从本地状态树中获取所述第一账户的信任账户信息。
在一个实施例中,所述信任账户信息被存储在区块中,其中,从本地获取所述第一账户的信任账户信息包括,从本地存储的多个区块中检索具有第一账户和预定标志的交易,从而获取第一账户的信任账户信息。
本说明书另一方面提供一种在区块链中存入账户的信任账户信息的装置,所述装置部署于第一用户在区块链中的第一账户客户端,包括:获取单元,配置为,获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户;以及交易发起单元,配置为,发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,所述第一交易的数据字段中至少包括所述第二账户。
在一个实施例中,所述获取单元还配置为,获取第二用户在区块链中的第二账户及其公钥,其中,所述第一交易的数据字段中还包括第二账户的公钥,以使得所述信任账户信息中还包括第二账户的公钥。
本说明书另一方面提供一种在区块链中存入账户的信任账户信息的装置,所述装置部署于区块链中的全节点,包括:接收单元,配置为,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限;以及存入单元,配置为,基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,其中,所述存入单元还配置为,通过在本地执行所述第一智能合约而将所述信任账户信息存入本地的状态树中的第一账户下。
在一个实施例中,所述存入单元还配置为,基于所述第一交易,在本地的新的区块中存入第一账户的信任账户信息,其中,所述第一交易中包括预定标志,用于指示该第一交易为用于向区块链中存入信任账户信息的交易。
本说明书另一方面提供一种在区块链中锁定账户的装置,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述装置部署于第二账户客户端,包括:
交易发起单元,配置为,发起第二交易,所述第二交易用于在区块链中锁定所述第一账户。
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,所述第二交易的数据字段中包括所述第一账户。
本说明书另一方面提供一种在区块链中锁定账户的装置,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述装置部署于区块链中的全节点,包括:接收单元,配置为,从区块链中接收由第二账户发起的用于锁定第一账户的第二交易;获取单元,配置为,从本地获取所述第一账户的信任账户信息;验证单元,配置为,基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户;以及锁定单元,配置为,在验证通过的情况中,在本地进行对第一账户的锁定。
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,其中,所述锁定单元还配置为,通过在本地执行所述第二智能合约而进行对第一账户的锁定。
在一个实施例中,所述信任账户信息被存储在所述全节点的本地状态树中,其中,所述获取单元还配置为,从本地状态树中获取所述第一账户的信任账户信息。
在一个实施例中,所述信任账户信息被存储在区块中,其中,所述获取单元还配置为,从本地存储的多个区块中检索具有第一账户和预定标志的交易,从而获取第一账 户的信任账户信息。
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项方法。
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项方法。
在根据本说明书实施例的方案中,通过采用信任账户机制,通过对信任的第三方授权锁定账户的权限,从而在账户私钥丢失或被盗的情况中,可通过第三方进行账户锁定,从而防止损失进一步扩大。
附图说明
通过结合附图描述本说明书实施例,可以使得本说明书实施例更加清楚:
图1示出根据本说明书实施例的区块链100的示意图;
图2示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的方法;
图3示出了第一交易的示意形式;
图4示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的方法;
图5示出根据本说明书实施例的一种在区块链中锁定账户的方法;
图6示出根据本说明书实施例的一种在区块链中锁定账户的方法;
图7示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的装置700;
图8示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的装置800;
图9示出根据本说明书实施例的一种在区块链中锁定账户的装置900;
图10示出根据本说明书实施例的一种在区块链中锁定账户的装置1000。
具体实施方式
下面将结合附图描述本说明书实施例。
图1示出根据本说明书实施例的区块链100的示意图。如图1所示,假设区块链 100为联盟链,其中包括图中1、2、3、4四个共识节点(全节点),另外,区块链中还包括多个通过客户端登录的用户,这些用户拥有自己的账户、私钥和公钥,其客户端可视为该区块链的轻节点,或者其客户端通过网关进行区块链中的操作。如图中所示,所述用户例如包括用户A、用户B和用户C。其中,用户C为恶意用户,其例如可能会盗取用户A的私钥,以进行非法交易活动。本说明书实施例为了应对例如用户C的恶意盗取用户私钥的情况,为用户设置信任用户机制,以便于用户在丢失私钥之后可通过其信任用户冻结(即锁定)其账户,以防止进一步的损失。例如,用户B为用户A的信任用户,用户A通过向区块链中发送第一交易而在区块链中存入用户B为信任用户的信息,而授予用户B冻结用户A账户的权限。从而,当用户A的私钥丢失时,用户A可通过线下通知用户B,使得用户B向区块链发送第二交易,以使得在区块链中冻结用户A的账户。
可以理解,上文参考图1的描述仅是示意性的,并不用于限制本说明书实施例的范围,例如,所述区块链不限于为联盟链,其也可以为公链等,在区块链为公链的情况中,用户A、B、C对应的客户端也可为区块链中的全节点。下文中,将以联盟链为例进行具体描述。
下面将详细描述上述授权的过程和冻结账户的过程。
图2示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的方法,所述方法由第一用户在区块链中的第一账户客户端执行,包括:
步骤S202,获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户;
步骤S204,发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
首先,在步骤S202,获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户。
该方法由第一用户通过其在区块链中的第一账户客户端执行,用于设置其在区块链中的信任账户,所述信任账户具有锁定所述第一账户的权限。第一用户首先确定好可作为信任用户的用户,例如第二用户,例如,第一用户可在线下取得其信任的第二用户 的同意之后,将第二用户确定为信任用户。之后,第一账户客户端获取第二用户的第二账户,以用于发起下个步骤中的第一交易。第一账户客户端例如可从第一用户的输入获取第二用户的第二账户,或者,第一账户客户端可从第二账户客户端接收第二账户,等等。
在一个实施例中,在获取第二用户第二账户的同时,还可以获取第二账户的公钥,以提供给下个步骤中的第一交易。
可以理解,虽然在该步骤中仅描述了获取第一用户的一个信任用户的账户,在本说明书实施例中可通过该方法类似地设置第一用户的多个信任用户。
在步骤S204,发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
本领域技术人员可以理解,在区块链中,客户端可通过发起交易而向区块链中存入信息,该信息为经过共识的、各个节点一致的,因此具有更高的安全性、可信度。区块链中包括多种数据库,如区块、账户数据库(状态数据树)等,因此,向区块链中存入信息包括向区块、账户数据库等数据库中存入信息。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于设置账户的信任账户的智能合约。所述第一智能合约中例如包括set1()函数,用于在区块链中的状态树中设置账户的预置的信任账户字段。当第一账户发起调用第一智能合约的第一交易时,第一交易例如如图3所示,图3示出了第一交易的示意形式,其中,第一交易中的发送字段(From)为第一账户,接收字段(To)为该第一智能合约的合约账户,数据字段(Data)为对第一智能合约中的set1()函数的调用,例如{set1(strings),“第二账户”},即,“第二账户”为set1()函数的输入参数,另外,该第一交易包括通过第一账户的私钥生成的数字签名。第一账户例如向图1中的任一全节点(例如节点1)发送该第一交易,节点1在接收该第一交易之后,对该第一交易进行验证之后在共识节点中扩散该第一交易。在通过共识节点确定记账节点之后,在记账节点执行该第一智能合约,从而通过执行该第一智能合约将记账节点本地的状态树中的第一账户的信任账户字段设置为第二账户。可以理解,在状态树数据库中可设置不止一个信任账户字段,例如设置三个信任账户字段,从而第一账户客户端可首先获取三个信任账户,并在第一交易中通过三次调用set1()函数,从而在状态树中分别设置三个信任 账户。记账节点在更新状态树之后,将该第一交易放入区块存入区块链中,并将该区块发送给其它共识节点,从而其它共识节点在接收到该区块之后也相同地更新本地状态树中第一账户的信任账户。
在一个实施例中,第一智能合约中除了包括set1()函数,还包括set2()函数,set2()函数用于在状态树中设置账户的信任账户的公钥。在该情况中,客户端在步骤S202中还获取第二账户的公钥,并在该步骤中类似地调用set2()函数,例如,在第一交易的数据字段中还包括“set2(strings),“第二账户公钥””,从而通过第一智能合约设置状态树中第一账户的信任账户公钥字段,以便于后续的锁定账户过程。
可以理解,这里虽然通过智能合约自动在状态树中存入账户的信任账户信息,本说明书不限于此,例如,所述第一智能合约的函数包括的Set函数可以不进行任何操作,从而仅用于传递设置第二账户及其公钥的信息,使得将第二账户及其公钥与该智能合约的调用一起作为交易被存入区块中,以用于后续的信任账户信息的查找。或者可通过预定好的规则,使得区块链中的节点基于该交易中调用的智能合约账户,确定该交易为用于存入信任账户信息的交易,从而在本地状态树中更新第一账户的预置的信任账户信息字段。
在一个实施例中,所述第一交易例如为由第一账户发送给第二账户的普通交易(例如转账交易),在该交易的数据字段中,可设置预定标志,以用于标识该交易用于存入信任账户信息,例如,该交易的数据字段为“存入信任账户信息”,并约定好,第一账户的信任账户即为第一交易的接收账户。从而,第一账户通过对第二账户发送这样的第一交易,当第一交易在经过共识被存入区块中之后,也即,第一账户向区块链中存入了第一账户的信任账户信息,并将第一账户的信任账户设定为第二账户。另外,在该第一交易的数据字段中还可以包括第二账户的公钥,从而在第一账户的信任账户信息中还包括第二账户的公钥。可以理解,第一交易不限于为第一账户发送给第二账户的交易,而可以为第一账户发送给区块链中非第二账户的任一账户的交易,在该情况中,该交易的数据字段例如包括“将“第二账户”设置为信任账户”,从而向区块链中传播将第二账户设置为信任账户的信任账户信息。或者,可通过预定好的规则,使得区块链中的节点基于该第一交易中的预定标志,确定该第一交易为用于存入信任账户信息的交易,从而在本地状态树中更新第一账户的预置的信任账户信息字段。
图4示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的方法,所述方法由区块链中的全节点执行,包括:
步骤S402,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限;以及
步骤S404,基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
该方法即为在第一账户客户端向区块链发出第一交易之后,区块链中的各个全节点基于第一交易向区块链中存入第一账户的信任账户信息的过程。如上文所述,此处,向区块链中存入包括,向状态树中存入,或向区块中存入,等等。
首先,在步骤S402,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限。该全节点例如为通过共识确定的记账节点,其可以为区块链中的任一全节点,如图1中的节点1、2、3、4,因此,参考上文对步骤S202中的描述,该全节点可从第一账户客户端接收该第一交易,或者可从其它任意全节点接收该第一交易。可以理解,用于执行该方法的全节点不限于为记账节点,例如,其可以为记账节点的共识节点,其通过从记账节点接收新生成的区块中包含的第一交易,从而接收该第一交易。参考上文对步骤S204中的描述,该第一交易例如为调用第一智能合约的交易,或者该第一交易的数据字段中包括预定标志,以用于标识其为用于在区块链中存入第一账户的信任账户信息的交易。
在步骤S404,基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
参考上文中对步骤S204中的描述,在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约。从而,该全节点通过在本地执行所述第一智能合约而自动将所述信任账户信息存入本地的状态树中的第一账户下。或者,所述第一智能合约包括的set函数可不进行任何操作,仅用于传递信息,从而,该全节点通过在本地执行所述第一智能合约,基于预定规则,由全节点自身将所述信任账户信息存入本地的状态树中的第一账户下。
参考上文中对步骤S204中的描述,在一个实施例中,所述第一交易中包括预定标志(例如第一智能合约的账户,或者“存入信任账户信息”),用于指示该第一交易为用于向区块链中存入信任账户信息的交易。例如记账节点基于所述第一交易生成新的区块 之后,将该区块存入本地的区块数据库中,并将该区块扩散给其它全节点,从而其它全节点分别在本地的新的区块中存入第一账户的信任账户信息。
图5示出根据本说明书实施例的一种在区块链中锁定账户的方法,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述方法在第二账户客户端执行,包括:
步骤502,发起第二交易,所述第二交易用于在区块链中锁定所述第一账户。
在如上所述执行图2和图4所示方法之后,区块链中已存入了第一账户的信任账户信息,即,所述信任账户信息中将第二账户设置为第一账户的信任账户。在该情况中,第二账户具有发起锁定第一账户的权限。当第一用户在私钥丢失或被盗的情况中,第一用户可例如通过电话、网络通信等通信方式告知第二用户,并请求第二用户锁定第一账户。第二用户在接收到第一用户的请求之后,可在通过第二账户客户端发出用于锁定第一账户的第二交易。
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约。例如,第二智能合约中包括“Lock()”函数,其用于在确定满足预定条件的情况中,即确定所述第二账户为第一账户的信任账户的情况中,在区块链中的状态树中将指定账户的状态修改为锁定状态。第二账户发起的调用第二智能合约的第二交易的具体形式与第一交易的形式类似,其也包括发送字段、接收字段和数据字段,其中发送字段为第二账户,接收字段为第二智能合约的合约账户,数据字段为对“Lock()”函数的调用,例如{Lock(strings),“第一账户”}。
可以理解,同样地,所述第二智能合约不限于包括上述Lock函数,以通过执行该函数而在状态树中修改账户的状态,在一个实施例中,第二智能合约包括的Lock函数可以不进行任何操作,仅用于传递锁定第一账户的信息,从而使得在区块链各个节点在执行该智能合约时基于预定规则主动修改第一账户的状态。
在一个实施例中,所述第二交易例如为由第二账户发送给第一账户的普通交易(例如转账交易),在该交易的数据字段中,可设置预定标志,以用于标识该交易用于锁定账户,例如,该交易的数据字段为“锁定账户”,并约定好,第二交易的接收账户即为待锁定的账户。从而,第二账户通过对第一账户发送这样的第二交易,当第二交易在经过共识被存入区块中之后,也即,第二账户向区块链中传播了锁定第一账户的信息。区块 链中的各个节点在从第二交易中获取锁定第一账户的信息之后,可在本地将第一账户的状态修改为锁定状态。可以理解,第二交易不限于为第二账户发送给第一账户的交易,而可以为第二账户发送给区块链中非第一账户的任一账户的交易,在该情况中,该交易的数据字段例如包括“锁定“第一账户””,从而向区块链中传播锁定第一账户的信息。
图6示出根据本说明书实施例的一种在区块链中锁定账户的方法,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述方法由区块链中的全节点执行,包括:
步骤S602,从区块链中接收由第二账户发起的用于锁定第一账户的第二交易;
步骤S604,从本地获取所述第一账户的信任账户信息;
步骤S606,基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户;
步骤S608,在验证通过的情况中,在本地进行对第一账户的锁定。
在第二账户进行图5所示方法之后,即向区块链中发起第二交易之后,区块链中通过共识节点的共识产生记账节点,从而记账节点及其共识节点可执行图6所示的方法,所述共识节点都应为区块链中的全节点,即,本地都包括全部区块和账户数据库,从而可基于数据库中的内容进行对交易的验证。
首先,在步骤S602,从区块链中接收由第二账户发起的用于锁定第一账户的第二交易。
第二账户客户端在向区块链中发送第二交易时,即将该第二交易发送给区块链中的任一全节点,该任一全节点然后将该第二交易扩散给其它全节点。从而,例如记账节点可以从第二账户直接接收第二交易,或者可从区块中的其它全节点接收第二交易。
在步骤S604,从本地获取所述第一账户的信任账户信息。
如上为所述,在一个实施例中,所述信任账户信息被存储在所述全节点的本地状态树中,其中,从本地获取所述第一账户的信任账户信息包括,从本地状态树中获取所述第一账户的信任账户信息。
在一个实施例中,所述信任账户信息被存储在区块中,其中,从本地获取所述第一账户的信任账户信息包括,从本地存储的多个区块中检索具有第一账户和预定标志的 交易(即上述第一交易),从而获取第一账户的信任账户信息。
该全节点在接收到该第二交易并获取第一账户的信任账户信息之后,首先使用第二账户的公钥对该第二交易的数字签名进行验证,另外,在例如以太坊中,该全节点还对第一账户的剩余燃料进行验证等,在此不一一列出。
在信任账户信息中还包括第二账户公钥的情况中,记账节点可以从例如账户状态树中获取第二账户公钥,以用于验证第二交易的数字签名。当信任账户信息中不包括第二账户公钥的情况中,记账节点可通过其他方法获取第二账户公钥,如通过密钥管理方获取第二账户公钥等。
在进行上述常规的验证之后,在一个实施例中,所述第二交易为调用第二智能合约的交易,从而该全节点开始执行该智能合约中的上述Lock()函数,从而通过执行该函数自动进行下述的步骤S606-S608。在一个实施例中,如上文所述,所述第二交易中包括预定标志,用于指示该第二交易为用于锁定账户的交易,从而使得该全节点本地执行下述的步骤S606-S608。
步骤S606,基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户。
在获取信任账户信息之后,可基于该信息确定第二账户是否为第一账户的信任账户。在一个实施例中,该信任账户信息存储在状态树的第一账户下,从而,可确定状态树的第一账户下的信任账户字段中是否包括第二账户,从而验证第二账户是否为第一账户的信任账户。在一个实施例中,信任账户信息存储在区块的一个交易中,从而可基于区块中该交易的信息,确定第二账户是否为第一账户的信任账户。
在步骤S608,在验证通过的情况中,在本地进行对第一账户的锁定。
在一个实施例中,所述第二交易为调用第二智能合约的交易,如上文所述,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,从而,记账节点通过在本地执行所述第二智能合约而进行对第一账户的锁定,也即,通过执行上述“Lock()”函数,执行步骤S606,在验证通过的情况中,自动将本地状态树中的第一账户的状态修改为锁定状态。
在一个实施例中,所述第二交易为普通交易,如上文所述,其向记账节点传递了锁定第一账户的信息,从而记账节点可在验证通过的情况中将本地状态树中的第一账户的状态修改为锁定状态。
记账节点在修改本地状态树之后,将第二交易打包到区块中并发送给其它全节点, 从而将该区块存入区块链中。其它节点在接收包括第二交易的区块之后,可同样地基于第二交易,修改本地状态树中第一账户的状态,从而达到各个全节点的数据一致性。
图7示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的装置700,所述装置部署于第一用户在区块链中的第一账户客户端,包括:
获取单元71,配置为,获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户;
交易发起单元72,配置为,发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,所述第一交易的数据字段中至少包括所述第二账户。
在一个实施例中,所述获取单元71还配置为,获取第二用户在区块链中的第二账户及其公钥,其中,所述第一交易的数据字段中还包括第二账户的公钥,以使得所述信任账户信息中还包括第二账户的公钥。
图8示出根据本说明书实施例的一种在区块链中存入账户的信任账户信息的装置800,所述装置部署于区块链中的全节点,包括:
接收单元81,配置为,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限;以及
存入单元82,配置为,基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
在一个实施例中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,其中,所述存入单元82还配置为,通过在本地执行所述第一智能合约而将所述信任账户信息存入本地的状态树中的第一账户下。
在一个实施例中,所述存入单元82还配置为,基于所述第一交易,在本地的新的区块中存入第一账户的信任账户信息,其中,所述第一交易中包括预定标志,用于指示该第一交易为用于向区块链中存入信任账户信息的交易。
图9示出根据本说明书实施例的一种在区块链中锁定账户的装置900,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述装置部署于第二账户客户端,包括:
交易发起单元91,配置为,发起第二交易,所述第二交易用于在区块链中锁定所述第一账户。
图10示出根据本说明书实施例的一种在区块链中锁定账户的装置1000,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述装置部署于区块链中的全节点,包括:
接收单元101,配置为,从区块链中接收由第二账户发起的用于锁定第一账户的第二交易;
获取单元102,配置为,从本地获取所述第一账户的信任账户信息;
验证单元103,配置为,基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户;以及
锁定单元104,配置为,在验证通过的情况中,在本地进行对第一账户的锁定。
在一个实施例中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,其中,所述锁定单元104还配置为,通过在本地执行所述第二智能合约而进行对第一账户的锁定。
在一个实施例中,所述信任账户信息被存储在所述全节点的本地状态树中,其中,所述获取单元102还配置为,从本地状态树中获取所述第一账户的信任账户信息。
在一个实施例中,所述信任账户信息被存储在区块中,其中,所述获取单元102还配置为,从本地存储的多个区块中检索具有第一账户和预定标志的交易,从而获取第一账户的信任账户信息。
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项方法。
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项方法。
在根据本说明书实施例的方案中,通过采用信任账户机制,通过对信任的第三方授权锁定账户的权限,从而在账户私钥丢失或被盗的情况中,可通过第三方进行账户锁 定,从而防止损失进一步扩大。
需要理解,本文中的“第一”,“第二”等描述,仅仅为了描述的简单而对相似概念进行区分,并不具有其他限定作用。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
本领域普通技术人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执轨道,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执轨道的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (26)

  1. 一种在区块链中存入账户的信任账户信息的方法,所述方法由第一用户在区块链中的第一账户客户端执行,包括:
    获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户;以及
    发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
  2. 根据权利要求1所述的方法,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,所述第一交易的数据字段中至少包括所述第二账户。
  3. 根据权利要求2所述的方法,其中,获取第二用户在区块链中的第二账户包括,获取第二用户在区块链中的第二账户及其公钥,其中,所述第一交易的数据字段中还包括第二账户的公钥,以使得所述信任账户信息中还包括第二账户的公钥。
  4. 一种在区块链中存入账户的信任账户信息的方法,所述方法由区块链中的全节点执行,包括:
    从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限;以及
    基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
  5. 根据权利要求4所述的方法,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,其中,基于所述第一交易,在本地存入所述第一账户的信任账户信息包括,通过在本地执行所述第一智能合约而将所述信任账户信息存入本地的状态树中的第一账户下。
  6. 根据权利要求4所述的方法,其中,基于所述第一交易,在本地存入所述第一账户的信任账户信息包括,基于所述第一交易,在本地的新的区块中存入第一账户的信任账户信息,其中,所述第一交易中包括预定标志,用于指示该第一交易为用于向区块链中存入信任账户信息的交易。
  7. 一种在区块链中锁定账户的方法,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户 的信任账户的第二账户,所述方法由第二账户客户端执行,包括:
    发起第二交易,所述第二交易用于在区块链中锁定所述第一账户。
  8. 根据权利要求7所述的方法,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,所述第二交易的数据字段中包括所述第一账户。
  9. 一种在区块链中锁定账户的方法,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述方法由区块链中的全节点执行,包括:
    从区块链中接收由第二账户发起的用于锁定第一账户的第二交易;
    从本地获取所述第一账户的信任账户信息;
    基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户;以及
    在验证通过的情况中,在本地进行对第一账户的锁定。
  10. 根据权利要求9所述的方法,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,其中,在本地进行对第一账户的锁定包括,通过在本地执行所述第二智能合约而进行对第一账户的锁定。
  11. 根据权利要求9所述的方法,其中,所述信任账户信息被存储在所述全节点的本地状态树中,其中,从本地获取所述第一账户的信任账户信息包括,从本地状态树中获取所述第一账户的信任账户信息。
  12. 根据权利要求9所述的方法,其中,所述信任账户信息被存储在区块中,其中,从本地获取所述第一账户的信任账户信息包括,从本地存储的多个区块中检索具有第一账户和预定标志的交易,从而获取第一账户的信任账户信息。
  13. 一种在区块链中存入账户的信任账户信息的装置,所述装置部署于第一用户在区块链中的第一账户客户端,包括:
    获取单元,配置为,获取第二用户在区块链中的第二账户,所述第二用户为所述第一用户的信任用户;以及
    交易发起单元,配置为,发起第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的所述第二账户,以使得所述信任账户信息中至少包括所述第二账户,其中,所述信任账户具有锁定第一账户的权限。
  14. 根据权利要求13所述的装置,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约, 所述第一交易的数据字段中至少包括所述第二账户。
  15. 根据权利要求14所述的装置,其中,所述获取单元还配置为,获取第二用户在区块链中的第二账户及其公钥,其中,所述第一交易的数据字段中还包括第二账户的公钥,以使得所述信任账户信息中还包括第二账户的公钥。
  16. 一种在区块链中存入账户的信任账户信息的装置,所述装置部署于区块链中的全节点,包括:
    接收单元,配置为,从区块链中接收由第一账户发起的第一交易,所述第一交易用于在区块链中存入第一账户的信任账户信息,所述第一交易中至少包括作为第一账户的信任账户的第二账户,所述信任账户具有锁定第一账户的权限;以及
    存入单元,配置为,基于所述第一交易,在本地存入所述第一账户的信任账户信息,其中,所述信任账户信息中至少包括所述第二账户。
  17. 根据权利要求16所述的装置,其中,所述第一交易为调用第一智能合约的交易,所述第一智能合约为区块链中预先部署的用于存入账户的信任账户信息的智能合约,其中,所述存入单元还配置为,通过在本地执行所述第一智能合约而将所述信任账户信息存入本地的状态树中的第一账户下。
  18. 根据权利要求16所述的装置,其中,所述存入单元还配置为,基于所述第一交易,在本地的新的区块中存入第一账户的信任账户信息,其中,所述第一交易中包括预定标志,用于指示该第一交易为用于向区块链中存入信任账户信息的交易。
  19. 一种在区块链中锁定账户的装置,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述装置部署于第二账户客户端,包括:
    交易发起单元,配置为,发起第二交易,所述第二交易用于在区块链中锁定所述第一账户。
  20. 根据权利要求19所述的装置,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,所述第二交易的数据字段中包括所述第一账户。
  21. 一种在区块链中锁定账户的装置,所述区块链中包括多个全节点,所述全节点本地预先存储有第一账户的信任账户信息,所述信任账户信息中至少包括作为第一账户的信任账户的第二账户,所述装置部署于区块链中的全节点,包括:
    接收单元,配置为,从区块链中接收由第二账户发起的用于锁定第一账户的第二交易;
    获取单元,配置为,从本地获取所述第一账户的信任账户信息;
    验证单元,配置为,基于所述信任账户信息,验证所述第二账户是否为所述第一账户的信任账户;以及
    锁定单元,配置为,在验证通过的情况中,在本地进行对第一账户的锁定。
  22. 根据权利要求21所述的装置,其中,所述第二交易为调用第二智能合约的交易,所述第二智能合约为区块链中预先部署的用于锁定账户的智能合约,其中,所述锁定单元还配置为,通过在本地执行所述第二智能合约而进行对第一账户的锁定。
  23. 根据权利要求21所述的装置,其中,所述信任账户信息被存储在所述全节点的本地状态树中,其中,所述获取单元还配置为,从本地状态树中获取所述第一账户的信任账户信息。
  24. 根据权利要求21所述的装置,其中,所述信任账户信息被存储在区块中,其中,所述获取单元还配置为,从本地存储的多个区块中检索具有第一账户和预定标志的交易,从而获取第一账户的信任账户信息。
  25. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-12中任一项的所述的方法。
  26. 一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-12中任一项所述的方法。
PCT/CN2020/082427 2019-06-12 2020-03-31 一种在区块链中锁定账户的方法和装置 Ceased WO2020248657A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910507879.1A CN110414977A (zh) 2019-06-12 2019-06-12 一种在区块链中锁定账户的方法和装置
CN201910507879.1 2019-06-12

Publications (1)

Publication Number Publication Date
WO2020248657A1 true WO2020248657A1 (zh) 2020-12-17

Family

ID=68359010

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/082427 Ceased WO2020248657A1 (zh) 2019-06-12 2020-03-31 一种在区块链中锁定账户的方法和装置

Country Status (3)

Country Link
CN (1) CN110414977A (zh)
TW (1) TW202046205A (zh)
WO (1) WO2020248657A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414977A (zh) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 一种在区块链中锁定账户的方法和装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609876A (zh) * 2017-08-18 2018-01-19 北京云知科技有限公司 一种恢复区块链资产的方法和系统
CN108830577A (zh) * 2018-06-07 2018-11-16 北京连琪科技有限公司 区块链的账户建立及恢复方法
CN109064327A (zh) * 2018-06-29 2018-12-21 浙江超脑时空科技有限公司 一种智能合约处理方法、装置及设备
CN109146448A (zh) * 2018-07-13 2019-01-04 杭州复杂美科技有限公司 跨链资产转移方法、设备和存储介质
US20190026450A1 (en) * 2017-07-24 2019-01-24 Dell Products, Lp Method and apparatus for optimized access of security credentials via mobile edge-computing systems
CN110414977A (zh) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 一种在区块链中锁定账户的方法和装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106779708B (zh) * 2016-12-23 2021-02-02 中钞信用卡产业发展有限公司杭州区块链技术研究院 基于智能合约的区块链上参与方身份管理方法及系统
CN106910072A (zh) * 2017-02-15 2017-06-30 捷德(中国)信息科技有限公司 数字货币管理方法和系统
CN107248074A (zh) * 2017-03-29 2017-10-13 阿里巴巴集团控股有限公司 一种基于区块链的业务处理方法及设备
CN107623569A (zh) * 2017-09-30 2018-01-23 矩阵元技术(深圳)有限公司 基于秘密共享技术的区块链密钥托管和恢复方法、装置
CN108694669A (zh) * 2018-07-18 2018-10-23 矩阵元技术(深圳)有限公司 一种区块链智能合约实现方法及装置
CN109584066B (zh) * 2018-10-31 2020-09-01 阿里巴巴集团控股有限公司 基于区块链的隐私交易及其应用方法和装置
KR101962290B1 (ko) * 2018-12-31 2019-03-26 주식회사 미탭스플러스 블록체인 기반의 공유경제를 위해 공유재화의 unlock 및 lock을 제어하는 분산 원장 장치

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190026450A1 (en) * 2017-07-24 2019-01-24 Dell Products, Lp Method and apparatus for optimized access of security credentials via mobile edge-computing systems
CN107609876A (zh) * 2017-08-18 2018-01-19 北京云知科技有限公司 一种恢复区块链资产的方法和系统
CN108830577A (zh) * 2018-06-07 2018-11-16 北京连琪科技有限公司 区块链的账户建立及恢复方法
CN109064327A (zh) * 2018-06-29 2018-12-21 浙江超脑时空科技有限公司 一种智能合约处理方法、装置及设备
CN109146448A (zh) * 2018-07-13 2019-01-04 杭州复杂美科技有限公司 跨链资产转移方法、设备和存储介质
CN110414977A (zh) * 2019-06-12 2019-11-05 阿里巴巴集团控股有限公司 一种在区块链中锁定账户的方法和装置

Also Published As

Publication number Publication date
TW202046205A (zh) 2020-12-16
CN110414977A (zh) 2019-11-05

Similar Documents

Publication Publication Date Title
JP7554380B2 (ja) 異なるネットワークにわたって資産を転送するためのセキュアかつ信頼できるブリッジ
US11159526B2 (en) System and method for decentralized-identifier authentication
US10708060B2 (en) System and method for blockchain-based notification
KR102206940B1 (ko) 스마트 계약을 사용하여 다자간 트랜잭션을 실행하는 방법
US11475150B2 (en) Methods and apparatus for implementing state proofs and ledger identifiers in a distributed database
US11646897B2 (en) Method and apparatus for utilizing off-platform-resolved data as an input to code execution on a decentralized platform
US9635000B1 (en) Blockchain identity management system based on public identities ledger
KR20200016238A (ko) 스크립트 기반 블록체인 상호작용
JP2020517169A (ja) 安全なブロックチェーンベースのコンセンサス
CN119135332A (zh) 用于区块链网络的凭证生成与分发方法和系统
WO2022121538A1 (zh) 基于区块链的数据同步方法、系统及相关设备
WO2020248656A1 (zh) 一种在区块链中解锁账户的方法和装置
WO2020238238A1 (zh) 创建区块链账户及验证区块链交易的方法及装置
Tapas et al. Blockchain-based publicly verifiable cloud storage
WO2020248657A1 (zh) 一种在区块链中锁定账户的方法和装置
CN115865447B (zh) 基于区块链的数字产品访问方法、装置、电子设备及计算机可读存储介质
CN111245600B (zh) 基于区块链技术的鉴权认证方法和系统
HK40016775A (zh) 一种在区块链中锁定账户的方法和装置
CN115801344B (zh) 基于区块链的多实例组网方法及装置和电子设备
Shekar et al. for User Anonymity on Blockchain
CN120567404A (zh) 基于区块链的数据处理方法及装置、电子设备、存储介质
Zima P2P Cryptocurrency Exchange and Blockchain Size Reduction
CN116862519A (zh) 基于区块链的处理匿名账户资源转移的方法、装置和设备
CN115459930A (zh) 一种api接口安全验证处理方法及装置
CN121887366A (zh) 基于区块链的数据处理方法及相关设备

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: 20823611

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: 20823611

Country of ref document: EP

Kind code of ref document: A1